public class LocalFileOffsetStore extends java.lang.Object implements OffsetStore
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOCAL_OFFSET_STORE_DIR |
Constructor and Description |
---|
LocalFileOffsetStore(MQClientInstance mQClientFactory,
java.lang.String groupName) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<MessageQueue,java.lang.Long> |
cloneOffsetTable(java.lang.String topic) |
void |
load()
Load
|
void |
persist(MessageQueue mq)
Persist the offset,may be in local storage or remote name server
|
void |
persistAll(java.util.Set<MessageQueue> mqs)
Persist all offsets,may be in local storage or remote name server
|
long |
readOffset(MessageQueue mq,
ReadOffsetType type)
Get offset from local storage
|
void |
removeOffset(MessageQueue mq)
Remove offset
|
void |
updateConsumeOffsetToBroker(MessageQueue mq,
long offset,
boolean isOneway) |
void |
updateOffset(MessageQueue mq,
long offset,
boolean increaseOnly)
Update the offset,store it in memory
|
public LocalFileOffsetStore(MQClientInstance mQClientFactory, java.lang.String groupName)
public void load() throws MQClientException
OffsetStore
load
in interface OffsetStore
MQClientException
public void updateOffset(MessageQueue mq, long offset, boolean increaseOnly)
OffsetStore
updateOffset
in interface OffsetStore
public long readOffset(MessageQueue mq, ReadOffsetType type)
OffsetStore
readOffset
in interface OffsetStore
public void persistAll(java.util.Set<MessageQueue> mqs)
OffsetStore
persistAll
in interface OffsetStore
public void persist(MessageQueue mq)
OffsetStore
persist
in interface OffsetStore
public void removeOffset(MessageQueue mq)
OffsetStore
removeOffset
in interface OffsetStore
public void updateConsumeOffsetToBroker(MessageQueue mq, long offset, boolean isOneway) throws RemotingException, MQBrokerException, java.lang.InterruptedException, MQClientException
updateConsumeOffsetToBroker
in interface OffsetStore
RemotingException
MQBrokerException
java.lang.InterruptedException
MQClientException
public java.util.Map<MessageQueue,java.lang.Long> cloneOffsetTable(java.lang.String topic)
cloneOffsetTable
in interface OffsetStore