public final class BitRpcUtility extends Object
DataClient
and
ControlClient
Modifier and Type | Method and Description |
---|---|
static boolean |
isLocalControlServer(CoordinationProtos.DrillbitEndpoint local,
CoordinationProtos.DrillbitEndpoint remote)
Verifies if local and remote Drillbit Endpoint has same control server by using address and control port
information.
|
static <T extends com.google.protobuf.Internal.EnumLite,CC extends ClientConnection,HS extends com.google.protobuf.MessageLite,HR extends com.google.protobuf.MessageLite> |
prepareSaslHandshake(RpcConnectionHandler<CC> connectionHandler,
List<String> serverAuthMechanisms,
CC connection,
BitConnectionConfig config,
CoordinationProtos.DrillbitEndpoint endpoint,
BasicClient<T,CC,HS,HR> client,
T saslRpcType)
Creates various instances needed to start the SASL handshake.
|
static List<String> |
validateHandshake(int handshakeRpcVersion,
List<String> remoteAuthMechs,
int rpcVersion,
ClientConnection connection,
BitConnectionConfig config,
BasicClient client)
Method to do validation on the handshake message received from server side.
|
public static List<String> validateHandshake(int handshakeRpcVersion, List<String> remoteAuthMechs, int rpcVersion, ClientConnection connection, BitConnectionConfig config, BasicClient client) throws RpcException
handshakeRpcVersion
- - rpc version received in handshake messageremoteAuthMechs
- - authentication mechanisms supported by serverrpcVersion
- - supported rpc version on clientconnection
- - client connectionconfig
- - client connectin configclient
- - data client or control clientRpcException
- - exception is thrown if rpc version or authentication configuration mismatch is foundpublic static <T extends com.google.protobuf.Internal.EnumLite,CC extends ClientConnection,HS extends com.google.protobuf.MessageLite,HR extends com.google.protobuf.MessageLite> void prepareSaslHandshake(RpcConnectionHandler<CC> connectionHandler, List<String> serverAuthMechanisms, CC connection, BitConnectionConfig config, CoordinationProtos.DrillbitEndpoint endpoint, BasicClient<T,CC,HS,HR> client, T saslRpcType)
BasicClient.prepareSaslHandshake(RpcConnectionHandler, List)
only for
DataClient
and ControlClient
connectionHandler
- - Connection handler used by client's to know about success/failure conditions.serverAuthMechanisms
- - List of auth mechanisms configured on server sideconnection
- - ClientConnection used for authenticationconfig
- - ClientConnection configendpoint
- - Remote DrillbitEndpointclient
- - Either of DataClient/ControlClient instancesaslRpcType
- - SASL_MESSAGE RpcType for Data and Control channelpublic static boolean isLocalControlServer(CoordinationProtos.DrillbitEndpoint local, CoordinationProtos.DrillbitEndpoint remote)
CoordinationProtos.DrillbitEndpoint
because DrillbitEndpoint stores
state information in it.
For local Drillbit a reference is stored in DrillbitContext
as soon as
Drillbit is started in ServiceEngine.start()
with state as STARTUP, but
while planning minor fragment the assignment list is used from active list of Drillbits in which state for local
Drillbit will not be STARTUPlocal
- - DrillbitEndpoint instance for local bitremote
- - DrillbitEndpoint instance for remote bitCopyright © 1970 The Apache Software Foundation. All rights reserved.