You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by wh...@apache.org on 2015/05/08 00:17:03 UTC
hadoop git commit: HDFS-8321. CacheDirectives and CachePool
operations should throw RetriableException in safemode. Contributed by Haohui
Mai.
Repository: hadoop
Updated Branches:
refs/heads/branch-2 976a3c1f9 -> f6b908ab0
HDFS-8321. CacheDirectives and CachePool operations should throw RetriableException in safemode. Contributed by Haohui Mai.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f6b908ab
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f6b908ab
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f6b908ab
Branch: refs/heads/branch-2
Commit: f6b908ab070269e000578b04afa6d4c14c6326fd
Parents: 976a3c1
Author: Haohui Mai <wh...@apache.org>
Authored: Mon May 4 15:47:16 2015 -0700
Committer: Haohui Mai <wh...@apache.org>
Committed: Thu May 7 15:17:02 2015 -0700
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 ++
.../hdfs/server/namenode/FSNamesystem.java | 32 +++++---------------
2 files changed, 11 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/f6b908ab/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 7fd0472..d6cfd59 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -321,6 +321,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8325. Misspelling of threshold in log4j.properties for tests.
(Brahma Reddy Battula via aajisaka)
+ HDFS-8321. CacheDirectives and CachePool operations should throw
+ RetriableException in safemode. (wheat9)
+
Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/f6b908ab/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index b1b2782..d8ed7ed 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -7673,10 +7673,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
writeLock();
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot add cache directive", safeMode);
- }
+ checkNameNodeSafeMode("Cannot add cache directive");
effectiveDirective = FSNDNCacheOp.addCacheDirective(this, cacheManager,
directive, flags, logRetryCache);
} finally {
@@ -7704,10 +7701,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
writeLock();
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot add cache directive", safeMode);
- }
+ checkNameNodeSafeMode("Cannot add cache directive");
FSNDNCacheOp.modifyCacheDirective(this, cacheManager, directive, flags,
logRetryCache);
success = true;
@@ -7728,10 +7722,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
writeLock();
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot remove cache directives", safeMode);
- }
+ checkNameNodeSafeMode("Cannot remove cache directives");
FSNDNCacheOp.removeCacheDirective(this, cacheManager, id, logRetryCache);
success = true;
} finally {
@@ -7771,10 +7762,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
String poolInfoStr = null;
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot add cache pool " + req.getPoolName(), safeMode);
- }
+ checkNameNodeSafeMode("Cannot add cache pool"
+ + (req == null ? null : req.getPoolName()));
CachePoolInfo info = FSNDNCacheOp.addCachePool(this, cacheManager, req,
logRetryCache);
poolInfoStr = info.toString();
@@ -7794,10 +7783,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
boolean success = false;
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot modify cache pool " + req.getPoolName(), safeMode);
- }
+ checkNameNodeSafeMode("Cannot modify cache pool"
+ + (req == null ? null : req.getPoolName()));
FSNDNCacheOp.modifyCachePool(this, cacheManager, req, logRetryCache);
success = true;
} finally {
@@ -7818,10 +7805,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
boolean success = false;
try {
checkOperation(OperationCategory.WRITE);
- if (isInSafeMode()) {
- throw new SafeModeException(
- "Cannot remove cache pool " + cachePoolName, safeMode);
- }
+ checkNameNodeSafeMode("Cannot modify cache pool" + cachePoolName);
FSNDNCacheOp.removeCachePool(this, cacheManager, cachePoolName,
logRetryCache);
success = true;