Java 类org.apache.hadoop.mapred.gridmix.Statistics.JobStats 实例源码

项目:hadoop    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hadoop    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hadoop    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:aliyun-oss-hadoop-fs    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:big-c    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:big-c    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:big-c    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hadoop-plus    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hadoop-plus    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hadoop-plus    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hops    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hops    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hops    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hadoop-TCP    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hadoop-TCP    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hadoop-TCP    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hardfs    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hardfs    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hardfs    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hadoop-on-lustre2    文件:TestGridmixSummary.java   
@SuppressWarnings("deprecation")
private static JobStats generateFakeJobStats(final int numMaps, 
    final int numReds, final boolean isSuccessful, final boolean lost) 
throws IOException {
  // A fake job 
  Job fakeJob = new Job() {
    @Override
    public int getNumReduceTasks() {
      return numReds;
    };

    @Override
    public boolean isSuccessful() throws IOException {
      if (lost) {
        throw new IOException("Test failure!");
      }
      return isSuccessful;
    };
  };
  return new JobStats(numMaps, numReds, fakeJob);
}
项目:hadoop-on-lustre2    文件:TestGridmixStatistics.java   
/**
 * Test {@link Statistics.JobStats}.
 */
@Test
@SuppressWarnings("deprecation")
public void testJobStats() throws Exception {
  Job job = new Job() {};
  JobStats stats = new JobStats(1, 2, job);
  assertEquals("Incorrect num-maps", 1, stats.getNoOfMaps());
  assertEquals("Incorrect num-reds", 2, stats.getNoOfReds());
  assertTrue("Incorrect job", job == stats.getJob());
  assertNull("Unexpected job status", stats.getJobStatus());

  // add a new status
  JobStatus status = new JobStatus();
  stats.updateJobStatus(status);
  assertNotNull("Missing job status", stats.getJobStatus());
  assertTrue("Incorrect job status", status == stats.getJobStatus());
}
项目:hadoop-on-lustre2    文件:TestGridmixStatistics.java   
private static void testJobStats(JobStats stats, int numMaps, int numReds,
                                 JobStatus jStatus, Job job) {
  assertEquals("Incorrect num map tasks", numMaps, stats.getNoOfMaps());
  assertEquals("Incorrect num reduce tasks", numReds, stats.getNoOfReds());

  if (job != null) {
    assertNotNull("Missing job", job);
  }
  // check running job
  assertTrue("Incorrect job", job == stats.getJob());

  if (jStatus != null) {
    assertNotNull("Missing job status", jStatus);
  }
  // check job stats
  assertTrue("Incorrect job status", jStatus == stats.getJobStatus());
}
项目:hadoop    文件:JobMonitor.java   
/**
 * Create a JobMonitor that sleeps for the specified duration after
 * polling a still-running job.
 * @param pollDelay Delay after polling a running job
 * @param unit Time unit for pollDelaySec (rounded to milliseconds)
 * @param statistics StatCollector , listener to job completion.
 */
public JobMonitor(int pollDelay, TimeUnit unit, Statistics statistics, 
                  int numPollingThreads) {
  executor = Executors.newCachedThreadPool();
  this.numPollingThreads = numPollingThreads;
  runningJobs = new LinkedBlockingQueue<JobStats>();
  mJobs = new LinkedList<JobStats>();
  this.pollDelayMillis = TimeUnit.MILLISECONDS.convert(pollDelay, unit);
  this.statistics = statistics;
}
项目:hadoop    文件:JobMonitor.java   
/**
 * Add a submission failed job's status, such that it can be communicated
 * back to serial.
 * TODO: Cleaner solution for this problem
 * @param job
 */
public void submissionFailed(JobStats job) {
  String jobID = job.getJob().getConfiguration().get(Gridmix.ORIGINAL_JOB_ID);
  LOG.info("Job submission failed notification for job " + jobID);
  synchronized (statistics) {
    this.statistics.add(job);
  }
}
项目:hadoop    文件:ExecutionSummarizer.java   
private void processJobState(JobStats stats) {
  Job job = stats.getJob();
  try {
    if (job.isSuccessful()) {
      ++totalSuccessfulJobs;
    } else {
      ++totalFailedJobs;
    }
  } catch (Exception e) {
    // this behavior is consistent with job-monitor which marks the job as 
    // complete (lost) if the status polling bails out
    ++totalLostJobs; 
  }
}
项目:hadoop    文件:ExecutionSummarizer.java   
private void process(JobStats stats) {
  // process the job run state
  processJobState(stats);

  // process the tasks information
  processJobTasks(stats);
}
项目:hadoop    文件:ExecutionSummarizer.java   
@Override
public void update(JobStats item) {
  // process only if the simulation has started
  if (simulationStartTime > 0) {
    process(item);
    totalSimulationTime = 
      System.currentTimeMillis() - getSimulationStartTime();
  }
}
项目:hadoop    文件:SerialJobFactory.java   
/**
 * SERIAL. Once you get notification from StatsCollector about the job
 * completion ,simply notify the waiting thread.
 *
 * @param item
 */
@Override
public void update(Statistics.JobStats item) {
  //simply notify in case of serial submissions. We are just bothered
  //if submitted job is completed or not.
  lock.lock();
  try {
    jobCompleted.signalAll();
  } finally {
    lock.unlock();
  }
}
项目:aliyun-oss-hadoop-fs    文件:JobMonitor.java   
/**
 * Create a JobMonitor that sleeps for the specified duration after
 * polling a still-running job.
 * @param pollDelay Delay after polling a running job
 * @param unit Time unit for pollDelaySec (rounded to milliseconds)
 * @param statistics StatCollector , listener to job completion.
 */
public JobMonitor(int pollDelay, TimeUnit unit, Statistics statistics, 
                  int numPollingThreads) {
  executor = Executors.newCachedThreadPool();
  this.numPollingThreads = numPollingThreads;
  runningJobs = new LinkedBlockingQueue<JobStats>();
  mJobs = new LinkedList<JobStats>();
  this.pollDelayMillis = TimeUnit.MILLISECONDS.convert(pollDelay, unit);
  this.statistics = statistics;
}
项目:aliyun-oss-hadoop-fs    文件:JobMonitor.java   
/**
 * Add a submission failed job's status, such that it can be communicated
 * back to serial.
 * TODO: Cleaner solution for this problem
 * @param job
 */
public void submissionFailed(JobStats job) {
  String jobID = job.getJob().getConfiguration().get(Gridmix.ORIGINAL_JOB_ID);
  LOG.info("Job submission failed notification for job " + jobID);
  synchronized (statistics) {
    this.statistics.add(job);
  }
}
项目:aliyun-oss-hadoop-fs    文件:ExecutionSummarizer.java   
private void processJobState(JobStats stats) {
  Job job = stats.getJob();
  try {
    if (job.isSuccessful()) {
      ++totalSuccessfulJobs;
    } else {
      ++totalFailedJobs;
    }
  } catch (Exception e) {
    // this behavior is consistent with job-monitor which marks the job as 
    // complete (lost) if the status polling bails out
    ++totalLostJobs; 
  }
}
项目:aliyun-oss-hadoop-fs    文件:ExecutionSummarizer.java   
private void process(JobStats stats) {
  // process the job run state
  processJobState(stats);

  // process the tasks information
  processJobTasks(stats);
}
项目:aliyun-oss-hadoop-fs    文件:ExecutionSummarizer.java   
@Override
public void update(JobStats item) {
  // process only if the simulation has started
  if (simulationStartTime > 0) {
    process(item);
    totalSimulationTime = 
      System.currentTimeMillis() - getSimulationStartTime();
  }
}
项目:aliyun-oss-hadoop-fs    文件:SerialJobFactory.java   
/**
 * SERIAL. Once you get notification from StatsCollector about the job
 * completion ,simply notify the waiting thread.
 *
 * @param item
 */
@Override
public void update(Statistics.JobStats item) {
  //simply notify in case of serial submissions. We are just bothered
  //if submitted job is completed or not.
  lock.lock();
  try {
    jobCompleted.signalAll();
  } finally {
    lock.unlock();
  }
}
项目:big-c    文件:JobMonitor.java   
/**
 * Create a JobMonitor that sleeps for the specified duration after
 * polling a still-running job.
 * @param pollDelay Delay after polling a running job
 * @param unit Time unit for pollDelaySec (rounded to milliseconds)
 * @param statistics StatCollector , listener to job completion.
 */
public JobMonitor(int pollDelay, TimeUnit unit, Statistics statistics, 
                  int numPollingThreads) {
  executor = Executors.newCachedThreadPool();
  this.numPollingThreads = numPollingThreads;
  runningJobs = new LinkedBlockingQueue<JobStats>();
  mJobs = new LinkedList<JobStats>();
  this.pollDelayMillis = TimeUnit.MILLISECONDS.convert(pollDelay, unit);
  this.statistics = statistics;
}
项目:big-c    文件:JobMonitor.java   
/**
 * Add a submission failed job's status, such that it can be communicated
 * back to serial.
 * TODO: Cleaner solution for this problem
 * @param job
 */
public void submissionFailed(JobStats job) {
  String jobID = job.getJob().getConfiguration().get(Gridmix.ORIGINAL_JOB_ID);
  LOG.info("Job submission failed notification for job " + jobID);
  synchronized (statistics) {
    this.statistics.add(job);
  }
}
项目:big-c    文件:ExecutionSummarizer.java   
private void processJobState(JobStats stats) {
  Job job = stats.getJob();
  try {
    if (job.isSuccessful()) {
      ++totalSuccessfulJobs;
    } else {
      ++totalFailedJobs;
    }
  } catch (Exception e) {
    // this behavior is consistent with job-monitor which marks the job as 
    // complete (lost) if the status polling bails out
    ++totalLostJobs; 
  }
}