当前位置: 首页>>代码示例>>Java>>正文


Java MurmurHash.hash3_x64_128方法代码示例

本文整理汇总了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]));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:Murmur3Partitioner.java

示例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];
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:GeneratorConfig.java

示例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));
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:15,代码来源:Murmur3Partitioner.java

示例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;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:7,代码来源:Murmur3Partitioner.java

示例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);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:6,代码来源:DecoratedKey.java


注:本文中的org.apache.cassandra.utils.MurmurHash.hash3_x64_128方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。