public abstract class OffHeapFixedMessageSizeRingBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
bufferAddress |
protected long |
consumerIndexAddress |
static long |
EOF |
static int |
HEADER_SIZE |
protected long |
mask |
static byte |
MESSAGE_INDICATOR_SIZE |
protected int |
messageSize |
protected long |
producerIndexAddress |
static int |
READ_ACQUIRE_INDICATOR |
static int |
READ_RELEASE_INDICATOR |
static int |
WRITE_ACQUIRE_INDICATOR |
static int |
WRITE_RELEASE_INDICATOR |
Modifier | Constructor and Description |
---|---|
protected |
OffHeapFixedMessageSizeRingBuffer(ByteBuffer buff,
int capacity,
boolean isProducer,
boolean isConsumer,
boolean initialize,
int messageSize)
This is to be used for an IPC queue with the direct buffer used being a memory mapped file.
|
|
OffHeapFixedMessageSizeRingBuffer(int capacity,
int messageSize) |
Modifier and Type | Method and Description |
---|---|
int |
capacity() |
static int |
getRequiredBufferSize(int capacity,
int messageSize) |
boolean |
isEmpty() |
protected boolean |
isReadReleased(long offset) |
protected long |
lpConsumerIndex() |
protected long |
lpProducerIndex() |
protected long |
lvConsumerIndex() |
protected long |
lvProducerIndex() |
protected long |
offsetForIndex(long currentHead) |
protected static long |
offsetForIndex(long bufferAddress,
long mask,
int messageSize,
long currentHead) |
protected abstract long |
readAcquire() |
protected void |
readAcquireState(long offset) |
protected abstract void |
readRelease(long offset) |
protected void |
readReleaseState(long offset) |
int |
size() |
protected void |
soConsumerIndex(long value) |
protected void |
soProducerIndex(long value) |
protected abstract long |
writeAcquire() |
protected void |
writeAcquireState(long offset) |
protected abstract void |
writeRelease(long offset) |
protected void |
writeReleaseState(long offset) |
public static final int READ_RELEASE_INDICATOR
public static final int READ_ACQUIRE_INDICATOR
public static final int WRITE_RELEASE_INDICATOR
public static final int WRITE_ACQUIRE_INDICATOR
public static final byte MESSAGE_INDICATOR_SIZE
public static final int HEADER_SIZE
public static final long EOF
protected final long bufferAddress
protected final long consumerIndexAddress
protected final long producerIndexAddress
protected final long mask
protected final int messageSize
public OffHeapFixedMessageSizeRingBuffer(int capacity, int messageSize)
protected OffHeapFixedMessageSizeRingBuffer(ByteBuffer buff, int capacity, boolean isProducer, boolean isConsumer, boolean initialize, int messageSize)
buff
- capacity
- in messages, actual capacity will bemessageSize
- public static int getRequiredBufferSize(int capacity, int messageSize)
public final int capacity()
public final int size()
public final boolean isEmpty()
protected final boolean isReadReleased(long offset)
protected final void writeReleaseState(long offset)
protected final void readReleaseState(long offset)
protected final void writeAcquireState(long offset)
protected final void readAcquireState(long offset)
protected final long offsetForIndex(long currentHead)
protected static long offsetForIndex(long bufferAddress, long mask, int messageSize, long currentHead)
protected final long lpConsumerIndex()
protected final long lvConsumerIndex()
protected final void soConsumerIndex(long value)
protected final long lpProducerIndex()
protected final long lvProducerIndex()
protected final void soProducerIndex(long value)
protected abstract long readAcquire()
protected abstract void readRelease(long offset)
offset
- the base address of a message that we are done reading and can be overwritten nowprotected abstract long writeAcquire()
protected abstract void writeRelease(long offset)
offset
- the base address of a message that we are done writing and can be read nowCopyright © 2013-2016. All Rights Reserved.