本文整理汇总了Java中org.apache.cassandra.utils.MurmurHash.hash3_x64_128方法的典型用法代码示例。如果您正苦于以下问题:Java MurmurHash.hash3_x64_128方法的具体用法?Java MurmurHash.hash3_x64_128怎么用?Java MurmurHash.hash3_x64_128使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.utils.MurmurHash
的用法示例。
在下文中一共展示了MurmurHash.hash3_x64_128方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getToken
import org.apache.cassandra.utils.MurmurHash; //导入方法依赖的package包/类
/**
* Generate the token of a key.
* Note that we need to ensure all generated token are strictly bigger than MINIMUM.
* In particular we don't want MINIMUM to correspond to any key because the range (MINIMUM, X] doesn't
* include MINIMUM but we use such range to select all data whose token is smaller than X.
*/
public LongToken getToken(ByteBuffer key)
{
if (key.remaining() == 0)
return MINIMUM;
long[] hash = new long[2];
MurmurHash.hash3_x64_128(key, key.position(), key.remaining(), 0, hash);
return new LongToken(normalize(hash[0]));
}
示例2: GeneratorConfig
import org.apache.cassandra.utils.MurmurHash; //导入方法依赖的package包/类
public GeneratorConfig(String seedStr, DistributionFactory clusteringDistributions, DistributionFactory sizeDistributions, DistributionFactory identityDistributions)
{
this.clusteringDistributions = clusteringDistributions;
this.sizeDistributions = sizeDistributions;
this.identityDistributions = identityDistributions;
ByteBuffer buf = ByteBufferUtil.bytes(seedStr);
long[] hash = new long[2];
MurmurHash.hash3_x64_128(buf, buf.position(), buf.remaining(), 0, hash);
salt = hash[0];
}
示例3: getToken
import org.apache.cassandra.utils.MurmurHash; //导入方法依赖的package包/类
/**
* Generate the token of a key.
* Note that we need to ensure all generated token are strictly bigger than MINIMUM.
* In particular we don't want MINIMUM to correspond to any key because the range (MINIMUM, X] doesn't
* include MINIMUM but we use such range to select all data whose token is smaller than X.
*/
public LongToken getToken(ByteBuffer key)
{
if (key.remaining() == 0)
return MINIMUM;
long hash = MurmurHash.hash3_x64_128(key, key.position(), key.remaining(), 0)[0];
return new LongToken(normalize(hash));
}
示例4: getHash
import org.apache.cassandra.utils.MurmurHash; //导入方法依赖的package包/类
private long[] getHash(ByteBuffer key)
{
long[] hash = new long[2];
MurmurHash.hash3_x64_128(key, key.position(), key.remaining(), 0, hash);
return hash;
}
示例5: filterHash
import org.apache.cassandra.utils.MurmurHash; //导入方法依赖的package包/类
public void filterHash(long[] dest)
{
ByteBuffer key = getKey();
MurmurHash.hash3_x64_128(key, key.position(), key.remaining(), 0, dest);
}