@Override @Nullable public ApplicationId getClusterId(CommandLine commandLine) { if (commandLine.hasOption(applicationId.getOpt())) { return ConverterUtils.toApplicationId(commandLine.getOptionValue(applicationId.getOpt())); } else if (isYarnPropertiesFileMode(commandLine)) { return yarnApplicationIdFromYarnProperties; } else { return null; } }
yarnApplicationIdFromYarnProperties = ConverterUtils.toApplicationId(yarnApplicationIdString);
protected ApplicationId checkAppId() throws ClientException { String appIdStr; if (opts.appId != null) { appIdStr = opts.appId; } else { File appIdFile = getAppIdFile(); appIdStr = loadAppId(appIdFile); if (appIdStr == null) { throw new ClientException( "No Drill cluster is running (did not find file appid file: " + appIdFile.toString() + ")"); } } return ConverterUtils.toApplicationId(appIdStr); }
public static TezTaskAttemptID createTaskAttemptId( QueryIdentifierProto queryIdProto, int vertexIndex, int fragmentNum, int attemptNum) { // Come ride the API roller-coaster! return TezTaskAttemptID.getInstance( TezTaskID.getInstance( TezVertexID.getInstance( TezDAGID.getInstance( ConverterUtils.toApplicationId( queryIdProto.getApplicationIdString()), queryIdProto.getDagIndex()), vertexIndex), fragmentNum), attemptNum); }
yarnApplicationId = ConverterUtils.toApplicationId(cmd.getOptionValue(applicationId.getOpt()));
@Override public void start(CallbackHandler resourceCallback, org.apache.hadoop.yarn.client.api.async.NMClientAsync.CallbackHandler nodeCallback ) { conf = new YarnConfiguration(); resourceMgr = AMRMClientAsync.createAMRMClientAsync(pollPeriodMs, resourceCallback); resourceMgr.init(conf); resourceMgr.start(); // Create the asynchronous node manager client nodeMgr = NMClientAsync.createNMClientAsync(nodeCallback); nodeMgr.init(conf); nodeMgr.start(); client = YarnClient.createYarnClient(); client.init(conf); client.start(); String appIdStr = System.getenv(DrillOnYarnConfig.APP_ID_ENV_VAR); if (appIdStr != null) { appId = ConverterUtils.toApplicationId(appIdStr); try { appReport = client.getApplicationReport(appId); } catch (YarnException | IOException e) { LOG.error( "Failed to get YARN applicaiton report for App ID: " + appIdStr, e); } } }
private ApplicationId parseApplicationId(String appIdStr) { ApplicationId appId = null; if (appIdStr.startsWith(ApplicationId.appIdStrPrefix)) { try { appId = ConverterUtils.toApplicationId(appIdStr); } catch (IllegalArgumentException e) { appId = null; } } return appId; }
public static StormOnYarn attachToApp(String appId, @SuppressWarnings("rawtypes") Map stormConf) { return new StormOnYarn(ConverterUtils.toApplicationId(appId), stormConf); } }
public static ApplicationId toApplicationId(RecordFactory recordFactory, String appIdStr) { Iterator<String> it = _split(appIdStr).iterator(); it.next(); // prefix. TODO: Validate application prefix return toApplicationId(recordFactory, it); }
public static ApplicationId toApplicationId(RecordFactory recordFactory, String appIdStr) { Iterator<String> it = _split(appIdStr).iterator(); it.next(); // prefix. TODO: Validate application prefix return toApplicationId(recordFactory, it); }
@Override @Nullable public ApplicationId getClusterId(CommandLine commandLine) { if (commandLine.hasOption(applicationId.getOpt())) { return ConverterUtils.toApplicationId(commandLine.getOptionValue(applicationId.getOpt())); } else if (isYarnPropertiesFileMode(commandLine)) { return yarnApplicationIdFromYarnProperties; } else { return null; } }
private Map<String, StreamClustersInfoReportData> getInstanceClustersStates(String yarnApplicationId, String clusterId) { HashMap<String, StreamClustersInfoReportData> states = new HashMap<String, StreamClustersInfoReportData>(); List<StreamClustersInfoReportData> clusterInfo = getApp(null, null, CloudAppType.STREAM) .getClusterInfo(ConverterUtils.toApplicationId(yarnApplicationId), clusterId); if (clusterInfo.size() == 1) { states.put(clusterId, clusterInfo.get(0)); } return states; }
private void storeOozieLauncherLog(final File outputDir, final WorkflowAction action, final String user) { try (PrintStream fw = new PrintStream(new File(outputDir, "launcher_" + action.getName() + ".log"), StandardCharsets.UTF_8.toString())) { final ApplicationId appId = ConverterUtils.toApplicationId(action.getExternalId()); oozieLauncherLogFetcher.dumpAllContainersLogs(appId, user, fw); } catch (IOException e) { System.err.printf("Exception occurred during the retrieval of Oozie launcher logs for workflow(s): %s%n", e.getMessage()); } }
protected static ApplicationId parseApplicationId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = ConverterUtils.toApplicationId(appId); if (aid == null) { throw new NotFoundException("appId is null"); } return aid; }
protected static ApplicationId parseApplicationId(String appId) { if (appId == null || appId.isEmpty()) { throw new NotFoundException("appId, " + appId + ", is empty or null"); } ApplicationId aid = ConverterUtils.toApplicationId(appId); if (aid == null) { throw new NotFoundException("appId is null"); } return aid; }
@Override public String runWithSpringApplication(ApplicationContext context) throws Exception { OperationProperties operationProperties = context.getBean(OperationProperties.class); ApplicationId applicationId = ConverterUtils.toApplicationId(operationProperties.getApplicationId()); YarnClient client = context.getBean(YarnClient.class); ApplicationReport report = client.getApplicationReport(applicationId); String trackingUrl = report.getOriginalTrackingUrl(); RestTemplate restTemplate = context.getBean(YarnSystemConstants.DEFAULT_ID_RESTTEMPLATE, RestTemplate.class); restTemplate.postForObject(trackingUrl + "/shutdown", null, Void.class); return "shutdown requested"; }
@Override public DumpHistoryCommand parse(String[] args) { DefaultParser parser = new DefaultParser(); CommandLine cmdLine; cmdLine = CliHelper.tryParse(parser, options, args); return DumpHistoryCommand.builder() .clientId(cmdLine.getOptionValue(CliConsts.CLIENT_ID_OPTION_NAME)) .applicationId(ConverterUtils.toApplicationId(cmdLine.getOptionValue( CliConsts.JOB_ID_OPTION_NAME))) .logBucket(cmdLine.getOptionValue(CliConsts.LOG_BUCKET_OPTION_NAME)) .build(); }
@Test(expected = IllegalArgumentException.class) @SuppressWarnings("deprecation") public void testApplicationId() { ConverterUtils.toApplicationId("application_1423221031460"); } }
@Test(expected = IllegalArgumentException.class) @SuppressWarnings("deprecation") public void testApplicationId() { ConverterUtils.toApplicationId("application_1423221031460"); } }
@Test(expected = IllegalArgumentException.class) public void testApplicationId() { ConverterUtils.toApplicationId("application_1423221031460"); } }