Search in sources :

Example 1 with BadMetaStoreException

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);
        }
    }
}
Also used : ReplicationStoreMeta(com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta) BadMetaStoreException(com.ctrip.xpipe.redis.core.store.exception.BadMetaStoreException)

Aggregations

ReplicationStoreMeta (com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta)1 BadMetaStoreException (com.ctrip.xpipe.redis.core.store.exception.BadMetaStoreException)1