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