use of com.ctrip.xpipe.redis.keeper.store.DefaultReplicationStoreManager in project x-pipe by ctripcorp.
the class AbstractRedisKeeperTest method createReplicationStoreManager.
protected ReplicationStoreManager createReplicationStoreManager(String clusterId, String shardId, String keeperRunid, KeeperConfig keeperConfig, File storeDir) {
DefaultReplicationStoreManager replicationStoreManager = new DefaultReplicationStoreManager(keeperConfig, clusterId, shardId, keeperRunid, storeDir, createkeeperMonitor());
replicationStoreManager.addObserver(new Observer() {
@Override
public void update(Object args, Observable observable) {
if (args instanceof NodeAdded) {
@SuppressWarnings("unchecked") ReplicationStore replicationStore = ((NodeAdded<ReplicationStore>) args).getNode();
try {
replicationStore.getMetaStore().becomeActive();
} catch (IOException e) {
logger.error("[update]" + replicationStore, e);
}
}
}
});
return replicationStoreManager;
}
Aggregations