public class SingleChronicleQueueStore extends Object implements WireStore
Constructor and Description |
---|
SingleChronicleQueueStore(RollCycle rollCycle,
net.openhft.chronicle.wire.WireType wireType,
net.openhft.chronicle.bytes.MappedBytes mappedBytes,
int indexCount,
int indexSpacing) |
Modifier and Type | Method and Description |
---|---|
net.openhft.chronicle.bytes.MappedBytes |
bytes() |
void |
close() |
String |
dump() |
static String |
dump(String directoryFilePath) |
File |
file() |
boolean |
indexable(long index) |
void |
initIndex(net.openhft.chronicle.wire.Wire wire) |
long |
lastSequenceNumber(ExcerptContext ec) |
ScanResult |
linearScanTo(long index,
long knownIndex,
ExcerptContext ec,
long knownAddress) |
long |
moveToEndForRead(net.openhft.chronicle.wire.Wire w) |
ScanResult |
moveToIndexForRead(ExcerptContext ec,
long index)
Moves the position to the index
|
long |
refCount() |
void |
release() |
void |
reserve() |
long |
sequenceForPosition(ExcerptContext ec,
long position,
boolean inclusive)
Reverse look up an index for a position.
|
void |
setPositionForSequenceNumber(ExcerptContext ec,
long sequenceNumber,
long position) |
String |
toString() |
boolean |
tryReserve() |
void |
writeEOF(net.openhft.chronicle.wire.Wire wire,
long timeoutMS) |
void |
writeMarshallable(net.openhft.chronicle.wire.WireOut wire) |
long |
writePosition() |
WireStore |
writePosition(long position) |
public SingleChronicleQueueStore(@NotNull RollCycle rollCycle, @NotNull net.openhft.chronicle.wire.WireType wireType, @NotNull net.openhft.chronicle.bytes.MappedBytes mappedBytes, int indexCount, int indexSpacing)
rollCycle
- the current rollCyclewireType
- the wire type that is being usedmappedBytes
- used to mapped the data store fileindexCount
- the number of entries in each index.indexSpacing
- the spacing between indexed entries.@NotNull public File file()
file
in interface CommonStore
@NotNull public String dump()
dump
in interface CommonStore
public long writePosition()
writePosition
in interface WireStore
@NotNull public WireStore writePosition(long position)
writePosition
in interface WireStore
position
- the start of the last written excerpt to this cycle/store@Nullable public ScanResult moveToIndexForRead(@NotNull ExcerptContext ec, long index)
moveToIndexForRead
in interface WireStore
ec
- the data structure we are navigatingindex
- the index we wish to move topublic long moveToEndForRead(@NotNull net.openhft.chronicle.wire.Wire w)
moveToEndForRead
in interface WireStore
public void reserve() throws IllegalStateException
reserve
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public void release() throws IllegalStateException
release
in interface net.openhft.chronicle.core.ReferenceCounted
IllegalStateException
public long refCount()
refCount
in interface net.openhft.chronicle.core.ReferenceCounted
public boolean tryReserve()
tryReserve
in interface net.openhft.chronicle.core.ReferenceCounted
public void close()
close
in interface Closeable
close
in interface AutoCloseable
@NotNull public net.openhft.chronicle.bytes.MappedBytes bytes()
bytes
in interface CommonStore
public long sequenceForPosition(@NotNull ExcerptContext ec, long position, boolean inclusive) throws net.openhft.chronicle.wire.UnrecoverableTimeoutException, StreamCorruptedException
WireStore
sequenceForPosition
in interface WireStore
ec
- the wire of the bytes, to work withposition
- of the start of the messagenet.openhft.chronicle.wire.UnrecoverableTimeoutException
StreamCorruptedException
public long lastSequenceNumber(@NotNull ExcerptContext ec) throws StreamCorruptedException
lastSequenceNumber
in interface WireStore
StreamCorruptedException
public void writeMarshallable(@NotNull net.openhft.chronicle.wire.WireOut wire)
writeMarshallable
in interface net.openhft.chronicle.wire.WriteMarshallable
public void initIndex(@NotNull net.openhft.chronicle.wire.Wire wire)
public void setPositionForSequenceNumber(@NotNull ExcerptContext ec, long sequenceNumber, long position) throws net.openhft.chronicle.wire.UnrecoverableTimeoutException, StreamCorruptedException
setPositionForSequenceNumber
in interface WireStore
net.openhft.chronicle.wire.UnrecoverableTimeoutException
StreamCorruptedException
public ScanResult linearScanTo(long index, long knownIndex, ExcerptContext ec, long knownAddress)
linearScanTo
in interface WireStore
Copyright © 2018. All rights reserved.