|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.taobao.metamorphosis.client.extension.producer.LocalMessageStorageManager
public class LocalMessageStorageManager
消息缓存在本地磁盘,并定期或手动recover
嵌套类摘要 |
---|
从接口 com.taobao.metamorphosis.client.extension.producer.MessageRecoverManager 继承的嵌套类/接口 |
---|
MessageRecoverManager.MessageRecoverer |
字段摘要 | |
---|---|
static String |
DEFAULT_META_LOCALMESSAGE_PATH
|
protected Deserializer |
deserializer
|
protected MessageRecoverManager.MessageRecoverer |
messageRecoverer
|
String |
META_LOCALMESSAGE_PATH
|
protected static String |
SPLIT
|
protected ThreadPoolExecutor |
threadPoolExecutor
|
protected ConcurrentHashMap<String,FutureTask<Boolean>> |
topicRecoverTaskMap
表示正在执行的恢复任务的map |
protected ConcurrentHashMap<String,FutureTask<Store>> |
topicStoreMap
表示以topic@partition为单位的store map |
构造方法摘要 | |
---|---|
LocalMessageStorageManager(MetaClientConfig metaClientConfig)
|
|
LocalMessageStorageManager(MetaClientConfig metaClientConfig,
String path,
MessageRecoverManager.MessageRecoverer messageRecoverer)
|
方法摘要 | |
---|---|
void |
append(Message message,
Partition partition)
存入消息 |
protected String |
generateKey(String topic,
Partition partition)
|
int |
getMessageCount(String topic,
Partition partition)
消息条数 |
protected Store |
getOrCreateStore(String topic,
Partition partition)
|
protected Store |
newStore(String name)
|
void |
recover()
全部恢复 |
boolean |
recover(String topic,
Partition partition,
MessageRecoverManager.MessageRecoverer recoverer)
触发恢复一个主题一个分区的消息,可多次调用(保证对某主题的恢复任务最多只有一个在运行) |
void |
setMessageRecoverer(MessageRecoverManager.MessageRecoverer recoverer)
设置如何恢复消息的处理器 |
void |
shutdown()
|
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
protected static final String SPLIT
protected final ConcurrentHashMap<String,FutureTask<Store>> topicStoreMap
protected final ConcurrentHashMap<String,FutureTask<Boolean>> topicRecoverTaskMap
protected final Deserializer deserializer
public static final String DEFAULT_META_LOCALMESSAGE_PATH
public String META_LOCALMESSAGE_PATH
protected final ThreadPoolExecutor threadPoolExecutor
protected MessageRecoverManager.MessageRecoverer messageRecoverer
构造方法详细信息 |
---|
public LocalMessageStorageManager(MetaClientConfig metaClientConfig)
public LocalMessageStorageManager(MetaClientConfig metaClientConfig, String path, MessageRecoverManager.MessageRecoverer messageRecoverer)
方法详细信息 |
---|
public void recover()
MessageRecoverManager
复制的描述
MessageRecoverManager
中的 recover
public boolean recover(String topic, Partition partition, MessageRecoverManager.MessageRecoverer recoverer)
MessageRecoverManager
中的 recover
topic
- partition
- recoverer
- 恢复出来的消息的处理器
protected Store getOrCreateStore(String topic, Partition partition)
public void shutdown()
Shutdownable
中的 shutdown
public void append(Message message, Partition partition) throws IOException
MessageRecoverManager
复制的描述
MessageRecoverManager
中的 append
IOException
public int getMessageCount(String topic, Partition partition)
MessageRecoverManager
复制的描述
MessageRecoverManager
中的 getMessageCount
protected String generateKey(String topic, Partition partition)
public void setMessageRecoverer(MessageRecoverManager.MessageRecoverer recoverer)
MessageRecoverManager
复制的描述
MessageRecoverManager
中的 setMessageRecoverer
protected Store newStore(String name) throws IOException
IOException
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |