Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1860

Refactor Rpc clients to take Connection Parameters

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: RPC
    • Labels:
      None

      Description

      Currently, Rpc client implementations only takes few parameters. This refactoring allows rpc clients to take flexible parameters. I also add connection timeout and cleaned up some routines.

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-0.11.0-build #67 (See https://builds.apache.org/job/Tajo-0.11.0-build/67/)
          TAJO-1860: Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 4a22d1da4e0104bdb957b3e0b7131892c1e4b647)

          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java
          • tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java
          • tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java
          • tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java
          • tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java
          • tajo-docs/src/main/sphinx/jdbc_driver.rst
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java
          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java
          • tajo-docs/src/main/sphinx/table_management/tablespaces.rst
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java
          • tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java
          • tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
          • tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java
          • tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java
          • tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java
          • tajo-common/src/main/proto/errors.proto
          • CHANGES
          • tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java
          • tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java
          • tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java
          • tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
          • tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java
          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
          • tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-0.11.0-build #67 (See https://builds.apache.org/job/Tajo-0.11.0-build/67/ ) TAJO-1860 : Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 4a22d1da4e0104bdb957b3e0b7131892c1e4b647) tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java tajo-docs/src/main/sphinx/jdbc_driver.rst tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java tajo-docs/src/main/sphinx/table_management/tablespaces.rst tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java tajo-common/src/main/proto/errors.proto CHANGES tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Tajo-master-build #892 (See https://builds.apache.org/job/Tajo-master-build/892/)
          TAJO-1860: Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 1eb10045908a8c5c6304e10379fa08a68bd61dad)

          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
          • tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java
          • tajo-docs/src/main/sphinx/jdbc_driver.rst
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java
          • tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java
          • tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java
          • tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java
          • tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java
          • tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java
          • tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java
          • tajo-common/src/main/proto/errors.proto
          • tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java
          • tajo-docs/src/main/sphinx/table_management/tablespaces.rst
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
          • tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java
          • tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java
          • tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java
          • tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java
          • tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java
          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java
          • CHANGES
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
          • tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java
          • tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #892 (See https://builds.apache.org/job/Tajo-master-build/892/ ) TAJO-1860 : Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 1eb10045908a8c5c6304e10379fa08a68bd61dad) tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java tajo-docs/src/main/sphinx/jdbc_driver.rst tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java tajo-common/src/main/proto/errors.proto tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java tajo-docs/src/main/sphinx/table_management/tablespaces.rst tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java CHANGES tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java
          Hide
          hyunsik Hyunsik Choi added a comment -

          thanks for the reviews. I committed it to both 0.11.0 and master branches.

          Show
          hyunsik Hyunsik Choi added a comment - thanks for the reviews. I committed it to both 0.11.0 and master branches.
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Tajo-master-CODEGEN-build #532 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/532/)
          TAJO-1860: Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 1eb10045908a8c5c6304e10379fa08a68bd61dad)

          • tajo-common/src/main/proto/errors.proto
          • tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java
          • tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java
          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java
          • tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java
          • CHANGES
          • tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java
          • tajo-docs/src/main/sphinx/jdbc_driver.rst
          • tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java
          • tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java
          • tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java
          • tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java
          • tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java
          • tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java
          • tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java
          • tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java
          • tajo-docs/src/main/sphinx/table_management/tablespaces.rst
          • tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java
          • tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java
          • tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java
          • tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java
          • tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java
          • tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java
          • tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java
          • tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java
          • tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java
          • tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java
          • tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #532 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/532/ ) TAJO-1860 : Refactor Rpc clients to take Connection Parameters. (hyunsik: rev 1eb10045908a8c5c6304e10379fa08a68bd61dad) tajo-common/src/main/proto/errors.proto tajo-common/src/main/java/org/apache/tajo/exception/SQLExceptionUtil.java tajo-core/src/main/java/org/apache/tajo/worker/rule/ConnectivityCheckerRuleForTajoWorker.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/AsyncRpcClient.java tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbcNegative.java tajo-core/src/main/java/org/apache/tajo/master/TajoMaster.java CHANGES tajo-core/src/main/java/org/apache/tajo/worker/TajoWorker.java tajo-client/src/main/java/org/apache/tajo/client/ClientParameterHelper.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java tajo-docs/src/main/sphinx/jdbc_driver.rst tajo-core/src/main/java/org/apache/tajo/master/QueryInProgress.java tajo-client/src/main/java/org/apache/tajo/client/ClientParameters.java tajo-core/src/main/java/org/apache/tajo/worker/TaskManager.java tajo-core/src/main/java/org/apache/tajo/worker/ExecutionBlockContext.java tajo-client/src/main/java/org/apache/tajo/client/v2/LegacyClientDelegate.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestHdfsCommand.java tajo-core/src/main/java/org/apache/tajo/worker/NodeStatusUpdater.java tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMaster.java tajo-core/src/main/java/org/apache/tajo/querymaster/Stage.java tajo-client/src/main/java/org/apache/tajo/client/v2/ClientDelegateFactory.java tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCli.java tajo-client/src/main/java/org/apache/tajo/client/v2/TajoClient.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/TajoCli.java tajo-core/src/main/java/org/apache/tajo/util/RpcParameterFactory.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcClientManager.java tajo-docs/src/main/sphinx/table_management/tablespaces.rst tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcParamFactory.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestRpcClientManager.java tajo-rpc/tajo-rpc-common/src/main/java/org/apache/tajo/rpc/RpcConstants.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/commands/TestExecExternalShellCommand.java tajo-cli/src/main/java/org/apache/tajo/cli/tsql/CliClientParamsFactory.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestDefaultCliOutputFormatter.java tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestBlockingRpc.java tajo-rpc/tajo-rpc-protobuf/src/test/java/org/apache/tajo/rpc/TestAsyncRpc.java tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/ProtoClientChannelInitializer.java tajo-client/src/main/java/org/apache/tajo/client/QueryClientImpl.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java tajo-jdbc/src/test/java/org/apache/tajo/jdbc/TestTajoJdbc.java tajo-core-tests/src/test/java/org/apache/tajo/cli/tsql/TestTajoCliNegatives.java tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/RpcConnectionKey.java tajo-catalog/tajo-catalog-client/src/main/java/org/apache/tajo/catalog/CatalogClient.java tajo-core/src/main/java/org/apache/tajo/querymaster/DefaultTaskScheduler.java
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/tajo/pull/763

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/763
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user jinossy commented on the pull request:

          https://github.com/apache/tajo/pull/763#issuecomment-142466226

          +1 Looks good to me

          Show
          githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/763#issuecomment-142466226 +1 Looks good to me
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/763#issuecomment-142196401

          I fixed bugs and reflected your comments.

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/763#issuecomment-142196401 I fixed bugs and reflected your comments.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user hyunsik commented on the pull request:

          https://github.com/apache/tajo/pull/763#issuecomment-141929448

          I've updated the jdbc documentation.
          http://people.apache.org/~hyunsik/TAJO-1860/jdbc_driver.html

          Show
          githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/763#issuecomment-141929448 I've updated the jdbc documentation. http://people.apache.org/~hyunsik/TAJO-1860/jdbc_driver.html
          Hide
          githubbot ASF GitHub Bot added a comment -

          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.

          Show
          githubbot ASF GitHub Bot added a comment - 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.
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/tajo/pull/763#discussion_r39621315

          — Diff: tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java —
          @@ -18,56 +18,54 @@

          package org.apache.tajo.rpc;

          -import com.google.common.annotations.VisibleForTesting;
          import com.google.protobuf.*;
          import com.google.protobuf.Descriptors.MethodDescriptor;
          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.net.InetSocketAddress;
          +import java.util.Properties;
          import java.util.concurrent.*;
          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 BlockingRpcClient extends NettyClientBase<BlockingRpcClient.ProtoCallFuture> {

          private final Method stubMethod;
          private final ProxyRpcChannel rpcChannel;
          private final NettyChannelInboundHandler handler;

          • @VisibleForTesting
          • BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries)
          • throws NoSuchMethodException, ClassNotFoundException { - 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
            + * @see RpcConstants
            */
          • BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries, long timeout, TimeUnit timeUnit, boolean enablePing,
          • EventLoopGroup eventLoopGroup) throws ClassNotFoundException, NoSuchMethodException {
          • super(rpcConnectionKey, retries);
            + public BlockingRpcClient(EventLoopGroup eventLoopGroup,
            + RpcConnectionKey rpcConnectionKey,
            + Properties connectionParameters)
            + throws ClassNotFoundException, NoSuchMethodException {
            + super(rpcConnectionKey, connectionParameters);

          this.stubMethod = getServiceClass().getMethod("newBlockingStub", BlockingRpcChannel.class);
          this.rpcChannel = new ProxyRpcChannel();
          this.handler = new ClientChannelInboundHandler();

          • init(new ProtoClientChannelInitializer(handler,
          • RpcResponse.getDefaultInstance(),
          • timeUnit.toNanos(timeout),
          • enablePing), eventLoopGroup);
            +
            + 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 –

          You should remove toNanos()

          Show
          githubbot ASF GitHub Bot added a comment - Github user jinossy commented on a diff in the pull request: https://github.com/apache/tajo/pull/763#discussion_r39621315 — Diff: tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/BlockingRpcClient.java — @@ -18,56 +18,54 @@ package org.apache.tajo.rpc; -import com.google.common.annotations.VisibleForTesting; import com.google.protobuf.*; import com.google.protobuf.Descriptors.MethodDescriptor; 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.net.InetSocketAddress; +import java.util.Properties; import java.util.concurrent.*; 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 BlockingRpcClient extends NettyClientBase<BlockingRpcClient.ProtoCallFuture> { private final Method stubMethod; private final ProxyRpcChannel rpcChannel; private final NettyChannelInboundHandler handler; @VisibleForTesting BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries) throws NoSuchMethodException, ClassNotFoundException { - 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 + * @see RpcConstants */ BlockingRpcClient(RpcConnectionKey rpcConnectionKey, int retries, long timeout, TimeUnit timeUnit, boolean enablePing, EventLoopGroup eventLoopGroup) throws ClassNotFoundException, NoSuchMethodException { super(rpcConnectionKey, retries); + public BlockingRpcClient(EventLoopGroup eventLoopGroup, + RpcConnectionKey rpcConnectionKey, + Properties connectionParameters) + throws ClassNotFoundException, NoSuchMethodException { + super(rpcConnectionKey, connectionParameters); this.stubMethod = getServiceClass().getMethod("newBlockingStub", BlockingRpcChannel.class); this.rpcChannel = new ProxyRpcChannel(); this.handler = new ClientChannelInboundHandler(); init(new ProtoClientChannelInitializer(handler, RpcResponse.getDefaultInstance(), timeUnit.toNanos(timeout), enablePing), eventLoopGroup); + + 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 – You should remove toNanos()
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/tajo/pull/763#discussion_r39621292

          — 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 –

          You should remove toNanos()

          Show
          githubbot ASF GitHub Bot added a comment - Github user jinossy commented on a diff in the pull request: https://github.com/apache/tajo/pull/763#discussion_r39621292 — 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 – You should remove toNanos()
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/tajo/pull/763#discussion_r39618433

          — Diff: tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcConnectionParamUtil.java —
          @@ -0,0 +1,40 @@
          +package org.apache.tajo.util;
          — End diff –

          you should add license

          Show
          githubbot ASF GitHub Bot added a comment - Github user jinossy commented on a diff in the pull request: https://github.com/apache/tajo/pull/763#discussion_r39618433 — Diff: tajo-core-tests/src/test/java/org/apache/tajo/util/TestRpcConnectionParamUtil.java — @@ -0,0 +1,40 @@ +package org.apache.tajo.util; — End diff – you should add license
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user hyunsik opened a pull request:

          https://github.com/apache/tajo/pull/763

          TAJO-1860: Refactor Rpc clients to take Connection Parameters.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/hyunsik/tajo TAJO-1860

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/tajo/pull/763.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #763


          commit bfe5d87a788220fd3978616120bfbca32d37d28a
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-14T21:47:41Z

          initial work

          commit 3ce490862315b783e1c9c2552473eba32061afd7
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T00:03:22Z

          Refined APIs.

          commit d54347f64c81e7e6b2df08e4c564ad4cd5d78ab4
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T00:04:37Z

          Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1847

          Conflicts:
          tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java

          commit 598267556fa7819748661a32959c5ca65c3f20d9
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T07:49:16Z

          Completed.

          commit 53f61ed998398dfbc110f14ee69772601d325e8d
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T08:06:20Z

          Add unit tests.

          commit c96626cea85246246d7b3aaa52edab1aacf85ac6
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T08:06:27Z

          Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1847

          commit 03bba84b3a2375137fbc936e6e02659f46613fe4
          Author: Hyunsik Choi <hyunsik@apache.org>
          Date: 2015-09-16T08:22:18Z

          Removed unnecessary routine.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/763 TAJO-1860 : Refactor Rpc clients to take Connection Parameters. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-1860 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/763.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #763 commit bfe5d87a788220fd3978616120bfbca32d37d28a Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-14T21:47:41Z initial work commit 3ce490862315b783e1c9c2552473eba32061afd7 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T00:03:22Z Refined APIs. commit d54347f64c81e7e6b2df08e4c564ad4cd5d78ab4 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T00:04:37Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1847 Conflicts: tajo-rpc/tajo-rpc-protobuf/src/main/java/org/apache/tajo/rpc/NettyClientBase.java commit 598267556fa7819748661a32959c5ca65c3f20d9 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T07:49:16Z Completed. commit 53f61ed998398dfbc110f14ee69772601d325e8d Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T08:06:20Z Add unit tests. commit c96626cea85246246d7b3aaa52edab1aacf85ac6 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T08:06:27Z Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into TAJO-1847 commit 03bba84b3a2375137fbc936e6e02659f46613fe4 Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-09-16T08:22:18Z Removed unnecessary routine.

            People

            • Assignee:
              hyunsik Hyunsik Choi
              Reporter:
              hyunsik Hyunsik Choi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development