Interface DiskOptimizationStrategy

    • Method Detail

      • bufferSize

        int bufferSize​(long recordSize)
        Parameters:
        recordSize - record size
        Returns:
        the buffer size for a given record size.
      • roundBufferSize

        default int roundBufferSize​(long size)
        Round up to the next multiple of 4k but no more than MAX_BUFFER_SIZE.
      • roundForCaching

        static int roundForCaching​(int size,
                                   boolean roundUp)
        Round either up or down to the next power of two, which is required by the ChunkCache.CachingRebufferer, but capping between MIN_BUFFER_SIZE and MAX_BUFFER_SIZE.
        Parameters:
        size - - the size to round to a power of two, normally this is a buffer size that was previously returned by a bufferSize(long).
        roundUp - - whether to round up or down
        Returns:
        a value rounded to a power of two but never bigger than MAX_BUFFER_SIZE or smaller than MIN_BUFFER_SIZE.