hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-16532 Procedure-V2: Enforce procedure ownership at submission
Date Wed, 31 Aug 2016 19:56:02 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 605af9513 -> 5376106d0


HBASE-16532 Procedure-V2: Enforce procedure ownership at submission


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

Branch: refs/heads/master
Commit: 5376106d05cd5d5a49a4fd65d90de442777883f9
Parents: 605af95
Author: tedyu <yuzhihong@gmail.com>
Authored: Wed Aug 31 12:55:54 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Aug 31 12:55:54 2016 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/procedure2/ProcedureExecutor.java   | 7 +++++++
 hbase-procedure/src/test/resources/hbase-site.xml           | 9 ++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5376106d/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
index ba7ba6f..5042329 100644
--- a/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
+++ b/hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureExecutor.java
@@ -246,6 +246,9 @@ public class ProcedureExecutor<TEnvironment> {
   private final ProcedureStore store;
   private final Configuration conf;
 
+  private static final String CHECK_OWNER_SET_CONF_KEY = "hbase.procedure.check.owner.set";
+  private final boolean checkOwnerSet;
+
   private Thread[] threads;
 
   public ProcedureExecutor(final Configuration conf, final TEnvironment environment,
@@ -259,6 +262,7 @@ public class ProcedureExecutor<TEnvironment> {
     this.runnables = runqueue;
     this.store = store;
     this.conf = conf;
+    this.checkOwnerSet = conf.getBoolean(CHECK_OWNER_SET_CONF_KEY, true);
   }
 
   private void load(final boolean abortOnCorruption) throws IOException {
@@ -640,6 +644,9 @@ public class ProcedureExecutor<TEnvironment> {
     Preconditions.checkArgument(isRunning());
     Preconditions.checkArgument(lastProcId.get() >= 0);
     Preconditions.checkArgument(!proc.hasParent());
+    if (this.checkOwnerSet) {
+      Preconditions.checkArgument(proc.hasOwner());
+    }
 
     // Initialize the Procedure ID
     long currentProcId = nextProcId();

http://git-wip-us.apache.org/repos/asf/hbase/blob/5376106d/hbase-procedure/src/test/resources/hbase-site.xml
----------------------------------------------------------------------
diff --git a/hbase-procedure/src/test/resources/hbase-site.xml b/hbase-procedure/src/test/resources/hbase-site.xml
index 063dafb..d350127 100644
--- a/hbase-procedure/src/test/resources/hbase-site.xml
+++ b/hbase-procedure/src/test/resources/hbase-site.xml
@@ -21,8 +21,15 @@
  */
 -->
 <configuration>
-    <property>
+  <property>
     <name>hbase.procedure.store.wal.use.hsync</name>
     <value>false</value>
   </property>
+  <property>
+    <name>hbase.procedure.check.owner.set</name>
+    <value>false</value>
+    <description>Whether ProcedureExecutor should enforce that each
+    procedure to have an owner
+    </description>
+  </property>
 </configuration>


Mime
View raw message