/** * Allocate a new {@link ByteArray} initialized with zeros. * @param size the initial length of the array */ public ByteArray newByteArray(long size) { return newByteArray(size, true); }
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) { this.bigArrays = bigArrays; this.bytes = bigArrays.newByteArray(expectedSize, false); }
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; }
/** Resize the array to the exact provided size. */ public ByteArray resize(ByteArray array, long size) { if (array instanceof BigByteArray) { return resizeInPlace((BigByteArray) array, size); } else { AbstractArray arr = (AbstractArray) array; final ByteArray newArray = newByteArray(size, arr.clearOnResize); final byte[] rawArray = ((ByteArrayWrapper) array).array; newArray.set(0, rawArray, 0, (int) Math.min(rawArray.length, newArray.size())); arr.close(); return newArray; } }
public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) { super(capacity, maxLoadFactor, bigArrays); startOffsets = bigArrays.newLongArray(capacity + 1, false); startOffsets.set(0, 0); bytes = bigArrays.newByteArray(capacity * 3, false); hashes = bigArrays.newIntArray(capacity, false); spare = new BytesRef(); }
/** * Allocate a new {@link ByteArray} initialized with zeros. * @param size the initial length of the array */ public ByteArray newByteArray(long size) { return newByteArray(size, true); }
/** * Allocate a new {@link ByteArray} initialized with zeros. * @param size the initial length of the array */ public ByteArray newByteArray(long size) { return newByteArray(size, true); }
/** * Allocate a new {@link ByteArray} initialized with zeros. * @param size the initial length of the array */ public ByteArray newByteArray(long size) { return newByteArray(size, true); }
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) { this.bigArrays = bigArrays; this.bytes = bigArrays.newByteArray(expectedSize); }
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) { this.bigArrays = bigArrays; this.bytes = bigArrays.newByteArray(expectedSize); }
protected BytesStreamOutput(int expectedSize, BigArrays bigarrays) { this.bigarrays = bigarrays; this.bytes = bigarrays.newByteArray(expectedSize); }
/** * Allocate a new {@link ByteArray} initialized with zeros. * @param size the initial length of the array */ public ByteArray newByteArray(long size) { return newByteArray(size, true); }
protected BytesStreamOutput(int expectedSize, BigArrays bigArrays) { this.bigArrays = bigArrays; this.bytes = bigArrays.newByteArray(expectedSize); }
@Override public ByteArray newByteArray(long size, boolean clearOnResize) { final ByteArrayWrapper array = new ByteArrayWrapper(super.newByteArray(size, clearOnResize), clearOnResize); if (!clearOnResize) { array.randomizeContent(0, size); } return array; }
/** Resize the array to the exact provided size. */ public ByteArray resize(ByteArray array, long size) { if (array instanceof BigByteArray) { return resizeInPlace((BigByteArray) array, size); } else { AbstractArray arr = (AbstractArray) array; final ByteArray newArray = newByteArray(size, arr.clearOnResize); final byte[] rawArray = ((ByteArrayWrapper) array).array; newArray.set(0, rawArray, 0, (int) Math.min(rawArray.length, newArray.size())); arr.close(); return newArray; } }
/** Resize the array to the exact provided size. */ public ByteArray resize(ByteArray array, long size) { if (array instanceof BigByteArray) { return resizeInPlace((BigByteArray) array, size); } else { AbstractArray arr = (AbstractArray) array; final ByteArray newArray = newByteArray(size, arr.clearOnResize); final byte[] rawArray = ((ByteArrayWrapper) array).array; newArray.set(0, rawArray, 0, (int) Math.min(rawArray.length, newArray.size())); arr.close(); return newArray; } }
public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) { super(capacity, maxLoadFactor, bigArrays); startOffsets = bigArrays.newLongArray(capacity + 1, false); startOffsets.set(0, 0); bytes = bigArrays.newByteArray(capacity * 3, false); hashes = bigArrays.newIntArray(capacity, false); spare = new BytesRef(); }
public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) { super(capacity, maxLoadFactor, bigArrays); startOffsets = bigArrays.newLongArray(capacity + 1, false); startOffsets.set(0, 0); bytes = bigArrays.newByteArray(capacity * 3, false); hashes = bigArrays.newIntArray(capacity, false); spare = new BytesRef(); }
public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) { super(capacity, maxLoadFactor, bigArrays); startOffsets = bigArrays.newLongArray(capacity + 1, false); startOffsets.set(0, 0); bytes = bigArrays.newByteArray(capacity * 3, false); hashes = bigArrays.newIntArray(capacity, false); spare = new BytesRef(); }
public BytesRefHash(long capacity, float maxLoadFactor, BigArrays bigArrays) { super(capacity, maxLoadFactor, bigArrays); startOffsets = bigArrays.newLongArray(capacity + 1, false); startOffsets.set(0, 0); bytes = bigArrays.newByteArray(capacity * 3, false); hashes = bigArrays.newIntArray(capacity, false); spare = new BytesRef(); }