Examples of JTClient


Examples of org.apache.hadoop.mapreduce.test.system.JTClient

      public Void run() throws Exception {
        MRCluster myCluster = null;
        try {
          myCluster = MRCluster.createCluster(cluster.getConf());
          myCluster.connect();
          JTClient jt = myCluster.getJTClient();
          String dir = ".";
          checkFileStatus(jt.getFileStatus(dir, true));
          checkFileStatus(jt.listStatus(dir, false, true), dir);
          for (TTClient tt : myCluster.getTTClients()) {
            String[] localDirs = tt.getMapredLocalDirs();
            for (String localDir : localDirs) {
              checkFileStatus(tt.listStatus(localDir, true, false), localDir);
              checkFileStatus(tt.listStatus(localDir, true, true), localDir);
            }
          }
          String systemDir = jt.getClient().getSystemDir().toString();
          checkFileStatus(jt.listStatus(systemDir, false, true), systemDir);
          checkFileStatus(jt.listStatus(jt.getLogDir(), true, true), jt
              .getLogDir());
        } finally {
          if (myCluster != null) {
            myCluster.disconnect();
          }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    UtilsForTests.waitFor(interval+2000);
    String defaultHealthScript = conf.get("mapred.healthChecker.script.path");   
    Assert.assertTrue("Task tracker is not healthy",
        nodeHealthStatus(client, true) == true);
    TaskTrackerStatus status = client.getStatus();
    JTClient jclient = cluster.getJTClient();
    Assert.assertTrue("Failed to move task tracker to healthy list",
        jclient.getProxy().isBlackListed(status.getTrackerName()) == false);       
    Assert.assertTrue("Health script was not set",defaultHealthScript != null);
   
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

        nodeHealthStatus(client, false) == true);
    TaskTrackerStatus status = client.getStatus();
    Assert.assertTrue("The custom error message did not appear",
        status.getHealthStatus().getHealthReport().trim().
        equals(errorMessage));
    JTClient jClient = cluster.getJTClient();   
    Assert.assertTrue("Failed to move task tracker to blacklisted list",
        jClient.getProxy().isBlackListed(status.getTrackerName()) == true);   
  }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

      public Void run() throws Exception {
        MRCluster myCluster = null;
        try {
          myCluster = MRCluster.createCluster(cluster.getConf());
          myCluster.connect();
          JTClient jt = myCluster.getJTClient();
          String dir = ".";
          checkFileStatus(jt.getFileStatus(dir, true));
          checkFileStatus(jt.listStatus(dir, false, true), dir);
          for (TTClient tt : myCluster.getTTClients()) {
            String[] localDirs = tt.getMapredLocalDirs();
            for (String localDir : localDirs) {
              checkFileStatus(tt.listStatus(localDir, true, false), localDir);
              checkFileStatus(tt.listStatus(localDir, true, true), localDir);
            }
          }
          String systemDir = jt.getClient().getSystemDir().toString();
          checkFileStatus(jt.listStatus(systemDir, false, true), systemDir);
          checkFileStatus(jt.listStatus(jt.getLogDir(), true, true), jt
              .getLogDir());
        } finally {
          if (myCluster != null) {
            myCluster.disconnect();
          }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setMaxMapAttempts(1);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);
   
    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);
    Assert.assertNotNull("Job information is null",jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID tAttID = new TaskAttemptID(tID,0);
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setNumReduceTasks(0);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);
    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);   
    Assert.assertNotNull("Job information is null", jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());
    taskAttID = new TaskAttemptID(tID,0);
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
    Collection<TTClient> ttClients = cluster.getTTClients();
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setNumReduceTasks(0);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);

    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);
    Assert.assertNotNull("Job information is null", jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());   
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
   
    Collection<TTClient> ttClients = cluster.getTTClients();
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setNumReduceTasks(0);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);

    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);
    Assert.assertNotNull("Job information is null", jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID tAttID = new TaskAttemptID(tID,0);
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setMaxMapAttempts(1);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);
   
    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);
    Assert.assertNotNull("Job information is null",jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());
    TaskAttemptID tAttID = new TaskAttemptID(tID,0);
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
View Full Code Here

Examples of org.apache.hadoop.mapreduce.test.system.JTClient

    jobConf.setNumReduceTasks(0);
    cleanup(outputDir, conf);
    FileInputFormat.setInputPaths(jobConf, inputDir);
    FileOutputFormat.setOutputPath(jobConf, outputDir);
    JTClient jtClient = cluster.getJTClient();
    JobClient client = jtClient.getClient();
    JTProtocol wovenClient = cluster.getJTClient().getProxy();
    RunningJob runJob = client.submitJob(jobConf);
    JobID id = runJob.getID();
    JobInfo jInfo = wovenClient.getJobInfo(id);   
    Assert.assertNotNull("Job information is null", jInfo);

    Assert.assertTrue("Job has not been started for 1 min.",
        jtClient.isJobStarted(id));

    TaskInfo[] taskInfos = wovenClient.getTaskInfo(id);
    for (TaskInfo taskinfo : taskInfos) {
      if (!taskinfo.isSetupOrCleanup()) {
        taskInfo = taskinfo;
        break;
      }
    }

    Assert.assertTrue("Task has not been started for 1 min.",
        jtClient.isTaskStarted(taskInfo));

    tID = TaskID.downgrade(taskInfo.getTaskID());
    taskAttID = new TaskAttemptID(tID,0);
    FinishTaskControlAction action = new FinishTaskControlAction(tID);
    Collection<TTClient> ttClients = cluster.getTTClients();
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.