本文整理汇总了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;
}
示例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);
}
示例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;
}
示例4: BytesStreamOutput
import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) {
this.bigArrays = bigArrays;
this.bytes = bigArrays.newByteArray(expectedSize);
}
示例5: BytesStreamOutput
import org.elasticsearch.common.util.BigArrays; //导入方法依赖的package包/类
protected BytesStreamOutput(int expectedSize, BigArrays bigarrays) {
this.bigarrays = bigarrays;
this.bytes = bigarrays.newByteArray(expectedSize);
}