Class ControlClient
java.lang.Object
org.apache.drill.exec.rpc.RpcBus<T,CC>
org.apache.drill.exec.rpc.BasicClient<BitControl.RpcType,ControlConnection,BitControl.BitControlHandshake,BitControl.BitControlHandshake>
org.apache.drill.exec.rpc.control.ControlClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ControlClient
extends BasicClient<BitControl.RpcType,ControlConnection,BitControl.BitControlHandshake,BitControl.BitControlHandshake>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.rpc.RpcBus
RpcBus.ChannelClosedHandler, RpcBus.InboundHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionControlClient
(ControlConnectionConfig config, CoordinationProtos.DrillbitEndpoint remoteEndpoint, ReconnectingConnection<ControlConnection, BitControl.BitControlHandshake>.CloseHandlerCreator closeHandlerFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalizeConnection
(BitControl.BitControlHandshake handshake, ControlConnection connection) protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture>
getCloseHandler
(io.netty.channel.socket.SocketChannel ch, ControlConnection clientConnection) getDecoder
(BufferAllocator allocator) com.google.protobuf.MessageLite
getResponseDefaultInstance
(int rpcType) protected void
handle
(ControlConnection connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) protected ControlConnection
initRemoteConnection
(io.netty.channel.socket.SocketChannel channel) protected void
prepareSaslHandshake
(RpcConnectionHandler<ControlConnection> connectionHandler, List<String> serverAuthMechanisms) Creates various instances needed to start the SASL handshake.validateHandshake
(BitControl.BitControlHandshake handshake) Methods inherited from class org.apache.drill.exec.rpc.BasicClient
close, connectAsClient, hasPing, isActive, isAuthComplete, isSslEnabled, send, send, send, setAuthComplete, setAutoRead, setSslChannel, setupSSL, startSaslHandshake
-
Constructor Details
-
ControlClient
public ControlClient(ControlConnectionConfig config, CoordinationProtos.DrillbitEndpoint remoteEndpoint, ReconnectingConnection<ControlConnection, BitControl.BitControlHandshake>.CloseHandlerCreator closeHandlerFactory)
-
-
Method Details
-
initRemoteConnection
-
getCloseHandler
protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture> getCloseHandler(io.netty.channel.socket.SocketChannel ch, ControlConnection clientConnection) - Overrides:
getCloseHandler
in classRpcBus<BitControl.RpcType,
ControlConnection>
-
getResponseDefaultInstance
- Specified by:
getResponseDefaultInstance
in classRpcBus<BitControl.RpcType,
ControlConnection> - Throws:
RpcException
-
handle
protected void handle(ControlConnection connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException - Specified by:
handle
in classRpcBus<BitControl.RpcType,
ControlConnection> - Throws:
RpcException
-
prepareSaslHandshake
protected void prepareSaslHandshake(RpcConnectionHandler<ControlConnection> connectionHandler, List<String> serverAuthMechanisms) Description copied from class:BasicClient
Creates various instances needed to start the SASL handshake. This is called fromBasicClient.validateHandshake(MessageLite)
if authentication is required from server side.- Specified by:
prepareSaslHandshake
in classBasicClient<BitControl.RpcType,
ControlConnection, BitControl.BitControlHandshake, BitControl.BitControlHandshake> - Parameters:
connectionHandler
- - Connection handler used by client's to know about success/failure conditions.serverAuthMechanisms
- - List of auth mechanisms configured on server side
-
validateHandshake
protected List<String> validateHandshake(BitControl.BitControlHandshake handshake) throws RpcException - Specified by:
validateHandshake
in classBasicClient<BitControl.RpcType,
ControlConnection, BitControl.BitControlHandshake, BitControl.BitControlHandshake> - Throws:
RpcException
-
finalizeConnection
protected void finalizeConnection(BitControl.BitControlHandshake handshake, ControlConnection connection) -
getDecoder
- Specified by:
getDecoder
in classBasicClient<BitControl.RpcType,
ControlConnection, BitControl.BitControlHandshake, BitControl.BitControlHandshake>
-