Package org.elasticsearch.common.util
Class MockBigArrays
java.lang.Object
org.elasticsearch.common.util.BigArrays
org.elasticsearch.common.util.MockBigArrays
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.common.util.BigArrays
BigArrays.DoubleBinarySearcher -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError message thrown byBigArraysproduced withMockBigArrays(PageCacheRecycler, ByteSizeValue).Fields inherited from class org.elasticsearch.common.util.BigArrays
NON_RECYCLING_INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionMockBigArrays(PageCacheRecycler recycler, ByteSizeValue limit) Create BigArrays with a configured limit.MockBigArrays(PageCacheRecycler recycler, CircuitBreakerService breakerService) Create BigArrays with a provided breaker service.MockBigArrays(PageCacheRecycler recycler, CircuitBreakerService breakerService, boolean checkBreaker) Create BigArrays with a provided breaker service. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertFitsIn(ByteSizeValue max, Function<BigArrays, org.elasticsearch.core.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 voidnewByteArray(long size, boolean clearOnResize) newDoubleArray(long size, boolean clearOnResize) newFloatArray(long size, boolean clearOnResize) newIntArray(long size, boolean clearOnResize) newLongArray(long size, boolean clearOnResize) <T> ObjectArray<T> newObjectArray(long size) resize(DoubleArray array, long size) resize(FloatArray array, long size) <T> ObjectArray<T> resize(ObjectArray<T> array, long size) withBreakerService(CircuitBreakerService breakerService) 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, shouldCheckBreaker
-
Field Details
-
ERROR_MESSAGE
Error message thrown byBigArraysproduced withMockBigArrays(PageCacheRecycler, ByteSizeValue).- See Also:
-
-
Constructor Details
-
MockBigArrays
Create BigArrays with a configured limit. -
MockBigArrays
Create BigArrays with a provided breaker service. The breaker is not enable by default. -
MockBigArrays
public MockBigArrays(PageCacheRecycler recycler, CircuitBreakerService breakerService, boolean checkBreaker) Create BigArrays with a provided breaker service. The breaker can be enabled with thecheckBreakerflag.
-
-
Method Details
-
assertFitsIn
public static void assertFitsIn(ByteSizeValue max, Function<BigArrays, org.elasticsearch.core.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
- Throws:
Exception
-
withCircuitBreaking
- Overrides:
withCircuitBreakingin classBigArrays
-
withBreakerService
- Overrides:
withBreakerServicein classBigArrays
-
newByteArray
- Overrides:
newByteArrayin classBigArrays
-
resize
-
newIntArray
- Overrides:
newIntArrayin classBigArrays
-
resize
-
newLongArray
- Overrides:
newLongArrayin classBigArrays
-
resize
-
newFloatArray
- Overrides:
newFloatArrayin classBigArrays
-
resize
-
newDoubleArray
- Overrides:
newDoubleArrayin classBigArrays
-
resize
-
newObjectArray
- Overrides:
newObjectArrayin classBigArrays
-
resize
-