This is an automated email from the ASF dual-hosted git repository.

bibinchundatt pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 89a53c7  YARN-9747. Reduce additional namenode call by 
EntityGroupFSTimelineStore#cleanLogs. Contributed by Prabhu Joseph.
89a53c7 is described below

commit 89a53c7eb41098d85d238c39a62d3f98e5f51585
Author: bibinchundatt <bibinchund...@apache.org>
AuthorDate: Wed Aug 14 13:46:23 2019 +0530

    YARN-9747. Reduce additional namenode call by 
EntityGroupFSTimelineStore#cleanLogs. Contributed by Prabhu Joseph.
---
 .../yarn/server/timeline/EntityGroupFSTimelineStore.java       | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java
index a5e5b41..cc246d9 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java
@@ -469,8 +469,8 @@ public class EntityGroupFSTimelineStore extends 
CompositeService
     RemoteIterator<FileStatus> iter = list(dirpath);
     while (iter.hasNext()) {
       FileStatus stat = iter.next();
-      Path clusterTimeStampPath = stat.getPath();
-      if (isValidClusterTimeStampDir(clusterTimeStampPath)) {
+      if (isValidClusterTimeStampDir(stat)) {
+        Path clusterTimeStampPath = stat.getPath();
         MutableBoolean appLogDirPresent = new MutableBoolean(false);
         cleanAppLogDir(clusterTimeStampPath, retainMillis, appLogDirPresent);
         if (appLogDirPresent.isFalse() &&
@@ -520,11 +520,9 @@ public class EntityGroupFSTimelineStore extends 
CompositeService
     }
   }
 
-  private boolean isValidClusterTimeStampDir(Path clusterTimeStampPath)
-      throws IOException {
-    FileStatus stat = fs.getFileStatus(clusterTimeStampPath);
+  private boolean isValidClusterTimeStampDir(FileStatus stat) {
     return stat.isDirectory() &&
-        StringUtils.isNumeric(clusterTimeStampPath.getName());
+        StringUtils.isNumeric(stat.getPath().getName());
   }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to