本文整理汇总了Java中org.apache.hadoop.mapred.gridmix.Statistics.JobStats类的典型用法代码示例。如果您正苦于以下问题:Java JobStats类的具体用法?Java JobStats怎么用?Java JobStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JobStats类属于org.apache.hadoop.mapred.gridmix.Statistics包,在下文中一共展示了JobStats类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateFakeJobStats
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
@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);
}
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestGridmixSummary.java
示例2: testJobStats
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
/**
* 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());
}
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestGridmixStatistics.java
示例3: JobMonitor
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
/**
* 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;
}
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:JobMonitor.java
示例4: submissionFailed
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
/**
* 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);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:JobMonitor.java
示例5: processJobState
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
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;
}
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ExecutionSummarizer.java
示例6: process
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
private void process(JobStats stats) {
// process the job run state
processJobState(stats);
// process the tasks information
processJobTasks(stats);
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:ExecutionSummarizer.java
示例7: update
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
@Override
public void update(JobStats item) {
// process only if the simulation has started
if (simulationStartTime > 0) {
process(item);
totalSimulationTime =
System.currentTimeMillis() - getSimulationStartTime();
}
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ExecutionSummarizer.java
示例8: update
import org.apache.hadoop.mapred.gridmix.Statistics.JobStats; //导入依赖的package包/类
/**
* 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();
}
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:SerialJobFactory.java
注:本文中的org.apache.hadoop.mapred.gridmix.Statistics.JobStats类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论