本文整理汇总了Java中org.apache.hadoop.mapreduce.v2.api.records.AMInfo类的典型用法代码示例。如果您正苦于以下问题:Java AMInfo类的具体用法?Java AMInfo怎么用?Java AMInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AMInfo类属于org.apache.hadoop.mapreduce.v2.api.records包,在下文中一共展示了AMInfo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: verifyJobAttemptsGeneric
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
public void verifyJobAttemptsGeneric(Job job, String nodeHttpAddress,
String nodeId, int id, long startTime, String containerId, String logsLink) {
boolean attemptFound = false;
for (AMInfo amInfo : job.getAMInfos()) {
if (amInfo.getAppAttemptId().getAttemptId() == id) {
attemptFound = true;
String nmHost = amInfo.getNodeManagerHost();
int nmHttpPort = amInfo.getNodeManagerHttpPort();
int nmPort = amInfo.getNodeManagerPort();
WebServicesTestUtils.checkStringMatch("nodeHttpAddress", nmHost + ":"
+ nmHttpPort, nodeHttpAddress);
WebServicesTestUtils.checkStringMatch("nodeId",
NodeId.newInstance(nmHost, nmPort).toString(), nodeId);
assertTrue("startime not greater than 0", startTime > 0);
WebServicesTestUtils.checkStringMatch("containerId", amInfo
.getContainerId().toString(), containerId);
String localLogsLink =ujoin("node", "containerlogs", containerId,
job.getUserName());
assertTrue("logsLink", logsLink.contains(localLogsLink));
}
}
assertTrue("attempt: " + id + " was not found", attemptFound);
}
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:TestAMWebServicesJobs.java
示例2: newJobReport
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
public static JobReport newJobReport(JobId jobId, String jobName,
String userName, JobState state, long submitTime, long startTime, long finishTime,
float setupProgress, float mapProgress, float reduceProgress,
float cleanupProgress, String jobFile, List<AMInfo> amInfos,
boolean isUber, String diagnostics) {
JobReport report = Records.newRecord(JobReport.class);
report.setJobId(jobId);
report.setJobName(jobName);
report.setUser(userName);
report.setJobState(state);
report.setSubmitTime(submitTime);
report.setStartTime(startTime);
report.setFinishTime(finishTime);
report.setSetupProgress(setupProgress);
report.setCleanupProgress(cleanupProgress);
report.setMapProgress(mapProgress);
report.setReduceProgress(reduceProgress);
report.setJobFile(jobFile);
report.setAMInfos(amInfos);
report.setIsUber(isUber);
report.setDiagnostics(diagnostics);
return report;
}
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:MRBuilderUtils.java
示例3: getJobAttempts
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
@GET
@Path("/mapreduce/jobs/{jobid}/jobattempts")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) {
init();
Job job = AMWebServices.getJobFromJobIdString(jid, ctx);
AMAttemptsInfo amAttempts = new AMAttemptsInfo();
for (AMInfo amInfo : job.getAMInfos()) {
AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(job
.getID()), job.getUserName(), uriInfo.getBaseUri().toString(),
webapp.name());
amAttempts.add(attempt);
}
return amAttempts;
}
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:HsWebServices.java
示例4: newJobReport
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
public static JobReport newJobReport(JobId jobId, String jobName,
String userName, JobState state, long submitTime, long startTime, long finishTime,
float setupProgress, float mapProgress, float reduceProgress,
float cleanupProgress, String jobFile, List<AMInfo> amInfos,
boolean isUber, String diagnostics, Priority priority) {
JobReport report = Records.newRecord(JobReport.class);
report.setJobId(jobId);
report.setJobName(jobName);
report.setUser(userName);
report.setJobState(state);
report.setSubmitTime(submitTime);
report.setStartTime(startTime);
report.setFinishTime(finishTime);
report.setSetupProgress(setupProgress);
report.setCleanupProgress(cleanupProgress);
report.setMapProgress(mapProgress);
report.setReduceProgress(reduceProgress);
report.setJobFile(jobFile);
report.setAMInfos(amInfos);
report.setIsUber(isUber);
report.setDiagnostics(diagnostics);
report.setJobPriority(priority);
return report;
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:25,代码来源:MRBuilderUtils.java
示例5: getJobAttempts
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
@GET
@Path("/jobs/{jobid}/jobattempts")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public AMAttemptsInfo getJobAttempts(@PathParam("jobid") String jid) {
init();
Job job = getJobFromJobIdString(jid, appCtx);
AMAttemptsInfo amAttempts = new AMAttemptsInfo();
for (AMInfo amInfo : job.getAMInfos()) {
AMAttemptInfo attempt = new AMAttemptInfo(amInfo, MRApps.toString(
job.getID()), job.getUserName());
amAttempts.add(attempt);
}
return amAttempts;
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:AMWebServices.java
示例6: verifyJobReport
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
private void verifyJobReport(JobReport jr) {
Assert.assertNotNull("JobReport is null", jr);
List<AMInfo> amInfos = jr.getAMInfos();
Assert.assertEquals(1, amInfos.size());
Assert.assertEquals(JobState.RUNNING, jr.getJobState());
AMInfo amInfo = amInfos.get(0);
Assert.assertEquals(MRApp.NM_HOST, amInfo.getNodeManagerHost());
Assert.assertEquals(MRApp.NM_PORT, amInfo.getNodeManagerPort());
Assert.assertEquals(MRApp.NM_HTTP_PORT, amInfo.getNodeManagerHttpPort());
Assert.assertEquals(1, amInfo.getAppAttemptId().getAttemptId());
Assert.assertEquals(1, amInfo.getContainerId().getApplicationAttemptId()
.getAttemptId());
Assert.assertTrue(amInfo.getStartTime() > 0);
Assert.assertEquals(false, jr.isUber());
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestMRClientService.java
示例7: createAMInfo
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
private static AMInfo createAMInfo(int attempt) {
ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(
ApplicationId.newInstance(100, 1), attempt);
ContainerId containerId = ContainerId.newContainerId(appAttemptId, 1);
return MRBuilderUtils.newAMInfo(appAttemptId, System.currentTimeMillis(),
containerId, NM_HOST, NM_PORT, NM_HTTP_PORT);
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:MockJobs.java
示例8: verifyJobReport
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
private void verifyJobReport(JobReport jobReport, JobId jobId) {
List<AMInfo> amInfos = jobReport.getAMInfos();
Assert.assertEquals(1, amInfos.size());
AMInfo amInfo = amInfos.get(0);
ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(jobId.getAppId(), 1);
ContainerId amContainerId = ContainerId.newContainerId(appAttemptId, 1);
Assert.assertEquals(appAttemptId, amInfo.getAppAttemptId());
Assert.assertEquals(amContainerId, amInfo.getContainerId());
Assert.assertTrue(jobReport.getSubmitTime() > 0);
Assert.assertTrue(jobReport.getStartTime() > 0
&& jobReport.getStartTime() >= jobReport.getSubmitTime());
Assert.assertTrue(jobReport.getFinishTime() > 0
&& jobReport.getFinishTime() >= jobReport.getStartTime());
}
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:TestMRJobsWithHistoryService.java
示例9: setAMInfos
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
@Override
public synchronized void setAMInfos(List<AMInfo> amInfos) {
maybeInitBuilder();
if (amInfos == null) {
this.builder.clearAmInfos();
this.amInfos = null;
return;
}
initAMInfos();
this.amInfos.clear();
this.amInfos.addAll(amInfos);
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:JobReportPBImpl.java
示例10: initAMInfos
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
private synchronized void initAMInfos() {
if (this.amInfos != null) {
return;
}
JobReportProtoOrBuilder p = viaProto ? proto : builder;
List<AMInfoProto> list = p.getAmInfosList();
this.amInfos = new ArrayList<AMInfo>();
for (AMInfoProto amInfoProto : list) {
this.amInfos.add(convertFromProtoFormat(amInfoProto));
}
}
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:JobReportPBImpl.java
示例11: addAMInfosToProto
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
private synchronized void addAMInfosToProto() {
maybeInitBuilder();
builder.clearAmInfos();
if (this.amInfos == null)
return;
for (AMInfo amInfo : this.amInfos) {
builder.addAmInfos(convertToProtoFormat(amInfo));
}
}
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:JobReportPBImpl.java
示例12: newAMInfo
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
public static AMInfo newAMInfo(ApplicationAttemptId appAttemptId,
long startTime, ContainerId containerId, String nmHost, int nmPort,
int nmHttpPort) {
AMInfo amInfo = Records.newRecord(AMInfo.class);
amInfo.setAppAttemptId(appAttemptId);
amInfo.setStartTime(startTime);
amInfo.setContainerId(containerId);
amInfo.setNodeManagerHost(nmHost);
amInfo.setNodeManagerPort(nmPort);
amInfo.setNodeManagerHttpPort(nmHttpPort);
return amInfo;
}
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:MRBuilderUtils.java
示例13: getAMInfos
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
@Override
public List<AMInfo> getAMInfos() {
List<AMInfo> amInfos = new LinkedList<AMInfo>();
for (org.apache.hadoop.mapreduce.jobhistory.JobHistoryParser.AMInfo jhAmInfo : jobInfo
.getAMInfos()) {
AMInfo amInfo =
MRBuilderUtils.newAMInfo(jhAmInfo.getAppAttemptId(),
jhAmInfo.getStartTime(), jhAmInfo.getContainerId(),
jhAmInfo.getNodeManagerHost(), jhAmInfo.getNodeManagerPort(),
jhAmInfo.getNodeManagerHttpPort());
amInfos.add(amInfo);
}
return amInfos;
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:CompletedJob.java
示例14: verifyHsJobAttemptsGeneric
import org.apache.hadoop.mapreduce.v2.api.records.AMInfo; //导入依赖的package包/类
public void verifyHsJobAttemptsGeneric(Job job, String nodeHttpAddress,
String nodeId, int id, long startTime, String containerId, String logsLink) {
boolean attemptFound = false;
for (AMInfo amInfo : job.getAMInfos()) {
if (amInfo.getAppAttemptId().getAttemptId() == id) {
attemptFound = true;
String nmHost = amInfo.getNodeManagerHost();
int nmHttpPort = amInfo.getNodeManagerHttpPort();
int nmPort = amInfo.getNodeManagerPort();
WebServicesTestUtils.checkStringMatch("nodeHttpAddress", nmHost + ":"
+ nmHttpPort, nodeHttpAddress);
WebServicesTestUtils.checkStringMatch("nodeId",
NodeId.newInstance(nmHost, nmPort).toString(), nodeId);
assertTrue("startime not greater than 0", startTime > 0);
WebServicesTestUtils.checkStringMatch("containerId", amInfo
.getContainerId().toString(), containerId);
String localLogsLink = join(
"hsmockwebapp",
ujoin("logs", nodeId, containerId, MRApps.toString(job.getID()),
job.getUserName()));
assertTrue("logsLink", logsLink.contains(localLogsLink));
}
}
assertTrue("attempt: " + id + " was not found", attemptFound);
}
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:TestHsWebServicesJobs.java
注:本文中的org.apache.hadoop.mapreduce.v2.api.records.AMInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论