public interface ChronicleQueue
extends net.openhft.chronicle.core.io.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.
ExcerptCommon
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 ExcerptCommon
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 int |
TEST_BLOCK_SIZE |
Modifier and Type | Method and Description |
---|---|
ExcerptAppender |
acquireAppender()
An Appender can be used to writeBytes new excerpts sequentially to the upper.
|
void |
clear()
Remove all the entries in the queue.
|
default ExcerptAppender |
createAppender()
Deprecated.
to be remove in version 4.6 or later use
acquireAppender() |
ExcerptTailer |
createTailer() |
String |
dump()
Dump a Queue in YAML format.
|
default void |
dump(OutputStream stream,
long fromIndex,
long toIndex) |
void |
dump(Writer writer,
long fromIndex,
long toIndex)
Dump a range of entries to a Writer
|
File |
file() |
long |
firstIndex() |
long |
lastAcknowledgedIndexReplicated() |
default <T> T |
methodWriter(Class<T> tClass,
Class... additional) |
default <T> net.openhft.chronicle.wire.VanillaMethodWriterBuilder<T> |
methodWriterBuilder(Class<T> tClass) |
default int |
numberOfReferences(File queueFile) |
int |
sourceId() |
net.openhft.chronicle.wire.WireType |
wireType() |
static final int TEST_BLOCK_SIZE
@NotNull ExcerptTailer createTailer()
@NotNull ExcerptAppender acquireAppender()
@NotNull @Deprecated default ExcerptAppender createAppender()
acquireAppender()
long firstIndex()
@NotNull net.openhft.chronicle.wire.WireType wireType()
void clear()
@NotNull File file()
@NotNull String dump()
void dump(Writer writer, long fromIndex, long toIndex)
writer
- to write tofromIndex
- first index to includetoIndex
- last index to include.default void dump(@NotNull OutputStream stream, long fromIndex, long toIndex)
int sourceId()
@NotNull default <T> net.openhft.chronicle.wire.VanillaMethodWriterBuilder<T> methodWriterBuilder(@NotNull Class<T> tClass)
default int numberOfReferences(File queueFile)
long lastAcknowledgedIndexReplicated()
Copyright © 2018. All rights reserved.