src/main/java/org/apache/hadoop/hdfs/server/namenode/cache/CacheManager.java
public void start(ApplicationConfiguration conf) throws IOException {
    String baseDir = conf.getBaseDir();
    File expectedDbDir = new File(baseDir + "/db");
    if (!expectedDbDir.exists()) {
      FileUtils.forceMkdir(new File(baseDir + "/db"));
    }
    cache =
        DBMaker.fileDB(baseDir + "/db/nna_cache")
            .fileMmapEnableIfSupported()
            .fileMmapPreclearDisable()
            .transactionEnable()
            .closeOnJvmShutdown()
            .cleanerHackEnable()
            .make();
  }
/** Opens and initializes the cache for reading / writing. */
Opens and initializes the cache for reading / writing.
Opens and initializes the cache for reading / writing .
public void start(ApplicationConfiguration conf) throws IOException {
    String baseDir = conf.getBaseDir();
    File expectedDbDir = new File(baseDir + "/db");
    if (!expectedDbDir.exists()) {
      FileUtils.forceMkdir(new File(baseDir + "/db"));
    }
    cache =
        DBMaker.fileDB(baseDir + "/db/nna_cache")
            .fileMmapEnableIfSupported()
            .fileMmapPreclearDisable()
            .transactionEnable()
            .closeOnJvmShutdown()
            .cleanerHackEnable()
            .make();
  }
public void start ( ApplicationConfiguration conf ) throws IOException { String baseDir = conf . getBaseDir ( ) ; File expectedDbDir = new File ( baseDir + "/db" ) ; if ( ! expectedDbDir . exists ( ) ) { FileUtils . forceMkdir ( new File ( baseDir + "/db" ) ) ; } cache = DBMaker . fileDB ( baseDir + "/db/nna_cache" ) . fileMmapEnableIfSupported ( ) . fileMmapPreclearDisable ( ) . transactionEnable ( ) . closeOnJvmShutdown ( ) . cleanerHackEnable ( ) . make ( ) ; }
Opens and initializes the cache for reading / writing.
Opens and initializes the cache for reading / writing .