void startTimelineClient(final Configuration conf) throws YarnException, IOException, InterruptedException { try { appSubmitterUgi.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { // Creating the Timeline Client timelineClient = TimelineClient.createTimelineClient(); timelineClient.init(conf); timelineClient.start(); } else { timelineClient = null; LOG.warn("Timeline service is not enabled"); } return null; } }); } catch (UndeclaredThrowableException e) { throw new YarnException(e.getCause()); } }
@Override protected void serviceInit(Configuration conf) throws Exception { Configuration config = new XLearningConfiguration(conf); config.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, true); // This is required for WebApps to use https if enabled. XLearningWebAppUtil.initialize(getConfig()); try { doSecureLogin(conf); } catch (IOException ie) { throw new YarnRuntimeException("History Server Failed to login", ie); } jobHistoryService = new JobHistory(); historyContext = (HistoryContext) jobHistoryService; stateStore = createStateStore(conf); this.jhsDTSecretManager = createJHSSecretManager(conf, stateStore); clientService = createHistoryClientService(); aggLogDelService = new AggregatedLogDeletionService(); addService(stateStore); addService(new HistoryServerSecretManagerService()); addService(clientService); addService(aggLogDelService); super.serviceInit(config); }
@Override public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } return null; }
@Override public RegisterApplicationMasterResponse registerApplicationMaster( RegisterApplicationMasterRequest request) throws YarnException, IOException { if (this.throwAlreadyRegister) { this.throwAlreadyRegister = false; throw new InvalidApplicationMasterRequestException( AMRMClientUtils.APP_ALREADY_REGISTERED_MESSAGE + "appId"); } return null; }
public static TaskType toYarn(org.apache.hadoop.mapreduce.TaskType taskType) { switch (taskType) { case MAP: return TaskType.MAP; case REDUCE: return TaskType.REDUCE; default: throw new YarnRuntimeException("Unrecognized task type: " + taskType); } }
@VisibleForTesting void startTimelineClient(final Configuration conf) throws YarnException, IOException, InterruptedException { try { appSubmitterUgi.doAs(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { if (conf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) { // Creating the Timeline Client timelineClient = TimelineClient.createTimelineClient(); timelineClient.init(conf); timelineClient.start(); } else { timelineClient = null; LOG.warn("Timeline service is not enabled"); } return null; } }); } catch (UndeclaredThrowableException e) { throw new YarnException(e.getCause()); } }
@Override public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { if (this.failover) { this.failover = false; throw new ApplicationMasterNotRegisteredException("Mock RM restarted"); } return null; }
public static org.apache.hadoop.mapreduce.TaskType fromYarn( TaskType taskType) { switch (taskType) { case MAP: return org.apache.hadoop.mapreduce.TaskType.MAP; case REDUCE: return org.apache.hadoop.mapreduce.TaskType.REDUCE; default: throw new YarnRuntimeException("Unrecognized task type: " + taskType); } }
/** * Returns an instance of {@link YarnException} */ public static YarnException getRemoteException(Throwable t) { return new YarnException(t); }
@Override public void setNextInterceptor(RESTRequestInterceptor next) { throw new YarnRuntimeException("setNextInterceptor is being called on " + "FederationInterceptorREST, which should be the last one " + "in the chain. Check if the interceptor pipeline configuration " + "is correct"); }
/** * Returns an instance of {@link YarnException} */ public static YarnException getRemoteException(String message) { return new YarnException(message); }
@Override public void setNextInterceptor(RESTRequestInterceptor next) { throw new YarnRuntimeException("setNextInterceptor is being called on " + "DefaultRequestInterceptorREST, which should be the last one " + "in the chain. Check if the interceptor pipeline configuration " + "is correct"); }
/** * Returns an instance of {@link YarnException} */ public static YarnException getRemoteException(Throwable t) { return new YarnException(t); }
@Override public void setNextInterceptor(RequestInterceptor next) { throw new YarnRuntimeException( "setNextInterceptor is being called on FederationInterceptor. " + "It should always be used as the last interceptor in the chain"); }
@Override public synchronized SignalContainerResponse signalToContainer( SignalContainerRequest request) throws YarnException, IOException { throw new YarnException("Not supported yet!"); }
public static TaskType toYarn(org.apache.hadoop.mapreduce.TaskType taskType) { switch (taskType) { case MAP: return TaskType.MAP; case REDUCE: return TaskType.REDUCE; default: throw new YarnRuntimeException("Unrecognized task type: " + taskType); } }
@Override public String moveApplication(ApplicationId appId, String newQueue) throws YarnException { if (failMove) { throw new YarnException("Move not supported"); } return newQueue; }
/** * This has to be initialized with at-least 1 Processor. * @param rootProcessor Root processor. */ AMSProcessingChain(ApplicationMasterServiceProcessor rootProcessor) { if (rootProcessor == null) { throw new YarnRuntimeException("No root ApplicationMasterService" + "Processor specified for the processing chain.."); } this.head = rootProcessor; }
@Override public String moveApplication(ApplicationId appId, String newQueue) throws YarnException { if (failMove) { throw new YarnException("Move not supported"); } return newQueue; }
@Override protected TaskSplitMetaInfo[] createSplits(JobImpl job, JobId jobId) { throw new YarnRuntimeException(EXCEPTIONMSG); } };