public interface ChronicleQueue extends Closeable
Using non-heap storage options Chronicle provides a processing environment where applications does not suffer from GarbageCollection. GarbageCollection (GC) may slow down your critical operations non-deterministically at any time.. In order to avoid non-determinism and escape from GC delays off-heap memory solutions are addressed. The main idea is to manage your memory manually so does not suffer from GC. Chronicle behaves like a management interface over off-heap memory so you can build your own solutions over it.
Chronicle uses RandomAccessFiles while managing memory and this choice brings lots of possibility. Random access files permit non-sequential, or random, access to a file's contents. To access a file randomly, you open the file, seek a particular location, and read from or writeBytes to that file. RandomAccessFiles can be seen as "large" C-type byte arrays that you can access any random index "directly" using pointers. File portions can be used as ByteBuffers if the portion is mapped into memory.
ChronicleQueue
(now in the specific sense) is the main interface for management and
can be seen as the "Collection class" of the Chronicle environment. You will reserve a
portion of memory and then put/fetch/update records using the ChronicleQueue
interface.
Excerpt
is the main data container in a ChronicleQueue
, each Chronicle is
composed of Excerpts. Putting data to a queue means starting a new Excerpt, writing data into it
and finishing the Excerpt at the upper.
While Excerpt
is a generic purpose container allowing for remote access, it also has
more specialized counterparts for sequential operations. See ExcerptTailer
and ExcerptAppender
Modifier and Type | Field and Description |
---|---|
static long |
MINUS_1_40BIT |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all the entries in the queue.
|
ExcerptAppender |
createAppender()
An Appender can be used to writeBytes new excerpts sequentially to the upper.
|
Excerpt |
createExcerpt()
An Excerpt can be used access entries randomly and optionally change them.
|
ExcerptTailer |
createTailer()
A Tailer can be used to read sequentially from the lower of a given position.
|
long |
firstIndex() |
static long |
index(long cycle,
long sequenceNumber) |
long |
lastIndex() |
String |
name() |
long |
size() |
static long |
toCycle(long index) |
static long |
toSequenceNumber(long index) |
net.openhft.chronicle.wire.WireType |
wireType() |
@NotNull String name()
@NotNull Excerpt createExcerpt()
@NotNull ExcerptTailer createTailer() throws IOException
IOException
- if an IO problem occurs@NotNull ExcerptAppender createAppender()
IOException
- if an IO problem occurslong size()
void clear()
long firstIndex()
long lastIndex()
@NotNull net.openhft.chronicle.wire.WireType wireType()
static long toSequenceNumber(long index)
static long toCycle(long index)
static long index(long cycle, long sequenceNumber)
Copyright © 2016. All rights reserved.