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


Java ApplicationReport.setHost方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.api.records.ApplicationReport.setHost方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationReport.setHost方法的具体用法?Java ApplicationReport.setHost怎么用?Java ApplicationReport.setHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.api.records.ApplicationReport的用法示例。


在下文中一共展示了ApplicationReport.setHost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newApplicationReport

import org.apache.hadoop.yarn.api.records.ApplicationReport; //导入方法依赖的package包/类
public static ApplicationReport newApplicationReport(
    ApplicationId applicationId, ApplicationAttemptId applicationAttemptId,
    String user, String queue, String name, String host, int rpcPort,
    Token clientToAMToken, YarnApplicationState state, String diagnostics,
    String url, long startTime, long finishTime,
    FinalApplicationStatus finalStatus,
    ApplicationResourceUsageReport appResources, String origTrackingUrl,
    float progress, String appType, Token amRmToken, Set<String> tags) {
  ApplicationReport report = recordFactory
      .newRecordInstance(ApplicationReport.class);
  report.setApplicationId(applicationId);
  report.setCurrentApplicationAttemptId(applicationAttemptId);
  report.setUser(user);
  report.setQueue(queue);
  report.setName(name);
  report.setHost(host);
  report.setRpcPort(rpcPort);
  report.setClientToAMToken(clientToAMToken);
  report.setYarnApplicationState(state);
  report.setDiagnostics(diagnostics);
  report.setTrackingUrl(url);
  report.setStartTime(startTime);
  report.setFinishTime(finishTime);
  report.setFinalApplicationStatus(finalStatus);
  report.setApplicationResourceUsageReport(appResources);
  report.setOriginalTrackingUrl(origTrackingUrl);
  report.setProgress(progress);
  report.setApplicationType(appType);
  report.setAMRMToken(amRmToken);
  report.setApplicationTags(tags);
  return report;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:BuilderUtils.java

示例2: getApplicationReport

import org.apache.hadoop.yarn.api.records.ApplicationReport; //导入方法依赖的package包/类
@Override
public GetApplicationReportResponse getApplicationReport(
    GetApplicationReportRequest request) throws IOException {
  ApplicationId applicationId = request.getApplicationId();
  ApplicationReport application = recordFactory
      .newRecordInstance(ApplicationReport.class);
  application.setApplicationId(applicationId);
  application.setFinalApplicationStatus(FinalApplicationStatus.UNDEFINED);
  if (amRunning) {
    application.setYarnApplicationState(YarnApplicationState.RUNNING);
  } else if (amRestarting) {
    application.setYarnApplicationState(YarnApplicationState.SUBMITTED);
  } else {
    application.setYarnApplicationState(YarnApplicationState.FINISHED);
    application.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED);
  }
  String[] split = AMHOSTADDRESS.split(":");
  application.setHost(split[0]);
  application.setRpcPort(Integer.parseInt(split[1]));
  application.setUser("TestClientRedirect-user");
  application.setName("N/A");
  application.setQueue("N/A");
  application.setStartTime(0);
  application.setFinishTime(0);
  application.setTrackingUrl("N/A");
  application.setDiagnostics("N/A");

  GetApplicationReportResponse response = recordFactory
      .newRecordInstance(GetApplicationReportResponse.class);
  response.setApplicationReport(application);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:TestClientRedirect.java

示例3: getApplications

import org.apache.hadoop.yarn.api.records.ApplicationReport; //导入方法依赖的package包/类
public List<ApplicationReport> getApplications(int id) {
  String result = null;
  String squeueCmd = conf.get(
      HPCConfiguration.YARN_APPLICATION_HPC_COMMAND_SLURM_SQUEUE,
      HPCConfiguration.DEFAULT_YARN_APPLICATION_HPC_COMMAND_SLURM_SQUEUE);
  List<ApplicationReport> applications = new ArrayList<ApplicationReport>();
  try {
    String argJ = id < 0 ? "" : "-j " + id;
    result = Shell.execCommand(squeueCmd, "-h", argJ, "-o %i %P %j %u %k");

    String[] resultLines = result.split("\\n");
    for (String line : resultLines) {
      if (line == null || line.length() == 0) {
        return applications;
      }

      String[] lineParts = line.trim().split("\\s+");

      if (!("YarnMaster".equals(lineParts[2]) && StringUtils
          .isNotEmpty(lineParts[4])))
        continue;

      String[] addr = lineParts[4].split(":");
      if (addr.length != 3)
        continue;

      ApplicationReport appReport = Records
          .newRecord(ApplicationReport.class);

      int jobid = Integer.parseInt(lineParts[0]);
      ApplicationId applicationId = ApplicationId.newInstance(
          getClusterTimestamp(), jobid);

      appReport.setApplicationId(applicationId);
      appReport.setTrackingUrl("");
      appReport.setQueue(lineParts[1]);
      appReport.setName(lineParts[2]);
      appReport.setUser(lineParts[3]);

      appReport.setHost(addr[1]);
      appReport.setRpcPort(Integer.parseInt(addr[2]));

      String stateStr = addr[0].toUpperCase();
      YarnApplicationState state = YarnApplicationState.valueOf(stateStr);
      appReport.setYarnApplicationState(state);
      if (state == YarnApplicationState.FINISHED) {
        appReport.setFinalApplicationStatus(FinalApplicationStatus.SUCCEEDED);
      }else{
        appReport.setFinalApplicationStatus(FinalApplicationStatus.UNDEFINED);
      }
      applications.add(appReport);
    }
  } catch (Throwable t) {
    throw new YarnRuntimeException(result, t);
  }
  return applications;
}
 
开发者ID:intel-hpdd,项目名称:scheduling-connector-for-hadoop,代码行数:58,代码来源:SlurmApplicationClient.java


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