YARN-4886. Add HDFS caller context for EntityGroupFSTimelineStore. Contributed 
by Li Lu


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e0cb4267
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e0cb4267
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e0cb4267

Branch: refs/heads/HDFS-7240
Commit: e0cb426758b3d716ff143f723fc16ef2f1e4971b
Parents: d2f3bbc
Author: Xuan <[email protected]>
Authored: Wed Apr 13 10:38:17 2016 -0700
Committer: Xuan <[email protected]>
Committed: Wed Apr 13 10:38:17 2016 -0700

----------------------------------------------------------------------
 .../yarn/server/timeline/EntityGroupFSTimelineStore.java       | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e0cb4267/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/EntityGroupFSTimelineStore.java
----------------------------------------------------------------------
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 34a2072..18b8951 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
@@ -28,6 +28,7 @@ import org.apache.hadoop.fs.RemoteIterator;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.service.CompositeService;
 import org.apache.hadoop.service.ServiceOperations;
+import org.apache.hadoop.ipc.CallerContext;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hadoop.util.Time;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
@@ -86,6 +87,8 @@ public class EntityGroupFSTimelineStore extends 
CompositeService
   static final String SUMMARY_LOG_PREFIX = "summarylog-";
   static final String ENTITY_LOG_PREFIX = "entitylog-";
 
+  static final String ATS_V15_SERVER_DFS_CALLER_CTXT = "yarn_ats_server_v1_5";
+
   private static final Logger LOG = LoggerFactory.getLogger(
       EntityGroupFSTimelineStore.class);
   private static final FsPermission ACTIVE_DIR_PERMISSION =
@@ -187,6 +190,8 @@ public class EntityGroupFSTimelineStore extends 
CompositeService
         YarnConfiguration
             .TIMELINE_SERVICE_ENTITYGROUP_FS_STORE_DONE_DIR_DEFAULT));
     fs = activeRootPath.getFileSystem(conf);
+    CallerContext.setCurrent(
+        new CallerContext.Builder(ATS_V15_SERVER_DFS_CALLER_CTXT).build());
     super.serviceInit(conf);
   }
 
@@ -304,6 +309,7 @@ public class EntityGroupFSTimelineStore extends 
CompositeService
         ServiceOperations.stopQuietly(cacheItem.getStore());
       }
     }
+    CallerContext.setCurrent(null);
     super.serviceStop();
   }
 

Reply via email to