本文整理汇总了Java中org.apache.hadoop.yarn.util.Times类的典型用法代码示例。如果您正苦于以下问题:Java Times类的具体用法?Java Times怎么用?Java Times使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Times类属于org.apache.hadoop.yarn.util包,在下文中一共展示了Times类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ContainerInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public ContainerInfo(ContainerReport container) {
containerId = container.getContainerId().toString();
if (container.getAllocatedResource() != null) {
allocatedMB = container.getAllocatedResource().getMemory();
allocatedVCores = container.getAllocatedResource().getVirtualCores();
allocatedGCores = container.getAllocatedResource().getGpuCores();
}
if (container.getAssignedNode() != null) {
assignedNodeId = container.getAssignedNode().toString();
}
priority = container.getPriority().getPriority();
startedTime = container.getCreationTime();
finishedTime = container.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
diagnosticsInfo = container.getDiagnosticsInfo();
logUrl = container.getLogUrl();
containerExitStatus = container.getContainerExitStatus();
containerState = container.getContainerState();
nodeHttpAddress = container.getNodeHttpAddress();
}
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:ContainerInfo.java
示例2: AppInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public AppInfo(ApplicationReport app) {
appId = app.getApplicationId().toString();
if (app.getCurrentApplicationAttemptId() != null) {
currentAppAttemptId = app.getCurrentApplicationAttemptId().toString();
}
user = app.getUser();
queue = app.getQueue();
name = app.getName();
type = app.getApplicationType();
host = app.getHost();
rpcPort = app.getRpcPort();
appState = app.getYarnApplicationState();
diagnosticsInfo = app.getDiagnostics();
trackingUrl = app.getTrackingUrl();
originalTrackingUrl = app.getOriginalTrackingUrl();
submittedTime = app.getStartTime();
startedTime = app.getStartTime();
finishedTime = app.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
finalAppStatus = app.getFinalApplicationStatus();
progress = app.getProgress() * 100; // in percent
if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) {
this.applicationTags = CSV_JOINER.join(app.getApplicationTags());
}
}
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:AppInfo.java
示例3: render
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
@Override
protected void render(Block html) {
SCMMetricsInfo metricsInfo = new SCMMetricsInfo(
CleanerMetrics.getInstance(), ClientSCMMetrics.getInstance(),
SharedCacheUploaderMetrics.getInstance());
info("Shared Cache Manager overview").
_("Started on:", Times.format(scm.getStartTime())).
_("Cache hits: ", metricsInfo.getCacheHits()).
_("Cache misses: ", metricsInfo.getCacheMisses()).
_("Cache releases: ", metricsInfo.getCacheReleases()).
_("Accepted uploads: ", metricsInfo.getAcceptedUploads()).
_("Rejected uploads: ", metricsInfo.getRejectUploads()).
_("Deleted files by the cleaner: ", metricsInfo.getTotalDeletedFiles()).
_("Processed files by the cleaner: ", metricsInfo.getTotalProcessedFiles());
html._(InfoBlock.class);
}
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:SCMOverviewPage.java
示例4: render
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
@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 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);
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:AboutBlock.java
示例5: listContainers
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
/**
* 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(ConverterUtils.toApplicationAttemptId(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();
}
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:ApplicationCLI.java
示例6: TaskAttemptInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) {
final TaskAttemptReport report = ta.getReport();
this.type = type.toString();
this.id = MRApps.toString(ta.getID());
this.nodeHttpAddress = ta.getNodeHttpAddress();
this.startTime = report.getStartTime();
this.finishTime = report.getFinishTime();
this.assignedContainerId = ConverterUtils.toString(report.getContainerId());
this.assignedContainer = report.getContainerId();
this.progress = report.getProgress() * 100;
this.status = report.getStateString();
this.state = report.getTaskAttemptState();
this.elapsedTime = Times
.elapsed(this.startTime, this.finishTime, isRunning);
if (this.elapsedTime == -1) {
this.elapsedTime = 0;
}
this.diagnostics = report.getDiagnosticInfo();
this.rack = ta.getNodeRackName();
}
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TaskAttemptInfo.java
示例7: ReduceTaskAttemptInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public ReduceTaskAttemptInfo(TaskAttempt ta, TaskType type) {
super(ta, type, false);
this.shuffleFinishTime = ta.getShuffleFinishTime();
this.mergeFinishTime = ta.getSortFinishTime();
this.elapsedShuffleTime = Times.elapsed(this.startTime,
this.shuffleFinishTime, false);
if (this.elapsedShuffleTime == -1) {
this.elapsedShuffleTime = 0;
}
this.elapsedMergeTime = Times.elapsed(this.shuffleFinishTime,
this.mergeFinishTime, false);
if (this.elapsedMergeTime == -1) {
this.elapsedMergeTime = 0;
}
this.elapsedReduceTime = Times.elapsed(this.mergeFinishTime,
this.finishTime, false);
if (this.elapsedReduceTime == -1) {
this.elapsedReduceTime = 0;
}
}
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:ReduceTaskAttemptInfo.java
示例8: TaskInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public TaskInfo(Task task) {
TaskType ttype = task.getType();
this.type = ttype.toString();
TaskReport report = task.getReport();
this.startTime = report.getStartTime();
this.finishTime = report.getFinishTime();
this.state = report.getTaskState();
this.elapsedTime = Times.elapsed(this.startTime, this.finishTime,
this.state == TaskState.RUNNING);
if (this.elapsedTime == -1) {
this.elapsedTime = 0;
}
this.progress = report.getProgress() * 100;
this.status = report.getStatus();
this.id = MRApps.toString(task.getID());
this.taskNum = task.getID().getId();
this.successful = getSuccessfulAttempt(task);
if (successful != null) {
this.successfulAttempt = MRApps.toString(successful.getID());
} else {
this.successfulAttempt = "";
}
}
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:TaskInfo.java
示例9: ContainerInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public ContainerInfo(ContainerReport container) {
containerId = container.getContainerId().toString();
if (container.getAllocatedResource() != null) {
allocatedMB = container.getAllocatedResource().getMemory();
allocatedVCores = container.getAllocatedResource().getVirtualCores();
}
if (container.getAssignedNode() != null) {
assignedNodeId = container.getAssignedNode().toString();
}
priority = container.getPriority().getPriority();
startedTime = container.getCreationTime();
finishedTime = container.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
diagnosticsInfo = container.getDiagnosticsInfo();
logUrl = container.getLogUrl();
containerExitStatus = container.getContainerExitStatus();
containerState = container.getContainerState();
nodeHttpAddress = container.getNodeHttpAddress();
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:ContainerInfo.java
示例10: render
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
@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);
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:20,代码来源:AboutBlock.java
示例11: AppInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
/**
*
* @param context
*/
public AppInfo(StramAppContext context)
{
this.appId = context.getApplicationID().toString();
this.name = context.getApplicationName();
this.docLink = context.getApplicationDocLink();
this.user = context.getUser().toString();
this.startTime = context.getStartTime();
this.elapsedTime = Times.elapsed(this.startTime, 0);
this.appPath = context.getApplicationPath();
this.appMasterTrackingUrl = context.getAppMasterTrackingUrl();
this.stats = context.getStats();
this.gatewayAddress = context.getGatewayAddress();
this.version = VersionInfo.APEX_VERSION.getBuildVersion();
this.attributes = new TreeMap<>();
for (Map.Entry<Attribute<Object>, Object> entry : AttributeMap.AttributeInitializer.getAllAttributes(context, DAGContext.class).entrySet()) {
this.attributes.put(entry.getKey().getSimpleName(), entry.getKey().codec.toString(entry.getValue()));
}
this.gatewayConnected = context.isGatewayConnected();
this.appDataSources = context.getAppDataSources();
this.metrics = context.getMetrics();
}
开发者ID:apache,项目名称:apex-core,代码行数:26,代码来源:AppInfo.java
示例12: ContainerInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public ContainerInfo(ContainerReport container) {
containerId = container.getContainerId().toString();
if (container.getAllocatedResource() != null) {
allocatedMB = container.getAllocatedResource().getMemory();
allocatedVCores = container.getAllocatedResource().getVirtualCores();
}
if (container.getAssignedNode() != null) {
assignedNodeId = container.getAssignedNode().toString();
}
priority = container.getPriority().getPriority();
startedTime = container.getCreationTime();
finishedTime = container.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
diagnosticsInfo = container.getDiagnosticsInfo();
logUrl = container.getLogUrl();
containerExitStatus = container.getContainerExitStatus();
containerState = container.getContainerState();
}
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:19,代码来源:ContainerInfo.java
示例13: TaskAttemptInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) {
this.type = type.toString();
this.id = MRApps.toString(ta.getID());
this.nodeHttpAddress = ta.getNodeHttpAddress();
this.startTime = ta.getLaunchTime();
this.finishTime = ta.getFinishTime();
this.assignedContainerId = ConverterUtils.toString(ta
.getAssignedContainerID());
this.assignedContainer = ta.getAssignedContainerID();
this.progress = ta.getProgress() * 100;
this.state = ta.getState();
this.elapsedTime = Times
.elapsed(this.startTime, this.finishTime, isRunning);
if (this.elapsedTime == -1) {
this.elapsedTime = 0;
}
List<String> diagnostics = ta.getDiagnostics();
if (diagnostics != null && !diagnostics.isEmpty()) {
StringBuffer b = new StringBuffer();
for (String diag : diagnostics) {
b.append(diag);
}
this.diagnostics = b.toString();
}
this.rack = ta.getNodeRackName();
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:27,代码来源:TaskAttemptInfo.java
示例14: TaskInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public TaskInfo(Task task) {
TaskType ttype = task.getType();
this.type = ttype.toString();
TaskReport report = task.getReport();
this.startTime = report.getStartTime();
this.finishTime = report.getFinishTime();
this.state = report.getTaskState();
this.elapsedTime = Times.elapsed(this.startTime, this.finishTime,
this.state == TaskState.RUNNING);
if (this.elapsedTime == -1) {
this.elapsedTime = 0;
}
this.progress = report.getProgress() * 100;
this.id = MRApps.toString(task.getID());
this.taskNum = task.getID().getId();
this.successful = getSuccessfulAttempt(task);
if (successful != null) {
this.successfulAttempt = MRApps.toString(successful.getID());
} else {
this.successfulAttempt = "";
}
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:23,代码来源:TaskInfo.java
示例15: ContainerInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public ContainerInfo(ContainerReport container) {
containerId = container.getContainerId().toString();
if (container.getAllocatedResource() != null) {
allocatedMB = container.getAllocatedResource().getMemorySize();
allocatedVCores = container.getAllocatedResource().getVirtualCores();
allocatedGPUs = container.getAllocatedResource().getGPUs();
}
if (container.getAssignedNode() != null) {
assignedNodeId = container.getAssignedNode().toString();
}
priority = container.getPriority().getPriority();
startedTime = container.getCreationTime();
finishedTime = container.getFinishTime();
elapsedTime = Times.elapsed(startedTime, finishedTime);
diagnosticsInfo = container.getDiagnosticsInfo();
logUrl = container.getLogUrl();
containerExitStatus = container.getContainerExitStatus();
containerState = container.getContainerState();
nodeHttpAddress = container.getNodeHttpAddress();
}
开发者ID:hopshadoop,项目名称:hops,代码行数:21,代码来源:ContainerInfo.java
示例16: listContainers
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
/**
* 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();
}
开发者ID:hopshadoop,项目名称:hops,代码行数:31,代码来源:ApplicationCLI.java
示例17: TaskAttemptInfo
import org.apache.hadoop.yarn.util.Times; //导入依赖的package包/类
public TaskAttemptInfo(TaskAttempt ta, TaskType type, Boolean isRunning) {
final TaskAttemptReport report = ta.getReport();
this.type = type.toString();
this.id = MRApps.toString(ta.getID());
this.nodeHttpAddress = ta.getNodeHttpAddress();
this.startTime = report.getStartTime();
this.finishTime = report.getFinishTime();
this.assignedContainer = report.getContainerId();
if (assignedContainer != null) {
this.assignedContainerId = assignedContainer.toString();
}
this.progress = report.getProgress() * 100;
this.status = report.getStateString();
this.state = report.getTaskAttemptState();
this.elapsedTime = Times
.elapsed(this.startTime, this.finishTime, isRunning);
if (this.elapsedTime == -1) {
this.elapsedTime = 0;
}
this.diagnostics = report.getDiagnosticInfo();
this.rack = ta.getNodeRackName();
}
开发者ID:hopshadoop,项目名称:hops,代码行数:23,代码来源:TaskAttemptInfo.java
注:本文中的org.apache.hadoop.yarn.util.Times类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论