Class TimedBuffer
java.lang.Object
org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
org.apache.activemq.artemis.core.io.buffer.TimedBuffer
- All Implemented Interfaces:
org.apache.activemq.artemis.utils.critical.CriticalComponent
public final class TimedBuffer
extends org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionTimedBuffer(org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer, int size, int timeout, boolean logRates) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBytes(ActiveMQBuffer bytes, boolean sync, IOCallback callback) voidaddBytes(EncodingSupport bytes, boolean sync, IOCallback callback) booleancheckSize(int sizeChecked) Verify if the size fits the buffervoidflush()booleanAttempts to flush if!delayFlushandbufferis filled by any data.voidsetObserver(TimedBufferObserver observer) protected voidsleep(long sleepNanos) Sub classes (tests basically) can use this to override how the sleep is being donevoidstart()protected voidSub classes (tests basically) can use this to override disabling spinningvoidstop()protected voidstopSpin()Sub classes (tests basically) can use this to override disabling spinningMethods inherited from class org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
checkExpiration, enterCritical, getCriticalAnalyzer, leaveCritical, measureCritical
-
Field Details
-
CRITICAL_PATHS
protected static final int CRITICAL_PATHS- See Also:
-
CRITICAL_PATH_FLUSH
protected static final int CRITICAL_PATH_FLUSH- See Also:
-
CRITICAL_PATH_STOP
protected static final int CRITICAL_PATH_STOP- See Also:
-
CRITICAL_PATH_START
protected static final int CRITICAL_PATH_START- See Also:
-
CRITICAL_PATH_CHECK_SIZE
protected static final int CRITICAL_PATH_CHECK_SIZE- See Also:
-
CRITICAL_PATH_ADD_BYTES
protected static final int CRITICAL_PATH_ADD_BYTES- See Also:
-
CRITICAL_PATH_SET_OBSERVER
protected static final int CRITICAL_PATH_SET_OBSERVER- See Also:
-
-
Constructor Details
-
TimedBuffer
public TimedBuffer(org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer, int size, int timeout, boolean logRates)
-
-
Method Details
-
start
public void start() -
stop
public void stop() -
setObserver
-
checkSize
public boolean checkSize(int sizeChecked) Verify if the size fits the buffer -
addBytes
-
addBytes
-
flush
public void flush() -
flushBatch
public boolean flushBatch()Attempts to flush if!delayFlushandbufferis filled by any data.- Returns:
truewhen are flushed any bytes,falseotherwise
-
sleep
protected void sleep(long sleepNanos) Sub classes (tests basically) can use this to override how the sleep is being done -
stopSpin
protected void stopSpin()Sub classes (tests basically) can use this to override disabling spinning -
startSpin
protected void startSpin()Sub classes (tests basically) can use this to override disabling spinning
-