Search in sources :

Example 11 with RawKVStore

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

the class MemoryKVStoreTest method compareAndPutTest.

/**
 * Test method: {@link MemoryRawKVStore#compareAndPut(byte[], byte[], byte[], KVStoreClosure)}
 */
@Test
public void compareAndPutTest() {
    final byte[] key = makeKey("put_test");
    byte[] value = makeValue("put_test_value");
    this.kvStore.put(key, value, null);
    byte[] update = makeValue("put_test_update");
    KVStoreClosure kvStoreClosure = new BaseKVStoreClosure() {

        @Override
        public void run(Status status) {
            assertEquals(status, Status.OK());
        }
    };
    this.kvStore.compareAndPut(key, value, update, kvStoreClosure);
    assertEquals(kvStoreClosure.getData(), Boolean.TRUE);
    byte[] newValue = new SyncKVStore<byte[]>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.get(key, closure);
        }
    }.apply(this.kvStore);
    assertArrayEquals(update, newValue);
    this.kvStore.compareAndPut(key, value, update, kvStoreClosure);
    assertEquals(kvStoreClosure.getData(), Boolean.FALSE);
}
Also used : Status(com.alipay.sofa.jraft.Status) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) MemoryRawKVStore(com.alipay.sofa.jraft.rhea.storage.MemoryRawKVStore) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) Test(org.junit.Test)

Example 12 with RawKVStore

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

the class RocksKVStoreTest method getSequenceTest.

/**
 * Test method: {@link RocksRawKVStore#getSequence(byte[], int, KVStoreClosure)}
 */
@Test
public void getSequenceTest() throws InterruptedException {
    final byte[] seqKey = makeKey("seq_test");
    Sequence sequence = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(seqKey, 199, closure);
        }
    }.apply(this.kvStore);
    assertEquals(sequence.getStartValue(), 0);
    assertEquals(sequence.getEndValue(), 199);
    Sequence sequence2 = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(seqKey, 10, closure);
        }
    }.apply(this.kvStore);
    assertEquals(sequence2.getStartValue(), 199);
    assertEquals(sequence2.getEndValue(), 209);
    this.kvStore.resetSequence(seqKey, null);
    Sequence sequence3 = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(seqKey, 11, closure);
        }
    }.apply(this.kvStore);
    assertEquals(sequence3.getStartValue(), 0);
    assertEquals(sequence3.getEndValue(), 11);
    // read-only
    Sequence sequence4 = new SyncKVStore<Sequence>() {

        @Override
        public void execute(RawKVStore kvStore, KVStoreClosure closure) {
            kvStore.getSequence(seqKey, 0, closure);
        }
    }.apply(this.kvStore);
    assertEquals(sequence4.getStartValue(), 11);
    assertEquals(sequence4.getEndValue(), 11);
    KVStoreClosure assertFailed = new BaseKVStoreClosure() {

        @Override
        public void run(Status status) {
            assertEquals("Fail to [GET_SEQUENCE], step must >= 0", status.getErrorMsg());
        }
    };
    this.kvStore.getSequence(seqKey, -1, assertFailed);
}
Also used : Status(com.alipay.sofa.jraft.Status) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) RocksRawKVStore(com.alipay.sofa.jraft.rhea.storage.RocksRawKVStore) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) KVStoreClosure(com.alipay.sofa.jraft.rhea.storage.KVStoreClosure) BaseKVStoreClosure(com.alipay.sofa.jraft.rhea.storage.BaseKVStoreClosure) Sequence(com.alipay.sofa.jraft.rhea.storage.Sequence) Test(org.junit.Test)

Example 13 with RawKVStore

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

the class RocksKVStoreTest method compareAndPutTest.

/**
 * Test method: {@link RocksRawKVStore#compareAndPut(byte[], byte[], byte[], KVStoreClosure)}
 */
@Test
public void compareAndPutTest() {
    final byte[] key = makeKey("put_test");
    final byte[] value = makeValue("put_test_value");
    this.kvStore.put(key, value, null);
    final byte[] update = makeValue("put_test_update");
    KVStoreClosure kvStoreClosure = new BaseKVStoreClosure() {

        @Override
        public void run(Status status) {
            assertEquals(status, Status.OK());
        }
    };
    this.kvStore.compareAndPut(key, value, update, kvStoreClosure);
    assertEquals(kvStoreClosure.getData(), Boolean.TRUE);
    byte[] newValue = new SyncKVStore<byte[]>() {

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

Example 14 with RawKVStore

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

the class DefaultRheaKVStore method internalRegionScan.

private void internalRegionScan(final Region region, final byte[] subStartKey, final byte[] subEndKey, final boolean reverse, final boolean readOnlySafe, final boolean returnValue, final CompletableFuture<List<KVEntry>> future, final int retriesLeft, final Errors lastCause, final boolean requireLeader) {
    final RegionEngine regionEngine = getRegionEngine(region.getId(), requireLeader);
    // require leader on retry
    final RetryRunner retryRunner = retryCause -> internalRegionScan(region, subStartKey, subEndKey, reverse, readOnlySafe, returnValue, future, retriesLeft - 1, retryCause, true);
    final FailoverClosure<List<KVEntry>> closure = new FailoverClosureImpl<>(future, false, retriesLeft, retryRunner);
    if (regionEngine != null) {
        if (ensureOnValidEpoch(region, regionEngine, closure)) {
            final RawKVStore rawKVStore = getRawKVStore(regionEngine);
            if (reverse) {
                if (this.kvDispatcher == null) {
                    rawKVStore.reverseScan(subStartKey, subEndKey, readOnlySafe, returnValue, closure);
                } else {
                    this.kvDispatcher.execute(() -> rawKVStore.reverseScan(subStartKey, subEndKey, readOnlySafe, returnValue, closure));
                }
            } else {
                if (this.kvDispatcher == null) {
                    rawKVStore.scan(subStartKey, subEndKey, readOnlySafe, returnValue, closure);
                } else {
                    this.kvDispatcher.execute(() -> rawKVStore.scan(subStartKey, subEndKey, readOnlySafe, returnValue, closure));
                }
            }
        }
    } else {
        final ScanRequest request = new ScanRequest();
        request.setStartKey(subStartKey);
        request.setEndKey(subEndKey);
        request.setReadOnlySafe(readOnlySafe);
        request.setReturnValue(returnValue);
        request.setRegionId(region.getId());
        request.setRegionEpoch(region.getRegionEpoch());
        request.setReverse(reverse);
        this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause, requireLeader);
    }
}
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) ScanRequest(com.alipay.sofa.jraft.rhea.cmd.store.ScanRequest) FailoverClosureImpl(com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl) RawKVStore(com.alipay.sofa.jraft.rhea.storage.RawKVStore) RegionEngine(com.alipay.sofa.jraft.rhea.RegionEngine) List(java.util.List) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner)

Example 15 with RawKVStore

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

the class DefaultRheaKVStore method internalRegionMultiGet.

private void internalRegionMultiGet(final Region region, final List<byte[]> subKeys, final boolean readOnlySafe, final CompletableFuture<Map<ByteArray, byte[]>> future, final int retriesLeft, final Errors lastCause, final boolean requireLeader) {
    final RegionEngine regionEngine = getRegionEngine(region.getId(), requireLeader);
    // require leader on retry
    final RetryRunner retryRunner = retryCause -> internalRegionMultiGet(region, subKeys, readOnlySafe, future, retriesLeft - 1, retryCause, true);
    final FailoverClosure<Map<ByteArray, byte[]>> 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.multiGet(subKeys, readOnlySafe, closure);
            } else {
                this.kvDispatcher.execute(() -> rawKVStore.multiGet(subKeys, readOnlySafe, closure));
            }
        }
    } else {
        final MultiGetRequest request = new MultiGetRequest();
        request.setKeys(subKeys);
        request.setReadOnlySafe(readOnlySafe);
        request.setRegionId(region.getId());
        request.setRegionEpoch(region.getRegionEpoch());
        this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause, requireLeader);
    }
}
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) RegionEngine(com.alipay.sofa.jraft.rhea.RegionEngine) Map(java.util.Map) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner) MultiGetRequest(com.alipay.sofa.jraft.rhea.cmd.store.MultiGetRequest)

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