UnmanagedApplicationManager { public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { if (this.userUgi == null) { if (this.connectionInitiated) { LOG.warn("Unmanaged AM still not successfully launched/registered yet." + " Stopping the UAM heartbeat thread anyways."); return FinishApplicationMasterResponse.newInstance(false); } else { throw new YarnException("finishApplicationMaster should not " + "be called before createAndRegister"); } } FinishApplicationMasterResponse response = this.rmProxyRelayer.finishApplicationMaster(request); if (response.getIsUnregistered()) { shutDownConnections(); } return response; } UnmanagedApplicationManager(Configuration conf, ApplicationId appId,
      String queueName, String submitter, String appNameSuffix,
      boolean keepContainersAcrossApplicationAttempts, String rmName); Token<AMRMTokenIdentifier> launchUAM(); void reAttachUAM(Token<AMRMTokenIdentifier> amrmToken); RegisterApplicationMasterResponse registerApplicationMaster(
      RegisterApplicationMasterRequest request); FinishApplicationMasterResponse finishApplicationMaster(
      FinishApplicationMasterRequest request); KillApplicationResponse forceKillApplication(); void allocateAsync(AllocateRequest request,
      AsyncCallback<AllocateResponse> callback); void shutDownConnections(); ApplicationId getAppId(); AMRMClientRelayer getAMRMClientRelayer(); @VisibleForTesting int getRequestQueueSize(); static final String APP_NAME; }
@Test(expected = Exception.class) public void testFinishWithoutRegister() throws YarnException, IOException, InterruptedException { finishApplicationMaster( FinishApplicationMasterRequest.newInstance(null, null, null), attemptId); }