org.apache.hadoop.yarn.api.records.ContainerReport Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.yarn.api.records;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.util.Records;
import java.util.List;
import java.util.Map;
/**
* {@code ContainerReport} is a report of an container.
*
* It includes details such as:
*
* - {@link ContainerId} of the container.
* - Allocated Resources to the container.
* - Assigned Node id.
* - Assigned Priority.
* - Creation Time.
* - Finish Time.
* - Container Exit Status.
* - {@link ContainerState} of the container.
* - Diagnostic information in case of errors.
* - Log URL.
* - nodeHttpAddress
*
*/
@Public
@Unstable
public abstract class ContainerReport {
@Private
@Unstable
public static ContainerReport newInstance(ContainerId containerId,
Resource allocatedResource, NodeId assignedNode, Priority priority,
long creationTime, long finishTime, String diagnosticInfo, String logUrl,
int containerExitStatus, ContainerState containerState,
String nodeHttpAddress) {
return newInstance(containerId, allocatedResource, assignedNode, priority,
creationTime, finishTime, diagnosticInfo, logUrl, containerExitStatus,
containerState, nodeHttpAddress, ExecutionType.GUARANTEED);
}
@Private
@Unstable
public static ContainerReport newInstance(ContainerId containerId,
Resource allocatedResource, NodeId assignedNode, Priority priority,
long creationTime, long finishTime, String diagnosticInfo, String logUrl,
int containerExitStatus, ContainerState containerState,
String nodeHttpAddress, ExecutionType executionType) {
ContainerReport report = Records.newRecord(ContainerReport.class);
report.setContainerId(containerId);
report.setAllocatedResource(allocatedResource);
report.setAssignedNode(assignedNode);
report.setPriority(priority);
report.setCreationTime(creationTime);
report.setFinishTime(finishTime);
report.setDiagnosticsInfo(diagnosticInfo);
report.setLogUrl(logUrl);
report.setContainerExitStatus(containerExitStatus);
report.setContainerState(containerState);
report.setNodeHttpAddress(nodeHttpAddress);
report.setExecutionType(executionType);
return report;
}
/**
* Get the ContainerId
of the container.
*
* @return ContainerId
of the container.
*/
@Public
@Unstable
public abstract ContainerId getContainerId();
@Public
@Unstable
public abstract void setContainerId(ContainerId containerId);
/**
* Get the allocated Resource
of the container.
*
* @return allocated Resource
of the container.
*/
@Public
@Unstable
public abstract Resource getAllocatedResource();
@Public
@Unstable
public abstract void setAllocatedResource(Resource resource);
/**
* Get the allocated NodeId
where container is running.
*
* @return allocated NodeId
where container is running.
*/
@Public
@Unstable
public abstract NodeId getAssignedNode();
@Public
@Unstable
public abstract void setAssignedNode(NodeId nodeId);
/**
* Get the allocated Priority
of the container.
*
* @return allocated Priority
of the container.
*/
@Public
@Unstable
public abstract Priority getPriority();
@Public
@Unstable
public abstract void setPriority(Priority priority);
/**
* Get the creation time of the container.
*
* @return creation time of the container
*/
@Public
@Unstable
public abstract long getCreationTime();
@Public
@Unstable
public abstract void setCreationTime(long creationTime);
/**
* Get the Finish time of the container.
*
* @return Finish time of the container
*/
@Public
@Unstable
public abstract long getFinishTime();
@Public
@Unstable
public abstract void setFinishTime(long finishTime);
/**
* Get the DiagnosticsInfo of the container.
*
* @return DiagnosticsInfo of the container
*/
@Public
@Unstable
public abstract String getDiagnosticsInfo();
@Public
@Unstable
public abstract void setDiagnosticsInfo(String diagnosticsInfo);
/**
* Get the LogURL of the container.
*
* @return LogURL of the container
*/
@Public
@Unstable
public abstract String getLogUrl();
@Public
@Unstable
public abstract void setLogUrl(String logUrl);
/**
* Get the final ContainerState
of the container.
*
* @return final ContainerState
of the container.
*/
@Public
@Unstable
public abstract ContainerState getContainerState();
@Public
@Unstable
public abstract void setContainerState(ContainerState containerState);
/**
* Get the final exit status
of the container.
*
* @return final exit status
of the container.
*/
@Public
@Unstable
public abstract int getContainerExitStatus();
@Public
@Unstable
public abstract void setContainerExitStatus(int containerExitStatus);
/**
* Get exposed ports of the container.
*
* @return the node exposed ports of the container
*/
@Public
@Unstable
public abstract String getExposedPorts();
@Private
@Unstable
public abstract void setExposedPorts(
Map>> ports);
/**
* Get the Node Http address of the container.
*
* @return the node http address of the container
*/
@Public
@Unstable
public abstract String getNodeHttpAddress();
@Private
@Unstable
public abstract void setNodeHttpAddress(String nodeHttpAddress);
/**
* Get the execution type of the container.
*
* @return the execution type of the container
*/
@Public
@Unstable
public abstract ExecutionType getExecutionType();
@Private
@Unstable
public abstract void setExecutionType(ExecutionType executionType);
}