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/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
ConstructorDescriptionMockBigArrays
(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 TypeMethodDescriptionstatic void
assertFitsIn
(org.elasticsearch.common.unit.ByteSizeValue max, Function<org.elasticsearch.common.util.BigArrays, org.elasticsearch.core.Releasable> run) Assert that a function returning aReleasable
runs to completion when allocated a breaker with that breaks when it uses more thanmax
bytes and that the function doesn't leak any BigArrays if it is given a breaker that allows fewer bytes.static void
org.elasticsearch.common.util.ByteArray
newByteArray
(long size, boolean clearOnResize) org.elasticsearch.common.util.DoubleArray
newDoubleArray
(long size, boolean clearOnResize) org.elasticsearch.common.util.FloatArray
newFloatArray
(long size, boolean clearOnResize) org.elasticsearch.common.util.IntArray
newIntArray
(long size, boolean clearOnResize) org.elasticsearch.common.util.LongArray
newLongArray
(long size, boolean clearOnResize) <T> org.elasticsearch.common.util.ObjectArray<T>
newObjectArray
(long size) org.elasticsearch.common.util.ByteArray
resize
(org.elasticsearch.common.util.ByteArray array, long size) org.elasticsearch.common.util.DoubleArray
resize
(org.elasticsearch.common.util.DoubleArray array, long size) org.elasticsearch.common.util.FloatArray
resize
(org.elasticsearch.common.util.FloatArray array, long size) org.elasticsearch.common.util.IntArray
resize
(org.elasticsearch.common.util.IntArray array, long size) org.elasticsearch.common.util.LongArray
resize
(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.BigArrays
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, withBreakerService
-
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, Function<org.elasticsearch.common.util.BigArrays, org.elasticsearch.core.Releasable> run) Assert that a function returning aReleasable
runs to completion when allocated a breaker with that breaks when it uses more thanmax
bytes and that the function doesn't leak any BigArrays if it is given a breaker that allows fewer bytes. -
ensureAllArraysAreReleased
- Throws:
Exception
-
withCircuitBreaking
public org.elasticsearch.common.util.BigArrays withCircuitBreaking()- Overrides:
withCircuitBreaking
in classorg.elasticsearch.common.util.BigArrays
-
newByteArray
public org.elasticsearch.common.util.ByteArray newByteArray(long size, boolean clearOnResize) - Overrides:
newByteArray
in classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.ByteArray resize(org.elasticsearch.common.util.ByteArray array, long size) - Overrides:
resize
in classorg.elasticsearch.common.util.BigArrays
-
newIntArray
public org.elasticsearch.common.util.IntArray newIntArray(long size, boolean clearOnResize) - Overrides:
newIntArray
in classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.IntArray resize(org.elasticsearch.common.util.IntArray array, long size) - Overrides:
resize
in classorg.elasticsearch.common.util.BigArrays
-
newLongArray
public org.elasticsearch.common.util.LongArray newLongArray(long size, boolean clearOnResize) - Overrides:
newLongArray
in classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.LongArray resize(org.elasticsearch.common.util.LongArray array, long size) - Overrides:
resize
in classorg.elasticsearch.common.util.BigArrays
-
newFloatArray
public org.elasticsearch.common.util.FloatArray newFloatArray(long size, boolean clearOnResize) - Overrides:
newFloatArray
in classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.FloatArray resize(org.elasticsearch.common.util.FloatArray array, long size) - Overrides:
resize
in classorg.elasticsearch.common.util.BigArrays
-
newDoubleArray
public org.elasticsearch.common.util.DoubleArray newDoubleArray(long size, boolean clearOnResize) - Overrides:
newDoubleArray
in classorg.elasticsearch.common.util.BigArrays
-
resize
public org.elasticsearch.common.util.DoubleArray resize(org.elasticsearch.common.util.DoubleArray array, long size) - Overrides:
resize
in classorg.elasticsearch.common.util.BigArrays
-
newObjectArray
public <T> org.elasticsearch.common.util.ObjectArray<T> newObjectArray(long size) - Overrides:
newObjectArray
in 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:
resize
in classorg.elasticsearch.common.util.BigArrays
-