Java 类org.apache.hadoop.hdfs.tools.GetConf.Command 实例源码

项目:hadoop    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hadoop    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:aliyun-oss-hadoop-fs    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:big-c    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:big-c    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hadoop-plus    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hadoop-plus    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:FlexMap    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:FlexMap    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hops    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hadoop-TCP    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hadoop-TCP    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hardfs    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hardfs    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hadoop-on-lustre2    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success)
    throws Exception {
  String[] args = new String[1];
  switch (type) {
  case NAMENODE:
    args[0] = Command.NAMENODE.getName();
    break;
  case BACKUP:
    args[0] = Command.BACKUP.getName();
    break;
  case SECONDARY:
    args[0] = Command.SECONDARY.getName();
    break;
  case NNRPCADDRESSES:
    args[0] = Command.NNRPCADDRESSES.getName();
    break;
  }
  return runTool(conf, args, success);
}
项目:hadoop-on-lustre2    文件:TestGetConf.java   
/**
 * Test empty configuration
 */
@Test(timeout=10000)
public void testEmptyConf() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  // Verify getting addresses fails
  getAddressListFromTool(TestType.NAMENODE, conf, false);
  System.out.println(getAddressListFromTool(TestType.BACKUP, conf, false));
  getAddressListFromTool(TestType.SECONDARY, conf, false);
  getAddressListFromTool(TestType.NNRPCADDRESSES, conf, false);
  for (Command cmd : Command.values()) {
    String arg = cmd.getName();
    CommandHandler handler = Command.getHandler(arg);
    assertNotNull("missing handler: " + cmd, handler);
    if (handler.key != null) {
      // First test with configuration missing the required key
      String[] args = {handler.key};
      runTool(conf, args, false);
    }
  }
}
项目:hadoop    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:big-c    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hadoop-plus    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:FlexMap    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hops    文件:TestGetConf.java   
/**
 * Get address list for a given type of address. Command expected to
 * fail if {@code success} is false.
 *
 * @return returns the success or error output from the tool.
 */
private String getAddressListFromTool(TestType type, HdfsConfiguration conf,
    boolean success) throws Exception {
  String[] args = new String[1];
  switch (type) {
    case NAMENODE:
      args[0] = Command.NAMENODE.getName();
      break;
    case NNRPCADDRESSES:
      args[0] = Command.NNRPCADDRESSES.getName();
      break;
  }
  return runTool(conf, args, success);
}
项目:hops    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link
 * Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hadoop-TCP    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hardfs    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}
项目:hadoop-on-lustre2    文件:TestGetConf.java   
/**
 * Tests commands other than {@link Command#NAMENODE}, {@link Command#BACKUP},
 * {@link Command#SECONDARY} and {@link Command#NNRPCADDRESSES}
 */
@Test(timeout=10000)
public void testTool() throws Exception {
  HdfsConfiguration conf = new HdfsConfiguration(false);
  for (Command cmd : Command.values()) {
    CommandHandler handler = Command.getHandler(cmd.getName());
    if (handler.key != null && !"-confKey".equals(cmd.getName())) {
      // Add the key to the conf and ensure tool returns the right value
      String[] args = {cmd.getName()};
      conf.set(handler.key, "value");
      assertTrue(runTool(conf, args, true).contains("value"));
    }
  }
}