public class HashWire extends Object implements WireOut
| Constructor and Description |
|---|
HashWire() |
| Modifier and Type | Method and Description |
|---|---|
WireOut |
addPadding(int paddingToAdd) |
net.openhft.chronicle.bytes.Bytes<?> |
bytes() |
net.openhft.chronicle.core.pool.ClassLookup |
classLookup() |
void |
classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
Define how classes should be looked up.
|
void |
clear()
This will reset the positions and the header number.
|
void |
endEvent() |
boolean |
endUse()
Check the Wire was not used by another thread.
|
ValueOut |
getValueOut()
Obtain the value out
|
int |
hash32() |
static int |
hash32(Object value) |
static int |
hash32(WriteMarshallable value) |
long |
hash64() |
static long |
hash64(Object value) |
static long |
hash64(WriteMarshallable value) |
long |
headerNumber() |
WireOut |
headerNumber(long headerNumber) |
net.openhft.chronicle.core.values.IntValue |
newIntReference() |
net.openhft.chronicle.core.values.LongArrayValues |
newLongArrayReference() |
net.openhft.chronicle.core.values.LongValue |
newLongReference() |
ObjectOutput |
objectOutput() |
Object |
parent()
Obtain the parent class of this wire if there is one
|
void |
parent(Object parent)
Assign a parent object to this wire for later retrieval.
|
net.openhft.chronicle.threads.Pauser |
pauser() |
void |
pauser(net.openhft.chronicle.threads.Pauser pauser) |
void |
startEvent()
Start an event object, mostly for internal use.
|
boolean |
startUse()
Used to check that the wrie is being used by only one thread
|
void |
updateFirstHeader()
update the first header after writing.
|
void |
updateHeader(int length,
long position,
boolean metaData)
Change the header from NOT_COMPLETE | length to metaData * META_DATA | length.
|
ValueOut |
write()
Write an empty filed marker
|
ValueOut |
write(CharSequence name) |
ValueOut |
write(WireKey key)
Write a key for wires that support fields.
|
WireOut |
writeComment(CharSequence s) |
void |
writeEndOfWire(long timeout,
TimeUnit timeUnit)
Write the end of wire marker, unless one is already written.
|
ValueOut |
writeEvent(Class ignored,
Object eventKey) |
boolean |
writeFirstHeader()
Start the first header, if there is none
This will increment the headerNumber as appropriate if successful
|
long |
writeHeader(int length,
long timeout,
TimeUnit timeUnit)
Write a message of a known length, handling timeouts and the end of wire marker.
|
DocumentContext |
writingDocument(boolean metaData)
This will increment the headerNumber as appropriate if successful
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdateHeader, writeAlignTo, writeDocument, writeEventName, writeEventName, writeHeader, writeNotCompleteDocumentnotCompleteIsNotPresent, notCompleteIsNotPresentpublic static long hash64(WriteMarshallable value)
public static long hash64(Object value)
public static int hash32(WriteMarshallable value)
public static int hash32(Object value)
public void classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
WireCommonclassLookup in interface WireCommonclassLookup - to usepublic net.openhft.chronicle.core.pool.ClassLookup classLookup()
classLookup in interface WireCommonpublic void clear()
WireOutclear in interface WireCommonclear in interface WireOutpublic Object parent()
WireCommonparent in interface WireCommonpublic void parent(Object parent)
WireCommonparent in interface WireCommonparent - to set, or null if there isn't one.public boolean startUse()
WireCommonstartUse in interface WireCommonpublic boolean endUse()
WireCommonendUse in interface WireCommonpublic long hash64()
public int hash32()
@NotNull public ValueOut write()
WireOut@NotNull public ValueOut write(WireKey key)
WireOut@NotNull public ValueOut write(CharSequence name)
public ValueOut writeEvent(Class ignored, Object eventKey)
writeEvent in interface WireOutpublic void startEvent()
WireOutstartEvent in interface WireOut@NotNull public ValueOut getValueOut()
WireOutgetValueOut in interface WireOutpublic ObjectOutput objectOutput()
objectOutput in interface WireOut@NotNull public WireOut writeComment(CharSequence s)
writeComment in interface WireOut@NotNull public WireOut addPadding(int paddingToAdd)
addPadding in interface WireOutpublic WireOut headerNumber(long headerNumber)
headerNumber in interface WireOutpublic long headerNumber()
headerNumber in interface WireOutpublic DocumentContext writingDocument(boolean metaData)
WireOutwritingDocument in interface WireOutpublic long writeHeader(int length,
long timeout,
TimeUnit timeUnit)
throws TimeoutException,
EOFException
WireOutwriteHeader in interface WireOutlength - the maximum length of the message.timeout - throw a TimeoutException if the header could not be written in this time.timeUnit - of the timeOutTimeoutException - the underlying pauser timed out.EOFException - the end of wire marker was reached.public void updateHeader(int length,
long position,
boolean metaData)
throws StreamCorruptedException
WireOutupdateHeader in interface WireOutlength - provided to make the header, note this can be larger than the message actually used.position - returned by writeHeadermetaData - whether the message is meta data or not.StreamCorruptedExceptionpublic boolean writeFirstHeader()
WireOutNote: the file might contain other data and the caller has to check this.
writeFirstHeader in interface WireOutpublic void updateFirstHeader()
WireOutupdateFirstHeader in interface WireOutpublic void writeEndOfWire(long timeout,
TimeUnit timeUnit)
throws TimeoutException
WireOutwriteEndOfWire in interface WireOuttimeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutTimeoutException - timeout exceeded.@NotNull public net.openhft.chronicle.bytes.Bytes<?> bytes()
bytes in interface WireCommon@NotNull public net.openhft.chronicle.core.values.IntValue newIntReference()
newIntReference in interface WireCommon@NotNull public net.openhft.chronicle.core.values.LongValue newLongReference()
newLongReference in interface WireCommon@NotNull public net.openhft.chronicle.core.values.LongArrayValues newLongArrayReference()
newLongArrayReference in interface WireCommonpublic net.openhft.chronicle.threads.Pauser pauser()
pauser in interface WireCommonpublic void pauser(net.openhft.chronicle.threads.Pauser pauser)
pauser in interface WireCommonpauser - to use for blocking operations.Copyright © 2016. All rights reserved.