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/a7f9b6dc Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a7f9b6dc Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a7f9b6dc Branch: refs/heads/hbase-12439 Commit: a7f9b6dc6ad049efb5873eeddcfacaa4c2d9488e Parents: 9d763cd Author: Matteo Bertozzi <[email protected]> Authored: Thu Apr 9 20:47:46 2015 +0100 Committer: Matteo Bertozzi <[email protected]> Committed: Thu Apr 9 21:01:46 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 | 439 +++ .../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 | 256 ++ .../procedure/TestDeleteTableProcedure.java | 208 ++ .../TestMasterFailoverWithProcedures.java | 291 ++ .../procedure/TestMasterProcedureQueue.java | 433 +++ 29 files changed, 6276 insertions(+), 54 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/a7f9b6dc/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/a7f9b6dc/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") [email protected] +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/a7f9b6dc/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>
