Tabnine Logo
GetConf$Command
Code IndexAdd Tabnine to your IDE (free)

How to use
GetConf$Command
in
org.apache.hadoop.hdfs.tools

Best Java code snippets using org.apache.hadoop.hdfs.tools.GetConf$Command (Showing top 9 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

/**
 * Main method that runs the tool for given arguments.
 * @param args arguments
 * @return return status of the command
 */
private int doWork(String[] args) {
 if (args.length >= 1) {
  CommandHandler handler = Command.getHandler(args[0]);
  if (handler != null) {
   return handler.doWork(this,
     Arrays.copyOfRange(args, 1, args.length));
  }
 }
 printUsage();
 return -1;
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * 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);
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * 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);
  }
 }
}

origin: ch.cern.hadoop/hadoop-hdfs

/**
 * 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"));
  }
 }
}
@Test
origin: io.prestosql.hadoop/hadoop-apache

/**
 * Main method that runs the tool for given arguments.
 * @param args arguments
 * @return return status of the command
 */
private int doWork(String[] args) {
 if (args.length >= 1) {
  CommandHandler handler = Command.getHandler(args[0]);
  if (handler != null) {
   return handler.doWork(this,
     Arrays.copyOfRange(args, 1, args.length));
  }
 }
 printUsage();
 return -1;
}
origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Main method that runs the tool for given arguments.
 * @param args arguments
 * @return return status of the command
 */
private int doWork(String[] args) {
 if (args.length >= 1) {
  CommandHandler handler = Command.getHandler(args[0]);
  if (handler != null) {
   return handler.doWork(this,
     Arrays.copyOfRange(args, 1, args.length));
  }
 }
 printUsage();
 return -1;
}
origin: io.prestosql.hadoop/hadoop-apache

@Override
protected void checkArgs(String[] args) {
 if (args.length != 1) {
  throw new HadoopIllegalArgumentException(
    "usage: " + Command.CONFKEY.getUsage());
 }
}
origin: ch.cern.hadoop/hadoop-hdfs

@Override
protected void checkArgs(String[] args) {
 if (args.length != 1) {
  throw new HadoopIllegalArgumentException(
    "usage: " + Command.CONFKEY.getUsage());
 }
}
origin: org.apache.hadoop/hadoop-hdfs

@Override
protected void checkArgs(String[] args) {
 if (args.length != 1) {
  throw new HadoopIllegalArgumentException(
    "usage: " + Command.CONFKEY.getUsage());
 }
}
org.apache.hadoop.hdfs.toolsGetConf$Command

Most used methods

  • getHandler
  • getUsage
  • getName
  • values

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Runner (org.openjdk.jmh.runner)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now