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

Tsz Wo Nicholas Sze commented on HDFS-316:
------------------------------------------

Some minor comments:
- Should "maxidleiteration" be "maxidleiterations"?  Or simply call it 
"idleiterations"?
- The patch adds two newNameNodeConnectors method.  One of them is not need 
since it is only used by a newNameNodeConnectors.  Another 
newNameNodeConnectors is only used in TestMover.  So we may reduce two 
newNameNodeConnectors methods as below:
{code}
  public static List<NameNodeConnector> newNameNodeConnectors(
      Collection<URI> namenodes, String name, Path idPath, Configuration conf,
      int maxNotChangedIterations) throws IOException {
    final List<NameNodeConnector> connectors = new ArrayList<NameNodeConnector>(
        namenodes.size());
    for (URI uri : namenodes) {
      NameNodeConnector nnc = new NameNodeConnector(name, uri, idPath,
          null, conf, maxNotChangedIterations);
      nnc.getKeyManager().startBlockKeyUpdater();
      connectors.add(nnc);
    }
    return connectors;
  }

  public static List<NameNodeConnector> newNameNodeConnectors(
      Map<URI, List<Path>> namenodes, String name, Path idPath,
      Configuration conf) throws IOException {
    final List<NameNodeConnector> connectors = new ArrayList<NameNodeConnector>(
        namenodes.size());
    for (Map.Entry<URI, List<Path>> entry : namenodes.entrySet()) {
      NameNodeConnector nnc = new NameNodeConnector(name, entry.getKey(),
          idPath, entry.getValue(), conf, DEFAULT_MAX_NOT_CHANGED_ITERATIONS);
      nnc.getKeyManager().startBlockKeyUpdater();
      connectors.add(nnc);
    }
    return connectors;
  }
{code}
TestMover can be fixed by changing DEFAULT_MAX_NOT_CHANGED_ITERATIONS to public 
and passing it in TestMover.

> Balancer should run for a configurable # of iterations
> ------------------------------------------------------
>
>                 Key: HDFS-316
>                 URL: https://issues.apache.org/jira/browse/HDFS-316
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: balancer & mover
>    Affects Versions: 2.4.1
>            Reporter: Brian Bockelman
>            Assignee: Xiaoyu Yao
>            Priority: Minor
>              Labels: newbie
>         Attachments: HDFS-316.0.patch, HDFS-316.1.patch, HDFS-316.2.patch, 
> HDFS-316.3.patch
>
>
> The balancer currently exits if nothing has changed after 5 iterations.
> Our site would like to constantly balance a stream of incoming data; we would 
> like to be able to set the number of iterations it "does nothing" for before 
> exiting; even better would be if we set it to a negative number and could 
> continuously run this as a daemon.



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

Reply via email to