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

    https://github.com/apache/tajo/pull/763#discussion_r39628859
  
    --- Diff: 
tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java
 ---
    @@ -18,56 +18,53 @@
     
     package org.apache.tajo.rpc;
     
    -import com.google.common.annotations.VisibleForTesting;
     import com.google.protobuf.Descriptors.MethodDescriptor;
     import com.google.protobuf.*;
     import io.netty.channel.ChannelHandler;
     import io.netty.channel.EventLoopGroup;
    -import org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey;
     import org.apache.tajo.rpc.RpcProtos.RpcResponse;
     
     import java.lang.reflect.Method;
    +import java.util.Properties;
     import java.util.concurrent.TimeUnit;
     import java.util.concurrent.atomic.AtomicInteger;
     
    +import static org.apache.tajo.rpc.RpcConstants.CLIENT_SOCKET_TIMEOUT;
    +import static 
org.apache.tajo.rpc.RpcConstants.CLIENT_SOCKET_TIMEOUT_DEFAULT;
    +
     public class AsyncRpcClient extends 
NettyClientBase<AsyncRpcClient.ResponseCallback> {
     
       private final Method stubMethod;
       private final ProxyRpcChannel rpcChannel;
       private final NettyChannelInboundHandler handler;
     
    -  @VisibleForTesting
    -  AsyncRpcClient(RpcConnectionKey rpcConnectionKey, int retries)
    -      throws ClassNotFoundException, NoSuchMethodException {
    -    this(rpcConnectionKey, retries, 0, TimeUnit.NANOSECONDS, false, 
NettyUtils.getDefaultEventLoopGroup());
    -  }
     
       /**
        * Intentionally make this method package-private, avoiding user directly
        * new an instance through this constructor.
        *
    -   * @param rpcConnectionKey
    -   * @param retries          retry operation number of times
    -   * @param timeout          disable ping, it trigger timeout event on 
idle-state.
    -   *                         otherwise it is request timeout on 
active-state
    -   * @param timeUnit         TimeUnit
    -   * @param enablePing       enable to detect remote peer hangs
    -   * @param eventLoopGroup   thread pool of netty's
    +   * @param rpcConnectionKey  RpcConnectionKey
    +   * @param eventLoopGroup    Thread pool of netty's
    +   * @param connectionParameters Connection parameters (see RpcConstants)
    +   *
        * @throws ClassNotFoundException
        * @throws NoSuchMethodException
        */
    -  AsyncRpcClient(RpcConnectionKey rpcConnectionKey, int retries, long 
timeout, TimeUnit timeUnit, boolean enablePing,
    -                 EventLoopGroup eventLoopGroup)
    +  AsyncRpcClient(EventLoopGroup eventLoopGroup,
    +                 RpcConnectionKey rpcConnectionKey,
    +                 Properties connectionParameters)
           throws ClassNotFoundException, NoSuchMethodException {
    -    super(rpcConnectionKey, retries);
    +    super(rpcConnectionKey, connectionParameters);
     
         this.stubMethod = getServiceClass().getMethod("newStub", 
RpcChannel.class);
         this.rpcChannel = new ProxyRpcChannel();
         this.handler = new ClientChannelInboundHandler();
    -    init(new ProtoClientChannelInitializer(handler,
    -        RpcResponse.getDefaultInstance(),
    -        timeUnit.toNanos(timeout),
    -        enablePing), eventLoopGroup);
    +
    +    final long socketTimeoutMills = Long.parseLong(
    +        connectionParameters.getProperty(CLIENT_SOCKET_TIMEOUT, 
String.valueOf(CLIENT_SOCKET_TIMEOUT_DEFAULT)));
    +
    +    init(new ProtoClientChannelInitializer(handler, 
RpcResponse.getDefaultInstance(),
    +        TimeUnit.MILLISECONDS.toNanos(socketTimeoutMills)),eventLoopGroup);
    --- End diff --
    
    I missed them after the change ProtoClientChannelInitializer.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to