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 class  MockBigArrays.LimitedBreaker  

    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

    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 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 a Releasable runs to completion when allocated a breaker with that breaks when it uses more than max bytes and that the function doesn't leak any BigArrays if it is given a breaker that allows fewer bytes.
    static void ensureAllArraysAreReleased()  
    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 withCircuitBreaking()  

    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

    Methods 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 a Releasable runs to completion when allocated a breaker with that breaks when it uses more than max bytes 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:
      withCircuitBreaking in class org.elasticsearch.common.util.BigArrays
    • newByteArray

      public org.elasticsearch.common.util.ByteArray newByteArray​(long size, boolean clearOnResize)
      Overrides:
      newByteArray in class org.elasticsearch.common.util.BigArrays
    • resize

      public org.elasticsearch.common.util.ByteArray resize​(org.elasticsearch.common.util.ByteArray array, long size)
      Overrides:
      resize in class org.elasticsearch.common.util.BigArrays
    • newIntArray

      public org.elasticsearch.common.util.IntArray newIntArray​(long size, boolean clearOnResize)
      Overrides:
      newIntArray in class org.elasticsearch.common.util.BigArrays
    • resize

      public org.elasticsearch.common.util.IntArray resize​(org.elasticsearch.common.util.IntArray array, long size)
      Overrides:
      resize in class org.elasticsearch.common.util.BigArrays
    • newLongArray

      public org.elasticsearch.common.util.LongArray newLongArray​(long size, boolean clearOnResize)
      Overrides:
      newLongArray in class org.elasticsearch.common.util.BigArrays
    • resize

      public org.elasticsearch.common.util.LongArray resize​(org.elasticsearch.common.util.LongArray array, long size)
      Overrides:
      resize in class org.elasticsearch.common.util.BigArrays
    • newFloatArray

      public org.elasticsearch.common.util.FloatArray newFloatArray​(long size, boolean clearOnResize)
      Overrides:
      newFloatArray in class org.elasticsearch.common.util.BigArrays
    • resize

      public org.elasticsearch.common.util.FloatArray resize​(org.elasticsearch.common.util.FloatArray array, long size)
      Overrides:
      resize in class org.elasticsearch.common.util.BigArrays
    • newDoubleArray

      public org.elasticsearch.common.util.DoubleArray newDoubleArray​(long size, boolean clearOnResize)
      Overrides:
      newDoubleArray in class org.elasticsearch.common.util.BigArrays
    • resize

      public org.elasticsearch.common.util.DoubleArray resize​(org.elasticsearch.common.util.DoubleArray array, long size)
      Overrides:
      resize in class org.elasticsearch.common.util.BigArrays
    • newObjectArray

      public <T> org.elasticsearch.common.util.ObjectArray<T> newObjectArray​(long size)
      Overrides:
      newObjectArray in class org.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 class org.elasticsearch.common.util.BigArrays