• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ApplicationAttemptHistoryData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: convertToApplicationReport

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
private ApplicationReport convertToApplicationReport(
    ApplicationHistoryData appHistory) throws IOException {
  ApplicationAttemptId currentApplicationAttemptId = null;
  String trackingUrl = UNAVAILABLE;
  String host = UNAVAILABLE;
  int rpcPort = -1;

  ApplicationAttemptHistoryData lastAttempt =
      getLastAttempt(appHistory.getApplicationId());
  if (lastAttempt != null) {
    currentApplicationAttemptId = lastAttempt.getApplicationAttemptId();
    trackingUrl = lastAttempt.getTrackingURL();
    host = lastAttempt.getHost();
    rpcPort = lastAttempt.getRPCPort();
  }
  return ApplicationReport.newInstance(appHistory.getApplicationId(),
    currentApplicationAttemptId, appHistory.getUser(), appHistory.getQueue(),
    appHistory.getApplicationName(), host, rpcPort, null,
    appHistory.getYarnApplicationState(), appHistory.getDiagnosticsInfo(),
    trackingUrl, appHistory.getStartTime(), appHistory.getFinishTime(),
    appHistory.getFinalApplicationStatus(), null, "", 100,
    appHistory.getApplicationType(), null);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:ApplicationHistoryManagerImpl.java


示例2: getLastAttempt

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
private ApplicationAttemptHistoryData getLastAttempt(ApplicationId appId)
    throws IOException {
  Map<ApplicationAttemptId, ApplicationAttemptHistoryData> attempts =
      historyStore.getApplicationAttempts(appId);
  ApplicationAttemptId prevMaxAttemptId = null;
  for (ApplicationAttemptId attemptId : attempts.keySet()) {
    if (prevMaxAttemptId == null) {
      prevMaxAttemptId = attemptId;
    } else {
      if (prevMaxAttemptId.getAttemptId() < attemptId.getAttemptId()) {
        prevMaxAttemptId = attemptId;
      }
    }
  }
  return attempts.get(prevMaxAttemptId);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:ApplicationHistoryManagerImpl.java


示例3: applicationAttemptStarted

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public void applicationAttemptStarted(
    ApplicationAttemptStartData appAttemptStart) throws IOException {
  ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
      getSubMap(appAttemptStart.getApplicationAttemptId().getApplicationId());
  ApplicationAttemptHistoryData oldData =
      subMap.putIfAbsent(appAttemptStart.getApplicationAttemptId(),
        ApplicationAttemptHistoryData.newInstance(
          appAttemptStart.getApplicationAttemptId(),
          appAttemptStart.getHost(), appAttemptStart.getRPCPort(),
          appAttemptStart.getMasterContainerId(), null, null, null, null));
  if (oldData != null) {
    throw new IOException("The start information of application attempt "
        + appAttemptStart.getApplicationAttemptId() + " is already stored.");
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:MemoryApplicationHistoryStore.java


示例4: applicationAttemptFinished

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public void applicationAttemptFinished(
    ApplicationAttemptFinishData appAttemptFinish) throws IOException {
  ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
      getSubMap(appAttemptFinish.getApplicationAttemptId().getApplicationId());
  ApplicationAttemptHistoryData data =
      subMap.get(appAttemptFinish.getApplicationAttemptId());
  if (data == null) {
    throw new IOException("The finish information of application attempt "
        + appAttemptFinish.getApplicationAttemptId() + " is stored before"
        + " the start information.");
  }
  // Make the assumption that YarnApplicationAttemptState should not be null
  // if the finish information is already recorded
  if (data.getYarnApplicationAttemptState() != null) {
    throw new IOException("The finish information of application attempt "
        + appAttemptFinish.getApplicationAttemptId() + " is already stored.");
  }
  data.setTrackingURL(appAttemptFinish.getTrackingURL());
  data.setDiagnosticsInfo(appAttemptFinish.getDiagnosticsInfo());
  data
    .setFinalApplicationStatus(appAttemptFinish.getFinalApplicationStatus());
  data.setYarnApplicationAttemptState(appAttemptFinish
    .getYarnApplicationAttemptState());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:26,代码来源:MemoryApplicationHistoryStore.java


示例5: convertToApplicationAttemptReport

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
private ApplicationAttemptReport convertToApplicationAttemptReport(
    ApplicationAttemptHistoryData appAttemptHistory) {
  return ApplicationAttemptReport.newInstance(
    appAttemptHistory.getApplicationAttemptId(), appAttemptHistory.getHost(),
    appAttemptHistory.getRPCPort(), appAttemptHistory.getTrackingURL(), null,
    appAttemptHistory.getDiagnosticsInfo(),
    appAttemptHistory.getYarnApplicationAttemptState(),
    appAttemptHistory.getMasterContainerId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ApplicationHistoryManagerImpl.java


示例6: getApplicationAttempts

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public Map<ApplicationAttemptId, ApplicationAttemptReport>
    getApplicationAttempts(ApplicationId appId) throws IOException {
  Map<ApplicationAttemptId, ApplicationAttemptHistoryData> histData =
      historyStore.getApplicationAttempts(appId);
  HashMap<ApplicationAttemptId, ApplicationAttemptReport> applicationAttemptsReport =
      new HashMap<ApplicationAttemptId, ApplicationAttemptReport>();
  for (Entry<ApplicationAttemptId, ApplicationAttemptHistoryData> entry : histData
    .entrySet()) {
    applicationAttemptsReport.put(entry.getKey(),
      convertToApplicationAttemptReport(entry.getValue()));
  }
  return applicationAttemptsReport;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:ApplicationHistoryManagerImpl.java


示例7: getApplicationAttempts

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public Map<ApplicationAttemptId, ApplicationAttemptHistoryData>
    getApplicationAttempts(ApplicationId appId) {
  ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
      applicationAttemptData.get(appId);
  if (subMap == null) {
    return Collections
      .<ApplicationAttemptId, ApplicationAttemptHistoryData> emptyMap();
  } else {
    return new HashMap<ApplicationAttemptId, ApplicationAttemptHistoryData>(
      subMap);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:MemoryApplicationHistoryStore.java


示例8: getApplicationAttempt

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public ApplicationAttemptHistoryData getApplicationAttempt(
    ApplicationAttemptId appAttemptId) {
  ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
      applicationAttemptData.get(appAttemptId.getApplicationId());
  if (subMap == null) {
    return null;
  } else {
    return subMap.get(appAttemptId);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:MemoryApplicationHistoryStore.java


示例9: getAMContainer

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public ContainerHistoryData getAMContainer(ApplicationAttemptId appAttemptId) {
  ApplicationAttemptHistoryData appAttempt =
      getApplicationAttempt(appAttemptId);
  if (appAttempt == null || appAttempt.getMasterContainerId() == null) {
    return null;
  } else {
    return getContainer(appAttempt.getMasterContainerId());
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:MemoryApplicationHistoryStore.java


示例10: getSubMap

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
private ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData>
    getSubMap(ApplicationId appId) {
  applicationAttemptData
    .putIfAbsent(
      appId,
      new ConcurrentHashMap<ApplicationAttemptId, ApplicationAttemptHistoryData>());
  return applicationAttemptData.get(appId);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:MemoryApplicationHistoryStore.java


示例11: getAMContainer

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
@Override
public ContainerHistoryData getAMContainer(ApplicationAttemptId appAttemptId)
    throws IOException {
  ApplicationAttemptHistoryData attemptHistoryData =
      getApplicationAttempt(appAttemptId);
  if (attemptHistoryData == null
      || attemptHistoryData.getMasterContainerId() == null) {
    return null;
  }
  return getContainer(attemptHistoryData.getMasterContainerId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:FileSystemApplicationHistoryStore.java


示例12: mergeApplicationAttemptHistoryData

import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ApplicationAttemptHistoryData; //导入依赖的package包/类
private static void mergeApplicationAttemptHistoryData(
    ApplicationAttemptHistoryData historyData,
    ApplicationAttemptStartData startData) {
  historyData.setHost(startData.getHost());
  historyData.setRPCPort(startData.getRPCPort());
  historyData.setMasterContainerId(startData.getMasterContainerId());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:FileSystemApplicationHistoryStore.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Requirement类代码示例发布时间:2022-05-22
下一篇:
Java SiteVisibility类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap