本文整理汇总了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());
}
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:MemoryApplicationHistoryStore.java
示例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);
}
}
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:FileSystemApplicationHistoryStore.java
示例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());
}
}
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:19,代码来源:FileSystemApplicationHistoryStore.java
示例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())));
}
}
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:RMApplicationHistoryWriter.java
示例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());
}
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:FileSystemApplicationHistoryStore.java
示例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;
}
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:WritingContainerFinishEvent.java
示例7: getContainerFinishData
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
public ContainerFinishData getContainerFinishData() {
return containerFinish;
}
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:WritingContainerFinishEvent.java
示例8: containerFinished
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData; //导入依赖的package包/类
@Override
public void containerFinished(ContainerFinishData containerFinish)
throws IOException {
}
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:NullApplicationHistoryStore.java
示例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();
}
}
开发者ID:naver,项目名称:hadoop,代码行数:48,代码来源:FileSystemApplicationHistoryStore.java
示例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));
}
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:FileSystemApplicationHistoryStore.java
示例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));
}
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:ApplicationHistoryStoreTestUtils.java
注:本文中的org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerFinishData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论