You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by jinossy <gi...@git.apache.org> on 2014/08/26 11:45:29 UTC

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

GitHub user jinossy opened a pull request:

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

    TAJO-1016: Refactor worker rpc information.

    

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

    $ git pull https://github.com/jinossy/tajo TAJO-1016

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

    https://github.com/apache/tajo/pull/125.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 #125
    
----
commit f922dd181676bb5a62008480744e5d833c9a65c0
Author: jhkim <jh...@apache.org>
Date:   2014-08-26T09:42:58Z

    TAJO-1016: Refactor worker rpc information.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by jinossy <gi...@git.apache.org>.
Github user jinossy commented on the pull request:

    https://github.com/apache/tajo/pull/125#issuecomment-55215256
  
    I’ve rebase this issue


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by hyunsik <gi...@git.apache.org>.
Github user hyunsik commented on the pull request:

    https://github.com/apache/tajo/pull/125#issuecomment-55743207
  
    It's nice code cleanup and refactoring.
    
    It's just wondering. Is there no possibility to cause some potential problem caused by changing hostname to unique worker id?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by hyunsik <gi...@git.apache.org>.
Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/125#discussion_r17600629
  
    --- Diff: tajo-core/src/main/java/org/apache/tajo/master/cluster/WorkerConnectionInfo.java ---
    @@ -0,0 +1,178 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.tajo.master.cluster;
    +
    +import org.apache.tajo.common.ProtoObject;
    +
    +import static org.apache.tajo.TajoProtos.WorkerConnectionInfoProto;
    +
    +public class WorkerConnectionInfo implements ProtoObject<WorkerConnectionInfoProto>, Comparable<WorkerConnectionInfo> {
    +  private WorkerConnectionInfoProto.Builder builder;
    +  /**
    +  * unique worker id
    +  */
    +  private int id;
    +  /**
    +   * Hostname
    +   */
    +  private String host;
    +  /**
    +   * Peer rpc port
    +   */
    +  private int peerRpcPort;
    +  /**
    +   * pull server port
    +   */
    +  private int pullServerPort;
    +  /**
    +   * QueryMaster rpc port
    +   */
    +  private int queryMasterPort;
    +  /**
    +   * the port of client rpc which provides an client API
    +   */
    +  private int clientPort;
    +  /**
    +   * http info port
    +   */
    +  private int httpInfoPort;
    +
    +  public WorkerConnectionInfo() {
    +    builder = WorkerConnectionInfoProto.newBuilder();
    +  }
    +
    +  public WorkerConnectionInfo(WorkerConnectionInfoProto proto) {
    +    this();
    +    this.id = proto.getId();
    +    this.host = proto.getHost();
    +    this.peerRpcPort = proto.getPeerRpcPort();
    +    this.pullServerPort = proto.getPullServerPort();
    +    this.clientPort = proto.getClientPort();
    +    this.httpInfoPort = proto.getHttpInfoPort();
    +    this.queryMasterPort = proto.getQueryMasterPort();
    +  }
    +
    +  public WorkerConnectionInfo(String host, int peerRpcPort, int pullServerPort, int clientPort,
    +                              int queryMasterPort, int httpInfoPort) {
    +    this();
    +    this.host = host;
    +    this.peerRpcPort = peerRpcPort;
    +    this.pullServerPort = pullServerPort;
    +    this.clientPort = clientPort;
    +    this.queryMasterPort = queryMasterPort;
    +    this.httpInfoPort = httpInfoPort;
    +    this.id = hashCode();
    +  }
    +
    +  public String getHost() {
    +    return host;
    +  }
    +
    +  public int getPeerRpcPort() {
    +    return peerRpcPort;
    +  }
    +
    +  public int getPullServerPort() {
    +    return pullServerPort;
    +  }
    +
    +  public int getQueryMasterPort() {
    +    return queryMasterPort;
    +  }
    +
    +  public int getClientPort() {
    +    return clientPort;
    +  }
    +
    +  public int getHttpInfoPort() {
    +    return httpInfoPort;
    +  }
    +
    +  public int getId() {
    +    return id;
    +  }
    +
    +  public String getHostAndPeerRpcPort() {
    +    return this.getHost() + ":" + this.getPeerRpcPort();
    +  }
    +
    +  @Override
    +  public WorkerConnectionInfoProto getProto() {
    +    builder.setId(id)
    --- End diff --
    
    It reuses builder. Recently, we've experienced race condition of builder object. Is there no possibility of concurrency problem?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by hyunsik <gi...@git.apache.org>.
Github user hyunsik commented on the pull request:

    https://github.com/apache/tajo/pull/125#issuecomment-56182860
  
    +1
    Ship it!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by hyunsik <gi...@git.apache.org>.
Github user hyunsik commented on the pull request:

    https://github.com/apache/tajo/pull/125#issuecomment-55072664
  
    It also needs rebase.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tajo pull request: TAJO-1016: Refactor worker rpc information.

Posted by jinossy <gi...@git.apache.org>.
Github user jinossy commented on the pull request:

    https://github.com/apache/tajo/pull/125#issuecomment-55856729
  
    @hyunsik Thank you for the review!
    This patch will fix potential problem caused by FQDN. Actually I was tested for 2 month.
    if you still have any problem, I will commit after 0.9.0 release


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---