public class SingleChronicleQueue extends Object implements RollingChronicleQueue
Modifier and Type | Field and Description |
---|---|
protected ThreadLocal<WeakReference<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.
|
<T> void |
addCloseListener(T key,
java.util.function.Consumer<T> closer) |
long |
blockSize() |
long |
bufferCapacity() |
boolean |
buffered() |
void |
clear()
Remove all the entries in the queue.
|
void |
close() |
long |
countExcerpts(long fromIndex,
long toIndex)
Will give you the number of excerpts between 2 index’s ( as exists on the current file
system ).
|
ExcerptTailer |
createTailer() |
int |
cycle() |
int |
deltaCheckpointInterval() |
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) |
net.openhft.chronicle.core.time.TimeProvider |
time() |
String |
toString() |
net.openhft.chronicle.wire.WireType |
wireType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createAppender, dump
public static final String SUFFIX
protected final ThreadLocal<WeakReference<ExcerptAppender>> excerptAppenderThreadLocal
protected final int sourceId
protected SingleChronicleQueue(@NotNull SingleChronicleQueueBuilder builder)
public int sourceId()
sourceId
in interface ChronicleQueue
public void clear()
ChronicleQueue
clear
in interface ChronicleQueue
@NotNull public File file()
file
in interface ChronicleQueue
public String dump()
ChronicleQueue
dump
in interface ChronicleQueue
public void dump(Writer writer, long fromIndex, long toIndex)
ChronicleQueue
dump
in interface ChronicleQueue
writer
- to write tofromIndex
- first index to includetoIndex
- last index to include.public int indexCount()
indexCount
in interface RollingChronicleQueue
public int indexSpacing()
indexSpacing
in interface RollingChronicleQueue
public long epoch()
epoch
in interface RollingChronicleQueue
@NotNull public RollCycle rollCycle()
rollCycle
in interface RollingChronicleQueue
public StoreRecoveryFactory recoverySupplier()
recoverySupplier
in interface RollingChronicleQueue
public int deltaCheckpointInterval()
deltaCheckpointInterval
in interface RollingChronicleQueue
public boolean buffered()
@Nullable public net.openhft.chronicle.core.threads.EventLoop eventLoop()
protected ExcerptAppender newAppender()
@NotNull public ExcerptAppender acquireAppender()
ChronicleQueue
acquireAppender
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 RollingChronicleQueue
cycle
- 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
RollingChronicleQueue
nextCycle
in interface RollingChronicleQueue
cycle
- the current cycledirection
- the directionParseException
public long countExcerpts(long fromIndex, long toIndex) throws IllegalStateException
countExcerpts
in interface RollingChronicleQueue
fromIndex
- the lower indextoIndex
- the higher indexIllegalStateException
- if we are not able to read the chronicle filespublic <T> void addCloseListener(T key, java.util.function.Consumer<T> closer)
public boolean isClosed()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public final void release(WireStore store)
release
in interface RollingChronicleQueue
store
- the store
to releasepublic final int cycle()
cycle
in interface RollingChronicleQueue
public long firstIndex()
firstIndex
in interface ChronicleQueue
public int firstCycle()
firstCycle
in interface RollingChronicleQueue
public int lastCycle()
lastCycle
in interface RollingChronicleQueue
public java.util.function.Consumer<net.openhft.chronicle.bytes.BytesRingBufferStats> onRingBufferStats()
public long blockSize()
@NotNull public net.openhft.chronicle.wire.WireType wireType()
wireType
in interface ChronicleQueue
public long bufferCapacity()
public net.openhft.chronicle.core.time.TimeProvider time()
Copyright © 2017. All rights reserved.