Search in sources :

Example 6 with ByteArray

use of com.alipay.sofa.jraft.rhea.util.ByteArray in project sofa-jraft by sofastack.

the class MemoryRawKVStore method tryLockWith.

@Override
public void tryLockWith(final byte[] key, final byte[] fencingKey, final boolean keepLease, final DistributedLock.Acquirer acquirer, final KVStoreClosure closure) {
    final Timer.Context timeCtx = getTimeContext("TRY_LOCK");
    try {
        // The algorithm relies on the assumption that while there is no
        // synchronized clock across the processes, still the local time in
        // every process flows approximately at the same rate, with an error
        // which is small compared to the auto-release time of the lock.
        final long now = acquirer.getLockingTimestamp();
        final long timeoutMillis = acquirer.getLeaseMillis();
        final ByteArray wrappedKey = ByteArray.wrap(key);
        final DistributedLock.Owner prevOwner = this.lockerDB.get(wrappedKey);
        final DistributedLock.Owner owner;
        // noinspection ConstantConditions
        do {
            final DistributedLock.OwnerBuilder builder = DistributedLock.newOwnerBuilder();
            if (prevOwner == null) {
                // no others own this lock
                if (keepLease) {
                    // it wants to keep the lease but too late, will return failure
                    owner = // 
                    builder.id(acquirer.getId()).remainingMillis(DistributedLock.OwnerBuilder.KEEP_LEASE_FAIL).success(false).build();
                    break;
                }
                // is first time to try lock (another possibility is that this lock has been deleted),
                // will return successful
                owner = // 
                builder.id(acquirer.getId()).deadlineMillis(now + timeoutMillis).remainingMillis(DistributedLock.OwnerBuilder.FIRST_TIME_SUCCESS).fencingToken(getNextFencingToken(fencingKey)).acquires(1).context(acquirer.getContext()).success(true).build();
                this.lockerDB.put(wrappedKey, owner);
                break;
            }
            // this lock has an owner, check if it has expired
            final long remainingMillis = prevOwner.getDeadlineMillis() - now;
            if (remainingMillis < 0) {
                // the previous owner is out of lease
                if (keepLease) {
                    // it wants to keep the lease but too late, will return failure
                    owner = // 
                    builder.id(prevOwner.getId()).deadlineMillis(prevOwner.getDeadlineMillis()).remainingMillis(DistributedLock.OwnerBuilder.KEEP_LEASE_FAIL).context(prevOwner.getContext()).success(false).build();
                    break;
                }
                // create new lock owner
                owner = // 
                builder.id(acquirer.getId()).deadlineMillis(now + timeoutMillis).remainingMillis(DistributedLock.OwnerBuilder.NEW_ACQUIRE_SUCCESS).fencingToken(getNextFencingToken(fencingKey)).acquires(1).context(acquirer.getContext()).success(true).build();
                this.lockerDB.put(wrappedKey, owner);
                break;
            }
            // the previous owner is not out of lease (remainingMillis >= 0)
            final boolean isReentrant = prevOwner.isSameAcquirer(acquirer);
            if (isReentrant) {
                // is the same old friend come back (reentrant lock)
                if (keepLease) {
                    // the old friend only wants to keep lease of lock
                    owner = // 
                    builder.id(prevOwner.getId()).deadlineMillis(now + timeoutMillis).remainingMillis(DistributedLock.OwnerBuilder.KEEP_LEASE_SUCCESS).fencingToken(prevOwner.getFencingToken()).acquires(prevOwner.getAcquires()).context(prevOwner.getContext()).success(true).build();
                    this.lockerDB.put(wrappedKey, owner);
                    break;
                }
                // now we are sure that is an old friend who is back again (reentrant lock)
                owner = // 
                builder.id(prevOwner.getId()).deadlineMillis(now + timeoutMillis).remainingMillis(DistributedLock.OwnerBuilder.REENTRANT_SUCCESS).fencingToken(prevOwner.getFencingToken()).acquires(prevOwner.getAcquires() + 1).context(acquirer.getContext()).success(true).build();
                this.lockerDB.put(wrappedKey, owner);
                break;
            }
            // the lock is exist and also prev locker is not the same as current
            owner = // 
            builder.id(prevOwner.getId()).remainingMillis(remainingMillis).context(prevOwner.getContext()).success(false).build();
            LOG.debug("Another locker [{}] is trying the existed lock [{}].", acquirer, prevOwner);
        } while (false);
        setSuccess(closure, owner);
    } catch (final Exception e) {
        LOG.error("Fail to [TRY_LOCK], [{}, {}], {}.", BytesUtil.toHex(key), acquirer, StackTraceUtil.stackTrace(e));
        setCriticalError(closure, "Fail to [TRY_LOCK]", e);
    } finally {
        timeCtx.stop();
    }
}
Also used : DistributedLock(com.alipay.sofa.jraft.rhea.util.concurrent.DistributedLock) Timer(com.codahale.metrics.Timer) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray)

Example 7 with ByteArray

use of com.alipay.sofa.jraft.rhea.util.ByteArray in project sofa-jraft by sofastack.

the class DefaultMetadataStore method unsafeGetStoreIdsByEndpoints.

@Override
public Map<Long, Endpoint> unsafeGetStoreIdsByEndpoints(final long clusterId, final List<Endpoint> endpoints) {
    if (endpoints == null || endpoints.isEmpty()) {
        return Collections.emptyMap();
    }
    final List<byte[]> storeIdKeyList = Lists.newArrayListWithCapacity(endpoints.size());
    final Map<ByteArray, Endpoint> keyToEndpointMap = Maps.newHashMapWithExpectedSize(endpoints.size());
    for (final Endpoint endpoint : endpoints) {
        final byte[] keyBytes = BytesUtil.writeUtf8(MetadataKeyHelper.getStoreIdKey(clusterId, endpoint));
        storeIdKeyList.add(keyBytes);
        keyToEndpointMap.put(ByteArray.wrap(keyBytes), endpoint);
    }
    final Map<ByteArray, byte[]> storeIdBytes = this.rheaKVStore.bMultiGet(storeIdKeyList);
    final Map<Long, Endpoint> ids = Maps.newHashMapWithExpectedSize(storeIdBytes.size());
    for (final Map.Entry<ByteArray, byte[]> entry : storeIdBytes.entrySet()) {
        final Long storeId = Bits.getLong(entry.getValue(), 0);
        final Endpoint endpoint = keyToEndpointMap.get(entry.getKey());
        ids.put(storeId, endpoint);
    }
    return ids;
}
Also used : Endpoint(com.alipay.sofa.jraft.util.Endpoint) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray) ConcurrentMap(java.util.concurrent.ConcurrentMap) Map(java.util.Map)

Example 8 with ByteArray

use of com.alipay.sofa.jraft.rhea.util.ByteArray 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)

Example 9 with ByteArray

use of com.alipay.sofa.jraft.rhea.util.ByteArray in project sofa-jraft by sofastack.

the class DefaultRheaKVStore method internalMultiGet.

private FutureGroup<Map<ByteArray, byte[]>> internalMultiGet(final List<byte[]> keys, final boolean readOnlySafe, final int retriesLeft, final Throwable lastCause) {
    final Map<Region, List<byte[]>> regionMap = this.pdClient.findRegionsByKeys(keys, ApiExceptionHelper.isInvalidEpoch(lastCause));
    final List<CompletableFuture<Map<ByteArray, byte[]>>> futures = Lists.newArrayListWithCapacity(regionMap.size());
    final Errors lastError = lastCause == null ? null : Errors.forException(lastCause);
    for (final Map.Entry<Region, List<byte[]>> entry : regionMap.entrySet()) {
        final Region region = entry.getKey();
        final List<byte[]> subKeys = entry.getValue();
        final RetryCallable<Map<ByteArray, byte[]>> retryCallable = retryCause -> internalMultiGet(subKeys, readOnlySafe, retriesLeft - 1, retryCause);
        final MapFailoverFuture<ByteArray, byte[]> future = new MapFailoverFuture<>(retriesLeft, retryCallable);
        internalRegionMultiGet(region, subKeys, readOnlySafe, future, retriesLeft, lastError, this.onlyLeaderRead);
        futures.add(future);
    }
    return new FutureGroup<>(futures);
}
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) MapFailoverFuture(com.alipay.sofa.jraft.rhea.client.failover.impl.MapFailoverFuture) Errors(com.alipay.sofa.jraft.rhea.errors.Errors) CompletableFuture(java.util.concurrent.CompletableFuture) Region(com.alipay.sofa.jraft.rhea.metadata.Region) ByteArray(com.alipay.sofa.jraft.rhea.util.ByteArray) List(java.util.List) Map(java.util.Map)

Aggregations

ByteArray (com.alipay.sofa.jraft.rhea.util.ByteArray)9 DistributedLock (com.alipay.sofa.jraft.rhea.util.concurrent.DistributedLock)5 Timer (com.codahale.metrics.Timer)4 Map (java.util.Map)4 CASEntry (com.alipay.sofa.jraft.rhea.storage.CASEntry)3 Endpoint (com.alipay.sofa.jraft.util.Endpoint)3 RouteTable (com.alipay.sofa.jraft.RouteTable)2 Status (com.alipay.sofa.jraft.Status)2 PeerId (com.alipay.sofa.jraft.entity.PeerId)2 DescriberManager (com.alipay.sofa.jraft.rhea.DescriberManager)2 FollowerStateListener (com.alipay.sofa.jraft.rhea.FollowerStateListener)2 JRaftHelper (com.alipay.sofa.jraft.rhea.JRaftHelper)2 LeaderStateListener (com.alipay.sofa.jraft.rhea.LeaderStateListener)2 RegionEngine (com.alipay.sofa.jraft.rhea.RegionEngine)2 StateListener (com.alipay.sofa.jraft.rhea.StateListener)2 StateListenerContainer (com.alipay.sofa.jraft.rhea.StateListenerContainer)2 StoreEngine (com.alipay.sofa.jraft.rhea.StoreEngine)2 FailoverClosure (com.alipay.sofa.jraft.rhea.client.failover.FailoverClosure)2 ListRetryCallable (com.alipay.sofa.jraft.rhea.client.failover.ListRetryCallable)2 RetryCallable (com.alipay.sofa.jraft.rhea.client.failover.RetryCallable)2