@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); }
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); } }
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); } }
@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"); }
@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"); }
@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"); }
protected RMProxy() { try { this.user = UserGroupInformation.getCurrentUser(); } catch (IOException ioe) { throw new YarnRuntimeException("Unable to determine user", ioe); } }
@Override public void handle(CommitterEvent event) { try { eventQueue.put(event); } catch (InterruptedException e) { throw new YarnRuntimeException(e); } }
@Override public void handle(ContainerLauncherEvent event) { try { eventQueue.put(event); } catch (InterruptedException e) { throw new YarnRuntimeException(e); // FIXME? YarnRuntimeException is "for runtime exceptions only" } }
@Override public void handle(ContainerLauncherEvent event) { try { eventQueue.put(event); } catch (InterruptedException e) { throw new YarnRuntimeException(e); } }
public static TaskType taskType(String symbol) { // JDK 7 supports switch on strings if (symbol.equals("m")) return TaskType.MAP; if (symbol.equals("r")) return TaskType.REDUCE; throw new YarnRuntimeException("Unknown task symbol: "+ symbol); }
public static TaskType taskType(String symbol) { // JDK 7 supports switch on strings if (symbol.equals("m")) return TaskType.MAP; if (symbol.equals("r")) return TaskType.REDUCE; throw new YarnRuntimeException("Unknown task symbol: "+ symbol); }
@Override protected TaskSplitMetaInfo[] createSplits(JobImpl job, JobId jobId) { throw new YarnRuntimeException(EXCEPTIONMSG); } };
FileContext getLocalFileContext(Configuration conf) { try { return FileContext.getLocalFSFileContext(conf); } catch (IOException e) { throw new YarnRuntimeException("Failed to access local fs"); } }
private void initializeLogDir(FileContext lfs, String logDir) { try { lfs.mkdir(new Path(logDir), null, true); } catch (FileAlreadyExistsException fe) { // do nothing } catch (IOException e) { String msg = "Could not initialize log dir " + logDir; LOG.warn(msg, e); throw new YarnRuntimeException(msg, e); } }
FileContext getLocalFileContext(Configuration conf) { try { return FileContext.getLocalFSFileContext(conf); } catch (IOException e) { throw new YarnRuntimeException("Failed to access local fs"); } }
protected ApplicationMasterProtocol createSchedulerProxy() { final Configuration conf = getConfig(); try { return ClientRMProxy.createRMProxy(conf, ApplicationMasterProtocol.class,true); } catch (IOException e) { throw new YarnRuntimeException(e); } }
@Override protected void serviceStart() throws Exception { try { ahsClient = AHSProxy.createAHSProxy(getConfig(), ApplicationHistoryProtocol.class, this.ahsAddress); } catch (IOException e) { throw new YarnRuntimeException(e); } super.serviceStart(); }
private String setupTestWorkDir() { File testWorkDir = new File("target", this.getClass().getCanonicalName()); try { FileContext.getLocalFSFileContext().delete( new Path(testWorkDir.getAbsolutePath()), true); return testWorkDir.getAbsolutePath(); } catch (Exception e) { LOG.warn("Could not cleanup", e); throw new YarnRuntimeException("could not cleanup test dir", e); } }
@Override public void serviceStart() throws Exception { amRmTokenSecretManager.start(); containerTokenSecretManager.start(); nmTokenSecretManager.start(); try { rmDTSecretManager.startThreads(); } catch(IOException ie) { throw new YarnRuntimeException("Failed to start secret manager threads", ie); } super.serviceStart(); }