@Override protected void resize(long capacity) { ids = bigArrays.resize(ids, capacity); }
@Override public void reset() { // shrink list of pages if (bytes.size() > PageCacheRecycler.PAGE_SIZE_IN_BYTES) { bytes = bigArrays.resize(bytes, PageCacheRecycler.PAGE_SIZE_IN_BYTES); } // go back to start count = 0; }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public IntArray grow(IntArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.INT_PAGE_SIZE, Integer.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public FloatArray grow(FloatArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.INT_PAGE_SIZE, Float.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public <T> ObjectArray<T> grow(ObjectArray<T> array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.OBJECT_PAGE_SIZE, RamUsageEstimator.NUM_BYTES_OBJECT_REF); return resize(array, newSize); } }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public DoubleArray grow(DoubleArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.LONG_PAGE_SIZE, Long.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public LongArray grow(LongArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.LONG_PAGE_SIZE, Long.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, * preserving content, and potentially reusing part of the provided array. */ public ByteArray grow(ByteArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, PageCacheRecycler.BYTE_PAGE_SIZE, 1); return resize(array, newSize); }
final long from = counts.size(); final long overSize = BigArrays.overSize(bucket + 1); counts = bigArrays.resize(counts, overSize); sums = bigArrays.resize(sums, overSize); compensations = bigArrays.resize(compensations, overSize); mins = bigArrays.resize(mins, overSize); maxes = bigArrays.resize(maxes, overSize); mins.fill(from, overSize, Double.POSITIVE_INFINITY); maxes.fill(from, overSize, Double.NEGATIVE_INFINITY);
final long from = counts.size(); final long overSize = BigArrays.overSize(bucket + 1); counts = bigArrays.resize(counts, overSize); sums = bigArrays.resize(sums, overSize); compensations = bigArrays.resize(compensations, overSize); mins = bigArrays.resize(mins, overSize); maxes = bigArrays.resize(maxes, overSize); sumOfSqrs = bigArrays.resize(sumOfSqrs, overSize); compensationOfSqrs = bigArrays.resize(compensationOfSqrs, overSize); mins.fill(from, overSize, Double.POSITIVE_INFINITY); maxes.fill(from, overSize, Double.NEGATIVE_INFINITY);
tops = bigArrays.grow(tops, bucket + 1); tops.fill(from, tops.size(), Double.NEGATIVE_INFINITY); bottoms = bigArrays.resize(bottoms, tops.size()); bottoms.fill(from, bottoms.size(), Double.POSITIVE_INFINITY); posLefts = bigArrays.resize(posLefts, tops.size()); posLefts.fill(from, posLefts.size(), Double.POSITIVE_INFINITY); posRights = bigArrays.resize(posRights, tops.size()); posRights.fill(from, posRights.size(), Double.NEGATIVE_INFINITY); negLefts = bigArrays.resize(negLefts, tops.size()); negLefts.fill(from, negLefts.size(), Double.POSITIVE_INFINITY); negRights = bigArrays.resize(negRights, tops.size()); negRights.fill(from, negRights.size(), Double.NEGATIVE_INFINITY);
@Override public <T> ObjectArray<T> resize(ObjectArray<T> array, long size) { ObjectArrayWrapper<T> arr = (ObjectArrayWrapper<T>) array; array = super.resize(arr.in, size); ACQUIRED_ARRAYS.remove(arr); if (array instanceof ObjectArrayWrapper) { arr = (ObjectArrayWrapper<T>) array; } else { arr = new ObjectArrayWrapper<>(array); } return arr; }
@Override public void reset() { // shrink list of pages if (bytes.size() > BigArrays.PAGE_SIZE_IN_BYTES) { bytes = bigArrays.resize(bytes, BigArrays.PAGE_SIZE_IN_BYTES); } // go back to start count = 0; }
/** Grow an array to a size that is larger than <code>minSize</code>, preserving content, and potentially reusing part of the provided array. */ public ByteArray grow(ByteArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, BYTE_PAGE_SIZE, 1); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, preserving content, and potentially reusing part of the provided array. */ public LongArray grow(LongArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, LONG_PAGE_SIZE, Long.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, preserving content, and potentially reusing part of the provided array. */ public IntArray grow(IntArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, INT_PAGE_SIZE, Integer.BYTES); return resize(array, newSize); }
/** Grow an array to a size that is larger than <code>minSize</code>, preserving content, and potentially reusing part of the provided array. */ public <T> ObjectArray<T> grow(ObjectArray<T> array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, OBJECT_PAGE_SIZE, RamUsageEstimator.NUM_BYTES_OBJECT_REF); return resize(array, newSize); } }
/** Grow an array to a size that is larger than <code>minSize</code>, preserving content, and potentially reusing part of the provided array. */ public FloatArray grow(FloatArray array, long minSize) { if (minSize <= array.size()) { return array; } final long newSize = overSize(minSize, INT_PAGE_SIZE, Float.BYTES); return resize(array, newSize); }