You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2015/04/10 09:55:29 UTC

[08/28] hbase git commit: HBASE-13203 Procedure v2 - master create/delete table

HBASE-13203 Procedure v2 - master create/delete table


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

Branch: refs/heads/hbase-12439
Commit: 9d684ac31f65c71db54104676cdd9458c2f881e0
Parents: aaf7751
Author: Matteo Bertozzi <ma...@cloudera.com>
Authored: Thu Apr 9 20:47:46 2015 +0100
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Fri Apr 10 08:55:05 2015 +0100

----------------------------------------------------------------------
 .../apache/hadoop/hbase/MetaTableAccessor.java  |    4 +-
 .../hbase/exceptions/TimeoutIOException.java    |   46 +
 hbase-protocol/pom.xml                          |    1 +
 .../generated/MasterProcedureProtos.java        | 2633 ++++++++++++++++++
 .../src/main/protobuf/MasterProcedure.proto     |   74 +
 hbase-server/pom.xml                            |   10 +
 .../apache/hadoop/hbase/ipc/RpcCallContext.java |    6 +
 .../org/apache/hadoop/hbase/ipc/RpcServer.java  |   15 +-
 .../org/apache/hadoop/hbase/master/HMaster.java |  106 +-
 .../hadoop/hbase/master/MasterServices.java     |    7 +
 .../hbase/master/TableNamespaceManager.java     |   19 +-
 .../master/procedure/CreateTableProcedure.java  |  442 +++
 .../master/procedure/DeleteTableProcedure.java  |  420 +++
 .../procedure/MasterProcedureConstants.java     |   31 +
 .../master/procedure/MasterProcedureEnv.java    |  123 +
 .../master/procedure/MasterProcedureQueue.java  |  448 +++
 .../master/procedure/MasterProcedureUtil.java   |   56 +
 .../master/procedure/ProcedurePrepareLatch.java |  105 +
 .../master/procedure/ProcedureSyncWait.java     |  179 ++
 .../procedure/TableProcedureInterface.java      |   46 +
 .../hadoop/hbase/quotas/MasterQuotaManager.java |   15 +-
 .../hbase/regionserver/HRegionServer.java       |    9 +-
 .../hadoop/hbase/util/ModifyRegionUtils.java    |   24 +
 .../hadoop/hbase/master/TestCatalogJanitor.java |    9 +-
 .../MasterProcedureTestingUtility.java          |  317 +++
 .../procedure/TestCreateTableProcedure.java     |  257 ++
 .../procedure/TestDeleteTableProcedure.java     |  208 ++
 .../TestMasterFailoverWithProcedures.java       |  291 ++
 .../procedure/TestMasterProcedureQueue.java     |  433 +++
 29 files changed, 6280 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9d684ac3/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
index d18239b..ea29e4f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
@@ -249,8 +249,10 @@ public class MetaTableAccessor {
   static Table getMetaHTable(final Connection connection)
   throws IOException {
     // We used to pass whole CatalogTracker in here, now we just pass in Connection
-    if (connection == null || connection.isClosed()) {
+    if (connection == null) {
       throw new NullPointerException("No connection");
+    } else if (connection.isClosed()) {
+      throw new IOException("connection is closed");
     }
     return connection.getTable(TableName.META_TABLE_NAME);
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/9d684ac3/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/TimeoutIOException.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/TimeoutIOException.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/TimeoutIOException.java
new file mode 100644
index 0000000..4e1ee39
--- /dev/null
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/exceptions/TimeoutIOException.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hbase.exceptions;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hbase.classification.InterfaceAudience;
+
+/**
+ * Exception thrown when a blocking operation times out.
+ */
+@SuppressWarnings("serial")
+@InterfaceAudience.Private
+public class TimeoutIOException extends IOException {
+  public TimeoutIOException() {
+    super();
+  }
+
+  public TimeoutIOException(final String message) {
+    super(message);
+  }
+
+  public TimeoutIOException(final String message, final Throwable t) {
+    super(message, t);
+  }
+
+  public TimeoutIOException(final Throwable t) {
+    super(t);
+  }
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/9d684ac3/hbase-protocol/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml
index 0d33332..fb5e0ab 100644
--- a/hbase-protocol/pom.xml
+++ b/hbase-protocol/pom.xml
@@ -175,6 +175,7 @@
                           <include>LoadBalancer.proto</include>
                           <include>MapReduce.proto</include>
                           <include>Master.proto</include>
+                          <include>MasterProcedure.proto</include>
                           <include>MultiRowMutation.proto</include>
                           <include>Procedure.proto</include>
                           <include>Quota.proto</include>