hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject hadoop git commit: HDFS-11410. Use the cached instance when edit logging SetAclOp, SetXAttrOp and RemoveXAttrOp.
Date Fri, 17 Feb 2017 02:08:31 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b23e93d46 -> 06386b7e7


HDFS-11410. Use the cached instance when edit logging SetAclOp, SetXAttrOp and RemoveXAttrOp.

(cherry picked from commit 02c549484a4fe6215c7f1a18d89389dbba6ea723)


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

Branch: refs/heads/branch-2
Commit: 06386b7e78dd2123b841616ce25146407a69ec2f
Parents: b23e93d
Author: Xiao Chen <xiao@apache.org>
Authored: Thu Feb 16 18:07:55 2017 -0800
Committer: Xiao Chen <xiao@apache.org>
Committed: Thu Feb 16 18:08:16 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hdfs/server/namenode/FSEditLog.java  |  6 +++---
 .../hdfs/server/namenode/FSEditLogOp.java       | 21 +++++++++-----------
 2 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/06386b7e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
index 29492b4..2ab15fd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
@@ -1207,14 +1207,14 @@ public class FSEditLog implements LogsPurgeable {
   }
 
   void logSetAcl(String src, List<AclEntry> entries) {
-    SetAclOp op = SetAclOp.getInstance();
+    final SetAclOp op = SetAclOp.getInstance(cache.get());
     op.src = src;
     op.aclEntries = entries;
     logEdit(op);
   }
   
   void logSetXAttrs(String src, List<XAttr> xAttrs, boolean toLogRpcIds) {
-    final SetXAttrOp op = SetXAttrOp.getInstance();
+    final SetXAttrOp op = SetXAttrOp.getInstance(cache.get());
     op.src = src;
     op.xAttrs = xAttrs;
     logRpcIds(op, toLogRpcIds);
@@ -1222,7 +1222,7 @@ public class FSEditLog implements LogsPurgeable {
   }
   
   void logRemoveXAttrs(String src, List<XAttr> xAttrs, boolean toLogRpcIds) {
-    final RemoveXAttrOp op = RemoveXAttrOp.getInstance();
+    final RemoveXAttrOp op = RemoveXAttrOp.getInstance(cache.get());
     op.src = src;
     op.xAttrs = xAttrs;
     logRpcIds(op, toLogRpcIds);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/06386b7e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
index ae9bfe1..bee71c0 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLogOp.java
@@ -3745,8 +3745,7 @@ public abstract class FSEditLogOp {
     }
 
     static AddCacheDirectiveInfoOp getInstance(OpInstanceCache cache) {
-      return (AddCacheDirectiveInfoOp) cache
-          .get(OP_ADD_CACHE_DIRECTIVE);
+      return (AddCacheDirectiveInfoOp) cache.get(OP_ADD_CACHE_DIRECTIVE);
     }
 
     @Override
@@ -3816,8 +3815,7 @@ public abstract class FSEditLogOp {
     }
 
     static ModifyCacheDirectiveInfoOp getInstance(OpInstanceCache cache) {
-      return (ModifyCacheDirectiveInfoOp) cache
-          .get(OP_MODIFY_CACHE_DIRECTIVE);
+      return (ModifyCacheDirectiveInfoOp) cache.get(OP_MODIFY_CACHE_DIRECTIVE);
     }
 
     @Override
@@ -3893,8 +3891,7 @@ public abstract class FSEditLogOp {
     }
 
     static RemoveCacheDirectiveInfoOp getInstance(OpInstanceCache cache) {
-      return (RemoveCacheDirectiveInfoOp) cache
-          .get(OP_REMOVE_CACHE_DIRECTIVE);
+      return (RemoveCacheDirectiveInfoOp) cache.get(OP_REMOVE_CACHE_DIRECTIVE);
     }
 
     @Override
@@ -4146,8 +4143,8 @@ public abstract class FSEditLogOp {
       super(OP_REMOVE_XATTR);
     }
     
-    static RemoveXAttrOp getInstance() {
-      return new RemoveXAttrOp();
+    static RemoveXAttrOp getInstance(OpInstanceCache cache) {
+      return (RemoveXAttrOp) cache.get(OP_REMOVE_XATTR);
     }
 
     @Override
@@ -4199,8 +4196,8 @@ public abstract class FSEditLogOp {
       super(OP_SET_XATTR);
     }
     
-    static SetXAttrOp getInstance() {
-      return new SetXAttrOp();
+    static SetXAttrOp getInstance(OpInstanceCache cache) {
+      return (SetXAttrOp) cache.get(OP_SET_XATTR);
     }
 
     @Override
@@ -4252,8 +4249,8 @@ public abstract class FSEditLogOp {
       super(OP_SET_ACL);
     }
 
-    static SetAclOp getInstance() {
-      return new SetAclOp();
+    static SetAclOp getInstance(OpInstanceCache cache) {
+      return (SetAclOp) cache.get(OP_SET_ACL);
     }
 
     @Override


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


Mime
View raw message