IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 14, 2008, 12:54:25 PM (17 years ago)
Author:
eugene
Message:

reverting to pre-distributed version code (distrib is on branch)

File:
1 edited

Legend:

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

    r20966 r20990  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: SQL.pm,v 1.77 2008-12-12 21:41:07 jhoblitt Exp $
     3# $Id: SQL.pm,v 1.78 2008-12-14 22:54:25 eugene Exp $
    44
    55package Nebulous::Server::SQL;
     
    88use warnings FATAL => qw( all );
    99
    10 our $VERSION = '0.03';
     10our $VERSION = '0.02';
    1111
    1212use base qw( Class::Accessor::Fast );
     
    4747        (so_id, vol_id, uri)
    4848        VALUES (?, ?, 'error')
    49     },
    50     get_all_instances   => qq{
    51         SELECT * FROM INSTANCE
    52         WHERE so_id = ?
    5349    },
    5450    get_object          => qq{
     
    328324        HAVING available_instances < instances OR instances < copies
    329325    },
    330     find_objects_with_extra_instances_by_xattr => qq{
    331         SELECT
    332             so.so_id,
    333             so.ext_id,
     326    find_objects_with_extra_instances => qq{
     327        SELECT
     328            storage_object.so_id,
     329            ext_id,
    334330            count(ins_id) as instances,
    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
     331            volume.name as volume_name,
     332            volume.host as volume_host,
     333            count(mymountedvol.vol_id) as available_instances,
     334            count(mymountedvol.vol_id) > 0 as recoverable,
     335            storage_object_xattr.value as copies
     336        FROM storage_object
     337        JOIN instance
     338            USING(so_id)
     339        JOIN volume
     340            USING(vol_id)
     341        LEFT JOIN storage_object_xattr
     342            ON storage_object.so_id = storage_object_xattr.so_id
     343        JOIN mymountedvol
    346344            USING(vol_id)
    347345        WHERE
    348             mv.available = 1
     346            mymountedvol.available = 1
     347            AND storage_object_xattr.name = 'user.copies'
    349348        GROUP BY so_id
    350349        HAVING available_instances > copies
    351         limit 5;
    352350    },
    353351    get_mounted_volumes => qq{
Note: See TracChangeset for help on using the changeset viewer.