コード例 #1
0
        private void DoAppLogAggregationPostCleanUp()
        {
            // Remove the local app-log-dirs
            IList <Path> localAppLogDirs = new AList <Path>();

            foreach (string rootLogDir in dirsHandler.GetLogDirsForCleanup())
            {
                Path logPath = new Path(rootLogDir, applicationId);
                try
                {
                    // check if log dir exists
                    lfs.GetFileStatus(logPath);
                    localAppLogDirs.AddItem(logPath);
                }
                catch (UnsupportedFileSystemException ue)
                {
                    Log.Warn("Log dir " + rootLogDir + "is an unsupported file system", ue);
                    continue;
                }
                catch (IOException)
                {
                    continue;
                }
            }
            if (localAppLogDirs.Count > 0)
            {
                this.delService.Delete(this.userUgi.GetShortUserName(), null, Sharpen.Collections.ToArray
                                           (localAppLogDirs, new Path[localAppLogDirs.Count]));
            }
        }