Java Code Examples for org.apache.hadoop.yarn.conf.YarnConfiguration#NM_RECOVERY_DIR

The following examples show how to use org.apache.hadoop.yarn.conf.YarnConfiguration#NM_RECOVERY_DIR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeManager.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private void initAndStartRecoveryStore(Configuration conf)
    throws IOException {
  boolean recoveryEnabled = conf.getBoolean(
      YarnConfiguration.NM_RECOVERY_ENABLED,
      YarnConfiguration.DEFAULT_NM_RECOVERY_ENABLED);
  if (recoveryEnabled) {
    FileSystem recoveryFs = FileSystem.getLocal(conf);
    String recoveryDirName = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
    if (recoveryDirName == null) {
      throw new IllegalArgumentException("Recovery is enabled but " +
          YarnConfiguration.NM_RECOVERY_DIR + " is not set.");
    }
    Path recoveryRoot = new Path(recoveryDirName);
    recoveryFs.mkdirs(recoveryRoot, new FsPermission((short)0700));
    nmStore = new NMLeveldbStateStoreService();
  } else {
    nmStore = new NMNullStateStoreService();
  }
  nmStore.init(conf);
  nmStore.start();
}
 
Example 2
Source File: NodeManager.java    From big-c with Apache License 2.0 6 votes vote down vote up
private void initAndStartRecoveryStore(Configuration conf)
    throws IOException {
  boolean recoveryEnabled = conf.getBoolean(
      YarnConfiguration.NM_RECOVERY_ENABLED,
      YarnConfiguration.DEFAULT_NM_RECOVERY_ENABLED);
  if (recoveryEnabled) {
    FileSystem recoveryFs = FileSystem.getLocal(conf);
    String recoveryDirName = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
    if (recoveryDirName == null) {
      throw new IllegalArgumentException("Recovery is enabled but " +
          YarnConfiguration.NM_RECOVERY_DIR + " is not set.");
    }
    Path recoveryRoot = new Path(recoveryDirName);
    recoveryFs.mkdirs(recoveryRoot, new FsPermission((short)0700));
    nmStore = new NMLeveldbStateStoreService();
  } else {
    nmStore = new NMNullStateStoreService();
  }
  nmStore.init(conf);
  nmStore.start();
}
 
Example 3
Source File: NMLeveldbStateStoreService.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private Path createStorageDir(Configuration conf) throws IOException {
  final String storeUri = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
  if (storeUri == null) {
    throw new IOException("No store location directory configured in " +
        YarnConfiguration.NM_RECOVERY_DIR);
  }

  Path root = new Path(storeUri, DB_NAME);
  FileSystem fs = FileSystem.getLocal(conf);
  fs.mkdirs(root, new FsPermission((short)0700));
  return root;
}
 
Example 4
Source File: NMLeveldbStateStoreService.java    From big-c with Apache License 2.0 5 votes vote down vote up
private Path createStorageDir(Configuration conf) throws IOException {
  final String storeUri = conf.get(YarnConfiguration.NM_RECOVERY_DIR);
  if (storeUri == null) {
    throw new IOException("No store location directory configured in " +
        YarnConfiguration.NM_RECOVERY_DIR);
  }

  Path root = new Path(storeUri, DB_NAME);
  FileSystem fs = FileSystem.getLocal(conf);
  fs.mkdirs(root, new FsPermission((short)0700));
  return root;
}