支持文件接口用户自定义信息;

This commit is contained in:
linuxrc@163.com
2021-07-27 16:25:13 +08:00
parent 5217e9188e
commit b32381f7f5
11 changed files with 76 additions and 40 deletions

View File

@@ -145,7 +145,7 @@ static u_int64_t bucket_gen_uniq_point(struct ch_bucket_inner *inner_bucket, u_i
u_int32_t hash, i=0;
seed = (((u_int64_t)cur_point_index)<<32) | inner_bucket->bucket.bucket_id;
hash = murmurhash2(&seed, sizeof(u_int64_t), 23068673);
hash = murmurhash2(&seed, sizeof(u_int64_t), 515880193);
x = (((u_int64_t)hash)<<32) | inner_bucket->bucket.bucket_id;
while(i != cur_point_index)
@@ -155,7 +155,7 @@ static u_int64_t bucket_gen_uniq_point(struct ch_bucket_inner *inner_bucket, u_i
if(x == inner_bucket->point_array[i].point_val) //<2F><>ͻ
{
seed = (((u_int64_t)hash)<<32) | inner_bucket->bucket.bucket_id;
hash = murmurhash2(&seed, sizeof(u_int64_t), 23068673);
hash = murmurhash2(&seed, sizeof(u_int64_t), 515880193);
x = (((u_int64_t)hash)<<32) | inner_bucket->bucket.bucket_id;
i = 0;
break;
@@ -434,7 +434,7 @@ enum CONHASH_ERRCODE conhash_lookup_bucket(struct consistent_hash *ch, const voi
return CONHASH_NO_VALID_BUCKETS;
}
hash = MurmurHash64A(key, len, 23068673);
hash = MurmurHash64A(key, len, 515880193);
idx = search_up_bound(hash, ch->point_array, ch->point_num, sizeof(struct ch_point), offsetof(struct ch_point, point_val));
ch->point_array[idx].hit_cnt++;
bucket_index = ch->point_array[idx].bucket_index;