IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23725


Ignore:
Timestamp:
Apr 7, 2009, 1:48:25 PM (17 years ago)
Author:
jhoblitt
Message:

select neb db to use by hashing only the directory component of the key

Location:
branches/neb_distrib_20081210/Nebulous-Server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/neb_distrib_20081210/Nebulous-Server/Changes

    r23715 r23725  
    99    - attempt to optimize _is_valid_object_key() by eliminating an unused join
    1010    - rename Nebulous::Keys class -> Nebulous::Key
     11    - select neb db to use by hashing only the directory component of the key
    1112     
    12130.16
  • branches/neb_distrib_20081210/Nebulous-Server/lib/Nebulous/Server.pm

    r23718 r23725  
    7979    # only use the first 8 hex chars... have to be careful to avoid an int
    8080    # overflow here
    81     # XXX this needs to be modified to follow my key prescription:
    82     # neb://host/path/path/filename.ext -> use path/path/filename (ignore neb://host and .ext)
    83     # EAM : test to double-check hashing behavior
    84     $db_index = unpack("h8", sha1_hex("$key")) % $config->n_db;
     81
     82    # hash only the directory component of the path and not the filename
     83    my $path = dirname($key->path);
     84    $db_index = unpack("h8", sha1_hex($path)) % $config->n_db;
    8585
    8686    return $db_index;
Note: See TracChangeset for help on using the changeset viewer.