Examples of run()


Examples of org.apache.hadoop.hdfs.TestAvatarShell.ShortTxidWaitAvatarShell.run()

    // PushbackInputStream processes in reverse order.
    for (int i = input.length - 1; i >= 0; i--) {
      stream.unread(input[i].getBytes());
    }
    ShortTxidWaitAvatarShell shell = new ShortTxidWaitAvatarShell(conf);
    assertEquals(0, shell.run(new String[] { "-failover" }));
    int blocksAfter = blocksInFile();
    assertTrue(blocksBefore == blocksAfter);
  }

  @Test
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.balancer.AvatarBalancer.run()

  private static void runBalancer() throws Exception {
    Configuration bconf = new Configuration(conf);
    bconf.setClass("fs.hdfs.impl", DistributedAvatarFileSystem.class,
        FileSystem.class);
    Balancer b = new AvatarBalancer(bconf);
    assertEquals(0, b.run(new String[] { "-threshold", "1" }));
  }

  @Test
  public void testBasic() throws Exception {
    cluster.startDataNodes(new long[] { CAPACITY }, 1, null, null, conf);
View Full Code Here

Examples of org.apache.hadoop.hdfs.server.balancer.Balancer.Cli.run()

    waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster);

    final String[] args = { "-policy", "datanode" };
    final Tool tool = new Cli();   
    tool.setConf(conf);
    final int r = tool.run(args); // start rebalancing
   
    assertEquals("Tools should exit 0 on success", 0, r);
    waitForHeartBeat(totalUsedSpace, totalCapacity, client, cluster);
    LOG.info("Rebalancing with default ctor.");
    waitForBalancer(totalUsedSpace, totalCapacity, client, cluster);
View Full Code Here

Examples of org.apache.hadoop.hdfs.tools.DFSAdmin.run()

      // Saving image without safe mode should fail
      DFSAdmin admin = new DFSAdmin(conf);
      String[] args = new String[]{"-saveNamespace"};
      try {
        admin.run(args);
      } catch(IOException eIO) {
        assertTrue(eIO.getLocalizedMessage().contains("Safe mode should be turned ON"));
      } catch(Exception e) {
        throw new IOException(e);
      }
View Full Code Here

Examples of org.apache.hadoop.hdfs.tools.DFSHAAdmin.run()

  @Test(timeout=30000)
  public void testManualFailoverWithDFSHAAdmin() throws Exception {
    DFSHAAdmin tool = new DFSHAAdmin();
    tool.setConf(conf);
    assertEquals(0,
        tool.run(new String[]{"-failover", "nn1", "nn2"}));
    waitForHAState(0, HAServiceState.STANDBY);
    waitForHAState(1, HAServiceState.ACTIVE);
    assertEquals(0,
        tool.run(new String[]{"-failover", "nn2", "nn1"}));
    waitForHAState(0, HAServiceState.ACTIVE);
View Full Code Here

Examples of org.apache.hadoop.hdfs.tools.DFSck.run()

    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(bout, true);
    DFSck dfsck = new DFSck(getConf(), ps);
    try {
      dfsck.run(dfsckArgs);
    } catch (Exception e) {
      throw new IOException(e);
    }
    ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
    return new BufferedReader(new InputStreamReader(bin));
View Full Code Here

Examples of org.apache.hadoop.hive.ql.Driver.run()

      return new SetProcessor().run(cmd.substring(firstToken.length()).trim()).getResponseCode();
    }

    Driver driver = new HowlDriver();

    int ret = driver.run(cmd).getResponseCode();

    if (ret != 0) {
      driver.close();
      System.exit(ret);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessor.run()

            ((Driver)proc).destroy();
            isHiveQuery = true;
            response = driver.run(cmd);
          } else {
            isHiveQuery = false;
            response = proc.run(cmd_1);
          }

          ret = response.getResponseCode();
          SQLState = response.getSQLState();
          errorMessage = response.getErrorMessage();
View Full Code Here

Examples of org.apache.hadoop.mapred.ExpireUnusedJobFiles.run()

    Thread.sleep(2*THRESHOLD);
    Pattern p = Pattern.compile("^(.+)\\/job_(\\d+)\\.(\\d+)_(\\d+)$");
    ExpireUnusedJobFiles expire = new ExpireUnusedJobFiles(new Clock(), conf,
      new Path(systemDir), p, THRESHOLD);
    expire.run();

    LOG.info("Check dirs under " + systemDir);
    // check if the dirs have been removed
    boolean result;
    for (int i = 0; i < 10; i++) {
View Full Code Here

Examples of org.apache.hadoop.mapred.JobHistory.LogTask.run()

    buf.append(JobHistory.LINE_DELIMITER_CHAR);

    for (PrintWriter out : writers) {
      LogTask task = new LogTask(out, buf.toString());
      if (sync) {
        task.run();
      } else {
        fileManager.addWriteTask(task);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.