public class RemoteBrokerOffsetStore extends java.lang.Object implements OffsetStore
Constructor and Description |
---|
RemoteBrokerOffsetStore(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)
Update the Consumer Offset synchronously, once the Master is off, updated to Slave,
here need to be optimized.
|
void |
updateOffset(MessageQueue mq,
long offset,
boolean increaseOnly)
Update the offset,store it in memory
|
public RemoteBrokerOffsetStore(MQClientInstance mQClientFactory, java.lang.String groupName)
public void load()
OffsetStore
load
in interface OffsetStore
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 java.util.Map<MessageQueue,java.lang.Long> cloneOffsetTable(java.lang.String topic)
cloneOffsetTable
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