List of usage examples for org.apache.hadoop.yarn.api.protocolrecords FinishApplicationMasterResponse getIsUnregistered
@Public @Stable public abstract boolean getIsUnregistered();
From source file:disAMS.AMRMClient.Impl.AMRMClientImpl.java
License:Apache License
@Override public void unregisterApplicationMaster(FinalApplicationStatus appStatus, String appMessage, String appTrackingUrl) throws YarnException, IOException { Preconditions.checkArgument(appStatus != null, "AppStatus should not be null."); FinishApplicationMasterRequest request = FinishApplicationMasterRequest.newInstance(appStatus, appMessage, appTrackingUrl);//from ww w . j a v a 2s. co m try { while (true) { FinishApplicationMasterResponse response = rmClient.finishApplicationMaster(request); if (response.getIsUnregistered()) { break; } LOG.info("Waiting for application to be successfully unregistered."); Thread.sleep(100); } } catch (InterruptedException e) { LOG.info("Interrupted while waiting for application" + " to be removed from RMStateStore"); } catch (ApplicationMasterNotRegisteredException e) { LOG.warn("ApplicationMaster is out of sync with ResourceManager," + " hence resyncing."); // re register with RM registerApplicationMaster(); unregisterApplicationMaster(appStatus, appMessage, appTrackingUrl); } }