zoukankan      html  css  js  c++  java
  • finalize过程

    之前说过case有两个

     switch (startOpt) {
          case FORMAT:
            boolean aborted = format(conf, true);
            System.exit(aborted ? 1 : 0);
          case FINALIZE:
            aborted = finalize(conf, true);
            System.exit(aborted ? 1 : 0);
          default:
        }

    现在看下finalize:

    private static boolean finalize(Configuration conf,
                                   boolean isConfirmationNeeded
                                   ) throws IOException {
        Collection<File> dirsToFormat = FSNamesystem.getNamespaceDirs(conf);
        Collection<File> editDirsToFormat = 
                                   FSNamesystem.getNamespaceEditsDirs(conf);
        FSNamesystem nsys = new FSNamesystem(new FSImage(dirsToFormat,
                                             editDirsToFormat), conf);
        System.err.print(
            ""finalize" will remove the previous state of the files system.
    "
            + "Recent upgrade will become permanent.
    "
            + "Rollback option will not be available anymore.
    ");
        if (isConfirmationNeeded) {
          System.err.print("Finalize filesystem state ? (Y or N) ");
          if (!(System.in.read() == 'Y')) {
            System.err.println("Finalize aborted.");
            return true;
          }
          while(System.in.read() != '
    '); // discard the enter-key
        }
        nsys.dir.fsImage.finalizeUpgrade();
        return false;
      }

    接下来会牵扯一些rpc相关的.

    问题:

    <property>
      <name>dfs.namenode.handler.count</name>
      <value>10</value>
      <description>The number of server threads for the namenode.</description>
    </property>

  • 相关阅读:
    NEERC 15 (10/12)
    uoj259 & 独立集问题的一些做法
    Berlekamp-Massey算法简单介绍
    树链剖分的一种用法
    长链剖分
    [黑科技]常数优化的一些技巧
    tarjan解决路径询问问题
    Comet OJ
    洛谷P3835 【模板】可持久化平衡树(FHQ Treap)
    LOJ#107. 维护全序集(FHQ Treap)
  • 原文地址:https://www.cnblogs.com/bokun-wang/p/3152909.html
Copyright © 2011-2022 走看看