public static class SingleChronicleQueueExcerpts.StoreTailer extends Object implements ExcerptTailer, net.openhft.chronicle.wire.SourceContext, ExcerptContext
| Constructor and Description |
|---|
StoreTailer(SingleChronicleQueue queue) |
StoreTailer(SingleChronicleQueue queue,
net.openhft.chronicle.core.values.LongValue indexValue) |
| Modifier and Type | Method and Description |
|---|---|
ExcerptTailer |
afterLastWritten(ChronicleQueue queue)
Wind this tailer to after the last entry which wrote an entry to the queue
|
int |
cycle() |
TailerDirection |
direction() |
ExcerptTailer |
direction(TailerDirection direction)
Set the direction of movement.
|
Runnable |
getCloserJob()
A task that will be run if a WeakReference referring this appender is registered with a clean-up task.
|
long |
index() |
boolean |
moveToIndex(long index)
Randomly select an Excerpt.
|
ExcerptTailer |
originalToEnd() |
boolean |
peekDocument()
peekDocument() can be used after a message has been found by toStart() or readingDocument().
|
ChronicleQueue |
queue() |
boolean |
readAfterReplicaAcknowledged() |
void |
readAfterReplicaAcknowledged(boolean readAfterReplicaAcknowledged)
Enterprise Queue only: if replication enabled, setting this to true on a source queue ensures that
this tailer will not read until at least one of the sinks has acknowledged receipt of the excerpt.
|
boolean |
readDocument(net.openhft.chronicle.wire.ReadMarshallable reader) |
static net.openhft.chronicle.wire.MessageHistory |
readHistory(net.openhft.chronicle.wire.DocumentContext dc,
net.openhft.chronicle.wire.MessageHistory history) |
net.openhft.chronicle.wire.DocumentContext |
readingDocument()
equivalent to
MarshallableIn.readDocument(ReadMarshallable) but with out the use of a
lambda expression. |
net.openhft.chronicle.wire.DocumentContext |
readingDocument(boolean includeMetaData) |
void |
releaseResources()
Can be used to manually release resources when this StoreTailer is no longer used.
|
void |
setCycle(int cycle) |
int |
sourceId() |
TailerState |
state() |
boolean |
striding() |
ExcerptTailer |
striding(boolean striding)
When striding is enabled AND direction is BACKWARD, skip to the entries easiest to find, doesn't need to be every entry.
|
long |
timeoutMS() |
ExcerptTailer |
toEnd()
Wind to the last entry in the last cycle
|
ExcerptTailer |
toStart()
Replay from the first entry in the first cycle.
|
String |
toString() |
net.openhft.chronicle.wire.Wire |
wire() |
net.openhft.chronicle.wire.Wire |
wireForIndex() |
public StoreTailer(@NotNull
SingleChronicleQueue queue)
public StoreTailer(@NotNull
SingleChronicleQueue queue,
net.openhft.chronicle.core.values.LongValue indexValue)
@Nullable
public static net.openhft.chronicle.wire.MessageHistory readHistory(net.openhft.chronicle.wire.DocumentContext dc,
net.openhft.chronicle.wire.MessageHistory history)
public boolean readDocument(@NotNull
net.openhft.chronicle.wire.ReadMarshallable reader)
readDocument in interface net.openhft.chronicle.wire.MarshallableIn@NotNull public net.openhft.chronicle.wire.DocumentContext readingDocument()
ExcerptTailerMarshallableIn.readDocument(ReadMarshallable) but with out the use of a
lambda expression.
This method is the ExcerptTailer equivalent of WireIn.readingDocument()
readingDocument in interface ExcerptTailerreadingDocument in interface net.openhft.chronicle.wire.MarshallableInpublic net.openhft.chronicle.wire.Wire wire()
wire in interface ExcerptContextpublic net.openhft.chronicle.wire.Wire wireForIndex()
wireForIndex in interface ExcerptContextpublic long timeoutMS()
timeoutMS in interface ExcerptContextpublic int sourceId()
sourceId in interface ExcerptCommon<ExcerptTailer>sourceId in interface net.openhft.chronicle.wire.SourceContext@NotNull public net.openhft.chronicle.wire.DocumentContext readingDocument(boolean includeMetaData)
readingDocument in interface ExcerptTailerpublic boolean peekDocument()
ExcerptTailerpeekDocument in interface ExcerptTailerpeekDocument in interface net.openhft.chronicle.wire.MarshallableInpublic long index()
index in interface ExcerptTailerindex in interface net.openhft.chronicle.wire.SourceContextpublic int cycle()
cycle in interface ExcerptTailerpublic boolean moveToIndex(long index)
ExcerptTailermoveToIndex in interface ExcerptTailerindex - index to look up, the index includes the cycle number and a sequence number from with this cycle@NotNull public final ExcerptTailer toStart()
ExcerptTailertoStart in interface ExcerptTailer@NotNull public ExcerptTailer toEnd()
ExcerptTailerIf the direction() == FORWARD, this will be 1 more than the last entry.
Otherwise the index will be the last entry.
This is not atomic with the appenders, in other words if a cycle has been added in the current millisecond, toEnd() may not see it, This is because for performance reasons, the queue.lastCycle() is cached, as finding the last cycle is expensive, it requires asking the directory for the Files.list() so, this cache is only refreshed if the call toEnd() is in a new millisecond. Hence a whole milliseconds with of data could be added to the chronicle-queue that toEnd() won’t see. For appenders that that are using the same queue instance ( and with then same JVM ), they can be informed that the last cycle has changed, this will yield better results, but atomicity can still not be guaranteed.
toEnd in interface ExcerptTailerpublic ExcerptTailer striding(boolean striding)
ExcerptTailerstriding in interface ExcerptTailerstriding - skip to the indexStride if that is easy, doesn't always happen.public boolean striding()
striding in interface ExcerptTailer@NotNull public ExcerptTailer originalToEnd()
public TailerDirection direction()
direction in interface ExcerptTailer@NotNull public ExcerptTailer direction(TailerDirection direction)
ExcerptTailerdirection in interface ExcerptTailerdirection - NONE, FORWARD, BACKWARD@NotNull public ChronicleQueue queue()
queue in interface ExcerptCommon<ExcerptTailer>public Runnable getCloserJob()
ExcerptTailergetCloserJob in interface ExcerptTailerpublic void releaseResources()
public void readAfterReplicaAcknowledged(boolean readAfterReplicaAcknowledged)
ExcerptTailerreadAfterReplicaAcknowledged in interface ExcerptTailerreadAfterReplicaAcknowledged - enablepublic boolean readAfterReplicaAcknowledged()
readAfterReplicaAcknowledged in interface ExcerptTailer@NotNull public TailerState state()
state in interface ExcerptTailer@NotNull public ExcerptTailer afterLastWritten(@NotNull ChronicleQueue queue)
ExcerptTailerafterLastWritten in interface ExcerptTailerqueue - which was written to.public void setCycle(int cycle)
Copyright © 2019. All rights reserved.