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.
|
void |
doWriteHistory(DocumentContext dc) |
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)
Reads the state of the Marshallable object from the given wire input.
|
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
or Wall Clock in NS if the wall.clock.message.history system property is set
|
void |
writeMarshallable(@NotNull net.openhft.chronicle.bytes.BytesOut<?> b) |
void |
writeMarshallable(@NotNull WireOut wire)
Writes the state of the Marshallable object to the given wire output.
|
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,
net.openhft.chronicle.core.io.InvalidMarshallableException
MarshallableThe default implementation will use a default value for each field not present
readMarshallable in interface MarshallablereadMarshallable in interface ReadMarshallablewire - The wire input source.net.openhft.chronicle.core.io.IORuntimeException - If an IO error occurs during the read operation.net.openhft.chronicle.core.io.InvalidMarshallableException - If there's an error during marshalling.public void writeMarshallable(@NotNull
@NotNull WireOut wire)
MarshallableThe default implementation will write all values even if they are a default value. c.f. readMarshallable
writeMarshallable in interface MarshallablewriteMarshallable in interface WriteMarshallablewire - The wire output destination.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() throws net.openhft.chronicle.core.io.InvalidMarshallableException
toString()deepCopy in interface Marshallablenet.openhft.chronicle.core.io.InvalidMarshallableExceptionpublic net.openhft.chronicle.bytes.util.BinaryLengthLength binaryLengthLength()
binaryLengthLength in interface WriteMarshallablepublic void doWriteHistory(DocumentContext dc)
doWriteHistory in interface MessageHistoryCopyright © 2023. All rights reserved.