示例#1
0
 /// <exception cref="System.Exception"/>
 public object Run()
 {
     try
     {
         FileSystem remoteFS = this._enclosing.GetFileSystem(this._enclosing.GetConfig());
         Path       appDir   = LogAggregationUtils.GetRemoteAppLogDir(this._enclosing.remoteRootLogDir
                                                                      , appId, user, this._enclosing.remoteRootLogDirSuffix);
         appDir = appDir.MakeQualified(remoteFS.GetUri(), remoteFS.GetWorkingDirectory());
         if (!this._enclosing.CheckExists(remoteFS, appDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                          .AppDirPermissions))
         {
             Path suffixDir = LogAggregationUtils.GetRemoteLogSuffixedDir(this._enclosing.remoteRootLogDir
                                                                          , user, this._enclosing.remoteRootLogDirSuffix);
             suffixDir = suffixDir.MakeQualified(remoteFS.GetUri(), remoteFS.GetWorkingDirectory
                                                     ());
             if (!this._enclosing.CheckExists(remoteFS, suffixDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                              .AppDirPermissions))
             {
                 Path userDir = LogAggregationUtils.GetRemoteLogUserDir(this._enclosing.remoteRootLogDir
                                                                        , user);
                 userDir = userDir.MakeQualified(remoteFS.GetUri(), remoteFS.GetWorkingDirectory()
                                                 );
                 if (!this._enclosing.CheckExists(remoteFS, userDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                                  .AppDirPermissions))
                 {
                     this._enclosing.CreateDir(remoteFS, userDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                               .AppDirPermissions);
                 }
                 this._enclosing.CreateDir(remoteFS, suffixDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                           .AppDirPermissions);
             }
             this._enclosing.CreateDir(remoteFS, appDir, Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
                                       .AppDirPermissions);
         }
     }
     catch (IOException e)
     {
         Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Logaggregation.LogAggregationService
         .Log.Error("Failed to setup application log directory for " + appId, e);
         throw;
     }
     return(null);
 }