Class AbstractOffsetStore
- java.lang.Object
-
- com.aliyun.openservices.ons.client.rocketmq.impl.AbstractOffsetStore
-
- All Implemented Interfaces:
OffsetStore
public abstract class AbstractOffsetStore extends Object implements OffsetStore
-
-
Constructor Summary
Constructors Constructor Description AbstractOffsetStore(long persistPeriodSeconds)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Map<TopicPartition,Long>
loadOffset()
从磁盘或者其他外部存储读取位点。abstract void
persistOffset(Map<TopicPartition,Long> offsetTable)
持久化位点到磁盘或其他外部存储介质。com.google.common.base.Optional<Long>
readOffset(TopicPartition partition)
void
shutdown()
void
start()
void
updateOffset(TopicPartition partition, long offset)
-
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceOffsetStore
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceOffsetStore
-
loadOffset
public abstract Map<TopicPartition,Long> loadOffset()
从磁盘或者其他外部存储读取位点。- Returns:
- 位点存储表
-
persistOffset
public abstract void persistOffset(Map<TopicPartition,Long> offsetTable)
持久化位点到磁盘或其他外部存储介质。- Parameters:
offsetTable
- 位点存储表
-
updateOffset
public void updateOffset(TopicPartition partition, long offset)
- Specified by:
updateOffset
in interfaceOffsetStore
-
readOffset
public com.google.common.base.Optional<Long> readOffset(TopicPartition partition)
- Specified by:
readOffset
in interfaceOffsetStore
-
-