if (logUploadedTime != -1) { out.print("Log Upload Time:"); out.println(Times.format(logUploadedTime));
private static List<ContainerLogFileInfo> getContainerLogsInfo( ContainerId id, String remoteUser, Context nmContext) throws YarnException { List<ContainerLogFileInfo> logFiles = new ArrayList<>(); List<File> logDirs = ContainerLogsUtils.getContainerLogDirs( id, remoteUser, nmContext); for (File containerLogsDir : logDirs) { File[] logs = containerLogsDir.listFiles(); if (logs != null) { for (File log : logs) { if (log.isFile()) { ContainerLogFileInfo logMeta = new ContainerLogFileInfo( log.getName(), Long.toString(log.length()), Times.format(log.lastModified())); logFiles.add(logMeta); } } } } return logFiles; } }
if (logUploadedTime != -1) { out.print("Log Upload Time:"); out.println(Times.format(logUploadedTime));
/** * Lists the containers matching the given application attempts * * @param appAttemptId * @throws YarnException * @throws IOException */ private void listContainers(String appAttemptId) throws YarnException, IOException { PrintWriter writer = new PrintWriter( new OutputStreamWriter(sysout, Charset.forName("UTF-8"))); List<ContainerReport> appsReport = client.getContainers( ApplicationAttemptId.fromString(appAttemptId)); writer.println("Total number of containers " + ":" + appsReport.size()); writer.printf(CONTAINER_PATTERN, "Container-Id", "Start Time", "Finish Time", "State", "Host", "Node Http Address", "LOG-URL"); for (ContainerReport containerReport : appsReport) { writer.printf( CONTAINER_PATTERN, containerReport.getContainerId(), Times.format(containerReport.getCreationTime()), Times.format(containerReport.getFinishTime()), containerReport.getContainerState(), containerReport .getAssignedNode(), containerReport.getNodeHttpAddress() == null ? "N/A" : containerReport.getNodeHttpAddress(), containerReport.getLogUrl()); } writer.flush(); }
/** * Lists the containers matching the given application attempts * * @param appAttemptId * @throws YarnException * @throws IOException */ private void listContainers(String appAttemptId) throws YarnException, IOException { PrintWriter writer = new PrintWriter( new OutputStreamWriter(sysout, Charset.forName("UTF-8"))); List<ContainerReport> appsReport = client.getContainers( ApplicationAttemptId.fromString(appAttemptId)); writer.println("Total number of containers " + ":" + appsReport.size()); writer.printf(CONTAINER_PATTERN, "Container-Id", "Start Time", "Finish Time", "State", "Host", "Node Http Address", "LOG-URL"); for (ContainerReport containerReport : appsReport) { writer.printf( CONTAINER_PATTERN, containerReport.getContainerId(), Times.format(containerReport.getCreationTime()), Times.format(containerReport.getFinishTime()), containerReport.getContainerState(), containerReport .getAssignedNode(), containerReport.getNodeHttpAddress() == null ? "N/A" : containerReport.getNodeHttpAddress(), containerReport.getLogUrl()); } writer.flush(); }
System.out.println("LogType:" + logFile); System.out.println("Log Upload Time:" + Times.format(System.currentTimeMillis())); System.out.println("Log Contents:"); try {
/** * The content of this page is the attempts block * @return AttemptsBlock.class */ @Override protected Class<? extends SubView> content() { HistoryInfo info = new HistoryInfo(); info("History Server"). _("BuildVersion", info.getHadoopBuildVersion() + " on " + info.getHadoopVersionBuiltOn()). _("History Server started on", Times.format(info.getStartedOn())); return InfoBlock.class; } }
/** * The content of this page is the attempts block * @return AttemptsBlock.class */ @Override protected Class<? extends SubView> content() { HistoryInfo info = new HistoryInfo(); info("History Server"). _("BuildVersion", info.getHadoopBuildVersion() + " on " + info.getHadoopVersionBuiltOn()). _("History Server started on", Times.format(info.getStartedOn())); return InfoBlock.class; } }
/** * The content of this page is the attempts block * @return AttemptsBlock.class */ @Override protected Class<? extends SubView> content() { HistoryInfo info = new HistoryInfo(); info("History Server"). _("BuildVersion", info.getHadoopBuildVersion() + " on " + info.getHadoopVersionBuiltOn()). _("History Server started on", Times.format(info.getStartedOn())); return InfoBlock.class; } }
+ record.getAppId() + " in NodeManager: " + LogAggregationUtils.getNodeString(record.getNodeId()) + " at " + Times.format(record.getLogUploadTimeStamp()) + "\n");
html.p().__("Log Upload Time: " + Times.format(logUpLoadTime)).__(); html.p().__("Log Length: " + Long.toString(logLength)).__();
html.p().__("Log Type: " + candidate.getFileName()).__(); html.p().__( "Log Upload Time: " + Times.format(candidate.getLastModifiedTime())) .__(); html.p().__("Log Length: " + Long.toString(logLength)).__();
/** * Render the /info page with an overview of current application. */ public void info() { AppInfo info = new AppInfo(app, app.context); info("Application Master Overview"). __("Application ID:", info.getId()). __("Application Name:", info.getName()). __("User:", info.getUser()). __("Started on:", Times.format(info.getStartTime())). __("Elasped: ", org.apache.hadoop.util.StringUtils.formatTime( info.getElapsedTime() )); render(InfoPage.class); }
/** * Render the /info page with an overview of current application. */ public void info() { AppInfo info = new AppInfo(app, app.context); info("Application Master Overview"). _("Application ID:", info.getId()). _("Application Name:", info.getName()). _("User:", info.getUser()). _("Started on:", Times.format(info.getStartTime())). _("Elasped: ", org.apache.hadoop.util.StringUtils.formatTime( info.getElapsedTime() )); render(InfoPage.class); }
/** * Render the /info page with an overview of current application. */ public void info() { AppInfo info = new AppInfo(app, app.context); info("Application Master Overview"). _("Application ID:", info.getId()). _("Application Name:", info.getName()). _("User:", info.getUser()). _("Started on:", Times.format(info.getStartTime())). _("Elasped: ", org.apache.hadoop.util.StringUtils.formatTime( info.getElapsedTime() )); render(InfoPage.class); }
@Override protected void render(Block html) { html._(MetricsOverviewTable.class); ResourceManager rm = getInstance(ResourceManager.class); ClusterInfo cinfo = new ClusterInfo(rm); info("Cluster overview"). _("Cluster ID:", cinfo.getClusterId()). _("ResourceManager state:", cinfo.getState()). _("ResourceManager HA state:", cinfo.getHAState()). _("ResourceManager HA zookeeper connection state:", cinfo.getHAZookeeperConnectionState()). _("ResourceManager RMStateStore:", cinfo.getRMStateStore()). _("ResourceManager started on:", Times.format(cinfo.getStartedOn())). _("ResourceManager version:", cinfo.getRMBuildVersion() + " on " + cinfo.getRMVersionBuiltOn()). _("Hadoop version:", cinfo.getHadoopBuildVersion() + " on " + cinfo.getHadoopVersionBuiltOn()); html._(InfoBlock.class); }
@Override protected void render(Block html) { html._(MetricsOverviewTable.class); ResourceManager rm = getInstance(ResourceManager.class); ClusterInfo cinfo = new ClusterInfo(rm); info("Cluster overview"). _("Cluster ID:", cinfo.getClusterId()). _("ResourceManager state:", cinfo.getState()). _("ResourceManager HA state:", cinfo.getHAState()). _("ResourceManager HA zookeeper connection state:", cinfo.getHAZookeeperConnectionState()). _("ResourceManager RMStateStore:", cinfo.getRMStateStore()). _("ResourceManager started on:", Times.format(cinfo.getStartedOn())). _("ResourceManager version:", cinfo.getRMBuildVersion() + " on " + cinfo.getRMVersionBuiltOn()). _("Hadoop version:", cinfo.getHadoopBuildVersion() + " on " + cinfo.getHadoopVersionBuiltOn()); html._(InfoBlock.class); }
@Override protected void render(Block html) { html.__(MetricsOverviewTable.class); ResourceManager rm = getInstance(ResourceManager.class); ClusterInfo cinfo = new ClusterInfo(rm); info("Cluster overview"). __("Cluster ID:", cinfo.getClusterId()). __("ResourceManager state:", cinfo.getState()). __("ResourceManager HA state:", cinfo.getHAState()). __("ResourceManager HA zookeeper connection state:", cinfo.getHAZookeeperConnectionState()). __("ResourceManager RMStateStore:", cinfo.getRMStateStore()). __("ResourceManager started on:", Times.format(cinfo.getStartedOn())). __("ResourceManager version:", cinfo.getRMBuildVersion() + " on " + cinfo.getRMVersionBuiltOn()). __("Hadoop version:", cinfo.getHadoopBuildVersion() + " on " + cinfo.getHadoopVersionBuiltOn()); html.__(InfoBlock.class); }