[09/50] [abbrv] hbase git commit: HBASE-15044 Region normalization should be allowed when underlying namespace has quota

2016-01-14 Thread jmhsieh
HBASE-15044 Region normalization should be allowed when underlying namespace 
has quota


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

Branch: refs/heads/trunk
Commit: c1b6d47e7974a5d9d75933bab9a28572e9d95c14
Parents: 07b6236
Author: tedyu 
Authored: Wed Dec 30 08:04:23 2015 -0800
Committer: tedyu 
Committed: Wed Dec 30 08:04:23 2015 -0800

--
 .../hadoop/hbase/master/AssignmentManager.java  | 19 ++--
 .../org/apache/hadoop/hbase/master/HMaster.java | 14 +++---
 .../hadoop/hbase/master/MasterServices.java |  6 +++
 .../normalizer/EmptyNormalizationPlan.java  |  6 +++
 .../normalizer/MergeNormalizationPlan.java  |  6 +++
 .../master/normalizer/NormalizationPlan.java| 10 
 .../master/normalizer/RegionNormalizer.java | 16 +++
 .../normalizer/SimpleRegionNormalizer.java  | 12 +
 .../normalizer/SplitNormalizationPlan.java  |  6 +++
 .../hadoop/hbase/master/TestCatalogJanitor.java |  6 +++
 .../TestSimpleRegionNormalizerOnCluster.java| 50 +++-
 .../hbase/namespace/TestNamespaceAuditor.java   | 10 ++--
 12 files changed, 135 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index f7f98fe..4feb2e7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -72,8 +72,10 @@ import 
org.apache.hadoop.hbase.master.balancer.FavoredNodeAssignmentHelper;
 import org.apache.hadoop.hbase.master.balancer.FavoredNodeLoadBalancer;
 import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
 import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
+import org.apache.hadoop.hbase.master.normalizer.NormalizationPlan.PlanType;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
+import org.apache.hadoop.hbase.quotas.QuotaExceededException;
 import org.apache.hadoop.hbase.quotas.RegionStateListener;
 import org.apache.hadoop.hbase.regionserver.RegionOpeningState;
 import org.apache.hadoop.hbase.regionserver.RegionServerAbortedException;
@@ -1654,9 +1656,13 @@ public class AssignmentManager {
 }
   }
   RegionLocations rl =  MetaTableAccessor.getRegionLocations(result);
-  if (rl == null) continue;
+  if (rl == null) {
+continue;
+  }
   HRegionLocation[] locations = rl.getRegionLocations();
-  if (locations == null) continue;
+  if (locations == null) {
+continue;
+  }
   for (HRegionLocation hrl : locations) {
 if (hrl == null) continue;
 HRegionInfo regionInfo = hrl.getRegionInfo();
@@ -1996,7 +2002,9 @@ public class AssignmentManager {
*/
   public boolean waitOnRegionToClearRegionsInTransition(final HRegionInfo hri, 
long timeOut)
   throws InterruptedException {
-if (!regionStates.isRegionInTransition(hri)) return true;
+if (!regionStates.isRegionInTransition(hri)) {
+  return true;
+}
 long end = (timeOut <= 0) ? Long.MAX_VALUE : 
EnvironmentEdgeManager.currentTime()
 + timeOut;
 // There is already a timeout monitor on regions in transition so I
@@ -2836,7 +2844,10 @@ public class AssignmentManager {
   regionStateListener.onRegionSplit(hri);
   errorMsg = onRegionReadyToSplit(current, hri, serverName, 
transition);
 } catch (IOException exp) {
-  errorMsg = StringUtils.stringifyException(exp);
+if (exp instanceof QuotaExceededException) {
+  server.getRegionNormalizer().planSkipped(hri, PlanType.SPLIT);
+}
+errorMsg = StringUtils.stringifyException(exp);
 }
 break;
   case SPLIT_PONR:

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index bdb19f4..8e51f25 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/

[23/29] hbase git commit: HBASE-15044 Region normalization should be allowed when underlying namespace has quota

2016-01-04 Thread syuanjiang
HBASE-15044 Region normalization should be allowed when underlying namespace 
has quota


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

Branch: refs/heads/hbase-12439
Commit: c1b6d47e7974a5d9d75933bab9a28572e9d95c14
Parents: 07b6236
Author: tedyu 
Authored: Wed Dec 30 08:04:23 2015 -0800
Committer: tedyu 
Committed: Wed Dec 30 08:04:23 2015 -0800

--
 .../hadoop/hbase/master/AssignmentManager.java  | 19 ++--
 .../org/apache/hadoop/hbase/master/HMaster.java | 14 +++---
 .../hadoop/hbase/master/MasterServices.java |  6 +++
 .../normalizer/EmptyNormalizationPlan.java  |  6 +++
 .../normalizer/MergeNormalizationPlan.java  |  6 +++
 .../master/normalizer/NormalizationPlan.java| 10 
 .../master/normalizer/RegionNormalizer.java | 16 +++
 .../normalizer/SimpleRegionNormalizer.java  | 12 +
 .../normalizer/SplitNormalizationPlan.java  |  6 +++
 .../hadoop/hbase/master/TestCatalogJanitor.java |  6 +++
 .../TestSimpleRegionNormalizerOnCluster.java| 50 +++-
 .../hbase/namespace/TestNamespaceAuditor.java   | 10 ++--
 12 files changed, 135 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index f7f98fe..4feb2e7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -72,8 +72,10 @@ import 
org.apache.hadoop.hbase.master.balancer.FavoredNodeAssignmentHelper;
 import org.apache.hadoop.hbase.master.balancer.FavoredNodeLoadBalancer;
 import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
 import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
+import org.apache.hadoop.hbase.master.normalizer.NormalizationPlan.PlanType;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
+import org.apache.hadoop.hbase.quotas.QuotaExceededException;
 import org.apache.hadoop.hbase.quotas.RegionStateListener;
 import org.apache.hadoop.hbase.regionserver.RegionOpeningState;
 import org.apache.hadoop.hbase.regionserver.RegionServerAbortedException;
@@ -1654,9 +1656,13 @@ public class AssignmentManager {
 }
   }
   RegionLocations rl =  MetaTableAccessor.getRegionLocations(result);
-  if (rl == null) continue;
+  if (rl == null) {
+continue;
+  }
   HRegionLocation[] locations = rl.getRegionLocations();
-  if (locations == null) continue;
+  if (locations == null) {
+continue;
+  }
   for (HRegionLocation hrl : locations) {
 if (hrl == null) continue;
 HRegionInfo regionInfo = hrl.getRegionInfo();
@@ -1996,7 +2002,9 @@ public class AssignmentManager {
*/
   public boolean waitOnRegionToClearRegionsInTransition(final HRegionInfo hri, 
long timeOut)
   throws InterruptedException {
-if (!regionStates.isRegionInTransition(hri)) return true;
+if (!regionStates.isRegionInTransition(hri)) {
+  return true;
+}
 long end = (timeOut <= 0) ? Long.MAX_VALUE : 
EnvironmentEdgeManager.currentTime()
 + timeOut;
 // There is already a timeout monitor on regions in transition so I
@@ -2836,7 +2844,10 @@ public class AssignmentManager {
   regionStateListener.onRegionSplit(hri);
   errorMsg = onRegionReadyToSplit(current, hri, serverName, 
transition);
 } catch (IOException exp) {
-  errorMsg = StringUtils.stringifyException(exp);
+if (exp instanceof QuotaExceededException) {
+  server.getRegionNormalizer().planSkipped(hri, PlanType.SPLIT);
+}
+errorMsg = StringUtils.stringifyException(exp);
 }
 break;
   case SPLIT_PONR:

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index bdb19f4..8e51f25 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/m

hbase git commit: HBASE-15044 Region normalization should be allowed when underlying namespace has quota

2015-12-30 Thread tedyu
Repository: hbase
Updated Branches:
  refs/heads/master 07b623670 -> c1b6d47e7


HBASE-15044 Region normalization should be allowed when underlying namespace 
has quota


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

Branch: refs/heads/master
Commit: c1b6d47e7974a5d9d75933bab9a28572e9d95c14
Parents: 07b6236
Author: tedyu 
Authored: Wed Dec 30 08:04:23 2015 -0800
Committer: tedyu 
Committed: Wed Dec 30 08:04:23 2015 -0800

--
 .../hadoop/hbase/master/AssignmentManager.java  | 19 ++--
 .../org/apache/hadoop/hbase/master/HMaster.java | 14 +++---
 .../hadoop/hbase/master/MasterServices.java |  6 +++
 .../normalizer/EmptyNormalizationPlan.java  |  6 +++
 .../normalizer/MergeNormalizationPlan.java  |  6 +++
 .../master/normalizer/NormalizationPlan.java| 10 
 .../master/normalizer/RegionNormalizer.java | 16 +++
 .../normalizer/SimpleRegionNormalizer.java  | 12 +
 .../normalizer/SplitNormalizationPlan.java  |  6 +++
 .../hadoop/hbase/master/TestCatalogJanitor.java |  6 +++
 .../TestSimpleRegionNormalizerOnCluster.java| 50 +++-
 .../hbase/namespace/TestNamespaceAuditor.java   | 10 ++--
 12 files changed, 135 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
index f7f98fe..4feb2e7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
@@ -72,8 +72,10 @@ import 
org.apache.hadoop.hbase.master.balancer.FavoredNodeAssignmentHelper;
 import org.apache.hadoop.hbase.master.balancer.FavoredNodeLoadBalancer;
 import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
 import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
+import org.apache.hadoop.hbase.master.normalizer.NormalizationPlan.PlanType;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition;
 import 
org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode;
+import org.apache.hadoop.hbase.quotas.QuotaExceededException;
 import org.apache.hadoop.hbase.quotas.RegionStateListener;
 import org.apache.hadoop.hbase.regionserver.RegionOpeningState;
 import org.apache.hadoop.hbase.regionserver.RegionServerAbortedException;
@@ -1654,9 +1656,13 @@ public class AssignmentManager {
 }
   }
   RegionLocations rl =  MetaTableAccessor.getRegionLocations(result);
-  if (rl == null) continue;
+  if (rl == null) {
+continue;
+  }
   HRegionLocation[] locations = rl.getRegionLocations();
-  if (locations == null) continue;
+  if (locations == null) {
+continue;
+  }
   for (HRegionLocation hrl : locations) {
 if (hrl == null) continue;
 HRegionInfo regionInfo = hrl.getRegionInfo();
@@ -1996,7 +2002,9 @@ public class AssignmentManager {
*/
   public boolean waitOnRegionToClearRegionsInTransition(final HRegionInfo hri, 
long timeOut)
   throws InterruptedException {
-if (!regionStates.isRegionInTransition(hri)) return true;
+if (!regionStates.isRegionInTransition(hri)) {
+  return true;
+}
 long end = (timeOut <= 0) ? Long.MAX_VALUE : 
EnvironmentEdgeManager.currentTime()
 + timeOut;
 // There is already a timeout monitor on regions in transition so I
@@ -2836,7 +2844,10 @@ public class AssignmentManager {
   regionStateListener.onRegionSplit(hri);
   errorMsg = onRegionReadyToSplit(current, hri, serverName, 
transition);
 } catch (IOException exp) {
-  errorMsg = StringUtils.stringifyException(exp);
+if (exp instanceof QuotaExceededException) {
+  server.getRegionNormalizer().planSkipped(hri, PlanType.SPLIT);
+}
+errorMsg = StringUtils.stringifyException(exp);
 }
 break;
   case SPLIT_PONR:

http://git-wip-us.apache.org/repos/asf/hbase/blob/c1b6d47e/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
--
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index bdb19f