IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 1, 2009, 6:40:27 PM (17 years ago)
Author:
jhoblitt
Message:

change Nebulous::Server->stat_object() to return both the total number of instance and just those that are available

File:
1 edited

Legend:

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

    r24638 r24639  
    8383    stat_object          => qq{
    8484        SELECT
    85             storage_object.so_id,
    86             storage_object.ext_id,
    87             read_lock,
    88             write_lock,
    89             storage_object_attr.epoch,
    90             storage_object_attr.mtime,
    91             COUNT(instance.so_id) as instances
    92         FROM storage_object
    93         JOIN storage_object_attr
     85            so.so_id,
     86            so.ext_id,
     87            attr.read_lock,
     88            attr.write_lock,
     89            attr.epoch,
     90            attr.mtime,
     91            COUNT(instance.so_id) as instances,
     92            SUM(available) as available
     93        FROM storage_object as so
     94        JOIN storage_object_attr as attr
    9495            USING (so_id)
    9596        JOIN instance
    9697            USING (so_id)
    97         WHERE ext_id = ?
    98         GROUP BY storage_object.so_id
     98        LEFT JOIN mountedvol
     99            USING(vol_id)
     100        WHERE ext_id = ?
     101        GROUP BY so.so_id
    99102    },
    100103    # Note: this sets an update lock
Note: See TracChangeset for help on using the changeset viewer.