Package org.apache.drill.exec.rpc.user
Class UserClient
java.lang.Object
org.apache.drill.exec.rpc.RpcBus<T,CC>
org.apache.drill.exec.rpc.BasicClient<UserProtos.RpcType,UserClient.UserToBitConnection,UserProtos.UserToBitHandshake,UserProtos.BitToUserHandshake>
org.apache.drill.exec.rpc.user.UserClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class UserClient
extends BasicClient<UserProtos.RpcType,UserClient.UserToBitConnection,UserProtos.UserToBitHandshake,UserProtos.BitToUserHandshake>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.rpc.RpcBus
RpcBus.ChannelClosedHandler, RpcBus.InboundHandler
-
Field Summary
Fields inherited from class org.apache.drill.exec.rpc.BasicClient
connection
-
Constructor Summary
ConstructorDescriptionUserClient
(String clientName, DrillConfig config, Properties properties, boolean supportComplexTypes, BufferAllocator allocator, io.netty.channel.EventLoopGroup eventLoopGroup, Executor eventExecutor, CoordinationProtos.DrillbitEndpoint endpoint) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(CoordinationProtos.DrillbitEndpoint endpoint, DrillProperties properties, UserBitShared.UserCredentials credentials) Connects, and if required, authenticates.getDecoder
(BufferAllocator allocator) protected com.google.protobuf.MessageLite
getResponseDefaultInstance
(int rpcType) protected void
handle
(UserClient.UserToBitConnection connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) protected UserClient.UserToBitConnection
initRemoteConnection
(io.netty.channel.socket.SocketChannel channel) protected boolean
planQuery is an API to plan a query without query executionprotected void
prepareSaslHandshake
(RpcConnectionHandler<UserClient.UserToBitConnection> connectionHandler, List<String> serverAuthMechanisms) Creates various instances needed to start the SASL handshake.protected <SEND extends com.google.protobuf.MessageLite,
RECEIVE extends com.google.protobuf.MessageLite>
voidsend
(RpcOutcomeListener<RECEIVE> listener, UserProtos.RpcType rpcType, SEND protobufBody, Class<RECEIVE> clazz, boolean allowInEventLoop, io.netty.buffer.ByteBuf... dataBodies) protected void
setupSSL
(io.netty.channel.ChannelPipeline pipe, ConnectionMultiListener.SSLHandshakeListener sslHandshakeListener) void
submitQuery
(UserResultsListener resultsListener, UserProtos.RunQuery query) Methods inherited from class org.apache.drill.exec.rpc.BasicClient
close, connectAsClient, finalizeConnection, hasPing, isActive, isAuthComplete, send, send, send, setAuthComplete, setAutoRead, setSslChannel, startSaslHandshake
Methods inherited from class org.apache.drill.exec.rpc.RpcBus
get, getCloseHandler, send, send, send, setAddresses
-
Constructor Details
-
UserClient
public UserClient(String clientName, DrillConfig config, Properties properties, boolean supportComplexTypes, BufferAllocator allocator, io.netty.channel.EventLoopGroup eventLoopGroup, Executor eventExecutor, CoordinationProtos.DrillbitEndpoint endpoint) throws NonTransientRpcException - Throws:
NonTransientRpcException
-
-
Method Details
-
setupSSL
protected void setupSSL(io.netty.channel.ChannelPipeline pipe, ConnectionMultiListener.SSLHandshakeListener sslHandshakeListener) -
isSslEnabled
protected boolean isSslEnabled() -
getServerInfos
-
getSupportedMethods
-
submitQuery
-
send
protected <SEND extends com.google.protobuf.MessageLite,RECEIVE extends com.google.protobuf.MessageLite> void send(RpcOutcomeListener<RECEIVE> listener, UserProtos.RpcType rpcType, SEND protobufBody, Class<RECEIVE> clazz, boolean allowInEventLoop, io.netty.buffer.ByteBuf... dataBodies) -
getResponseDefaultInstance
protected com.google.protobuf.MessageLite getResponseDefaultInstance(int rpcType) throws RpcException - Specified by:
getResponseDefaultInstance
in classRpcBus<UserProtos.RpcType,
UserClient.UserToBitConnection> - Throws:
RpcException
-
handle
protected void handle(UserClient.UserToBitConnection connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody, ResponseSender sender) throws RpcException - Specified by:
handle
in classRpcBus<UserProtos.RpcType,
UserClient.UserToBitConnection> - Throws:
RpcException
-
prepareSaslHandshake
protected void prepareSaslHandshake(RpcConnectionHandler<UserClient.UserToBitConnection> 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<UserProtos.RpcType,
UserClient.UserToBitConnection, UserProtos.UserToBitHandshake, UserProtos.BitToUserHandshake> - 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<UserProtos.RpcType,
UserClient.UserToBitConnection, UserProtos.UserToBitHandshake, UserProtos.BitToUserHandshake> - Throws:
RpcException
-
initRemoteConnection
protected UserClient.UserToBitConnection initRemoteConnection(io.netty.channel.socket.SocketChannel channel) -
getDecoder
-
planQuery
public DrillRpcFuture<UserProtos.QueryPlanFragments> planQuery(UserProtos.GetQueryPlanFragments req) planQuery is an API to plan a query without query execution- Parameters:
req
- - data necessary to plan query- Returns:
- list of PlanFragments that can later on be submitted for execution
-