Github user sudheeshkatkam commented on a diff in the pull request:

    https://github.com/apache/drill/pull/578#discussion_r100131255
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/DataClient.java ---
    @@ -75,27 +85,106 @@ public MessageLite getResponseDefaultInstance(int 
rpcType) throws RpcException {
       }
     
       @Override
    -  protected Response handle(DataClientConnection connection, int rpcType, 
ByteBuf pBody, ByteBuf dBody) throws RpcException {
    +  protected void handle(DataClientConnection connection, int rpcType, 
ByteBuf pBody, ByteBuf dBody,
    +                        ResponseSender sender) throws RpcException {
         throw new UnsupportedOperationException("DataClient is unidirectional 
by design.");
       }
     
       BufferAllocator getAllocator() {
    -    return allocator;
    +    return config.getAllocator();
       }
     
       @Override
       protected void validateHandshake(BitServerHandshake handshake) throws 
RpcException {
         if (handshake.getRpcVersion() != DataRpcConfig.RPC_VERSION) {
    -      throw new RpcException(String.format("Invalid rpc version.  Expected 
%d, actual %d.", handshake.getRpcVersion(), DataRpcConfig.RPC_VERSION));
    +      throw new RpcException(String.format("Invalid rpc version.  Expected 
%d, actual %d.",
    +          handshake.getRpcVersion(), DataRpcConfig.RPC_VERSION));
    +    }
    +
    +    if (handshake.getAuthenticationMechanismsCount() != 0) { // remote 
requires authentication
    --- End diff --
    
    Correct me if I am wrong, but both your intentions are different.
    
    I've addressed Sorabh's comment, as in, "check for the case if 
Authentication is enabled on this client and for some reason server is sending 
empty list of mechanisms list (may be wrong config) then we should throw 
exception"
    
    But regarding Laurent's comment, the "code" is the "same as in 
ControlClient", the objects are all different (handshake, connection, config). 
That refactoring would require a lot more changes to BasicClient. I'll open a 
ticket once this PR is merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to