public interface ExcerptAppender extends ExcerptCommon<ExcerptAppender>, net.openhft.chronicle.wire.MarshallableOut
The component that facilitates sequentially writing data to a ChronicleQueue.
NOTE: Appenders are NOT thread-safe, sharing the Appender between threads will lead to errors and unpredictable behaviour.
| Modifier and Type | Method and Description |
|---|---|
int |
cycle() |
default Runnable |
getCloserJob()
A task that will be run if a WeakReference referring this appender is registered with a clean-up task.
|
long |
lastIndexAppended() |
default <T> T |
methodWriter(Class<T> tClass,
Class... additional) |
default <T> net.openhft.chronicle.wire.VanillaMethodWriterBuilder<T> |
methodWriterBuilder(Class<T> tClass) |
void |
padToCacheAlign(net.openhft.chronicle.wire.MarshallableOut.Padding padToCacheAlign)
Enable padding if near the end of a cache line, pad it so a following 4-byte int value will
not split a cache line.
|
net.openhft.chronicle.wire.MarshallableOut.Padding |
padToCacheAlignMode() |
default void |
pretouch()
We suggest this code is called from a background thread [ not you main
business thread ], it must be called from the same thread that created it, as the call to
pretouch() is not thread safe.
|
net.openhft.chronicle.wire.Wire |
wire()
Obtain the raw wire for low level direct access.
|
default void |
writeBytes(net.openhft.chronicle.bytes.Bytes bytes) |
void |
writeBytes(net.openhft.chronicle.bytes.BytesStore bytes) |
default net.openhft.chronicle.wire.DocumentContext |
writingDocument(long index)
Write an entry at a given index.
|
queue, sourceIdvoid writeBytes(@NotNull
net.openhft.chronicle.bytes.BytesStore bytes)
throws net.openhft.chronicle.wire.UnrecoverableTimeoutException
bytes - to write to excerpt.net.openhft.chronicle.wire.UnrecoverableTimeoutExceptiondefault void writeBytes(@NotNull
net.openhft.chronicle.bytes.Bytes bytes)
throws net.openhft.chronicle.wire.UnrecoverableTimeoutException
net.openhft.chronicle.wire.UnrecoverableTimeoutException@NotNull default net.openhft.chronicle.wire.DocumentContext writingDocument(long index)
index - to write the byte to or fail.long lastIndexAppended()
IllegalStateException - if no index is availableint cycle()
default void pretouch()
newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> queue.acquireAppender().pretouch(), 0, 1, TimeUnit.SECONDS);
void padToCacheAlign(net.openhft.chronicle.wire.MarshallableOut.Padding padToCacheAlign)
@NotNull net.openhft.chronicle.wire.MarshallableOut.Padding padToCacheAlignMode()
padToCacheAlignMode in interface net.openhft.chronicle.wire.MarshallableOutdefault Runnable getCloserJob()
@NotNull
default <T> T methodWriter(@NotNull
Class<T> tClass,
Class... additional)
methodWriter in interface net.openhft.chronicle.wire.MarshallableOut@NotNull
default <T> net.openhft.chronicle.wire.VanillaMethodWriterBuilder<T> methodWriterBuilder(@NotNull
Class<T> tClass)
methodWriterBuilder in interface net.openhft.chronicle.wire.MarshallableOutnet.openhft.chronicle.wire.Wire wire()
Copyright © 2018. All rights reserved.