Search in sources :

Example 11 with ReplicationStoreMeta

use of com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta in project x-pipe by ctripcorp.

the class AbstractMetaStore method loadMeta.

@Override
public final void loadMeta() throws IOException {
    synchronized (metaRef) {
        ReplicationStoreMeta meta = loadMetaCreateIfEmpty(baseDir, META_FILE);
        metaRef.set(meta);
        logger.info("Meta loaded: {}", meta);
    }
}
Also used : ReplicationStoreMeta(com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta)

Example 12 with ReplicationStoreMeta

use of com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta in project x-pipe by ctripcorp.

the class AbstractMetaStore method setRdbFileSize.

@Override
public void setRdbFileSize(long rdbFileSize) throws IOException {
    synchronized (metaRef) {
        ReplicationStoreMeta metaDup = dupReplicationStoreMeta();
        if (metaDup.getRdbFileSize() != rdbFileSize) {
            metaDup.setRdbFileSize(rdbFileSize);
            saveMeta(metaDup);
        }
    }
}
Also used : ReplicationStoreMeta(com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta)

Aggregations

ReplicationStoreMeta (com.ctrip.xpipe.redis.core.store.ReplicationStoreMeta)12 Test (org.junit.Test)2 XpipeRuntimeException (com.ctrip.xpipe.exception.XpipeRuntimeException)1 ByteArrayOutputStreamPayload (com.ctrip.xpipe.payload.ByteArrayOutputStreamPayload)1 AbstractRedisTest (com.ctrip.xpipe.redis.core.AbstractRedisTest)1 BadMetaStoreException (com.ctrip.xpipe.redis.core.store.exception.BadMetaStoreException)1 File (java.io.File)1