Search in sources :

Example 1 with RawKVStore

use of com.alipay.sofa.jraft.rhea.storage.RawKVStore in project sofa-jraft by sofastack.

the class RocksKVStoreTest method putListTest.

/**
 * Test method: {@link RocksRawKVStore#put(List, KVStoreClosure)}
 */
@Test
public void putListTest() {
    final List<KVEntry> entries = Lists.newArrayList();
    for (int i = 0; i < 10; i++) {
        entries.add(new KVEntry(makeKey("batch_put_test_key" + i), makeValue("batch_put_test_value" + i)));
    }
    this.kvStore.put(entries, null);
    final List<KVEntry> entries2 = new SyncKVStore<List<KVEntry>>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.scan(makeKey("batch_put_test_key"), makeKey("batch_put_test_key" + 99), closure);
        }
    }.apply(this.kvStore);
    assertEquals(entries.size(), entries2.size());
    for (int i = 0; i < entries.size(); i++) {
        assertArrayEquals(entries.get(i).getKey(), entries2.get(i).getKey());
        assertArrayEquals(entries.get(i).getValue(), entries2.get(i).getValue());
    }
}
Also used : RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) KVEntry(com.alipay.sofa.jraft.rhea.storage.KVEntry) List(java.util.List) KVStateOutputList(com.alipay.sofa.jraft.rhea.storage.KVStateOutputList) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) Test(org.junit.Test)

Example 2 with RawKVStore

use of com.alipay.sofa.jraft.rhea.storage.RawKVStore in project sofa-jraft by sofastack.

the class RocksKVStoreTest method multiGroupSnapshotTest.

public void multiGroupSnapshotTest() throws Exception {
    final File backupDir = new File("multi-backup");
    if (backupDir.exists()) {
        FileUtils.deleteDirectory(backupDir);
    }
    final List<Region> regions = Lists.newArrayList();
    regions.add(new Region(1, makeKey("0"), makeKey("1"), null, null));
    regions.add(new Region(2, makeKey("1"), makeKey("2"), null, null));
    regions.add(new Region(3, makeKey("2"), makeKey("3"), null, null));
    regions.add(new Region(4, makeKey("3"), makeKey("4"), null, null));
    regions.add(new Region(5, makeKey("4"), makeKey("5"), null, null));
    for (int i = 0; i < 5; i++) {
        final String v = String.valueOf(i);
        this.kvStore.put(makeKey(v), makeValue(v), null);
    }
    for (int i = 0; i < 5; i++) {
        this.kvStore.getSequence(makeKey(i + "_seq_test"), 10, null);
    }
    KVStoreSnapshotFile kvStoreSnapshotFile = KVStoreSnapshotFileFactory.getKVStoreSnapshotFile(this.kvStore);
    final ExecutorService snapshotPool = StoreEngineHelper.createSnapshotExecutor(1, 5);
    final List<TestSnapshotWriter> writers = Lists.newArrayList();
    for (int i = 0; i < 4; i++) {
        final Path p = Paths.get(backupDir.getAbsolutePath(), String.valueOf(i));
        final TestSnapshotWriter snapshotWriter = new TestSnapshotWriter(p.toString());
        writers.add(snapshotWriter);
        final CountDownLatch latch = new CountDownLatch(1);
        final Closure done = status -> {
            assertTrue(status.isOk());
            latch.countDown();
        };
        kvStoreSnapshotFile.save(snapshotWriter, regions.get(i), done, snapshotPool);
        latch.await();
        final LocalFileMeta meta = (LocalFileMeta) snapshotWriter.getFileMeta(SNAPSHOT_ARCHIVE);
        assertNotNull(meta);
    }
    this.kvStore.shutdown();
    FileUtils.deleteDirectory(new File(this.tempPath));
    FileUtils.forceMkdir(new File(this.tempPath));
    this.kvStore = new RocksRawKVStore();
    this.kvStore.init(this.dbOptions);
    kvStoreSnapshotFile = KVStoreSnapshotFileFactory.getKVStoreSnapshotFile(this.kvStore);
    for (int i = 0; i < 4; i++) {
        final Path p = Paths.get(backupDir.getAbsolutePath(), String.valueOf(i));
        final TestSnapshotReader snapshotReader = new TestSnapshotReader(writers.get(i).metaTable, p.toString());
        final boolean ret = kvStoreSnapshotFile.load(snapshotReader, regions.get(i));
        assertTrue(ret);
    }
    for (int i = 0; i < 4; i++) {
        final String v = String.valueOf(i);
        final byte[] seqKey = makeKey(i + "_seq_test");
        assertArrayEquals(makeValue(v), get(makeKey(v)));
        final Sequence sequence = new SyncKVStore<Sequence>() {

            @Override
            public void execute(RawKVStore kvStore, KVStoreClosure closure) {
                kvStore.getSequence(seqKey, 10, closure);
            }
        }.apply(this.kvStore);
        assertEquals(10L, sequence.getStartValue());
        assertEquals(20L, sequence.getEndValue());
    }
    assertNull(get(makeKey("5")));
    final Sequence sequence = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(makeKey("4_seq_test"), 10, closure);
        }
    }.apply(this.kvStore);
    assertEquals(0L, sequence.getStartValue());
    FileUtils.deleteDirectory(backupDir);
    ExecutorServiceHelper.shutdownAndAwaitTermination(snapshotPool);
}
Also used : Path(java.nio.file.Path) StoreEngineHelper(com.alipay.sofa.jraft.rhea.StoreEngineHelper) Region(com.alipay.sofa.jraft.rhea.metadata.Region) TestSnapshotReader(com.alipay.sofa.jraft.rhea.storage.TestSnapshotReader) SyncKVStore(com.alipay.sofa.jraft.rhea.storage.SyncKVStore) Lists(com.alipay.sofa.jraft.rhea.util.Lists) SstColumnFamily(com.alipay.sofa.jraft.rhea.storage.SstColumnFamily) Map(java.util.Map) After(org.junit.After) KVStoreSnapshotFileFactory(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFileFactory) Method(java.lang.reflect.Method) Path(java.nio.file.Path) DistributedLock(com.alipay.sofa.jraft.rhea.util.concurrent.DistributedLock) EnumMap(java.util.EnumMap) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) KVOperation(com.alipay.sofa.jraft.rhea.storage.KVOperation) Assert.assertFalse(org.junit.Assert.assertFalse) RocksDBOptions(com.alipay.sofa.jraft.rhea.options.RocksDBOptions) TestClosure(com.alipay.sofa.jraft.rhea.storage.TestClosure) KVState(com.alipay.sofa.jraft.rhea.storage.KVState) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) KeyValueTool.makeKey(com.alipay.sofa.jraft.rhea.KeyValueTool.makeKey) Closure(com.alipay.sofa.jraft.Closure) KVIterator(com.alipay.sofa.jraft.rhea.storage.KVIterator) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) ExecutorServiceHelper(com.alipay.sofa.jraft.util.ExecutorServiceHelper) LocalLock(com.alipay.sofa.jraft.rhea.storage.LocalLock) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) KVStoreAccessHelper(com.alipay.sofa.jraft.rhea.storage.KVStoreAccessHelper) TestSnapshotWriter(com.alipay.sofa.jraft.rhea.storage.TestSnapshotWriter) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) Assert.assertNotNull(org.junit.Assert.assertNotNull) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) Test(org.junit.Test) Status(com.alipay.sofa.jraft.Status) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) Assert.assertNull(org.junit.Assert.assertNull) Paths(java.nio.file.Paths) LocalFileMeta(com.alipay.sofa.jraft.entity.LocalFileMetaOutter.LocalFileMeta) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) KVEntry(com.alipay.sofa.jraft.rhea.storage.KVEntry) KVStateOutputList(com.alipay.sofa.jraft.rhea.storage.KVStateOutputList) KeyValueTool.makeValue(com.alipay.sofa.jraft.rhea.KeyValueTool.makeValue) Assert.assertEquals(org.junit.Assert.assertEquals) BytesUtil(com.alipay.sofa.jraft.util.BytesUtil) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) TestClosure(com.alipay.sofa.jraft.rhea.storage.TestClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) Closure(com.alipay.sofa.jraft.Closure) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) TestSnapshotReader(com.alipay.sofa.jraft.rhea.storage.TestSnapshotReader) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) CountDownLatch(java.util.concurrent.CountDownLatch) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) ExecutorService(java.util.concurrent.ExecutorService) Region(com.alipay.sofa.jraft.rhea.metadata.Region) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) LocalFileMeta(com.alipay.sofa.jraft.entity.LocalFileMetaOutter.LocalFileMeta) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) File(java.io.File) TestSnapshotWriter(com.alipay.sofa.jraft.rhea.storage.TestSnapshotWriter)

Example 3 with RawKVStore

use of com.alipay.sofa.jraft.rhea.storage.RawKVStore in project sofa-jraft by sofastack.

the class MemoryKVStoreTest method multiGroupSnapshotTest.

@Test
public void multiGroupSnapshotTest() throws Exception {
    final File backupDir = new File("multi-backup");
    if (backupDir.exists()) {
        FileUtils.deleteDirectory(backupDir);
    }
    final List<Region> regions = Lists.newArrayList();
    regions.add(new Region(1, makeKey("0"), makeKey("1"), null, null));
    regions.add(new Region(2, makeKey("1"), makeKey("2"), null, null));
    regions.add(new Region(3, makeKey("2"), makeKey("3"), null, null));
    regions.add(new Region(4, makeKey("3"), makeKey("4"), null, null));
    regions.add(new Region(5, makeKey("4"), makeKey("5"), null, null));
    for (int i = 0; i < 5; i++) {
        final String v = String.valueOf(i);
        this.kvStore.put(makeKey(v), makeValue(v), null);
    }
    for (int i = 0; i < 5; i++) {
        this.kvStore.getSequence(makeKey(i + "_seq_test"), 10, null);
    }
    KVStoreSnapshotFile kvStoreSnapshotFile = KVStoreSnapshotFileFactory.getKVStoreSnapshotFile(this.kvStore);
    final ExecutorService snapshotPool = StoreEngineHelper.createSnapshotExecutor(1, 2);
    final List<TestSnapshotWriter> writers = Lists.newArrayList();
    for (int i = 0; i < 4; i++) {
        final Path p = Paths.get(backupDir.getAbsolutePath(), String.valueOf(i));
        final TestSnapshotWriter snapshotWriter = new TestSnapshotWriter(p.toString());
        writers.add(snapshotWriter);
        final CountDownLatch latch = new CountDownLatch(1);
        final Closure done = status -> {
            assertTrue(status.isOk());
            latch.countDown();
        };
        kvStoreSnapshotFile.save(snapshotWriter, regions.get(i), done, snapshotPool);
        latch.await();
        final LocalFileMeta meta = (LocalFileMeta) snapshotWriter.getFileMeta(SNAPSHOT_ARCHIVE);
        assertNotNull(meta);
    }
    this.kvStore.shutdown();
    this.kvStore = new MemoryRawKVStore();
    final MemoryDBOptions dbOpts = new MemoryDBOptions();
    this.kvStore.init(dbOpts);
    kvStoreSnapshotFile = KVStoreSnapshotFileFactory.getKVStoreSnapshotFile(this.kvStore);
    for (int i = 0; i < 4; i++) {
        final Path p = Paths.get(backupDir.getAbsolutePath(), String.valueOf(i));
        final TestSnapshotReader snapshotReader = new TestSnapshotReader(writers.get(i).metaTable, p.toString());
        final boolean ret = kvStoreSnapshotFile.load(snapshotReader, regions.get(i));
        assertTrue(ret);
    }
    for (int i = 0; i < 4; i++) {
        final String v = String.valueOf(i);
        final byte[] seqKey = makeKey(i + "_seq_test");
        assertArrayEquals(makeValue(v), get(makeKey(v)));
        final Sequence sequence = new SyncKVStore<Sequence>() {

            @Override
            public void execute(RawKVStore kvStore, KVStoreClosure closure) {
                kvStore.getSequence(seqKey, 10, closure);
            }
        }.apply(this.kvStore);
        assertEquals(10L, sequence.getStartValue());
        assertEquals(20L, sequence.getEndValue());
    }
    assertNull(get(makeKey("5")));
    final Sequence sequence = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(makeKey("4_seq_test"), 10, closure);
        }
    }.apply(this.kvStore);
    assertEquals(0L, sequence.getStartValue());
    FileUtils.deleteDirectory(backupDir);
    ExecutorServiceHelper.shutdownAndAwaitTermination(snapshotPool);
}
Also used : Path(java.nio.file.Path) StoreEngineHelper(com.alipay.sofa.jraft.rhea.StoreEngineHelper) Region(com.alipay.sofa.jraft.rhea.metadata.Region) TestSnapshotReader(com.alipay.sofa.jraft.rhea.storage.TestSnapshotReader) SyncKVStore(com.alipay.sofa.jraft.rhea.storage.SyncKVStore) TestClosure(com.alipay.sofa.jraft.rhea.storage.TestClosure) Lists(com.alipay.sofa.jraft.rhea.util.Lists) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) KeyValueTool.makeKey(com.alipay.sofa.jraft.rhea.KeyValueTool.makeKey) Closure(com.alipay.sofa.jraft.Closure) Map(java.util.Map) After(org.junit.After) KVIterator(com.alipay.sofa.jraft.rhea.storage.KVIterator) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) ExecutorServiceHelper(com.alipay.sofa.jraft.util.ExecutorServiceHelper) KVStoreSnapshotFileFactory(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFileFactory) LocalLock(com.alipay.sofa.jraft.rhea.storage.LocalLock) Method(java.lang.reflect.Method) Path(java.nio.file.Path) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) DistributedLock(com.alipay.sofa.jraft.rhea.util.concurrent.DistributedLock) MemoryDBOptions(com.alipay.sofa.jraft.rhea.options.MemoryDBOptions) TestSnapshotWriter(com.alipay.sofa.jraft.rhea.storage.TestSnapshotWriter) Assert.assertNotNull(org.junit.Assert.assertNotNull) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) Assert.assertTrue(org.junit.Assert.assertTrue) FileUtils(org.apache.commons.io.FileUtils) Test(org.junit.Test) Status(com.alipay.sofa.jraft.Status) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Assert.assertNull(org.junit.Assert.assertNull) Paths(java.nio.file.Paths) LocalFileMeta(com.alipay.sofa.jraft.entity.LocalFileMetaOutter.LocalFileMeta) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) Assert.assertFalse(org.junit.Assert.assertFalse) KVEntry(com.alipay.sofa.jraft.rhea.storage.KVEntry) MemoryRawKVStore(com.alipay.sofa.jraft.rhea.storage.MemoryRawKVStore) KeyValueTool.makeValue(com.alipay.sofa.jraft.rhea.KeyValueTool.makeValue) Assert.assertEquals(org.junit.Assert.assertEquals) BytesUtil(com.alipay.sofa.jraft.util.BytesUtil) TestClosure(com.alipay.sofa.jraft.rhea.storage.TestClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) Closure(com.alipay.sofa.jraft.Closure) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) MemoryDBOptions(com.alipay.sofa.jraft.rhea.options.MemoryDBOptions) TestSnapshotReader(com.alipay.sofa.jraft.rhea.storage.TestSnapshotReader) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) CountDownLatch(java.util.concurrent.CountDownLatch) MemoryRawKVStore(com.alipay.sofa.jraft.rhea.storage.MemoryRawKVStore) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) MemoryRawKVStore(com.alipay.sofa.jraft.rhea.storage.MemoryRawKVStore) ExecutorService(java.util.concurrent.ExecutorService) Region(com.alipay.sofa.jraft.rhea.metadata.Region) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) LocalFileMeta(com.alipay.sofa.jraft.entity.LocalFileMetaOutter.LocalFileMeta) KVStoreSnapshotFile(com.alipay.sofa.jraft.rhea.storage.KVStoreSnapshotFile) File(java.io.File) TestSnapshotWriter(com.alipay.sofa.jraft.rhea.storage.TestSnapshotWriter) Test(org.junit.Test)

Example 4 with RawKVStore

use of com.alipay.sofa.jraft.rhea.storage.RawKVStore in project sofa-jraft by sofastack.

the class RocksKVStoreTest method putTest.

/**
 * Test method: {@link RocksRawKVStore#put(byte[], byte[], KVStoreClosure)}
 */
@Test
public void putTest() {
    final byte[] key = makeKey("put_test");
    TestClosure closure = new TestClosure();
    this.kvStore.get(key, closure);
    byte[] value = (byte[]) closure.getData();
    assertNull(value);
    value = makeValue("put_test_value");
    this.kvStore.put(key, value, null);
    byte[] newValue = new SyncKVStore<byte[]>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.get(key, closure);
        }
    }.apply(this.kvStore);
    assertArrayEquals(value, newValue);
}
Also used : TestClosure(com.alipay.sofa.jraft.rhea.storage.TestClosure) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) Test(org.junit.Test)

Example 5 with RawKVStore

use of com.alipay.sofa.jraft.rhea.storage.RawKVStore in project sofa-jraft by sofastack.

the class DefaultRheaKVStore method internalRegionDelete.

private void internalRegionDelete(final Region region, final List<byte[]> subKeys, final CompletableFuture<Boolean> future, final int retriesLeft, final Errors lastCause) {
    final RegionEngine regionEngine = getRegionEngine(region.getId(), true);
    final RetryRunner retryRunner = retryCause -> internalRegionDelete(region, subKeys, future, retriesLeft - 1, retryCause);
    final FailoverClosure<Boolean> closure = new FailoverClosureImpl<>(future, false, retriesLeft, retryRunner);
    if (regionEngine != null) {
        if (ensureOnValidEpoch(region, regionEngine, closure)) {
            final RawKVStore rawKVStore = getRawKVStore(regionEngine);
            if (this.kvDispatcher == null) {
                rawKVStore.delete(subKeys, closure);
            } else {
                this.kvDispatcher.execute(() -> rawKVStore.delete(subKeys, closure));
            }
        }
    } else {
        final BatchDeleteRequest request = new BatchDeleteRequest();
        request.setKeys(subKeys);
        request.setRegionId(region.getId());
        request.setRegionEpoch(region.getRegionEpoch());
        this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause);
    }
}
Also used : NamedThreadFactory(com.alipay.sofa.jraft.rhea.util.concurrent.NamedThreadFactory) PlacementDriverClient(com.alipay.sofa.jraft.rhea.client.pd.PlacementDriverClient) BatchingOptions(com.alipay.sofa.jraft.rhea.options.BatchingOptions) LoggerFactory(org.slf4j.LoggerFactory) FailoverClosure(com.alipay.sofa.jraft.rhea.client.failover.FailoverClosure) ExtSerializerSupports(com.alipay.sofa.jraft.rhea.rpc.ExtSerializerSupports) Region(com.alipay.sofa.jraft.rhea.metadata.Region) Lists(com.alipay.sofa.jraft.rhea.util.Lists) ListFailoverFuture(com.alipay.sofa.jraft.rhea.client.failover.impl.ListFailoverFuture) DescriberManager(com.alipay.sofa.jraft.rhea.DescriberManager) Map(java.util.Map) Constants(com.alipay.sofa.jraft.rhea.util.Constants) ApiExceptionHelper(com.alipay.sofa.jraft.rhea.errors.ApiExceptionHelper) ScanRequest(com.alipay.sofa.jraft.rhea.cmd.store.ScanRequest) Endpoint(com.alipay.sofa.jraft.util.Endpoint) MergeRequest(com.alipay.sofa.jraft.rhea.cmd.store.MergeRequest) ThreadFactory(java.util.concurrent.ThreadFactory) DeleteRequest(com.alipay.sofa.jraft.rhea.cmd.store.DeleteRequest) WaitStrategyType(com.alipay.sofa.jraft.rhea.util.concurrent.disruptor.WaitStrategyType) CASEntry(com.alipay.sofa.jraft.rhea.storage.CASEntry) DistributedLock(com.alipay.sofa.jraft.rhea.util.concurrent.DistributedLock) LogExceptionHandler(com.alipay.sofa.jraft.util.LogExceptionHandler) CASAllRequest(com.alipay.sofa.jraft.rhea.cmd.store.CASAllRequest) TaskDispatcher(com.alipay.sofa.jraft.rhea.util.concurrent.disruptor.TaskDispatcher) PeerId(com.alipay.sofa.jraft.entity.PeerId) RouteTable(com.alipay.sofa.jraft.RouteTable) PlacementDriverOptions(com.alipay.sofa.jraft.rhea.options.PlacementDriverOptions) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) KVMetrics(com.alipay.sofa.jraft.rhea.metrics.KVMetrics) CompareAndPutRequest(com.alipay.sofa.jraft.rhea.cmd.store.CompareAndPutRequest) PutRequest(com.alipay.sofa.jraft.rhea.cmd.store.PutRequest) FakePlacementDriverClient(com.alipay.sofa.jraft.rhea.client.pd.FakePlacementDriverClient) ContainsKeyRequest(com.alipay.sofa.jraft.rhea.cmd.store.ContainsKeyRequest) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) DeleteRangeRequest(com.alipay.sofa.jraft.rhea.cmd.store.DeleteRangeRequest) Strings(com.alipay.sofa.jraft.rhea.util.Strings) List(java.util.List) ResetSequenceRequest(com.alipay.sofa.jraft.rhea.cmd.store.ResetSequenceRequest) RegionEngine(com.alipay.sofa.jraft.rhea.RegionEngine) BoolFailoverFuture(com.alipay.sofa.jraft.rhea.client.failover.impl.BoolFailoverFuture) JRaftHelper(com.alipay.sofa.jraft.rhea.JRaftHelper) ZipStrategyManager(com.alipay.sofa.jraft.rhea.storage.zip.ZipStrategyManager) RemotePlacementDriverClient(com.alipay.sofa.jraft.rhea.client.pd.RemotePlacementDriverClient) FailoverClosureImpl(com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl) RheaKVStoreOptions(com.alipay.sofa.jraft.rhea.options.RheaKVStoreOptions) Requires(com.alipay.sofa.jraft.util.Requires) Histogram(com.codahale.metrics.Histogram) RheaRuntimeException(com.alipay.sofa.jraft.rhea.errors.RheaRuntimeException) BatchPutRequest(com.alipay.sofa.jraft.rhea.cmd.store.BatchPutRequest) StackTraceUtil(com.alipay.sofa.jraft.rhea.util.StackTraceUtil) CompletableFuture(java.util.concurrent.CompletableFuture) FollowerStateListener(com.alipay.sofa.jraft.rhea.FollowerStateListener) Utils(com.alipay.sofa.jraft.util.Utils) ErrorsHelper(com.alipay.sofa.jraft.rhea.errors.ErrorsHelper) BatchDeleteRequest(com.alipay.sofa.jraft.rhea.cmd.store.BatchDeleteRequest) StateListenerContainer(com.alipay.sofa.jraft.rhea.StateListenerContainer) RetryCallable(com.alipay.sofa.jraft.rhea.client.failover.RetryCallable) GetRequest(com.alipay.sofa.jraft.rhea.cmd.store.GetRequest) Errors(com.alipay.sofa.jraft.rhea.errors.Errors) StateListener(com.alipay.sofa.jraft.rhea.StateListener) GetAndPutRequest(com.alipay.sofa.jraft.rhea.cmd.store.GetAndPutRequest) KeyLockRequest(com.alipay.sofa.jraft.rhea.cmd.store.KeyLockRequest) KeyUnlockRequest(com.alipay.sofa.jraft.rhea.cmd.store.KeyUnlockRequest) MapFailoverFuture(com.alipay.sofa.jraft.rhea.client.failover.impl.MapFailoverFuture) KVMetricNames(com.alipay.sofa.jraft.rhea.metrics.KVMetricNames) KVIterator(com.alipay.sofa.jraft.rhea.storage.KVIterator) NodeExecutor(com.alipay.sofa.jraft.rhea.storage.NodeExecutor) Dispatcher(com.alipay.sofa.jraft.rhea.util.concurrent.disruptor.Dispatcher) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) StoreEngine(com.alipay.sofa.jraft.rhea.StoreEngine) MultiGetRequest(com.alipay.sofa.jraft.rhea.cmd.store.MultiGetRequest) EventHandler(com.lmax.disruptor.EventHandler) PutIfAbsentRequest(com.alipay.sofa.jraft.rhea.cmd.store.PutIfAbsentRequest) Logger(org.slf4j.Logger) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner) GetSequenceRequest(com.alipay.sofa.jraft.rhea.cmd.store.GetSequenceRequest) RingBuffer(com.lmax.disruptor.RingBuffer) AffinityNamedThreadFactory(com.alipay.sofa.jraft.rhea.util.concurrent.AffinityNamedThreadFactory) ListRetryCallable(com.alipay.sofa.jraft.rhea.client.failover.ListRetryCallable) Status(com.alipay.sofa.jraft.Status) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray) NodeExecuteRequest(com.alipay.sofa.jraft.rhea.cmd.store.NodeExecuteRequest) TimeUnit(java.util.concurrent.TimeUnit) StoreEngineOptions(com.alipay.sofa.jraft.rhea.options.StoreEngineOptions) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) RpcOptions(com.alipay.sofa.jraft.rhea.options.RpcOptions) KVEntry(com.alipay.sofa.jraft.rhea.storage.KVEntry) Collections(java.util.Collections) LeaderStateListener(com.alipay.sofa.jraft.rhea.LeaderStateListener) EventFactory(com.lmax.disruptor.EventFactory) Disruptor(com.lmax.disruptor.dsl.Disruptor) BytesUtil(com.alipay.sofa.jraft.util.BytesUtil) FailoverClosureImpl(com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) BatchDeleteRequest(com.alipay.sofa.jraft.rhea.cmd.store.BatchDeleteRequest) RegionEngine(com.alipay.sofa.jraft.rhea.RegionEngine) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner)

Aggregations

RawKVStore (com.alipay.sofa.jraft.rhea.storage.RawKVStore)16 KVStoreClosure (com.alipay.sofa.jraft.rhea.storage.KVStoreClosure)15 Status (com.alipay.sofa.jraft.Status)11 BaseKVStoreClosure (com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure)10 Test (org.junit.Test)10 KVEntry (com.alipay.sofa.jraft.rhea.storage.KVEntry)9 Sequence (com.alipay.sofa.jraft.rhea.storage.Sequence)9 List (java.util.List)9 PeerId (com.alipay.sofa.jraft.entity.PeerId)6 RouteTable (com.alipay.sofa.jraft.RouteTable)5 DescriberManager (com.alipay.sofa.jraft.rhea.DescriberManager)5 FollowerStateListener (com.alipay.sofa.jraft.rhea.FollowerStateListener)5 JRaftHelper (com.alipay.sofa.jraft.rhea.JRaftHelper)5 LeaderStateListener (com.alipay.sofa.jraft.rhea.LeaderStateListener)5 RegionEngine (com.alipay.sofa.jraft.rhea.RegionEngine)5 StateListener (com.alipay.sofa.jraft.rhea.StateListener)5 StateListenerContainer (com.alipay.sofa.jraft.rhea.StateListenerContainer)5 StoreEngine (com.alipay.sofa.jraft.rhea.StoreEngine)5 FailoverClosure (com.alipay.sofa.jraft.rhea.client.failover.FailoverClosure)5 ListRetryCallable (com.alipay.sofa.jraft.rhea.client.failover.ListRetryCallable)5