tajo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAJO-1670) Refactor client errors and exceptions
Date Mon, 20 Jul 2015 00:32:04 GMT

    [ https://issues.apache.org/jira/browse/TAJO-1670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14632996#comment-14632996
] 

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_r34964536
  
    --- 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 --
    
    Ok. If so, please add a brief comment. 


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

Mime
View raw message