Search in sources :

Example 1 with SetStoreInfoRequest

use of com.alipay.sofa.jraft.rhea.cmd.pd.SetStoreInfoRequest in project sofa-jraft by sofastack.

the class MetadataRpcClient method internalUpdateStoreInfo.

private void internalUpdateStoreInfo(final long clusterId, final Store store, final CompletableFuture<Store> future, final int retriesLeft, final Errors lastCause) {
    final RetryRunner retryRunner = retryCause -> internalUpdateStoreInfo(clusterId, store, future, retriesLeft - 1, retryCause);
    final FailoverClosure<Store> closure = new FailoverClosureImpl<>(future, retriesLeft, retryRunner);
    final SetStoreInfoRequest request = new SetStoreInfoRequest();
    request.setClusterId(clusterId);
    request.setStore(store);
    this.pdRpcService.callPdServerWithRpc(request, closure, lastCause);
}
Also used : Store(com.alipay.sofa.jraft.rhea.metadata.Store) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner) FailoverClosure(com.alipay.sofa.jraft.rhea.client.failover.FailoverClosure) CreateRegionIdRequest(com.alipay.sofa.jraft.rhea.cmd.pd.CreateRegionIdRequest) CompletableFuture(java.util.concurrent.CompletableFuture) GetStoreInfoRequest(com.alipay.sofa.jraft.rhea.cmd.pd.GetStoreInfoRequest) Errors(com.alipay.sofa.jraft.rhea.errors.Errors) Cluster(com.alipay.sofa.jraft.rhea.metadata.Cluster) GetStoreIdRequest(com.alipay.sofa.jraft.rhea.cmd.pd.GetStoreIdRequest) SetStoreInfoRequest(com.alipay.sofa.jraft.rhea.cmd.pd.SetStoreInfoRequest) GetClusterInfoRequest(com.alipay.sofa.jraft.rhea.cmd.pd.GetClusterInfoRequest) Endpoint(com.alipay.sofa.jraft.util.Endpoint) FutureHelper(com.alipay.sofa.jraft.rhea.client.FutureHelper) FailoverClosureImpl(com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl) FailoverClosureImpl(com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl) Store(com.alipay.sofa.jraft.rhea.metadata.Store) SetStoreInfoRequest(com.alipay.sofa.jraft.rhea.cmd.pd.SetStoreInfoRequest) RetryRunner(com.alipay.sofa.jraft.rhea.client.failover.RetryRunner)

Aggregations

FutureHelper (com.alipay.sofa.jraft.rhea.client.FutureHelper)1 FailoverClosure (com.alipay.sofa.jraft.rhea.client.failover.FailoverClosure)1 RetryRunner (com.alipay.sofa.jraft.rhea.client.failover.RetryRunner)1 FailoverClosureImpl (com.alipay.sofa.jraft.rhea.client.failover.impl.FailoverClosureImpl)1 CreateRegionIdRequest (com.alipay.sofa.jraft.rhea.cmd.pd.CreateRegionIdRequest)1 GetClusterInfoRequest (com.alipay.sofa.jraft.rhea.cmd.pd.GetClusterInfoRequest)1 GetStoreIdRequest (com.alipay.sofa.jraft.rhea.cmd.pd.GetStoreIdRequest)1 GetStoreInfoRequest (com.alipay.sofa.jraft.rhea.cmd.pd.GetStoreInfoRequest)1 SetStoreInfoRequest (com.alipay.sofa.jraft.rhea.cmd.pd.SetStoreInfoRequest)1 Errors (com.alipay.sofa.jraft.rhea.errors.Errors)1 Cluster (com.alipay.sofa.jraft.rhea.metadata.Cluster)1 Store (com.alipay.sofa.jraft.rhea.metadata.Store)1 Endpoint (com.alipay.sofa.jraft.util.Endpoint)1 CompletableFuture (java.util.concurrent.CompletableFuture)1