Changeset 20094
- Timestamp:
- Oct 13, 2008, 11:20:33 AM (18 years ago)
- Location:
- trunk/Nebulous
- Files:
-
- 1 added
- 4 edited
-
Changes (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
lib/Nebulous/Client.pm (modified) (2 diffs)
-
lib/Nebulous/Client.pod (modified) (2 diffs)
-
t/67_client_swap.t (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/Changes
r19715 r20094 6 6 no instance 7 7 - retry all calls to open() 8 - add Nebulous::Client->swap() method 8 9 9 10 0.09 Wed Jul 9 16:36:27 HST 2008 -
trunk/Nebulous/MANIFEST
r18316 r20094 102 102 t/65_client_mounts.t 103 103 t/66_client_xattr.t 104 t/67_client_swap.t 104 105 t/90_nebclient.t 105 106 t/TEST.PL -
trunk/Nebulous/lib/Nebulous/Client.pm
r20093 r20094 1 1 # Copyright (c) 2004-2008 Joshua Hoblitt 2 2 # 3 # $Id: Client.pm,v 1.6 1 2008-10-13 20:54:49jhoblitt Exp $3 # $Id: Client.pm,v 1.62 2008-10-13 21:20:33 jhoblitt Exp $ 4 4 5 5 package Nebulous::Client; … … 907 907 908 908 909 sub swap 910 { 911 my $self = shift; 912 913 my ( $key1, $key2 ) = validate_pos( @_, 914 { 915 type => SCALAR, 916 }, 917 { 918 type => SCALAR, 919 }, 920 ); 921 922 $log->debug( "entered - @_" ); 923 924 my $response = $self->{ 'server' }->swap_objects( $key1, $key2 ); 925 if ( $response->fault ) { 926 $self->set_err($response->faultstring); 927 928 if ($response->faultstring =~ /is valid object key/) { 929 $log->debug( "leaving" ); 930 return; 931 } 932 933 $log->logdie("unhandled fault - ", $self->err); 934 } 935 936 $log->debug( "leaving" ); 937 938 return 1; 939 } 940 941 909 942 sub delete_instance 910 943 { -
trunk/Nebulous/lib/Nebulous/Client.pod
r17736 r20094 30 30 $neb->copy( "key", "new_key", "node01" ); 31 31 $neb->move( "key", "new_key" ); 32 $neb->swap( "key1", "key2" ); 32 33 $neb->delete_instance( $uri ); 33 34 my $stats = $neb->stat( "key" ); … … 349 350 350 351 =item * new_key 352 353 The destination object. 354 355 =back 356 357 Returns true on success or C<undef> on failure. 358 359 360 =item * swap($key1, $key2) 361 362 Atomically swaps the names of two storage objects. 363 364 =over 4 365 366 =item * key1 367 368 The source object. 369 370 =item * key2 351 371 352 372 The destination object.
Note:
See TracChangeset
for help on using the changeset viewer.
