public class TimedBuffer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CHECKS_ON_SLEEP |
| Constructor and Description |
|---|
TimedBuffer(int size,
int timeout,
boolean logRates) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes,
boolean sync,
IOCallback callback) |
void |
addBytes(EncodingSupport bytes,
boolean sync,
IOCallback callback) |
boolean |
checkSize(int sizeChecked)
Verify if the size fits the buffer
|
void |
flush() |
void |
flush(boolean force)
force means the Journal is moving to a new file.
|
boolean |
isUseSleep() |
void |
setObserver(TimedBufferObserver observer) |
void |
setUseSleep(boolean useSleep) |
protected void |
sleep(int sleepMillis,
int sleepNanos)
Sub classes (tests basically) can use this to override how the sleep is being done
|
void |
start() |
protected void |
startSpin()
Sub classes (tests basically) can use this to override disabling spinning
|
void |
stop() |
protected void |
stopSpin()
Sub classes (tests basically) can use this to override disabling spinning
|
public static final int MAX_CHECKS_ON_SLEEP
public boolean isUseSleep()
public void setUseSleep(boolean useSleep)
public void start()
public void stop()
public void setObserver(TimedBufferObserver observer)
public boolean checkSize(int sizeChecked)
sizeChecked - public void addBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer bytes,
boolean sync,
IOCallback callback)
public void addBytes(EncodingSupport bytes, boolean sync, IOCallback callback)
public void flush()
public void flush(boolean force)
protected void sleep(int sleepMillis,
int sleepNanos)
throws InterruptedException
sleepMillis - sleepNanos - InterruptedExceptionprotected void stopSpin()
protected void startSpin()
Copyright © 2023 The Apache Software Foundation. All rights reserved.