protected internal virtual void InitAppAggregator(ApplicationId appId, string user , Credentials credentials, ContainerLogsRetentionPolicy logRetentionPolicy, IDictionary <ApplicationAccessType, string> appAcls, LogAggregationContext logAggregationContext ) { // Get user's FileSystem credentials UserGroupInformation userUgi = UserGroupInformation.CreateRemoteUser(user); if (credentials != null) { userUgi.AddCredentials(credentials); } // New application AppLogAggregator appLogAggregator = new AppLogAggregatorImpl(this.dispatcher, this .deletionService, GetConfig(), appId, userUgi, this.nodeId, dirsHandler, GetRemoteNodeLogFileForApp (appId, user), logRetentionPolicy, appAcls, logAggregationContext, this.context, GetLocalFileContext(GetConfig())); if (this.appLogAggregators.PutIfAbsent(appId, appLogAggregator) != null) { throw new YarnRuntimeException("Duplicate initApp for " + appId); } // wait until check for existing aggregator to create dirs YarnRuntimeException appDirException = null; try { // Create the app dir CreateAppDir(user, appId, userUgi); } catch (Exception e) { appLogAggregator.DisableLogAggregation(); if (!(e is YarnRuntimeException)) { appDirException = new YarnRuntimeException(e); } else { appDirException = (YarnRuntimeException)e; } } // TODO Get the user configuration for the list of containers that need log // aggregation. // Schedule the aggregator. Runnable aggregatorWrapper = new _Runnable_381(this, appLogAggregator, appId, userUgi ); this.threadPool.Execute(aggregatorWrapper); if (appDirException != null) { throw appDirException; } }
public virtual void TestUncaughtExceptionHandlerWithRuntimeException() { YarnUncaughtExceptionHandler spyYarnHandler = Org.Mockito.Mockito.Spy(exHandler); YarnRuntimeException yarnException = new YarnRuntimeException("test-yarn-runtime-exception" ); Sharpen.Thread yarnThread = new Sharpen.Thread(new _Runnable_45(yarnException)); yarnThread.SetUncaughtExceptionHandler(spyYarnHandler); NUnit.Framework.Assert.AreSame(spyYarnHandler, yarnThread.GetUncaughtExceptionHandler ()); yarnThread.Start(); yarnThread.Join(); Org.Mockito.Mockito.Verify(spyYarnHandler).UncaughtException(yarnThread, yarnException ); }
public _Runnable_45(YarnRuntimeException yarnException) { this.yarnException = yarnException; }