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.
---
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.
---