本文整理汇总了Java中org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData类的典型用法代码示例。如果您正苦于以下问题:Java ContainerFinishData类的具体用法?Java ContainerFinishData怎么用?Java ContainerFinishData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContainerFinishData类属于org.apache.hadoop.yarn.server.applicationhistoryservice.records包,在下文中一共展示了ContainerFinishData类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public void containerFinished(ContainerFinishData containerFinish)
throws IOException {
ConcurrentMap<ContainerId, ContainerHistoryData> subMap =
getSubMap(containerFinish.getContainerId().getApplicationAttemptId());
ContainerHistoryData data = subMap.get(containerFinish.getContainerId());
if (data == null) {
throw new IOException("The finish information of container "
+ containerFinish.getContainerId() + " is stored before"
+ " the start information.");
}
// Make the assumption that ContainerState should not be null if
// the finish information is already recorded
if (data.getContainerState() != null) {
throw new IOException("The finish information of container "
+ containerFinish.getContainerId() + " is already stored.");
}
data.setFinishTime(containerFinish.getFinishTime());
data.setDiagnosticsInfo(containerFinish.getDiagnosticsInfo());
data.setContainerExitStatus(containerFinish.getContainerExitStatus());
data.setContainerState(containerFinish.getContainerState());
}
示例2: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public void containerFinished(ContainerFinishData containerFinish)
throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(containerFinish.getContainerId()
.getApplicationAttemptId().getApplicationId());
assert containerFinish instanceof ContainerFinishDataPBImpl;
try {
hfWriter.writeHistoryData(new HistoryDataKey(containerFinish
.getContainerId().toString(), FINISH_DATA_SUFFIX),
((ContainerFinishDataPBImpl) containerFinish).getProto().toByteArray());
LOG.info("Finish information of container "
+ containerFinish.getContainerId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing finish information of container "
+ containerFinish.getContainerId(), e);
}
}
示例3: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public void containerFinished(ContainerFinishData containerFinish)
throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(containerFinish.getContainerId()
.getApplicationAttemptId().getApplicationId());
assert containerFinish instanceof ContainerFinishDataPBImpl;
try {
hfWriter.writeHistoryData(new HistoryDataKey(containerFinish
.getContainerId().toString(), FINISH_DATA_SUFFIX),
((ContainerFinishDataPBImpl) containerFinish).getProto().toByteArray());
LOG.info("Finish information of container "
+ containerFinish.getContainerId() + " is written");
} catch (IOException e) {
LOG.error("Error when writing finish information of container "
+ containerFinish.getContainerId());
}
}
示例4: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void containerFinished(RMContainer container) {
if (historyServiceEnabled) {
dispatcher.getEventHandler().handle(
new WritingContainerFinishEvent(container.getContainerId(),
ContainerFinishData.newInstance(container.getContainerId(),
container.getFinishTime(), container.getDiagnosticsInfo(),
container.getContainerExitStatus(),
container.getContainerState())));
}
}
示例5: mergeContainerHistoryData
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
private static void mergeContainerHistoryData(
ContainerHistoryData historyData, ContainerFinishData finishData) {
historyData.setFinishTime(finishData.getFinishTime());
historyData.setDiagnosticsInfo(finishData.getDiagnosticsInfo());
historyData.setContainerExitStatus(finishData.getContainerExitStatus());
historyData.setContainerState(finishData.getContainerState());
}
示例6: WritingContainerFinishEvent
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
public WritingContainerFinishEvent(ContainerId containerId,
ContainerFinishData containerFinish) {
super(WritingHistoryEventType.CONTAINER_FINISH);
this.containerId = containerId;
this.containerFinish = containerFinish;
}
示例7: getContainerFinishData
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
public ContainerFinishData getContainerFinishData() {
return containerFinish;
}
示例8: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public void containerFinished(ContainerFinishData containerFinish)
throws IOException {
}
示例9: getContainer
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public ContainerHistoryData getContainer(ContainerId containerId)
throws IOException {
HistoryFileReader hfReader =
getHistoryFileReader(containerId.getApplicationAttemptId()
.getApplicationId());
try {
boolean readStartData = false;
boolean readFinishData = false;
ContainerHistoryData historyData =
ContainerHistoryData
.newInstance(containerId, null, null, null, Long.MIN_VALUE,
Long.MAX_VALUE, null, Integer.MAX_VALUE, null);
while ((!readStartData || !readFinishData) && hfReader.hasNext()) {
HistoryFileReader.Entry entry = hfReader.next();
if (entry.key.id.equals(containerId.toString())) {
if (entry.key.suffix.equals(START_DATA_SUFFIX)) {
ContainerStartData startData = parseContainerStartData(entry.value);
mergeContainerHistoryData(historyData, startData);
readStartData = true;
} else if (entry.key.suffix.equals(FINISH_DATA_SUFFIX)) {
ContainerFinishData finishData =
parseContainerFinishData(entry.value);
mergeContainerHistoryData(historyData, finishData);
readFinishData = true;
}
}
}
if (!readStartData && !readFinishData) {
return null;
}
if (!readStartData) {
LOG.warn("Start information is missing for container " + containerId);
}
if (!readFinishData) {
LOG.warn("Finish information is missing for container " + containerId);
}
LOG.info("Completed reading history information of container "
+ containerId);
return historyData;
} catch (IOException e) {
LOG.error("Error when reading history file of container " + containerId, e);
throw e;
} finally {
hfReader.close();
}
}
示例10: parseContainerFinishData
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
private static ContainerFinishData parseContainerFinishData(byte[] value)
throws InvalidProtocolBufferException {
return new ContainerFinishDataPBImpl(
ContainerFinishDataProto.parseFrom(value));
}
示例11: writeContainerFinishData
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
protected void writeContainerFinishData(ContainerId containerId)
throws IOException {
store.containerFinished(ContainerFinishData.newInstance(containerId, 0,
containerId.toString(), 0, ContainerState.COMPLETE));
}