IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 12, 2008, 11:41:07 AM (17 years ago)
Author:
jhoblitt
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm

    r20965 r20966  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.76 2008-12-12 21:13:41 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.77 2008-12-12 21:41:07 jhoblitt Exp $
    44
    55package Nebulous::Server::SQL;
     
    328328        HAVING available_instances < instances OR instances < copies
    329329    },
    330     find_objects_with_extra_instances => qq{
    331         SELECT
    332             storage_object.so_id,
    333             ext_id,
     330    find_objects_with_extra_instances_by_xattr => qq{
     331        SELECT
     332            so.so_id,
     333            so.ext_id,
    334334            count(ins_id) as instances,
    335             volume.name as volume_name,
    336             volume.host as volume_host,
    337             count(mymountedvol.vol_id) as available_instances,
    338             count(mymountedvol.vol_id) > 0 as recoverable,
    339             storage_object_xattr.value as copies
    340         FROM storage_object
    341         JOIN instance
    342             USING(so_id)
    343         JOIN volume
    344             USING(vol_id)
    345         LEFT JOIN storage_object_xattr
    346             ON storage_object.so_id = storage_object_xattr.so_id
    347         JOIN mymountedvol
     335            mv.name as volume_name,
     336            mv.host as volume_host,
     337            count(mv.vol_id) as available_instances,
     338            xattr.value as copies
     339        FROM storage_object AS so
     340        JOIN storage_object_xattr as xattr
     341            ON so.so_id = xattr.so_id
     342            AND xattr.name = 'user.copies'
     343        JOIN instance AS i
     344            ON so.so_id = i.so_id
     345        JOIN mountedvol AS mv
    348346            USING(vol_id)
    349347        WHERE
    350             mymountedvol.available = 1
    351             AND storage_object_xattr.name = 'user.copies'
     348            mv.available = 1
    352349        GROUP BY so_id
    353350        HAVING available_instances > copies
     351        limit 5;
    354352    },
    355353    get_mounted_volumes => qq{
Note: See TracChangeset for help on using the changeset viewer.