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/15 12:54:58 UTC
[10/27] 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/58b1598b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/58b1598b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/58b1598b
Branch: refs/heads/branch-1
Commit: 58b1598b44981b495760a3c20fc12457eeb134f3
Parents: bea57f2
Author: Matteo Bertozzi <ma...@cloudera.com>
Authored: Thu Apr 9 20:47:46 2015 +0100
Committer: Matteo Bertozzi <ma...@cloudera.com>
Committed: Wed Apr 15 11:01:36 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/TableStateManager.java | 14 +-
.../apache/hadoop/hbase/ipc/RpcCallContext.java | 6 +
.../org/apache/hadoop/hbase/ipc/RpcServer.java | 13 +
.../org/apache/hadoop/hbase/master/HMaster.java | 109 +-
.../hadoop/hbase/master/MasterServices.java | 18 +-
.../hbase/master/TableNamespaceManager.java | 19 +-
.../master/procedure/CreateTableProcedure.java | 458 +++
.../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 | 180 ++
.../procedure/TableProcedureInterface.java | 46 +
.../hadoop/hbase/quotas/MasterQuotaManager.java | 18 +-
.../hbase/regionserver/HRegionServer.java | 9 +-
.../hadoop/hbase/util/ModifyRegionUtils.java | 24 +
.../hbase/zookeeper/ZKTableStateManager.java | 57 +-
.../hadoop/hbase/master/TestCatalogJanitor.java | 7 +
.../MasterProcedureTestingUtility.java | 317 +++
.../procedure/TestCreateTableProcedure.java | 256 ++
.../procedure/TestDeleteTableProcedure.java | 207 ++
.../TestMasterFailoverWithProcedures.java | 290 ++
.../procedure/TestMasterProcedureQueue.java | 432 +++
31 files changed, 6352 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/58b1598b/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 37ef788..9ace7d9 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
@@ -179,8 +179,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");
}
// If the passed in 'connection' is 'managed' -- i.e. every second test uses
// a Table or an HBaseAdmin with managed connections -- then doing
http://git-wip-us.apache.org/repos/asf/hbase/blob/58b1598b/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/58b1598b/hbase-protocol/pom.xml
----------------------------------------------------------------------
diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml
index 015f039..2794e78 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>