public void display(boolean verbose, boolean isNew) { YarnApplicationState state = report.getYarnApplicationState(); if (verbose || !isNew) { System.out.println("Application State: " + state.toString()); System.out.println("Host: " + report.getHost()); } if (verbose || !isNew) { System.out.println("Queue: " + report.getQueue()); System.out.println("User: " + report.getUser()); long startTime = report.getStartTime(); System.out.println("Start Time: " + DoYUtil.toIsoTime(startTime)); System.out.println("Application Name: " + report.getName()); } System.out.println("Tracking URL: " + report.getTrackingUrl()); if (isNew) { System.out.println("Application Master URL: " + getAmUrl()); } showFinalStatus(); }
final String host = appReport.getHost(); final int rpcPort = appReport.getRpcPort();
writename.createNewFile(); BufferedWriter out = new BufferedWriter(new FileWriter(writename)); out.write(report.getHost() + JOYConstants.NEW_LINE); out.write(report.getRpcPort() + JOYConstants.NEW_LINE); out.flush(); + ", clientToAMToken=" + report.getClientToAMToken() + ", appDiagnostics=" + report.getDiagnostics() + ", appMasterHost=" + report.getHost() + ", appQueue=" + report.getQueue() + ", appMasterRpcPort=" + report.getRpcPort()
LOG.info("Application report for " + applicationId + " (state: " + applicationReport.getYarnApplicationState().toString() + ")"); xlearningClient = getAppMessageHandler(conf, applicationReport.getHost(), applicationReport.getRpcPort());
validClusterSpecification); String host = report.getHost(); int port = report.getRpcPort();
+ ", clientToAMToken=" + report.getClientToAMToken() + ", appDiagnostics=" + report.getDiagnostics() + ", appMasterHost=" + report.getHost() + ", appQueue=" + report.getQueue() + ", appMasterRpcPort=" + report.getRpcPort()
@Override public String getHost() { return report.getHost(); }
@Override public String getHost() { return report.getHost(); }
@Override public String getHost() { return report.getHost(); }
ClusterClient<ApplicationId> deploy() { ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class); context.setApplicationId(job.yarnAppId()); ApplicationReport report; try { report = startAppMaster(context); Configuration conf = getFlinkConfiguration(); conf.setString(JobManagerOptions.ADDRESS.key(), report.getHost()); conf.setInteger(JobManagerOptions.PORT.key(), report.getRpcPort()); return createYarnClusterClient(this, (int) job.taskManagerCount(), (int) job.slotCountPerTaskManager(), report, conf, false); } catch (Exception e) { throw new RuntimeException(e); } }
private void initRpcClient(ApplicationReport report) throws IOException { if (!amRpcServerInitialized && report.getRpcPort() != -1) { amRpcPort = report.getRpcPort(); amHost = report.getHost(); LOG.info("AM host: " + report.getHost()); LOG.info("AM RPC port: " + report.getRpcPort()); addClientToAMTokenToUGI(report); amRpcClient = ApplicationRpcClient.getInstance(amHost, amRpcPort, yarnConf); amRpcServerInitialized = true; } }
/** * Get a proxy from the application report * @param conf config to use * @param application app report * @param rpcTimeout timeout in RPC operations * @return the proxy * @throws IOException * @throws SliderException * @throws InterruptedException */ public static SliderClusterProtocol getProxy(final Configuration conf, final ApplicationReport application, final int rpcTimeout) throws IOException, SliderException, InterruptedException { String host = application.getHost(); int port = application.getRpcPort(); org.apache.hadoop.yarn.api.records.Token clientToAMToken = application.getClientToAMToken(); return createProxy(conf, host, port, clientToAMToken, rpcTimeout); }
/** * Get a proxy from the application report * @param conf config to use * @param application app report * @param rpcTimeout timeout in RPC operations * @return the proxy * @throws IOException * @throws SliderException * @throws InterruptedException */ public static SliderClusterProtocol getProxy(final Configuration conf, final ApplicationReport application, final int rpcTimeout) throws IOException, SliderException, InterruptedException { String host = application.getHost(); int port = application.getRpcPort(); org.apache.hadoop.yarn.api.records.Token clientToAMToken = application.getClientToAMToken(); return createProxy(conf, host, port, clientToAMToken, rpcTimeout); }
private void addClientToAMTokenToUGI(ApplicationReport report) throws IOException { InetSocketAddress serviceAddr = NetUtils.createSocketAddrForHost(report.getHost(), report.getRpcPort()); if (UserGroupInformation.isSecurityEnabled()) { org.apache.hadoop.yarn.api.records.Token clientToAMToken = report.getClientToAMToken(); Token<ClientToAMTokenIdentifier> token = ConverterUtils.convertFromYarn(clientToAMToken, serviceAddr); UserGroupInformation.getCurrentUser().addToken(token); } }
@Override public boolean exitLoop(ApplicationReport report) { LOG.info("Got application report from ASM for, appId={}, clientToken={}, appDiagnostics={}, appMasterHost={}," + "appQueue={}, appMasterRpcPort={}, appStartTime={}, yarnAppState={}, distributedFinalState={}, " + "appTrackingUrl={}, appUser={}", appId.getId(), report.getClientToAMToken(), report.getDiagnostics(), report.getHost(), report.getQueue(), report.getRpcPort(), report.getStartTime(), report.getYarnApplicationState(), report.getFinalApplicationStatus(), report.getTrackingUrl(), report.getUser()); return false; }
/** * convert an AM report to a string for diagnostics * @param report the report * @return the string value */ public static String reportToString(ApplicationReport report) { if (report == null) { return "Null application report"; } return "App " + report.getName() + "/" + report.getApplicationType() + "# " + report.getApplicationId() + " user " + report.getUser() + " is in state " + report.getYarnApplicationState() + " RPC: " + report.getHost() + ":" + report.getRpcPort() + " URL: " + report.getOriginalTrackingUrl(); }
/** * convert an AM report to a string for diagnostics * @param report the report * @return the string value */ public static String reportToString(ApplicationReport report) { if (report == null) { return "Null application report"; } return "App " + report.getName() + "/" + report.getApplicationType() + "# " + report.getApplicationId() + " user " + report.getUser() + " is in state " + report.getYarnApplicationState() + " RPC: " + report.getHost() + ":" + report.getRpcPort() + " URL: " + report.getOriginalTrackingUrl(); }
public SerializedApplicationReport(ApplicationReport report) { this.applicationId = report.getApplicationId().toString(); ApplicationAttemptId attemptId = report.getCurrentApplicationAttemptId(); this.applicationAttemptId = attemptId != null ? attemptId.toString() : "N/A"; this.name = report.getName(); this.applicationType = report.getApplicationType(); this.user = report.getUser(); this.queue = report.getQueue(); this.host = report.getHost(); this.rpcPort = report.getRpcPort(); this.state = report.getYarnApplicationState().toString(); this.diagnostics = report.getDiagnostics(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); FinalApplicationStatus appStatus = report.getFinalApplicationStatus(); this.finalStatus = appStatus == null ? "" : appStatus.toString(); this.progress = report.getProgress(); this.url = report.getTrackingUrl(); this.origTrackingUrl= report.getOriginalTrackingUrl(); }
public SerializedApplicationReport(ApplicationReport report) { this.applicationId = report.getApplicationId().toString(); ApplicationAttemptId attemptId = report.getCurrentApplicationAttemptId(); this.applicationAttemptId = attemptId != null ? attemptId.toString() : "N/A"; this.name = report.getName(); this.applicationType = report.getApplicationType(); this.user = report.getUser(); this.queue = report.getQueue(); this.host = report.getHost(); this.rpcPort = report.getRpcPort(); this.state = report.getYarnApplicationState().toString(); this.diagnostics = report.getDiagnostics(); this.startTime = report.getStartTime(); this.finishTime = report.getFinishTime(); FinalApplicationStatus appStatus = report.getFinalApplicationStatus(); this.finalStatus = appStatus == null ? "" : appStatus.toString(); this.progress = report.getProgress(); this.url = report.getTrackingUrl(); this.origTrackingUrl= report.getOriginalTrackingUrl(); }