{"action":"created","comment":{"url":"https://api.github.com/repos/apache/tajo/pulls/comments/39621315","id":39621315,"diff_hunk":"@@ -18,56 +18,54 @@\n \n package org.apache.tajo.rpc;\n \n-import com.google.common.annotations.VisibleForTesting;\n import com.google.protobuf.*;\n import com.google.protobuf.Descriptors.MethodDescriptor;\n import io.netty.channel.ChannelHandler;\n import io.netty.channel.EventLoopGroup;\n-import org.apache.tajo.rpc.RpcClientManager.RpcConnectionKey;\n import org.apache.tajo.rpc.RpcProtos.RpcResponse;\n \n import java.lang.reflect.Method;\n import java.net.InetSocketAddress;\n+import java.util.Properties;\n import java.util.concurrent.*;\n import java.util.concurrent.atomic.AtomicInteger;\n \n+import static org.apache.tajo.rpc.RpcConstants.CLIENT_SOCKET_TIMEOUT;\n+import static org.apache.tajo.rpc.RpcConstants.CLIENT_SOCKET_TIMEOUT_DEFAULT;\n+\n public class BlockingRpcClient extends NettyClientBase<BlockingRpcClient.ProtoCallFuture> {\n \n   private final Method stubMethod;\n   private final ProxyRpcChannel rpcChannel;\n   private final NettyChannelInboundHandler handler;\n \n-  @VisibleForTesting\n-  BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries)\n-      throws NoSuchMethodException, ClassNotFoundException {\n-    this(rpcConnectionKey, retries, 0, TimeUnit.NANOSECONDS, false, NettyUtils.getDefaultEventLoopGroup());\n-  }\n-\n   /**\n    * Intentionally make this method package-private, avoiding user directly\n    * new an instance through this constructor.\n    *\n-   * @param rpcConnectionKey\n-   * @param retries          retry operation number of times\n-   * @param timeout          disable ping, it trigger timeout event on idle-state.\n-   *                         otherwise it is request timeout on active-state\n-   * @param timeUnit         TimeUnit\n-   * @param enablePing       enable to detect remote peer hangs\n-   * @param eventLoopGroup   thread pool of netty's\n+   * @param rpcConnectionKey     RpcConnectionKey\n+   * @param eventLoopGroup       Thread pool of netty's\n+   * @param connectionParameters Connection parameters (see RpcConstants)\n+   *\n    * @throws ClassNotFoundException\n    * @throws NoSuchMethodException\n+   * @see RpcConstants\n    */\n-  BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries, long timeout, TimeUnit timeUnit, boolean enablePing,\n-                    EventLoopGroup eventLoopGroup) throws ClassNotFoundException, NoSuchMethodException {\n-    super(rpcConnectionKey, retries);\n+  public BlockingRpcClient(EventLoopGroup eventLoopGroup,\n+                           RpcConnectionKey rpcConnectionKey,\n+                           Properties connectionParameters)\n+      throws ClassNotFoundException, NoSuchMethodException {\n+    super(rpcConnectionKey, connectionParameters);\n \n     this.stubMethod = getServiceClass().getMethod(\"newBlockingStub\", BlockingRpcChannel.class);\n     this.rpcChannel = new ProxyRpcChannel();\n     this.handler = new ClientChannelInboundHandler();\n-    init(new ProtoClientChannelInitializer(handler,\n-        RpcResponse.getDefaultInstance(),\n-        timeUnit.toNanos(timeout),\n-        enablePing), eventLoopGroup);\n+\n+    long socketTimeoutMills = Long.parseLong(\n+        connectionParameters.getProperty(CLIENT_SOCKET_TIMEOUT, String.valueOf(CLIENT_SOCKET_TIMEOUT_DEFAULT)));\n+\n+    init(new ProtoClientChannelInitializer(handler, RpcResponse.getDefaultInstance(),\n+        TimeUnit.MILLISECONDS.toNanos(socketTimeoutMills)),eventLoopGroup);","path":"tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java","position":73,"original_position":73,"commit_id":"22ddc15685ae921e535a4b507583f03d65db234f","original_commit_id":"22ddc15685ae921e535a4b507583f03d65db234f","user":{"login":"jinossy","id":3632397,"avatar_url":"https://avatars.githubusercontent.com/u/3632397?v=3","gravatar_id":"","url":"https://api.github.com/users/jinossy","html_url":"https://github.com/jinossy","followers_url":"https://api.github.com/users/jinossy/followers","following_url":"https://api.github.com/users/jinossy/following{/other_user}","gists_url":"https://api.github.com/users/jinossy/gists{/gist_id}","starred_url":"https://api.github.com/users/jinossy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinossy/subscriptions","organizations_url":"https://api.github.com/users/jinossy/orgs","repos_url":"https://api.github.com/users/jinossy/repos","events_url":"https://api.github.com/users/jinossy/events{/privacy}","received_events_url":"https://api.github.com/users/jinossy/received_events","type":"User","site_admin":false},"body":"You should remove toNanos()","created_at":"2015-09-16T12:10:48Z","updated_at":"2015-09-16T12:10:48Z","html_url":"https://github.com/apache/tajo/pull/763#discussion_r39621315","pull_request_url":"https://api.github.com/repos/apache/tajo/pulls/763","_links":{"self":{"href":"https://api.github.com/repos/apache/tajo/pulls/comments/39621315"},"html":{"href":"https://github.com/apache/tajo/pull/763#discussion_r39621315"},"pull_request":{"href":"https://api.github.com/repos/apache/tajo/pulls/763"}}},"pull_request":{"url":"https://api.github.com/repos/apache/tajo/pulls/763","id":45143436,"html_url":"https://github.com/apache/tajo/pull/763","diff_url":"https://github.com/apache/tajo/pull/763.diff","patch_url":"https://github.com/apache/tajo/pull/763.patch","issue_url":"https://api.github.com/repos/apache/tajo/issues/763","number":763,"state":"open","locked":false,"title":"TAJO-1860: Refactor Rpc clients to take Connection Parameters.","user":{"login":"hyunsik","id":225941,"avatar_url":"https://avatars.githubusercontent.com/u/225941?v=3","gravatar_id":"","url":"https://api.github.com/users/hyunsik","html_url":"https://github.com/hyunsik","followers_url":"https://api.github.com/users/hyunsik/followers","following_url":"https://api.github.com/users/hyunsik/following{/other_user}","gists_url":"https://api.github.com/users/hyunsik/gists{/gist_id}","starred_url":"https://api.github.com/users/hyunsik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyunsik/subscriptions","organizations_url":"https://api.github.com/users/hyunsik/orgs","repos_url":"https://api.github.com/users/hyunsik/repos","events_url":"https://api.github.com/users/hyunsik/events{/privacy}","received_events_url":"https://api.github.com/users/hyunsik/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-16T08:25:02Z","updated_at":"2015-09-16T12:10:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca678dc5ea5620435f82c3fd562f2bf6048faeee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/tajo/pulls/763/commits","review_comments_url":"https://api.github.com/repos/apache/tajo/pulls/763/comments","review_comment_url":"https://api.github.com/repos/apache/tajo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/tajo/issues/763/comments","statuses_url":"https://api.github.com/repos/apache/tajo/statuses/22ddc15685ae921e535a4b507583f03d65db234f","head":{"label":"hyunsik:TAJO-1860","ref":"TAJO-1860","sha":"22ddc15685ae921e535a4b507583f03d65db234f","user":{"login":"hyunsik","id":225941,"avatar_url":"https://avatars.githubusercontent.com/u/225941?v=3","gravatar_id":"","url":"https://api.github.com/users/hyunsik","html_url":"https://github.com/hyunsik","followers_url":"https://api.github.com/users/hyunsik/followers","following_url":"https://api.github.com/users/hyunsik/following{/other_user}","gists_url":"https://api.github.com/users/hyunsik/gists{/gist_id}","starred_url":"https://api.github.com/users/hyunsik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyunsik/subscriptions","organizations_url":"https://api.github.com/users/hyunsik/orgs","repos_url":"https://api.github.com/users/hyunsik/repos","events_url":"https://api.github.com/users/hyunsik/events{/privacy}","received_events_url":"https://api.github.com/users/hyunsik/received_events","type":"User","site_admin":false},"repo":{"id":17972237,"name":"tajo","full_name":"hyunsik/tajo","owner":{"login":"hyunsik","id":225941,"avatar_url":"https://avatars.githubusercontent.com/u/225941?v=3","gravatar_id":"","url":"https://api.github.com/users/hyunsik","html_url":"https://github.com/hyunsik","followers_url":"https://api.github.com/users/hyunsik/followers","following_url":"https://api.github.com/users/hyunsik/following{/other_user}","gists_url":"https://api.github.com/users/hyunsik/gists{/gist_id}","starred_url":"https://api.github.com/users/hyunsik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyunsik/subscriptions","organizations_url":"https://api.github.com/users/hyunsik/orgs","repos_url":"https://api.github.com/users/hyunsik/repos","events_url":"https://api.github.com/users/hyunsik/events{/privacy}","received_events_url":"https://api.github.com/users/hyunsik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hyunsik/tajo","description":"Mirror of Apache Tajo","fork":true,"url":"https://api.github.com/repos/hyunsik/tajo","forks_url":"https://api.github.com/repos/hyunsik/tajo/forks","keys_url":"https://api.github.com/repos/hyunsik/tajo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyunsik/tajo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyunsik/tajo/teams","hooks_url":"https://api.github.com/repos/hyunsik/tajo/hooks","issue_events_url":"https://api.github.com/repos/hyunsik/tajo/issues/events{/number}","events_url":"https://api.github.com/repos/hyunsik/tajo/events","assignees_url":"https://api.github.com/repos/hyunsik/tajo/assignees{/user}","branches_url":"https://api.github.com/repos/hyunsik/tajo/branches{/branch}","tags_url":"https://api.github.com/repos/hyunsik/tajo/tags","blobs_url":"https://api.github.com/repos/hyunsik/tajo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyunsik/tajo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyunsik/tajo/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyunsik/tajo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyunsik/tajo/statuses/{sha}","languages_url":"https://api.github.com/repos/hyunsik/tajo/languages","stargazers_url":"https://api.github.com/repos/hyunsik/tajo/stargazers","contributors_url":"https://api.github.com/repos/hyunsik/tajo/contributors","subscribers_url":"https://api.github.com/repos/hyunsik/tajo/subscribers","subscription_url":"https://api.github.com/repos/hyunsik/tajo/subscription","commits_url":"https://api.github.com/repos/hyunsik/tajo/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyunsik/tajo/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyunsik/tajo/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyunsik/tajo/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyunsik/tajo/contents/{+path}","compare_url":"https://api.github.com/repos/hyunsik/tajo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyunsik/tajo/merges","archive_url":"https://api.github.com/repos/hyunsik/tajo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyunsik/tajo/downloads","issues_url":"https://api.github.com/repos/hyunsik/tajo/issues{/number}","pulls_url":"https://api.github.com/repos/hyunsik/tajo/pulls{/number}","milestones_url":"https://api.github.com/repos/hyunsik/tajo/milestones{/number}","notifications_url":"https://api.github.com/repos/hyunsik/tajo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyunsik/tajo/labels{/name}","releases_url":"https://api.github.com/repos/hyunsik/tajo/releases{/id}","created_at":"2014-03-21T07:53:46Z","updated_at":"2015-04-07T06:07:49Z","pushed_at":"2015-09-16T08:38:14Z","git_url":"git://github.com/hyunsik/tajo.git","ssh_url":"git@github.com:hyunsik/tajo.git","clone_url":"https://github.com/hyunsik/tajo.git","svn_url":"https://github.com/hyunsik/tajo","homepage":null,"size":24671,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"8baaa481ee6c627b88ecc21097aaf51f571c4e14","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17971138,"name":"tajo","full_name":"apache/tajo","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/tajo","description":"Mirror of Apache Tajo","fork":false,"url":"https://api.github.com/repos/apache/tajo","forks_url":"https://api.github.com/repos/apache/tajo/forks","keys_url":"https://api.github.com/repos/apache/tajo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/tajo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/tajo/teams","hooks_url":"https://api.github.com/repos/apache/tajo/hooks","issue_events_url":"https://api.github.com/repos/apache/tajo/issues/events{/number}","events_url":"https://api.github.com/repos/apache/tajo/events","assignees_url":"https://api.github.com/repos/apache/tajo/assignees{/user}","branches_url":"https://api.github.com/repos/apache/tajo/branches{/branch}","tags_url":"https://api.github.com/repos/apache/tajo/tags","blobs_url":"https://api.github.com/repos/apache/tajo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/tajo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/tajo/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/tajo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/tajo/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/tajo/languages","stargazers_url":"https://api.github.com/repos/apache/tajo/stargazers","contributors_url":"https://api.github.com/repos/apache/tajo/contributors","subscribers_url":"https://api.github.com/repos/apache/tajo/subscribers","subscription_url":"https://api.github.com/repos/apache/tajo/subscription","commits_url":"https://api.github.com/repos/apache/tajo/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/tajo/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/tajo/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/tajo/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/tajo/contents/{+path}","compare_url":"https://api.github.com/repos/apache/tajo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/tajo/merges","archive_url":"https://api.github.com/repos/apache/tajo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/tajo/downloads","issues_url":"https://api.github.com/repos/apache/tajo/issues{/number}","pulls_url":"https://api.github.com/repos/apache/tajo/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/tajo/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/tajo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/tajo/labels{/name}","releases_url":"https://api.github.com/repos/apache/tajo/releases{/id}","created_at":"2014-03-21T07:00:07Z","updated_at":"2015-08-25T06:25:42Z","pushed_at":"2015-09-16T09:50:35Z","git_url":"git://github.com/apache/tajo.git","ssh_url":"git@github.com:apache/tajo.git","clone_url":"https://github.com/apache/tajo.git","svn_url":"https://github.com/apache/tajo","homepage":null,"size":48777,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":71,"mirror_url":"git://git.apache.org/tajo.git","open_issues_count":57,"forks":71,"open_issues":57,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/tajo/pulls/763"},"html":{"href":"https://github.com/apache/tajo/pull/763"},"issue":{"href":"https://api.github.com/repos/apache/tajo/issues/763"},"comments":{"href":"https://api.github.com/repos/apache/tajo/issues/763/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/tajo/pulls/763/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/tajo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/tajo/pulls/763/commits"},"statuses":{"href":"https://api.github.com/repos/apache/tajo/statuses/22ddc15685ae921e535a4b507583f03d65db234f"}}}}