hama-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward J. Yoon (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HAMA-939) Refactoring which was implement using out-of-date status response
Date Tue, 09 Jun 2015 04:26:00 GMT

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

Edward J. Yoon edited comment on HAMA-939 at 6/9/15 4:25 AM:
-------------------------------------------------------------

I also would like to change the register() method like below. Creating root node is in race
condition. Exception also need to be thrown if system can't create root node.

{code}
  @Override
  public void register(BSPJobID jobId, TaskAttemptID taskId,
      String hostAddress, long port) {
    int count = 0;
    String jobRegisterKey = constructKey(jobId, "peers");
    Stat stat = null;
    while (stat != null) {
      try {
        stat = zk.exists(jobRegisterKey, false);
        zk.create(jobRegisterKey, new byte[0], Ids.OPEN_ACL_UNSAFE,
            CreateMode.PERSISTENT);
        Thread.sleep(1000);
      } catch (Exception e) {
        LOG.debug(e); // ignore it.
      }
      count++;

      // retry 10 times.
      if (count > 9) {
        throw new RuntimeException("can't create root node.");
      }
    }
    registerTask(jobId, hostAddress, port, taskId);
  }
{code}


was (Author: udanax):
I also would like to change the register() method like below. Creating root node is in race
condition. Exception also need to be thrown if system can't create root node.

{code}
  @Override
  public void register(BSPJobID jobId, TaskAttemptID taskId,
      String hostAddress, long port) {
    int count = 0;
    String jobRegisterKey = constructKey(jobId, "peers");
    Stat stat = null;
    while (stat != null) {
      try {
        stat = zk.exists(jobRegisterKey, false);
        zk.create(jobRegisterKey, new byte[0], Ids.OPEN_ACL_UNSAFE,
            CreateMode.PERSISTENT);
        Thread.sleep(1000);
      } catch (Exception e) {
        LOG.error(e);
      }
      count++;

      // retry 10 times.
      if (count > 9) {
        throw new RuntimeException("can't create root node.");
      }
    }
    registerTask(jobId, hostAddress, port, taskId);
  }
{code}

> Refactoring which was implement using out-of-date status response
> -----------------------------------------------------------------
>
>                 Key: HAMA-939
>                 URL: https://issues.apache.org/jira/browse/HAMA-939
>             Project: Hama
>          Issue Type: Improvement
>          Components: yarn
>    Affects Versions: 0.7.0
>            Reporter: Minho Kim
>            Assignee: Minho Kim
>             Fix For: 0.7.0
>
>         Attachments: HAMA-939_v1.patch, HAMA-939_v2.patch, HAMA-939_v3.patch
>
>
> Status response handler of current YARN module is out of date.
> So I'm planning to modify status response handler using callback handler of RM and NM.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message