- All Known Implementing Classes:
- BatchAppenderNative
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface BatchAppender
Created by Rob Austin
This API is and advanced Chronicle Queue API that should be used with care and only used if you
are sure you know what you are doing, misuse of this API could corrupt your data or even
worst cause the JVM or your application to crash.
You should only consider this API if :
- you have a batch of messages that you wish to write to a chronicle queue and you wish to write
them directly to the off heap memory
- you only have a single appender thread
- you don't care about queue roll [ in other words this API wont take account of Queue Roll]
Before writing messages directly to off heap memory checks have to be made to ensure that the
batch fits into the existing memory block, or that an individual message does not have to be
indexed. There is more on this below.
Writing Each Message
--------------------
When you come to write each message you must start by skipping 4 bytes in other words leaving
them as byte[]{0,0,0,0} [ which will become the length later ( as a java int ) ],
first write the data, then go back and set the 4 byte length, the data must be written first
and then the length to ensure that a tailer does not attempt to read a half written message.