Changeset 20990 for trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
- Timestamp:
- Dec 14, 2008, 12:54:25 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r20966 r20990 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1.7 7 2008-12-12 21:41:07 jhoblittExp $3 # $Id: SQL.pm,v 1.78 2008-12-14 22:54:25 eugene Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 8 8 use warnings FATAL => qw( all ); 9 9 10 our $VERSION = '0.0 3';10 our $VERSION = '0.02'; 11 11 12 12 use base qw( Class::Accessor::Fast ); … … 47 47 (so_id, vol_id, uri) 48 48 VALUES (?, ?, 'error') 49 },50 get_all_instances => qq{51 SELECT * FROM INSTANCE52 WHERE so_id = ?53 49 }, 54 50 get_object => qq{ … … 328 324 HAVING available_instances < instances OR instances < copies 329 325 }, 330 find_objects_with_extra_instances _by_xattr=> qq{331 SELECT 332 s o.so_id,333 so.ext_id,326 find_objects_with_extra_instances => qq{ 327 SELECT 328 storage_object.so_id, 329 ext_id, 334 330 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 346 344 USING(vol_id) 347 345 WHERE 348 mv.available = 1 346 mymountedvol.available = 1 347 AND storage_object_xattr.name = 'user.copies' 349 348 GROUP BY so_id 350 349 HAVING available_instances > copies 351 limit 5;352 350 }, 353 351 get_mounted_volumes => qq{
Note:
See TracChangeset
for help on using the changeset viewer.
