Class TimingBufferSource
java.lang.Object
org.terracotta.offheapstore.buffersource.TimingBufferSource
- All Implemented Interfaces:
BufferSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate final BufferSourceprivate final booleanprivate static final org.slf4j.Loggerprivate final long -
Constructor Summary
ConstructorsConstructorDescriptionTimingBufferSource(BufferSource source, long slow, TimeUnit slowUnit, long critical, TimeUnit criticalUnit, boolean haltOnCritical) -
Method Summary
Modifier and TypeMethodDescriptionallocateBuffer(int size) Allocates a buffer of the given size.private static voidcommitSuicide(String msg) Try to terminate the VM as soon as possible no matter the method and how abrupt it may be.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
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
Description copied from interface:BufferSourceAllocates a buffer of the given size.If a suitable buffer cannot be allocated then
nullshould be returned. Implementations may place restrictions on the valid size value they will accept.- Specified by:
allocateBufferin interfaceBufferSource- Parameters:
size- required buffer size- Returns:
- a buffer of the required size
-
commitSuicide
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.
-