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


Java BigArrays.newByteArray方法代码示例

本文整理汇总了Java中org.elasticsearch.common.util.BigArrays.newByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java BigArrays.newByteArray方法的具体用法?Java BigArrays.newByteArray怎么用?Java BigArrays.newByteArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.util.BigArrays的用法示例。


在下文中一共展示了BigArrays.newByteArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HyperLogLogPlusPlus

import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
public HyperLogLogPlusPlus(int precision, BigArrays bigArrays, long initialBucketCount) {
    Preconditions.checkArgument(precision >= 4, "precision must be >= 4");
    Preconditions.checkArgument(precision <= 18, "precision must be <= 18");
    p = precision;
    m = 1 << p;
    this.bigArrays = bigArrays;
    algorithm = new OpenBitSet();
    runLens = bigArrays.newByteArray(initialBucketCount << p);
    hashSet = new Hashset(initialBucketCount);
    final double alpha;
    switch (p) {
    case 4:
        alpha = 0.673;
        break;
    case 5:
        alpha = 0.697;
        break;
    default:
        alpha = 0.7213 / (1 + 1.079 / m);
        break;
    }
    alphaMM = alpha * m * m;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:HyperLogLogPlusPlus.java

示例2: TestResponse

import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
TestResponse(final BigArrays bigArrays) {
    final byte[] bytes;
    try {
        bytes = "content".getBytes("UTF-8");
    } catch (final UnsupportedEncodingException e) {
        throw new AssertionError(e);
    }
    final ByteArray bigArray = bigArrays.newByteArray(bytes.length);
    bigArray.set(0, bytes, 0, bytes.length);
    reference = new ReleasablePagedBytesReference(bigArrays, bigArray, bytes.length);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:Netty4HttpChannelTests.java

示例3: HyperLogLogPlusPlus

import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
public HyperLogLogPlusPlus(int precision, BigArrays bigArrays, long initialBucketCount) {
    if (precision < 4) {
        throw new IllegalArgumentException("precision must be >= 4");
    }
    if (precision > 18) {
        throw new IllegalArgumentException("precision must be <= 18");
    }
    p = precision;
    m = 1 << p;
    this.bigArrays = bigArrays;
    algorithm = new OpenBitSet();
    runLens = bigArrays.newByteArray(initialBucketCount << p);
    hashSet = new Hashset(initialBucketCount);
    final double alpha;
    switch (p) {
    case 4:
        alpha = 0.673;
        break;
    case 5:
        alpha = 0.697;
        break;
    default:
        alpha = 0.7213 / (1 + 1.079 / m);
        break;
    }
    alphaMM = alpha * m * m;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:28,代码来源:HyperLogLogPlusPlus.java

示例4: BytesStreamOutput

import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) {
    this.bigArrays = bigArrays;
    this.bytes = bigArrays.newByteArray(expectedSize);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:BytesStreamOutput.java

示例5: BytesStreamOutput

import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
protected BytesStreamOutput(int expectedSize, BigArrays bigarrays) {
    this.bigarrays = bigarrays;
    this.bytes = bigarrays.newByteArray(expectedSize);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:BytesStreamOutput.java


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