org.apache.hadoop.yarn.client.api.YarnClientApplication类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.apache.hadoop.yarn.client.api.YarnClientApplication类的一些代码示例,展示了YarnClientApplication类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnClientApplication类的具体详情如下:
包路径:org.apache.hadoop.yarn.client.api.YarnClientApplication
类名称:YarnClientApplication

YarnClientApplication介绍

暂无

代码示例

代码示例来源:origin: alibaba/jstorm

GetNewApplicationResponse appResponse = app.getNewApplicationResponse();
int maxMem = appResponse.getMaximumResourceCapability().getMemory();
LOG.info("Max mem capabililty of resources in this cluster " + maxMem);
ApplicationSubmissionContext appContext = app.getApplicationSubmissionContext();
ApplicationId appId = appContext.getApplicationId();

代码示例来源:origin: apache/flink

ApplicationSubmissionContext appContext = yarnApplication.getApplicationSubmissionContext();
Set<File> systemShipFiles = new HashSet<>(shipFiles.size());
for (File file : shipFiles) {

代码示例来源:origin: apache/flink

/**
 * Kills YARN application and stops YARN client.
 *
 * <p>Use this method to kill the App before it has been properly deployed
 */
private void failSessionDuringDeployment(YarnClient yarnClient, YarnClientApplication yarnApplication) {
  LOG.info("Killing YARN application");
  try {
    yarnClient.killApplication(yarnApplication.getNewApplicationResponse().getApplicationId());
  } catch (Exception e) {
    // we only log a debug message here because the "killApplication" call is a best-effort
    // call (we don't know if the application has been deployed when the error occured).
    LOG.debug("Error while killing YARN application", e);
  }
  yarnClient.stop();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-client

@Override
public YarnClientApplication createApplication()
  throws YarnException, IOException {
 ApplicationSubmissionContext context = Records.newRecord
   (ApplicationSubmissionContext.class);
 GetNewApplicationResponse newApp = getNewApplication();
 ApplicationId appId = newApp.getApplicationId();
 context.setApplicationId(appId);
 return new YarnClientApplication(newApp, context);
}

代码示例来源:origin: apache/ignite

ApplicationSubmissionContext appContext = app.getApplicationSubmissionContext();
appContext.setApplicationName("ignition"); // application name
appContext.setAMContainerSpec(amContainer);

代码示例来源:origin: apache/drill

public GetNewApplicationResponse createAppMaster()
  throws YarnClientException {
 // Create application via yarnClient
 // Response is a new application ID along with cluster capacity info
 try {
  app = yarnClient.createApplication();
 } catch (YarnException | IOException e) {
  throw new YarnClientException("Create application failed", e);
 }
 GetNewApplicationResponse response = app.getNewApplicationResponse();
 appId = response.getApplicationId();
 return response;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-client

@Override
public YarnClientApplication createApplication()
  throws YarnException, IOException {
 ApplicationSubmissionContext context = Records.newRecord
   (ApplicationSubmissionContext.class);
 GetNewApplicationResponse newApp = getNewApplication();
 ApplicationId appId = newApp.getApplicationId();
 context.setApplicationId(appId);
 return new YarnClientApplication(newApp, context);
}

代码示例来源:origin: Qihoo360/XLearning

GetNewApplicationResponse newAppResponse = newAPP.getNewApplicationResponse();
applicationId = newAppResponse.getApplicationId();
LOG.info("Got new Application: " + applicationId.toString());
ApplicationSubmissionContext applicationContext = newAPP.getApplicationSubmissionContext();
applicationContext.setApplicationId(applicationId);
applicationContext.setApplicationName(clientArguments.appName);

代码示例来源:origin: apache/drill

.getApplicationSubmissionContext();

代码示例来源:origin: apache/flink

final GetNewApplicationResponse appResponse = yarnApplication.getNewApplicationResponse();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

@Override
public YarnClientApplication createApplication()
  throws YarnException, IOException {
 ApplicationSubmissionContext context = Records.newRecord
   (ApplicationSubmissionContext.class);
 GetNewApplicationResponse newApp = getNewApplication();
 ApplicationId appId = newApp.getApplicationId();
 context.setApplicationId(appId);
 return new YarnClientApplication(newApp, context);
}

代码示例来源:origin: apache/incubator-gobblin

ApplicationId setupAndSubmitApplication() throws IOException, YarnException {
 YarnClientApplication gobblinYarnApp = this.yarnClient.createApplication();
 ApplicationSubmissionContext appSubmissionContext = gobblinYarnApp.getApplicationSubmissionContext();
 appSubmissionContext.setApplicationType(GOBBLIN_YARN_APPLICATION_TYPE);
 ApplicationId applicationId = appSubmissionContext.getApplicationId();
 GetNewApplicationResponse newApplicationResponse = gobblinYarnApp.getNewApplicationResponse();

代码示例来源:origin: uber/AthenaX

ApplicationId createApplication() throws IOException, YarnException {
 YarnClientApplication app = yarnClient.createApplication();
 return app.getApplicationSubmissionContext().getApplicationId();
}

代码示例来源:origin: org.apache.flink/flink-yarn_2.11

/**
 * Kills YARN application and stops YARN client.
 *
 * <p>Use this method to kill the App before it has been properly deployed
 */
private void failSessionDuringDeployment(YarnClient yarnClient, YarnClientApplication yarnApplication) {
  LOG.info("Killing YARN application");
  try {
    yarnClient.killApplication(yarnApplication.getNewApplicationResponse().getApplicationId());
  } catch (Exception e) {
    // we only log a debug message here because the "killApplication" call is a best-effort
    // call (we don't know if the application has been deployed when the error occured).
    LOG.debug("Error while killing YARN application", e);
  }
  yarnClient.stop();
}

代码示例来源:origin: io.hops/hadoop-yarn-client

@Override
public YarnClientApplication createApplication()
  throws YarnException, IOException {
 ApplicationSubmissionContext context = Records.newRecord
   (ApplicationSubmissionContext.class);
 GetNewApplicationResponse newApp = getNewApplication();
 ApplicationId appId = newApp.getApplicationId();
 context.setApplicationId(appId);
 return new YarnClientApplication(newApp, context);
}

代码示例来源:origin: apache/metron

GetNewApplicationResponse appResponse = app.getNewApplicationResponse();
ApplicationSubmissionContext appContext = app.getApplicationSubmissionContext();
ApplicationId appId = appContext.getApplicationId();

代码示例来源:origin: org.apache.hadoop/hadoop-mapreduce-client-jobclient

public JobID getNewJobID() throws IOException, InterruptedException {
 try {
  this.application = client.createApplication().getApplicationSubmissionContext();
  this.applicationId = this.application.getApplicationId();
  return TypeConverter.fromYarn(applicationId);
 } catch (YarnException e) {
  throw new IOException(e);
 }
}

代码示例来源:origin: org.apache.flink/flink-yarn

/**
 * Kills YARN application and stops YARN client.
 *
 * <p>Use this method to kill the App before it has been properly deployed
 */
private void failSessionDuringDeployment(YarnClient yarnClient, YarnClientApplication yarnApplication) {
  LOG.info("Killing YARN application");
  try {
    yarnClient.killApplication(yarnApplication.getNewApplicationResponse().getApplicationId());
  } catch (Exception e) {
    // we only log a debug message here because the "killApplication" call is a best-effort
    // call (we don't know if the application has been deployed when the error occured).
    LOG.debug("Error while killing YARN application", e);
  }
  yarnClient.stop();
}

代码示例来源:origin: org.apache.tez/tez-dag

@Override
public YarnClientApplication createApplication() throws YarnException, IOException {
 ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class);
 ApplicationId appId = ApplicationId.newInstance(clusterTimeStamp, appIdNumber++);
 context.setApplicationId(appId);
 GetNewApplicationResponse response = Records.newRecord(GetNewApplicationResponse.class);
 response.setApplicationId(appId);
 return new YarnClientApplication(response, context);
}

代码示例来源:origin: org.apache.reef/reef-runtime-yarn

public YarnSubmissionHelper(final YarnConfiguration yarnConfiguration,
              final REEFFileNames fileNames,
              final ClasspathProvider classpath,
              final YarnProxyUser yarnProxyUser,
              final SecurityTokenProvider tokenProvider,
              final boolean isUnmanaged,
              final List<String> commandPrefixList) throws IOException, YarnException {
 this.classpath = classpath;
 this.yarnProxyUser = yarnProxyUser;
 this.isUnmanaged = isUnmanaged;
 this.driverStdoutFilePath =
   ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/" + fileNames.getDriverStdoutFileName();
 this.driverStderrFilePath =
   ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/" + fileNames.getDriverStderrFileName();
 LOG.log(Level.FINE, "Initializing YARN Client");
 this.yarnClient = YarnClient.createYarnClient();
 this.yarnClient.init(yarnConfiguration);
 this.yarnClient.start();
 LOG.log(Level.FINE, "Initialized YARN Client");
 LOG.log(Level.FINE, "Requesting Application ID from YARN.");
 final YarnClientApplication yarnClientApplication = this.yarnClient.createApplication();
 this.applicationResponse = yarnClientApplication.getNewApplicationResponse();
 this.applicationSubmissionContext = yarnClientApplication.getApplicationSubmissionContext();
 this.applicationSubmissionContext.setUnmanagedAM(isUnmanaged);
 this.applicationId = this.applicationSubmissionContext.getApplicationId();
 this.tokenProvider = tokenProvider;
 this.commandPrefixList = commandPrefixList;
 this.configurationFilePaths = Collections.singletonList(fileNames.getDriverConfigurationPath());
 LOG.log(Level.INFO, "YARN Application ID: {0}", this.applicationId);
}

相关文章