Changeset 17077
- Timestamp:
- Mar 20, 2008, 3:25:21 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 1 added
- 5 edited
-
Changes (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
lib/Nebulous/Server.pm (modified) (2 diffs)
-
lib/Nebulous/Server.pod (modified) (3 diffs)
-
lib/Nebulous/Server/SQL.pm (modified) (2 diffs)
-
t/15_mounts.t (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r17073 r17077 2 2 3 3 0.07 4 - add Nebulous::Server::mounts() 4 5 - server/client split into Nebulous::Server and Nebulous::Client packages 5 6 - add support for storing instances in multi-tier 'hashed' directories -
trunk/Nebulous-Server/MANIFEST
r17074 r17077 48 48 t/13_server_rename_object.t 49 49 t/14_server_xattr.t 50 t/15_mounts.t 50 51 t/75_parse_neb_key.t -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r17074 r17077 1 # Copyright (c) 2004 Joshua Hoblitt1 # Copyright (c) 2004-2008 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.5 6 2008-03-20 23:29:56 jhoblitt Exp $3 # $Id: Server.pm,v 1.57 2008-03-21 01:24:36 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 1105 1105 1106 1106 1107 sub mounts 1108 { 1109 my $self = shift; 1110 1111 validate_pos(@_); 1112 1113 my $log = $self->log; 1114 my $sql = $self->sql; 1115 my $db =$self->db; 1116 1117 $log->debug("entered - @_"); 1118 1119 my $stats; 1120 my $query; 1121 eval { 1122 # ask the db to generate the table of mounted Nebulous volume 1123 $db->do("call getmountedvol()"); 1124 1125 $query = $db->prepare_cached( $sql->get_mounted_volumes ); 1126 $query->execute(); 1127 1128 # suck that table into an AoA 1129 $stats = $query->fetchall_arrayref; 1130 1131 $query->finish; 1132 }; 1133 $log->logdie("database error: $@") if $@; 1134 1135 $log->logdie("no mounted volumes found") unless (scalar @$stats); 1136 1137 $log->debug("leaving"); 1138 1139 return $stats; 1140 } 1141 1142 1107 1143 sub _get_storage_volume 1108 1144 { -
trunk/Nebulous-Server/lib/Nebulous/Server.pod
r16261 r17077 27 27 Nebulous::Server->delete_instance( $uri ); 28 28 Nebulous::Server->stat_object( $key ); 29 Nebulous::Server->mounts(); 29 30 30 31 =head1 DESCRIPTION … … 97 98 number of instances 98 99 100 =item * mounts( $key ); 101 102 Accepts no parameters and returns an AoA of: 103 104 [ 105 [ 106 mountpoint, 107 total, 108 used, 109 vol_id, 110 name, 111 path, 112 allocate, 113 available, 114 xattr, 115 ], 116 [ ... ], 117 ... 118 ] 119 99 120 =back 100 121 … … 117 138 =head1 COPYRIGHT 118 139 119 Copyright (C) 2004-200 5Joshua Hoblitt. All rights reserved.140 Copyright (C) 2004-2008 Joshua Hoblitt. All rights reserved. 120 141 121 142 This program is free software; you can redistribute it and/or modify it under -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r17072 r17077 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1. 49 2008-03-20 21:10:57jhoblitt Exp $3 # $Id: SQL.pm,v 1.50 2008-03-21 01:24:36 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 265 265 GROUP BY so_id 266 266 HAVING need_recovery = 1 267 }, 268 get_mounted_volumes => qq{ 269 SELECT * FROM mountedvol ORDER BY vol_id 267 270 }, 268 271 );
Note:
See TracChangeset
for help on using the changeset viewer.
