类 GrpcClient
java.lang.Object
com.alibaba.nacos.common.remote.client.RpcClient
com.alibaba.nacos.common.remote.client.grpc.GrpcClient
- 所有已实现的接口:
Closeable
- 直接已知子类:
GrpcClusterClient,GrpcSdkClient
gRPC Client.
- 版本:
- $Id: GrpcClient.java, v 0.1 2020年07月13日 9:16 PM liuzunfei Exp $
- 作者:
- liuzunfei
-
嵌套类概要
从类继承的嵌套类/接口 com.alibaba.nacos.common.remote.client.RpcClient
RpcClient.ConnectionEvent, RpcClient.ServerInfo -
字段概要
从类继承的字段 com.alibaba.nacos.common.remote.client.RpcClient
clientEventExecutor, connectionEventListeners, currentConnection, eventLinkedBlockingQueue, resourceLoader, rpcClientConfig, rpcClientStatus, serverRequestHandlers -
构造器概要
构造器构造器说明GrpcClient(GrpcClientConfig clientConfig) constructor.GrpcClient(GrpcClientConfig clientConfig, ServerListFactory serverListFactory) constructor.GrpcClient(String name) constructor.GrpcClient(String name, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels) constructor.GrpcClient(String name, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels, RpcClientTlsConfig tlsConfig) -
方法概要
修饰符和类型方法说明protected abstract com.alibaba.nacos.api.ability.constant.AbilityModeability mode: sdk client or cluster client.protected voidafterReset(com.alibaba.nacos.api.remote.request.ConnectResetRequest request) . invoke after receiving reset requestconnectToServer(RpcClient.ServerInfo serverInfo) connect to server.protected ThreadPoolExecutorcreateGrpcExecutor(String serverIp) protected com.alibaba.nacos.api.grpc.auto.RequestGrpc.RequestFutureStubcreateNewChannelStub(io.grpc.ManagedChannel managedChannelTemp) Create a stub using a channel.protected Stringget connection type of this client.voidshutdown()Shutdown the Resources, such as Thread Pool.从类继承的方法 com.alibaba.nacos.common.remote.client.RpcClient
asyncRequest, currentRpcServer, getConnectionAbility, getCurrentServer, getLabels, getName, getServerListFactory, getTenant, handleServerRequest, init, isRunning, isShutdown, isWaitInitiated, nextRpcServer, notifyConnected, notifyDisConnected, onServerListChange, reconnect, registerConnectionListener, registerServerRequestHandler, request, request, requestFuture, rpcPortOffset, serverListFactory, setTenant, start, switchServerAsync, switchServerAsync, switchServerAsyncOnRequestFail
-
构造器详细资料
-
GrpcClient
constructor.- 参数:
name- .
-
GrpcClient
constructor.- 参数:
clientConfig- .
-
GrpcClient
constructor.- 参数:
clientConfig- .serverListFactory- .
-
GrpcClient
public GrpcClient(String name, Integer threadPoolCoreSize, Integer threadPoolMaxSize, Map<String, String> labels) constructor.- 参数:
name- .threadPoolCoreSize- .threadPoolMaxSize- .labels- .
-
GrpcClient
-
-
方法详细资料
-
getConnectionType
从类复制的说明:RpcClientget connection type of this client.- 指定者:
getConnectionType在类中RpcClient- 返回:
- ConnectionType.
-
createGrpcExecutor
-
shutdown
public void shutdown() throws com.alibaba.nacos.api.exception.NacosException从接口复制的说明:CloseableShutdown the Resources, such as Thread Pool. -
createNewChannelStub
protected com.alibaba.nacos.api.grpc.auto.RequestGrpc.RequestFutureStub createNewChannelStub(io.grpc.ManagedChannel managedChannelTemp) Create a stub using a channel.- 参数:
managedChannelTemp- channel.- 返回:
- if server check success,return a non-null stub.
-
connectToServer
从类复制的说明:RpcClientconnect to server.- 指定者:
connectToServer在类中RpcClient- 参数:
serverInfo- server address to connect.- 返回:
- return connection when successfully connect to server, or null if failed.
-
getClientVersion
-
abilityMode
protected abstract com.alibaba.nacos.api.ability.constant.AbilityMode abilityMode()ability mode: sdk client or cluster client.- 返回:
- mode
-
afterReset
protected void afterReset(com.alibaba.nacos.api.remote.request.ConnectResetRequest request) 从类复制的说明:RpcClient. invoke after receiving reset request- 覆盖:
afterReset在类中RpcClient- 参数:
request- request for resetting
-