Java Code Examples for org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption#getEnum()

The following examples show how to use org.apache.hadoop.hdfs.server.common.HdfsServerConstants.StartupOption#getEnum() . 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: TestHdfsServerConstants.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Verify that parsing a StartupOption string gives the expected results.
 * If a RollingUpgradeStartupOption is specified than it is also checked.
 *
 * @param value
 * @param expectedOption
 * @param expectedRollupOption optional, may be null.
 */
private static void verifyStartupOptionResult(String value,
    StartupOption expectedOption,
    RollingUpgradeStartupOption expectedRollupOption) {

  StartupOption option = StartupOption.getEnum(value);
  assertEquals(expectedOption, option);

  if (expectedRollupOption != null) {
    assertEquals(expectedRollupOption, option.getRollingUpgradeStartupOption());
  }
}
 
Example 2
Source File: TestHdfsServerConstants.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Verify that parsing a StartupOption string gives the expected results.
 * If a RollingUpgradeStartupOption is specified than it is also checked.
 *
 * @param value
 * @param expectedOption
 * @param expectedRollupOption optional, may be null.
 */
private static void verifyStartupOptionResult(String value,
    StartupOption expectedOption,
    RollingUpgradeStartupOption expectedRollupOption) {

  StartupOption option = StartupOption.getEnum(value);
  assertEquals(expectedOption, option);

  if (expectedRollupOption != null) {
    assertEquals(expectedRollupOption, option.getRollingUpgradeStartupOption());
  }
}
 
Example 3
Source File: DataNode.java    From hadoop with Apache License 2.0 4 votes vote down vote up
static StartupOption getStartupOption(Configuration conf) {
  String value = conf.get(DFS_DATANODE_STARTUP_KEY,
                          StartupOption.REGULAR.toString());
  return StartupOption.getEnum(value);
}
 
Example 4
Source File: DataNode.java    From big-c with Apache License 2.0 4 votes vote down vote up
static StartupOption getStartupOption(Configuration conf) {
  String value = conf.get(DFS_DATANODE_STARTUP_KEY,
                          StartupOption.REGULAR.toString());
  return StartupOption.getEnum(value);
}