Loading src/common/rpc/distributor.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -322,8 +322,6 @@ host_t RandomSlicingDistributor::locate_file_metadata(const std::string& path, const int num_copy) const { auto myhash = str_hash(path); // TODO placeExtent hashes the hash with it's own hash, is this a problem? // (migh be unavoidable if multiple copies should be stored sometime) return dist_impl_->placeExtent(myhash); } Loading src/common/rpc/random_slicing/dist_rand_slice.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ DistRandSlice::partition_capacity(Disk* disk, uint64_t new_total_capacity) { /** * 64 bit Integer Hash Function * found at http://www.concentric.net/~Ttwang/tech/inthash.htm by Thomas Wang * currently unused */ static inline uint64_t my_hash(int64_t i) { Loading @@ -287,11 +288,18 @@ my_hash(int64_t i) { uint64_t DistRandSlice::placeExtent(int64_t position) { // function heavily modified for GekkoFS assert(m_copies == 1); uint64_t key = my_hash(position); // original uses my_hash function. // uint64_t key = my_hash(position); // For debugging with smaller VSPACE_MAX. if(DistRandSlice::VSPACE_MAX != UINT64_MAX) { #ifndef DEBUG assert(!"Running with VSPACE_MAX != UINT64_MAX but no DEBUG"); #endif position = position % DistRandSlice::VSPACE_MAX; } uint64_t partition_id = 0; m_interval_tree->search_tree(key, partition_id); m_interval_tree->search_tree(position, partition_id); return partition_id; } Loading Loading
src/common/rpc/distributor.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -322,8 +322,6 @@ host_t RandomSlicingDistributor::locate_file_metadata(const std::string& path, const int num_copy) const { auto myhash = str_hash(path); // TODO placeExtent hashes the hash with it's own hash, is this a problem? // (migh be unavoidable if multiple copies should be stored sometime) return dist_impl_->placeExtent(myhash); } Loading
src/common/rpc/random_slicing/dist_rand_slice.cpp +11 −3 Original line number Diff line number Diff line Loading @@ -262,6 +262,7 @@ DistRandSlice::partition_capacity(Disk* disk, uint64_t new_total_capacity) { /** * 64 bit Integer Hash Function * found at http://www.concentric.net/~Ttwang/tech/inthash.htm by Thomas Wang * currently unused */ static inline uint64_t my_hash(int64_t i) { Loading @@ -287,11 +288,18 @@ my_hash(int64_t i) { uint64_t DistRandSlice::placeExtent(int64_t position) { // function heavily modified for GekkoFS assert(m_copies == 1); uint64_t key = my_hash(position); // original uses my_hash function. // uint64_t key = my_hash(position); // For debugging with smaller VSPACE_MAX. if(DistRandSlice::VSPACE_MAX != UINT64_MAX) { #ifndef DEBUG assert(!"Running with VSPACE_MAX != UINT64_MAX but no DEBUG"); #endif position = position % DistRandSlice::VSPACE_MAX; } uint64_t partition_id = 0; m_interval_tree->search_tree(key, partition_id); m_interval_tree->search_tree(position, partition_id); return partition_id; } Loading