当前位置: 首页>>代码示例>>Java>>正文


Java ContainerStartData类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData的典型用法代码示例。如果您正苦于以下问题:Java ContainerStartData类的具体用法?Java ContainerStartData怎么用?Java ContainerStartData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContainerStartData类属于org.apache.hadoop.yarn.server.applicationhistoryservice.records包,在下文中一共展示了ContainerStartData类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@Override
public void containerStarted(ContainerStartData containerStart)
    throws IOException {
  ConcurrentMap<ContainerId, ContainerHistoryData> subMap =
      getSubMap(containerStart.getContainerId().getApplicationAttemptId());
  ContainerHistoryData oldData =
      subMap.putIfAbsent(containerStart.getContainerId(),
        ContainerHistoryData.newInstance(containerStart.getContainerId(),
          containerStart.getAllocatedResource(),
          containerStart.getAssignedNode(), containerStart.getPriority(),
          containerStart.getStartTime(), Long.MAX_VALUE, null,
          Integer.MAX_VALUE, null));
  if (oldData != null) {
    throw new IOException("The start information of container "
        + containerStart.getContainerId() + " is already stored.");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:MemoryApplicationHistoryStore.java

示例2: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@Override
public void containerStarted(ContainerStartData containerStart)
    throws IOException {
  HistoryFileWriter hfWriter =
      getHistoryFileWriter(containerStart.getContainerId()
        .getApplicationAttemptId().getApplicationId());
  assert containerStart instanceof ContainerStartDataPBImpl;
  try {
    hfWriter.writeHistoryData(new HistoryDataKey(containerStart
      .getContainerId().toString(), START_DATA_SUFFIX),
      ((ContainerStartDataPBImpl) containerStart).getProto().toByteArray());
    LOG.info("Start information of container "
        + containerStart.getContainerId() + " is written");
  } catch (IOException e) {
    LOG.error("Error when writing start information of container "
        + containerStart.getContainerId(), e);
    throw e;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:FileSystemApplicationHistoryStore.java

示例3: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@Override
public void containerStarted(ContainerStartData containerStart)
    throws IOException {
  HistoryFileWriter hfWriter =
      getHistoryFileWriter(containerStart.getContainerId()
        .getApplicationAttemptId().getApplicationId());
  assert containerStart instanceof ContainerStartDataPBImpl;
  try {
    hfWriter.writeHistoryData(new HistoryDataKey(containerStart
      .getContainerId().toString(), START_DATA_SUFFIX),
      ((ContainerStartDataPBImpl) containerStart).getProto().toByteArray());
    LOG.info("Start information of container "
        + containerStart.getContainerId() + " is written");
  } catch (IOException e) {
    LOG.error("Error when writing start information of container "
        + containerStart.getContainerId());
    throw e;
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:20,代码来源:FileSystemApplicationHistoryStore.java

示例4: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void containerStarted(RMContainer container) {
  if (historyServiceEnabled) {
    dispatcher.getEventHandler().handle(
      new WritingContainerStartEvent(container.getContainerId(),
        ContainerStartData.newInstance(container.getContainerId(),
          container.getAllocatedResource(), container.getAllocatedNode(),
          container.getAllocatedPriority(), container.getCreationTime())));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:RMApplicationHistoryWriter.java

示例5: mergeContainerHistoryData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
private static void mergeContainerHistoryData(
    ContainerHistoryData historyData, ContainerStartData startData) {
  historyData.setAllocatedResource(startData.getAllocatedResource());
  historyData.setAssignedNode(startData.getAssignedNode());
  historyData.setPriority(startData.getPriority());
  historyData.setStartTime(startData.getStartTime());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:FileSystemApplicationHistoryStore.java

示例6: writeContainerStartData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void writeContainerStartData(ContainerId containerId)
    throws IOException {
  store.containerStarted(ContainerStartData.newInstance(containerId,
    Resource.newInstance(0, 0, 0), NodeId.newInstance("localhost", 0),
    Priority.newInstance(containerId.getId()), 0));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:ApplicationHistoryStoreTestUtils.java

示例7: writeContainerStartData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void writeContainerStartData(ContainerId containerId)
    throws IOException {
  store.containerStarted(ContainerStartData.newInstance(containerId,
    Resource.newInstance(0, 0), NodeId.newInstance("localhost", 0),
    Priority.newInstance(containerId.getId()), 0));
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:8,代码来源:ApplicationHistoryStoreTestUtils.java

示例8: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void containerStarted(RMContainer container) {
  if (historyServiceEnabled) {
    dispatcher.getEventHandler().handle(
      new WritingContainerStartEvent(container.getContainerId(),
        ContainerStartData.newInstance(container.getContainerId(),
          container.getAllocatedResource(), container.getAllocatedNode(),
          container.getAllocatedPriority(), container.getStartTime())));
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:11,代码来源:RMApplicationHistoryWriter.java

示例9: WritingContainerStartEvent

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
public WritingContainerStartEvent(ContainerId containerId,
    ContainerStartData containerStart) {
  super(WritingHistoryEventType.CONTAINER_START);
  this.containerId = containerId;
  this.containerStart = containerStart;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:WritingContainerStartEvent.java

示例10: getContainerStartData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
public ContainerStartData getContainerStartData() {
  return containerStart;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:WritingContainerStartEvent.java

示例11: containerStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
@Override
public void containerStarted(ContainerStartData containerStart)
    throws IOException {
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:NullApplicationHistoryStore.java

示例12: getContainer

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的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

示例13: parseContainerStartData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData; //导入依赖的package包/类
private static ContainerStartData parseContainerStartData(byte[] value)
    throws InvalidProtocolBufferException {
  return new ContainerStartDataPBImpl(
    ContainerStartDataProto.parseFrom(value));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:FileSystemApplicationHistoryStore.java


注:本文中的org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。