Class TimingBufferSource

java.lang.Object
org.terracotta.offheapstore.buffersource.TimingBufferSource
All Implemented Interfaces:
BufferSource

public class TimingBufferSource extends Object implements BufferSource
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • delegate

      private final BufferSource delegate
    • slowNanos

      private final long slowNanos
    • criticalNanos

      private final long criticalNanos
    • haltOnCritical

      private final boolean haltOnCritical
  • Constructor Details

    • TimingBufferSource

      public TimingBufferSource(BufferSource source, long slow, TimeUnit slowUnit, long critical, TimeUnit criticalUnit, boolean haltOnCritical)
  • Method Details

    • allocateBuffer

      public ByteBuffer allocateBuffer(int size)
      Description copied from interface: BufferSource
      Allocates a buffer of the given size.

      If a suitable buffer cannot be allocated then null should be returned. Implementations may place restrictions on the valid size value they will accept.

      Specified by:
      allocateBuffer in interface BufferSource
      Parameters:
      size - required buffer size
      Returns:
      a buffer of the required size
    • commitSuicide

      private static void commitSuicide(String msg)
      Try to terminate the VM as soon as possible no matter the method and how abrupt it may be.
      Parameters:
      msg - an error message which may end up being reported.