[
https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632674#comment-14632674
]
ASF GitHub Bot commented on TAJO-1670:
--------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/621#discussion_r34954132
--- Diff:
tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java ---
@@ -98,33 +106,49 @@ public SessionConnection(@NotNull ServiceTracker
tracker, @Nullable String baseD
this.manager.setRetries(properties.getInt(RpcConstants.RPC_CLIENT_RETRY_MAX,
RpcConstants.DEFAULT_RPC_RETRIES));
this.userInfo = UserRoleInfo.getCurrentUser();
- try {
- this.client = getTajoMasterConnection();
- } catch (ServiceException e) {
- throw new IOException(e);
- }
+ this.client = getTajoMasterConnection();
}
public Map<String, String> getClientSideSessionVars() {
return Collections.unmodifiableMap(sessionVarsCache);
}
- public synchronized NettyClientBase getTajoMasterConnection() throws
ServiceException {
- if (client != null && client.isConnected()) return client;
- else {
+ public synchronized NettyClientBase getTajoMasterConnection() throws
SQLException {
+
+ if (client != null && client.isConnected()) {
+ return client;
+ } else {
+
try {
RpcClientManager.cleanup(client);
+
// Client do not closed on idle state for support high available
- this.client = manager.newClient(getTajoMasterAddr(),
TajoMasterClientProtocol.class, false,
- manager.getRetries(), 0, TimeUnit.SECONDS, false);
+ this.client = manager.newClient(
+ getTajoMasterAddr(),
+ TajoMasterClientProtocol.class,
+ false,
+ manager.getRetries(),
+ 0,
+ TimeUnit.SECONDS,
+ false);
connections.incrementAndGet();
- } catch (Exception e) {
- throw new ServiceException(e);
+
+ } catch (Throwable t) {
+ throw SQLExceptionUtil.makeUnableToEstablishConnection(t);
}
+
return client;
}
}
+ protected BlockingInterface getTMStub() throws SQLException {
--- End diff --
As I mentioned above, I think abbreviation is not intuitive because it can
be understood in various ways.
> Refactor client errors and exceptions
> -------------------------------------
>
> Key: TAJO-1670
> URL: https://issues.apache.org/jira/browse/TAJO-1670
> Project: Tajo
> Issue Type: Sub-task
> Components: Java Client, TajoMaster, Worker
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.11.0
>
>
> The main objective is to refactor the error and exception system in client
> side and its connected parts like TajoMaster.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)