Package org.nuxeo.lib.stream.log
Interface LogAppender<M extends Externalizable>
- All Known Subinterfaces:
- CloseableLogAppender<M>
- All Known Implementing Classes:
- KafkaLogAppender,- MemLogAppender
public interface LogAppender<M extends Externalizable>
An appender is used to append message into a Log. Implementations must be thread safe.
- Since:
- 9.3
- 
Method SummaryModifier and TypeMethodDescriptionAppend a message into a partition, returnsLogOffsetposition of the message.default LogOffsetSame asappend(int, Externalizable), the queue is chosen using a hash of parameters "key".booleanclosed()Returnstrueif the appender has been closed by the manager.getCodec()Returns the codec used to write record.name()Returns the Log's name.intsize()Returns the number of partitions in the Log.booleanWait for consumer to process a message up to the offset.
- 
Method Details- 
nameName name()Returns the Log's name.
- 
sizeint size()Returns the number of partitions in the Log.
- 
appendAppend a message into a partition, returnsLogOffsetposition of the message. This method is thread safe, a queue can be shared by multiple producers.- Parameters:
- partition- index lower than- size()
 
- 
appendSame asappend(int, Externalizable), the queue is chosen using a hash of parameters "key".
- 
waitForWait for consumer to process a message up to the offset. The message is processed if a consumer of the group commits a greater or equals offset. Returntrueif the message has been consumed,falsein case of timeout.- Throws:
- InterruptedException
 
- 
closedboolean closed()Returnstrueif the appender has been closed by the manager.
- 
getCodecReturns the codec used to write record. A null codec is the default legacy encoding.- Since:
- 10.2
 
 
-