public class VanillaMessageHistory extends SelfDescribingMarshallable implements MessageHistory
| Modifier and Type | Field and Description |
|---|---|
static int |
MESSAGE_HISTORY_LENGTH |
EMPTYDISCARD| Constructor and Description |
|---|
VanillaMessageHistory() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSource(int id,
long index) |
boolean |
addSourceDetails() |
void |
addSourceDetails(boolean addSourceDetails)
Whether to automatically add timestamp on read.
|
void |
addTiming(long l) |
net.openhft.chronicle.bytes.util.BinaryLengthLength |
binaryLengthLength() |
@NotNull VanillaMessageHistory |
deepCopy()
Override deepCopy as writeMarshallable adds a timing every time it is called.
|
boolean |
isDirty() |
int |
lastSourceId()
Returns the last source id contained in this
MessageHistory. |
long |
lastSourceIndex()
Returns the last source index contained in this
MessageHistory. |
protected long |
nanoTime() |
void |
readMarshallable(@NotNull net.openhft.chronicle.bytes.BytesIn<?> bytes) |
void |
readMarshallable(@NotNull WireIn wire)
Straight line ordered decoding.
|
void |
reset()
Clears all data contained in this
MessageHistory |
void |
reset(int sourceId,
long sourceIndex)
Resets the
MessageHistory with the provided sourceId
and sourceIndex as a starting point. |
int |
sourceId(int n)
Returns the source id at a position specified by the input
n. |
boolean |
sourceIdsEndsWith(int[] sourceIds)
Returns
true if the source ids contained in this
MessageHistory end with the provided sourceIds. |
long |
sourceIndex(int n)
Returns the index of the source at a position specified by the
input
n. |
int |
sources()
Returns the number of sources contained in this
MessageHistory. |
long |
timing(int n)
Returns a timing at a position specified by the input
n. |
int |
timings()
Returns the number of timings contained in this
MessageHistory. |
String |
toString()
We need a custom toString as the base class toString calls writeMarshallable which does not mutate this,
but will display a different result every time you toString the object as it outputs System.nanoTime
|
void |
writeMarshallable(@NotNull net.openhft.chronicle.bytes.BytesOut<?> b) |
void |
writeMarshallable(@NotNull WireOut wire)
Write data to the wire
|
usesSelfDescribingMessageequals, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitget, set, writeHistory$equals, $fieldInfoMap, $fieldInfos, $hashCode, $toString, className, copyTo, fromFile, fromFile, fromString, fromString, fromString, getField, getLongField, mergeToMap, setField, setLongField, streamFromFile, streamFromFilewriteValueunexpectedFieldpublic static final int MESSAGE_HISTORY_LENGTH
public void addSourceDetails(boolean addSourceDetails)
false for utilities that expect to
read MessageHistory without mutationaddSourceDetails - addSourceDetailspublic void reset()
MessageHistoryMessageHistoryreset in interface net.openhft.chronicle.core.io.Resettablereset in interface Marshallablereset in interface MessageHistorypublic boolean addSourceDetails()
public void reset(int sourceId,
long sourceIndex)
MessageHistoryMessageHistory with the provided sourceId
and sourceIndex as a starting point.reset in interface MessageHistorypublic int lastSourceId()
MessageHistoryMessageHistory.lastSourceId in interface MessageHistoryMessageHistory.public long lastSourceIndex()
MessageHistoryMessageHistory.lastSourceIndex in interface MessageHistoryMessageHistory.public int timings()
MessageHistoryMessageHistory.timings in interface MessageHistoryMessageHistory.public long timing(int n)
MessageHistoryn.timing in interface MessageHistoryn.public int sources()
MessageHistoryMessageHistory.sources in interface MessageHistoryMessageHistory.public int sourceId(int n)
MessageHistoryn.sourceId in interface MessageHistoryn.public boolean sourceIdsEndsWith(int[] sourceIds)
MessageHistorytrue if the source ids contained in this
MessageHistory end with the provided sourceIds.sourceIdsEndsWith in interface MessageHistorytrue if the source ids contained in this
MessageHistory end with the provided sourceIds.public long sourceIndex(int n)
MessageHistoryn.sourceIndex in interface MessageHistoryn.public void readMarshallable(@NotNull
@NotNull WireIn wire)
throws net.openhft.chronicle.core.io.IORuntimeException
ReadMarshallablereadMarshallable in interface MarshallablereadMarshallable in interface ReadMarshallablewire - to read from in an ordered manner.net.openhft.chronicle.core.io.IORuntimeException - the stream wasn't ordered or formatted as expected.public void writeMarshallable(@NotNull
@NotNull WireOut wire)
WriteMarshallablewriteMarshallable in interface MarshallablewriteMarshallable in interface WriteMarshallablewire - to write to.public void readMarshallable(@NotNull
@NotNull net.openhft.chronicle.bytes.BytesIn<?> bytes)
throws net.openhft.chronicle.core.io.IORuntimeException
readMarshallable in interface net.openhft.chronicle.bytes.BytesMarshallablereadMarshallable in interface net.openhft.chronicle.bytes.ReadBytesMarshallablenet.openhft.chronicle.core.io.IORuntimeExceptionpublic void writeMarshallable(@NotNull
@NotNull net.openhft.chronicle.bytes.BytesOut<?> b)
writeMarshallable in interface net.openhft.chronicle.bytes.BytesMarshallablewriteMarshallable in interface net.openhft.chronicle.bytes.WriteBytesMarshallableprotected long nanoTime()
public void addSource(int id,
long index)
public boolean isDirty()
isDirty in interface MessageHistorytrue if the message history has not been written using
Marshallable.writeMarshallable(net.openhft.chronicle.wire.WireOut)public void addTiming(long l)
public String toString()
toString in class AbstractCommonMarshallable@NotNull public @NotNull VanillaMessageHistory deepCopy()
toString()deepCopy in interface Marshallablepublic net.openhft.chronicle.bytes.util.BinaryLengthLength binaryLengthLength()
binaryLengthLength in interface WriteMarshallableCopyright © 2022. All rights reserved.