本文整理汇总了Java中org.apache.hadoop.mapred.JobTracker.RetireJobInfo类的典型用法代码示例。如果您正苦于以下问题:Java RetireJobInfo类的具体用法?Java RetireJobInfo怎么用?Java RetireJobInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RetireJobInfo类属于org.apache.hadoop.mapred.JobTracker包,在下文中一共展示了RetireJobInfo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateJobRetire
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
private JobID validateJobRetire(JobConf jobConf, Path inDir, Path outDir,
JobTracker jobtracker) throws IOException {
RunningJob rj = UtilsForTests.runJob(jobConf, inDir, outDir, 0, 0);
rj.waitForCompletion();
assertTrue(rj.isSuccessful());
JobID id = rj.getID();
//wait for job to get retired
waitTillRetire(id, jobtracker);
RetireJobInfo retired = jobtracker.retireJobs.get(id);
assertTrue("History url not set", retired.getHistoryFile() != null &&
retired.getHistoryFile().length() > 0);
assertNotNull("Job is not in cache", jobtracker.getJobStatus(id));
// get the job conf filename
String name = jobtracker.getLocalJobFilePath(id);
File file = new File(name);
assertFalse("JobConf file not deleted", file.exists());
//test redirection
URL jobUrl = new URL(rj.getTrackingURL());
HttpURLConnection conn = (HttpURLConnection) jobUrl.openConnection();
conn.setInstanceFollowRedirects(false);
conn.connect();
assertEquals(HttpURLConnection.HTTP_MOVED_TEMP, conn.getResponseCode());
conn.disconnect();
URL redirectedUrl = new URL(conn.getHeaderField("Location"));
conn = (HttpURLConnection) redirectedUrl.openConnection();
conn.connect();
assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode());
conn.disconnect();
return id;
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:37,代码来源:TestJobRetire.java
示例2: getJobDetailsHistoryLink
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
/**
* Given jobId, resolve the link to jobdetailshistory.jsp
* @param tracker JobTracker
* @param jobId JobID
* @return the link to the page jobdetailshistory.jsp for the job
*/
public static String getJobDetailsHistoryLink(JobTracker tracker,
String jobId) {
RetireJobInfo info = tracker.retireJobs.get(JobID.forName(jobId));
String historyFileUrl = getHistoryFileUrl(info);
String result = (historyFileUrl == null ? "" :
"jobdetailshistory.jsp?jobid=" + jobId + "&logFile=" +
historyFileUrl);
return result;
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:16,代码来源:JSPUtil.java
示例3: getTaskDetailsHistoryLink
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
/**
* Given jobId, taskid resolve the link to taskdetailshistory.jsp
* @param tracker JobTracker
* @param jobId JobID
* @param tid String
* @return the link to the page jobdetailshistory.jsp for the job
*/
public static String getTaskDetailsHistoryLink(JobTracker tracker,
String jobId,
String tid) {
RetireJobInfo info = tracker.retireJobs.get(JobID.forName(jobId));
String historyFileUrl = getHistoryFileUrl(info);
String result = (historyFileUrl == null ? "" :
"taskdetailshistory.jsp?jobid=" + jobId + "&logFile=" +
historyFileUrl + "&taskid=" + tid);
return result;
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:18,代码来源:JSPUtil.java
示例4: getHistoryFileUrl
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
/**
* Obtain history file URL from RetireJobInfo
* @param info RetireJobInfo
* @return corresponding history file url, null if cannot creat one
*/
private static String getHistoryFileUrl(RetireJobInfo info) {
String historyFile = info.getHistoryFile();
String historyFileUrl = null;
if (historyFile != null && !historyFile.equals("")) {
try {
historyFileUrl = URLEncoder.encode(info.getHistoryFile(), "UTF-8");
} catch (UnsupportedEncodingException e) {
LOG.warn("Can't create history url ", e);
}
}
return historyFileUrl;
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:18,代码来源:JSPUtil.java
示例5: generateRetiredJobXml
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void generateRetiredJobXml(JspWriter out, JobTracker tracker, int rowId)
throws IOException {
Iterator<RetireJobInfo> iterator =
tracker.retireJobs.getAll().descendingIterator();
for (int i = 0; i < 100 && iterator.hasNext(); i++) {
RetireJobInfo info = iterator.next();
JobStatus status = info.status;
StringBuilder sb = new StringBuilder();
sb.append("<retired_job rowid=\"" + rowId + "\" jobid=\"" + status.getJobId() + "\">");
sb.append("<jobid>" + status.getJobId() + "</jobid>");
sb.append("<history_url>jobdetailshistory.jsp?jobid=" + status.getJobId()
+ "&logFile="
+ URLEncoder.encode(info.getHistoryFile().toString(), "UTF-8")
+ "</history_url>");
sb.append("<priority>" + status.getJobPriority().toString()
+ "</priority>");
sb.append("<user>" + info.profile.getUser() + "</user>");
sb.append("<name>" + info.profile.getJobName() + "</name>");
sb.append("<run_state>" + JobStatus.getJobRunState(status.getRunState())
+ "</run_state>");
sb.append("<start_time>" + new Date(status.getStartTime())
+ "</start_time>");
sb.append("<finish_time>" + new Date(info.finishTime)
+ "</finish_time>");
sb.append("<map_complete>" + StringUtils.formatPercent(
status.mapProgress(), 2) + "</map_complete>");
sb.append("<reduce_complete>" + StringUtils.formatPercent(
status.reduceProgress(), 2) + "</reduce_complete>");
sb.append("<scheduling_info>" + status.getSchedulingInfo() + "</scheduling_info>");
sb.append("</retired_job>\n");
out.write(sb.toString());
rowId++;
}
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:38,代码来源:JSPUtil.java
示例6: generateRetiredJobTable
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static String generateRetiredJobTable(JobTracker tracker, int rowId)
throws IOException {
StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" class=\"sortable\">\n");
Iterator<RetireJobInfo> iterator =
tracker.retireJobs.getAll().descendingIterator();
if (!iterator.hasNext()) {
sb.append("<tr><td align=\"center\" colspan=\"8\"><i>none</i>" +
"</td></tr>\n");
} else {
sb.append("<tr>");
sb.append("<td><b>Jobid</b></td>");
sb.append("<td><b>Priority</b></td>");
sb.append("<td><b>User</b></td>");
sb.append("<td><b>Name</b></td>");
sb.append("<td><b>State</b></td>");
sb.append("<td><b>Start Time</b></td>");
sb.append("<td><b>Finish Time</b></td>");
sb.append("<td><b>Map % Complete</b></td>");
sb.append("<td><b>Reduce % Complete</b></td>");
sb.append("<td><b>Job Scheduling Information</b></td>");
sb.append("<td><b>Diagnostic Info </b></td>");
sb.append("</tr>\n");
for (int i = 0; i < 100 && iterator.hasNext(); i++) {
RetireJobInfo info = iterator.next();
String historyFile = info.getHistoryFile();
String historyFileUrl = null;
if (historyFile != null && !historyFile.equals("")) {
try {
historyFileUrl = URLEncoder.encode(info.getHistoryFile(), "UTF-8");
} catch (UnsupportedEncodingException e) {
LOG.warn("Can't create history url ", e);
}
}
sb.append("<tr>");
sb.append(
"<td id=\"job_" + rowId + "\">" +
(historyFileUrl == null ? "" :
"<a href=\"jobdetailshistory.jsp?logFile=" + historyFileUrl + "\">") +
info.status.getJobId() + "</a></td>" +
"<td id=\"priority_" + rowId + "\">" +
info.status.getJobPriority().toString() + "</td>" +
"<td id=\"user_" + rowId + "\">" +
HtmlQuoting.quoteHtmlChars(info.profile.getUser()) + "</td>" +
"<td id=\"name_" + rowId + "\">" +
HtmlQuoting.quoteHtmlChars(info.profile.getJobName()) + "</td>" +
"<td>" + JobStatus.getJobRunState(info.status.getRunState())
+ "</td>" +
"<td>" + new Date(info.status.getStartTime()) + "</td>" +
"<td>" + new Date(info.finishTime) + "</td>" +
"<td>" + StringUtils.formatPercent(info.status.mapProgress(), 2)
+ ServletUtil.percentageGraph(info.status.mapProgress() * 100, 80) +
"</td>" +
"<td>" + StringUtils.formatPercent(info.status.reduceProgress(), 2)
+ ServletUtil.percentageGraph(
info.status.reduceProgress() * 100, 80) +
"</td>" +
"<td>" +
HtmlQuoting.quoteHtmlChars(info.status.getSchedulingInfo()) +
"</td>" +
"<td>" + HtmlQuoting.quoteHtmlChars(info.status.getFailureInfo()) +
"</td></tr>\n");
rowId++;
}
}
sb.append("</table>\n");
return sb.toString();
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:79,代码来源:JSPUtil.java
示例7: generateRetiredJobTable
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static String generateRetiredJobTable(JobTracker tracker, int rowId)
throws IOException {
StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\" class=\"tablesorter\">\n");
Iterator<RetireJobInfo> iterator =
tracker.retireJobs.getAll().descendingIterator();
if (!iterator.hasNext()) {
sb.append("<tr><th align=\"center\" colspan=\"8\"><i>none</i>" +
"</th></tr>\n");
} else {
sb.append("<thead><tr>");
sb.append("<th><b>Jobid</b></th>");
sb.append("<th><b>Priority</b></th>");
sb.append("<th><b>User</b></th>");
sb.append("<th><b>Name</b></th>");
sb.append("<th><b>State</b></th>");
sb.append("<th><b>Start Time</b></th>");
sb.append("<th><b>Finish Time</b></th>");
sb.append("<th><b>Map % Complete</b></th>");
sb.append("<th><b>Reduce % Complete</b></th>");
sb.append("<th><b>Job Scheduling Information</b></th>");
sb.append("</tr></thead><tbody>\n");
for (int i = 0; i < 100 && iterator.hasNext(); i++) {
RetireJobInfo info = iterator.next();
String historyFileUrl = getHistoryFileUrl(info);
sb.append("<tr>");
String name = info.profile.getJobName();
String abbreviatedName
= (name.length() > 76 ? name.substring(0,76) + "..." : name);
sb.append(
"<td id=\"job_" + rowId + "\">" +
(historyFileUrl == null ? "" :
"<a href=\"jobdetailshistory.jsp?jobid=" +
info.status.getJobId() + "&logFile=" + historyFileUrl + "\">") +
info.status.getJobId() + "</a></td>" +
"<td id=\"priority_" + rowId + "\">" +
info.status.getJobPriority().toString() + "</td>" +
"<td id=\"user_" + rowId + "\">" + info.profile.getUser()
+ "</td>" +
"<td id=\"name_" + rowId + "\">" + abbreviatedName
+ "</td>" +
"<td>" + JobStatus.getJobRunState(info.status.getRunState())
+ "</td>" +
"<td>" + new Date(info.status.getStartTime()) + "</td>" +
"<td>" + new Date(info.finishTime) + "</td>" +
"<td>" + StringUtils.formatPercent(info.status.mapProgress(), 2)
+ ServletUtil.percentageGraph(info.status.mapProgress() * 100, 80) +
"</td>" +
"<td>" + StringUtils.formatPercent(info.status.reduceProgress(), 2)
+ ServletUtil.percentageGraph(
info.status.reduceProgress() * 100, 80) +
"</td>" +
"<td>" + info.status.getSchedulingInfo() + "</td>" +
"</tr>\n");
rowId++;
}
sb.append("</tbody>");
}
sb.append("</table>\n");
return sb.toString();
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:75,代码来源:JSPUtil.java
示例8: generateRetiredJobTable
import org.apache.hadoop.mapred.JobTracker.RetireJobInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static String generateRetiredJobTable(JobTracker tracker, int rowId)
throws IOException {
StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\">\n");
Iterator<RetireJobInfo> iterator =
tracker.retireJobs.getAll().descendingIterator();
if (!iterator.hasNext()) {
sb.append("<tr><td align=\"center\" colspan=\"8\"><i>none</i>" +
"</td></tr>\n");
} else {
sb.append("<tr>");
sb.append("<td><b>Jobid</b></td>");
sb.append("<td><b>Priority</b></td>");
sb.append("<td><b>User</b></td>");
sb.append("<td><b>Name</b></td>");
sb.append("<td><b>State</b></td>");
sb.append("<td><b>Start Time</b></td>");
sb.append("<td><b>Finish Time</b></td>");
sb.append("<td><b>Map % Complete</b></td>");
sb.append("<td><b>Reduce % Complete</b></td>");
sb.append("<td><b>Job Scheduling Information</b></td>");
sb.append("<td><b>Diagnostic Info </b></td>");
sb.append("</tr>\n");
for (int i = 0; i < 100 && iterator.hasNext(); i++) {
RetireJobInfo info = iterator.next();
String historyFile = info.getHistoryFile();
String historyFileUrl = null;
if (historyFile != null && !historyFile.equals("")) {
try {
historyFileUrl = URLEncoder.encode(info.getHistoryFile(), "UTF-8");
} catch (UnsupportedEncodingException e) {
LOG.warn("Can't create history url ", e);
}
}
sb.append("<tr>");
sb.append(
"<td id=\"job_" + rowId + "\">" +
(historyFileUrl == null ? "" :
"<a href=\"" + JobHistoryServer.getHistoryUrlPrefix(tracker.conf) +
"/jobdetailshistory.jsp?logFile=" + historyFileUrl + "\">") +
info.status.getJobId() + "</a></td>" +
"<td id=\"priority_" + rowId + "\">" +
info.status.getJobPriority().toString() + "</td>" +
"<td id=\"user_" + rowId + "\">" +
HtmlQuoting.quoteHtmlChars(info.profile.getUser()) + "</td>" +
"<td id=\"name_" + rowId + "\">" +
HtmlQuoting.quoteHtmlChars(info.profile.getJobName()) + "</td>" +
"<td>" + JobStatus.getJobRunState(info.status.getRunState())
+ "</td>" +
"<td>" + new Date(info.status.getStartTime()) + "</td>" +
"<td>" + new Date(info.finishTime) + "</td>" +
"<td>" + StringUtils.formatPercent(info.status.mapProgress(), 2)
+ ServletUtil.percentageGraph(info.status.mapProgress() * 100, 80) +
"</td>" +
"<td>" + StringUtils.formatPercent(info.status.reduceProgress(), 2)
+ ServletUtil.percentageGraph(
info.status.reduceProgress() * 100, 80) +
"</td>" +
"<td>" +
HtmlQuoting.quoteHtmlChars(info.status.getSchedulingInfo()) +
"</td>" +
"<td>" + HtmlQuoting.quoteHtmlChars(info.status.getFailureInfo()) +
"</td></tr>\n");
rowId++;
}
}
sb.append("</table>\n");
return sb.toString();
}
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:80,代码来源:JSPUtil.java
注:本文中的org.apache.hadoop.mapred.JobTracker.RetireJobInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论