public class ChronicleLogTailer<M extends Externalizable> extends Object implements LogTailer<M>
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePath |
protected boolean |
closed |
protected net.openhft.chronicle.queue.ExcerptTailer |
cqTailer |
protected LogPartitionGroup |
id |
protected ChronicleLogOffsetTracker |
offsetTracker |
protected LogPartition |
partition |
protected static long |
POLL_INTERVAL_MS |
protected static Set<LogPartitionGroup> |
tailersId |
| Constructor and Description |
|---|
ChronicleLogTailer(String basePath,
net.openhft.chronicle.queue.ExcerptTailer cqTailer,
LogPartition partition,
String group,
ChronicleRetentionDuration retention) |
| Modifier and Type | Method and Description |
|---|---|
Collection<LogPartition> |
assignments()
Returns the list of Log name, partitions tuples currently assigned to this tailer.
|
void |
close() |
boolean |
closed()
Returns
true if the tailer has been closed. |
void |
commit()
Commit current positions for all partitions (last message offset returned by read).
|
LogOffset |
commit(LogPartition partition)
Commit current position for the partition.
|
String |
group()
Returns the consumer group.
|
protected LogRecord<M> |
read() |
LogRecord<M> |
read(Duration timeout)
Read a message from assigned partitions within the timeout.
|
protected void |
registerTailer() |
void |
reset()
Reset all committed positions for this group, next read will be done from beginning.
|
void |
reset(LogPartition partition)
Reset the committed position for this group on this partition, next read for this partition will be done from the
beginning.
|
void |
seek(LogOffset offset)
Set the current position for a single partition.
|
void |
toEnd()
Set the current positions to the end of all partitions.
|
void |
toLastCommitted()
Set the current positions to previously committed positions.
|
void |
toStart()
Set the current positions to the beginning of all partitions.
|
String |
toString() |
protected void |
unregisterTailer() |
protected static final long POLL_INTERVAL_MS
protected static final Set<LogPartitionGroup> tailersId
protected final net.openhft.chronicle.queue.ExcerptTailer cqTailer
protected final ChronicleLogOffsetTracker offsetTracker
protected final LogPartitionGroup id
protected final LogPartition partition
protected volatile boolean closed
public ChronicleLogTailer(String basePath, net.openhft.chronicle.queue.ExcerptTailer cqTailer, LogPartition partition, String group, ChronicleRetentionDuration retention)
protected void registerTailer()
protected void unregisterTailer()
public LogRecord<M> read(Duration timeout) throws InterruptedException
LogTailerread in interface LogTailer<M extends Externalizable>InterruptedExceptionpublic LogOffset commit(LogPartition partition)
LogTailercommit in interface LogTailer<M extends Externalizable>public void commit()
LogTailercommit in interface LogTailer<M extends Externalizable>public void toEnd()
LogTailertoEnd in interface LogTailer<M extends Externalizable>public void toStart()
LogTailertoStart in interface LogTailer<M extends Externalizable>public void toLastCommitted()
LogTailertoLastCommitted in interface LogTailer<M extends Externalizable>public void seek(LogOffset offset)
LogTailerseek in interface LogTailer<M extends Externalizable>public void reset()
LogTailerreset in interface LogTailer<M extends Externalizable>public void reset(LogPartition partition)
LogTailerreset in interface LogTailer<M extends Externalizable>public Collection<LogPartition> assignments()
LogTailerLogManager.subscribe(java.lang.String, java.util.Collection<java.lang.String>, org.nuxeo.lib.stream.log.RebalanceListener).assignments in interface LogTailer<M extends Externalizable>public String group()
LogTailergroup in interface LogTailer<M extends Externalizable>public void close()
close in interface AutoCloseableclose in interface LogTailer<M extends Externalizable>public boolean closed()
LogTailertrue if the tailer has been closed.closed in interface LogTailer<M extends Externalizable>Copyright © 2018 Nuxeo. All rights reserved.