public class ChronicleLogOffsetTracker extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
static int |
CQ_BLOCK_SIZE |
protected long |
lastCommittedOffset |
protected static String |
OFFSET_QUEUE_PREFIX |
protected net.openhft.chronicle.queue.impl.single.SingleChronicleQueue |
offsetQueue |
protected int |
partition |
protected ChronicleRetentionDuration |
retention |
Constructor and Description |
---|
ChronicleLogOffsetTracker(String basePath,
int partition,
String group,
ChronicleRetentionDuration retention) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
commit(long offset) |
static boolean |
exists(Path basePath,
String group) |
static String |
getGroupFromDirectory(String dirName) |
long |
getLastCommittedOffset()
Use a cache to return the last committed offset, concurrent consumer is not taken in account use
readLastCommittedOffset() in concurrency. |
static boolean |
isOffsetTracker(String dirName) |
long |
readLastCommittedOffset()
Read the last committed offset from the file.
|
protected static final String OFFSET_QUEUE_PREFIX
public static final int CQ_BLOCK_SIZE
protected final net.openhft.chronicle.queue.impl.single.SingleChronicleQueue offsetQueue
protected final int partition
protected long lastCommittedOffset
protected final ChronicleRetentionDuration retention
public ChronicleLogOffsetTracker(String basePath, int partition, String group, ChronicleRetentionDuration retention)
public static boolean isOffsetTracker(String dirName)
public static String getGroupFromDirectory(String dirName)
public long getLastCommittedOffset()
readLastCommittedOffset()
in concurrency.public long readLastCommittedOffset()
public void commit(long offset)
public void close()
close
in interface AutoCloseable
Copyright © 2018 Nuxeo. All rights reserved.