IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2010, 2:35:32 AM (16 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20101103/Nebulous
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/Nebulous/Build.PL

    r28446 r29906  
    122122        bin/neb-touch
    123123        bin/neb-xattr
     124        bin/whichnode
    124125    )],
    125126)->create_build_script;
  • branches/eam_branches/ipp-20101103/Nebulous/lib/Nebulous/Client.pm

    r28525 r29906  
    379379        {
    380380            # volume
    381             type        => SCALAR,
     381            type        => SCALAR|UNDEF,
    382382            optional    => 1,
    383383        },
     
    401401        }
    402402
     403        # set the number of user copies to 1 to prevent replication
     404        $self->setxattr($key, 'user.copies', 1, 'replace');
     405
    403406        if (defined $locations) {
    404             my $instances = $self->find_instances($key);
    405             if (scalar @$instances < 2) {
    406                 die "not enough instances";
     407            my $instances = $self->find_instances($key, undef, 'find them all');
     408            if (scalar @$instances == 1) {
     409                # only one instance nothing to do
     410                return 0;
     411            }
     412            if (scalar @$instances == 0) {
     413                die "no instances";
    407414            }
    408415            foreach my $victim (@$instances) {
     
    416423            # start at one so cull() is called one less time then the # of
    417424            # instances
    418             if ($stats->[6] < 2) {
    419                 die "not enough instances";
     425            if ($stats->[6] ==  1) {
     426                # only one instance nothing to do
     427                return 0;
     428            }
     429            if ($stats->[6] == 0) {
     430                die "no instances";
    420431            }
    421432            for (my $i = 1; $i < $stats->[6]; $i++) {
     
    439450}
    440451
     452sub storage_object_exists
     453{
     454    my $self = shift;
     455
     456    # HI!
     457
     458    my ($key) = validate_pos(@_,
     459        {
     460            type => SCALAR,
     461        },
     462    );
     463
     464    $log->debug( "entered - @_" );
     465
     466    my $found = 0;
     467    eval {
     468        my $objects = $self->find_objects($key);
     469        if  ($objects) {
     470            $found = (scalar @$objects) > 0;
     471        }
     472    };
     473    if ($@) {
     474        if ($@ =~ qr/invalid key/) {
     475            $self->set_err($@);
     476            return;
     477        }
     478        $log->logdie($@);
     479    }
     480
     481    $log->debug("leaving");
     482
     483    return $found;
     484}
    441485
    442486sub lock
Note: See TracChangeset for help on using the changeset viewer.