Package org.elasticsearch.common.util
Class MockBigArrays
java.lang.Object
org.elasticsearch.common.util.BigArrays
org.elasticsearch.common.util.MockBigArrays
public class MockBigArrays
extends org.elasticsearch.common.util.BigArrays
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMockBigArrays.LimitedBreakerNested classes/interfaces inherited from class org.elasticsearch.common.util.BigArrays
org.elasticsearch.common.util.BigArrays.DoubleBinarySearcher -
Field Summary
Fields inherited from class org.elasticsearch.common.util.BigArrays
NON_RECYCLING_INSTANCE -
Constructor Summary
Constructors Constructor Description MockBigArrays(org.elasticsearch.common.util.PageCacheRecycler recycler, org.elasticsearch.common.unit.ByteSizeValue limit)Create BigArrays with a configured limit.MockBigArrays(org.elasticsearch.common.util.PageCacheRecycler recycler, org.elasticsearch.indices.breaker.CircuitBreakerService breakerService) -
Method Summary
Modifier and Type Method Description static voidassertFitsIn(org.elasticsearch.common.unit.ByteSizeValue max, java.util.function.Function<org.elasticsearch.common.util.BigArrays,org.elasticsearch.common.lease.Releasable> run)Assert that a function returning aReleasableruns to completion when allocated a breaker with that breaks when it uses more thanmaxbytes and that the function doesn't leak any BigArrays if it is given a breaker that allows fewer bytes.static voidensureAllArraysAreReleased()org.elasticsearch.common.util.ByteArraynewByteArray(long size, boolean clearOnResize)org.elasticsearch.common.util.DoubleArraynewDoubleArray(long size, boolean clearOnResize)org.elasticsearch.common.util.FloatArraynewFloatArray(long size, boolean clearOnResize)org.elasticsearch.common.util.IntArraynewIntArray(long size, boolean clearOnResize)org.elasticsearch.common.util.LongArraynewLongArray(long size, boolean clearOnResize)<T> org.elasticsearch.common.util.ObjectArray<T>newObjectArray(long size)org.elasticsearch.common.util.ByteArrayresize(org.elasticsearch.common.util.ByteArray array, long size)org.elasticsearch.common.util.DoubleArrayresize(org.elasticsearch.common.util.DoubleArray array, long size)org.elasticsearch.common.util.FloatArrayresize(org.elasticsearch.common.util.FloatArray array, long size)org.elasticsearch.common.util.IntArrayresize(org.elasticsearch.common.util.IntArray array, long size)org.elasticsearch.common.util.LongArrayresize(org.elasticsearch.common.util.LongArray array, long size)<T> org.elasticsearch.common.util.ObjectArray<T>resize(org.elasticsearch.common.util.ObjectArray<T> array, long size)org.elasticsearch.common.util.BigArrayswithCircuitBreaking()Methods inherited from class org.elasticsearch.common.util.BigArrays
breakerService, equals, grow, grow, grow, grow, grow, grow, hashCode, newByteArray, newDoubleArray, newFloatArray, newIntArray, newLongArray, overSize, overSize, withBreakerServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MockBigArrays
public MockBigArrays(org.elasticsearch.common.util.PageCacheRecycler recycler, org.elasticsearch.common.unit.ByteSizeValue limit)Create BigArrays with a configured limit. -
MockBigArrays
public MockBigArrays(org.elasticsearch.common.util.PageCacheRecycler recycler, org.elasticsearch.indices.breaker.CircuitBreakerService breakerService)
-
-
Method Details
-
assertFitsIn
public static void assertFitsIn(org.elasticsearch.common.unit.ByteSizeValue max, java.util.function.Function<org.elasticsearch.common.util.BigArrays,org.elasticsearch.common.lease.Releasable> run)Assert that a function returning aReleasableruns to completion when allocated a breaker with that breaks when it uses more thanmaxbytes and that the function doesn't leak any BigArrays if it is given a breaker that allows fewer bytes. -
ensureAllArraysAreReleased
public static void ensureAllArraysAreReleased() throws java.lang.Exception- Throws:
java.lang.Exception
-
withCircuitBreaking
public org.elasticsearch.common.util.BigArrays withCircuitBreaking()- Overrides:
withCircuitBreakingin classorg.elasticsearch.common.util.BigArrays
-
newByteArray
public org.elasticsearch.common.util.ByteArray newByteArray(long size, boolean clearOnResize)- Overrides:
newByteArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.ByteArray resize(org.elasticsearch.common.util.ByteArray array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-
newIntArray
public org.elasticsearch.common.util.IntArray newIntArray(long size, boolean clearOnResize)- Overrides:
newIntArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.IntArray resize(org.elasticsearch.common.util.IntArray array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-
newLongArray
public org.elasticsearch.common.util.LongArray newLongArray(long size, boolean clearOnResize)- Overrides:
newLongArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.LongArray resize(org.elasticsearch.common.util.LongArray array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-
newFloatArray
public org.elasticsearch.common.util.FloatArray newFloatArray(long size, boolean clearOnResize)- Overrides:
newFloatArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.FloatArray resize(org.elasticsearch.common.util.FloatArray array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-
newDoubleArray
public org.elasticsearch.common.util.DoubleArray newDoubleArray(long size, boolean clearOnResize)- Overrides:
newDoubleArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.DoubleArray resize(org.elasticsearch.common.util.DoubleArray array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-
newObjectArray
public <T> org.elasticsearch.common.util.ObjectArray<T> newObjectArray(long size)- Overrides:
newObjectArrayin classorg.elasticsearch.common.util.BigArrays
-
resize
public <T> org.elasticsearch.common.util.ObjectArray<T> resize(org.elasticsearch.common.util.ObjectArray<T> array, long size)- Overrides:
resizein classorg.elasticsearch.common.util.BigArrays
-