Package io.dingodb.sdk.service.connector
Class ServiceConnector<S extends io.grpc.stub.AbstractBlockingStub<S>>
java.lang.Object
io.dingodb.sdk.service.connector.ServiceConnector<S>
- Direct Known Subclasses:
AutoIncrementServiceConnector,CoordinatorServiceConnector,IndexServiceConnector,MetaServiceConnector,StoreServiceConnector,UtilServiceConnector,VersionServiceConnector
public abstract class ServiceConnector<S extends io.grpc.stub.AbstractBlockingStub<S>>
extends Object
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected final intprotected final AtomicReference<S> -
Constructor Summary
ConstructorsConstructorDescriptionServiceConnector(String locations) Deprecated.ServiceConnector(String locations, int retryTimes) ServiceConnector(Set<Location> locations) Deprecated.ServiceConnector(Set<Location> locations, int retryTimes) -
Method Summary
Modifier and TypeMethodDescriptionprotected <R> RcleanResponse(ServiceConnector.Response<R> response) voidclose()<R> Rexec(String name, Function<S, R> task, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker) <R> ServiceConnector.Response<R>exec(String name, Function<S, R> task, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker, Function<R, ServiceConnector.Response<R>> toResponse) <R> R<R> R<R> R<R> ServiceConnector.Response<R>exec(Function<S, R> function, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker, Function<R, ServiceConnector.Response<R>> toResponse) <R> RgetStub()protected io.grpc.ManagedChannelnewChannel(Location location) protected io.grpc.ManagedChannelnewChannel(String host, int port) protected abstract SnewStub(io.grpc.ManagedChannel channel) voidprotected abstract io.grpc.ManagedChanneltransformToLeaderChannel(io.grpc.ManagedChannel channel)
-
Field Details
-
RETRY_TIMES
public static final int RETRY_TIMES- See Also:
-
stubRef
-
locations
-
retryTimes
protected final int retryTimes
-
-
Constructor Details
-
ServiceConnector
Deprecated. -
ServiceConnector
Deprecated. -
ServiceConnector
-
ServiceConnector
-
-
Method Details
-
close
public void close() -
getStub
-
cleanResponse
-
exec
-
exec
-
exec
-
exec
public <R> R exec(Function<S, R> function, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker) -
exec
public <R> ServiceConnector.Response<R> exec(Function<S, R> function, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker, Function<R, ServiceConnector.Response<R>> toResponse) -
exec
-
exec
public <R> ServiceConnector.Response<R> exec(String name, Function<S, R> task, int retryTimes, Function<Integer, ErrorCodeUtils.Strategy> errChecker, Function<R, ServiceConnector.Response<R>> toResponse) -
refresh
-
newChannel
-
newChannel
-
transformToLeaderChannel
protected abstract io.grpc.ManagedChannel transformToLeaderChannel(io.grpc.ManagedChannel channel) -
newStub
-