use of com.ctrip.xpipe.redis.core.store.exception.BadMetaStoreException in project x-pipe by ctripcorp.
the class AbstractMetaStore method checkOrSaveKeeperRunid.
private final void checkOrSaveKeeperRunid(String keeperRunid) throws IOException {
synchronized (metaRef) {
String oldRunId = metaRef.get().getKeeperRunid();
if (oldRunId != null) {
if (!oldRunId.equals(keeperRunid)) {
throw new BadMetaStoreException(oldRunId, keeperRunid);
}
} else {
ReplicationStoreMeta newMeta = dupReplicationStoreMeta();
newMeta.setKeeperRunid(keeperRunid);
saveMeta(newMeta);
}
}
}
Aggregations