public class SingleChronicleQueue extends Object implements RollingChronicleQueue
| Modifier and Type | Field and Description |
|---|---|
protected ThreadLocal<ExcerptAppender> |
excerptAppenderThreadLocal |
protected int |
sourceId |
static String |
SUFFIX |
TEST_BLOCK_SIZE| Modifier | Constructor and Description |
|---|---|
protected |
SingleChronicleQueue(SingleChronicleQueueBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
ExcerptAppender |
acquireAppender()
An Appender can be used to writeBytes new excerpts sequentially to the upper.
|
void |
addCloseListener(Runnable closer) |
long |
blockSize() |
long |
bufferCapacity() |
boolean |
buffered() |
void |
clear()
Remove all the entries in the queue.
|
void |
close() |
long |
countExcerpts(long lowerIndex,
long upperIndex)
The number of excerpts between the indexes,
index1 inclusive, index2
exclusive. |
ExcerptTailer |
createTailer() |
int |
cycle() |
String |
dump()
Dump a Queue in YAML format.
|
void |
dump(Writer writer,
long fromIndex,
long toIndex)
Dump a range of entries to a Writer
|
long |
epoch() |
net.openhft.chronicle.core.threads.EventLoop |
eventLoop() |
File |
file() |
int |
firstCycle() |
long |
firstIndex() |
int |
indexCount() |
int |
indexSpacing() |
boolean |
isClosed() |
int |
lastCycle() |
protected ExcerptAppender |
newAppender() |
int |
nextCycle(int cycle,
TailerDirection direction)
the next available cycle, no cycle will be created by this method, this method is typically
used by a tailer to jump to the next cycle when the cycles are not adjacent.
|
java.util.function.Consumer<net.openhft.chronicle.bytes.BytesRingBufferStats> |
onRingBufferStats() |
StoreRecoveryFactory |
recoverySupplier() |
void |
release(WireStore store) |
RollCycle |
rollCycle() |
int |
sourceId() |
WireStore |
storeForCycle(int cycle,
long epoch,
boolean createIfAbsent) |
String |
toString() |
net.openhft.chronicle.wire.WireType |
wireType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateAppender, dumppublic static final String SUFFIX
protected final ThreadLocal<ExcerptAppender> excerptAppenderThreadLocal
protected final int sourceId
protected SingleChronicleQueue(@NotNull
SingleChronicleQueueBuilder builder)
public int sourceId()
sourceId in interface ChronicleQueuepublic void clear()
ChronicleQueueclear in interface ChronicleQueue@NotNull public File file()
file in interface ChronicleQueuepublic String dump()
ChronicleQueuedump in interface ChronicleQueuepublic void dump(Writer writer, long fromIndex, long toIndex)
ChronicleQueuedump in interface ChronicleQueuewriter - to write tofromIndex - first index to includetoIndex - last index to include.public int indexCount()
indexCount in interface RollingChronicleQueuepublic int indexSpacing()
indexSpacing in interface RollingChronicleQueuepublic long epoch()
epoch in interface RollingChronicleQueue@NotNull public RollCycle rollCycle()
rollCycle in interface RollingChronicleQueuepublic StoreRecoveryFactory recoverySupplier()
recoverySupplier in interface RollingChronicleQueuepublic boolean buffered()
@Nullable public net.openhft.chronicle.core.threads.EventLoop eventLoop()
protected ExcerptAppender newAppender()
@NotNull public ExcerptAppender acquireAppender()
ChronicleQueueacquireAppender in interface ChronicleQueue@NotNull public ExcerptTailer createTailer()
createTailer in interface ChronicleQueue@Nullable public final WireStore storeForCycle(int cycle, long epoch, boolean createIfAbsent)
storeForCycle in interface RollingChronicleQueuecycle - the cycleepoch - an epoch offset as the number of number of milliseconds since January
1, 1970, 00:00:00 GMTcreateIfAbsent - create missing stores if true, or return null if missingWireStore associated with this cycle, or null if !createIfAbsent
is false and absentpublic int nextCycle(int cycle,
@NotNull
TailerDirection direction)
throws ParseException
RollingChronicleQueuenextCycle in interface RollingChronicleQueuecycle - the current cycledirection - the directionParseExceptionpublic long countExcerpts(long lowerIndex,
long upperIndex)
throws IllegalStateException
RollingChronicleQueueindex1 inclusive, index2
exclusive.
When index1 and index2 are in different cycles which are not adjacent, this
operation can be expensive, as the index count for each intermediate cycle has to be found
and calculated. As such, and in this situation, it's not recommended to call this method
regularly in latency sensitive systems.countExcerpts in interface RollingChronicleQueuelowerIndex - from index, the index provided must exist. To improve performance no checking
is
 carried out to validate if an excerpt exists at this index.upperIndex - to index, the index provided must exist. To improve performance no checking is
carried out to validate if an excerpt exists at this index.index1 inclusive, index2
exclusive.IllegalStateException - if the cycle of index1 or index2 can
not be ascertainedpublic void addCloseListener(Runnable closer)
public boolean isClosed()
public void close()
close in interface Closeableclose in interface AutoCloseablepublic final void release(@NotNull
WireStore store)
release in interface RollingChronicleQueuestore - the store to releasepublic final int cycle()
cycle in interface RollingChronicleQueuepublic long firstIndex()
firstIndex in interface ChronicleQueuepublic int firstCycle()
firstCycle in interface RollingChronicleQueuepublic int lastCycle()
lastCycle in interface RollingChronicleQueuepublic java.util.function.Consumer<net.openhft.chronicle.bytes.BytesRingBufferStats> onRingBufferStats()
public long blockSize()
@NotNull public net.openhft.chronicle.wire.WireType wireType()
wireType in interface ChronicleQueuepublic long bufferCapacity()
Copyright © 2016. All rights reserved.