From 53fa76bc013a14d94d6915a512fda3c41f38fb07 Mon Sep 17 00:00:00 2001 From: tedyu Date: Wed, 13 Jan 2016 15:20:06 -0800 Subject: [PATCH] HBASE-15099 Move RegionStateListener class out of quotas package --- .../hadoop/hbase/RegionStateListener.java | 53 +++++++++++++++++++ .../hbase/master/AssignmentManager.java | 2 +- .../apache/hadoop/hbase/master/HMaster.java | 2 +- .../hbase/quotas/MasterQuotaManager.java | 1 + .../hbase/quotas/RegionStateListener.java | 44 --------------- 5 files changed, 56 insertions(+), 46 deletions(-) create mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/RegionStateListener.java delete mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionStateListener.java diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionStateListener.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionStateListener.java new file mode 100644 index 00000000000..22725ec7140 --- /dev/null +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/RegionStateListener.java @@ -0,0 +1,53 @@ +/** + * 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; + +import java.io.IOException; + +import org.apache.hadoop.hbase.classification.InterfaceAudience; + +/** + * The listener interface for receiving region state events. + */ +@InterfaceAudience.Private +public interface RegionStateListener { + + /** + * Process region split event. + * + * @param hri An instance of HRegionInfo + * @throws IOException + */ + void onRegionSplit(HRegionInfo hri) throws IOException; + + /** + * Process region split reverted event. + * + * @param hri An instance of HRegionInfo + * @throws IOException Signals that an I/O exception has occurred. + */ + void onRegionSplitReverted(HRegionInfo hri) throws IOException; + + /** + * Process region merge event. + * + * @param hri An instance of HRegionInfo + * @throws IOException + */ + void onRegionMerged(HRegionInfo hri) throws IOException; +} 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 83f9d722404..7833985a043 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 @@ -57,6 +57,7 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.NotServingRegionException; import org.apache.hadoop.hbase.RegionLocations; +import org.apache.hadoop.hbase.RegionStateListener; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -88,7 +89,6 @@ import org.apache.hadoop.hbase.master.handler.OpenedRegionHandler; import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition; import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; -import org.apache.hadoop.hbase.quotas.RegionStateListener; import org.apache.hadoop.hbase.regionserver.RegionAlreadyInTransitionException; import org.apache.hadoop.hbase.regionserver.RegionOpeningState; import org.apache.hadoop.hbase.regionserver.RegionServerAbortedException; 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 6761bfc719e..2999789a3d5 100644 --- 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 @@ -65,6 +65,7 @@ import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.NamespaceNotFoundException; import org.apache.hadoop.hbase.PleaseHoldException; import org.apache.hadoop.hbase.ProcedureInfo; +import org.apache.hadoop.hbase.RegionStateListener; import org.apache.hadoop.hbase.Server; import org.apache.hadoop.hbase.ServerLoad; import org.apache.hadoop.hbase.ServerName; @@ -126,7 +127,6 @@ import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionServerInfo; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos; import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode; import org.apache.hadoop.hbase.quotas.MasterQuotaManager; -import org.apache.hadoop.hbase.quotas.RegionStateListener; import org.apache.hadoop.hbase.regionserver.DefaultStoreEngine; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.regionserver.HStore; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java index 65759e86e2d..2442498fbb2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java @@ -20,6 +20,7 @@ import org.apache.hadoop.hbase.DoNotRetryIOException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.MetaTableAccessor; import org.apache.hadoop.hbase.NamespaceDescriptor; +import org.apache.hadoop.hbase.RegionStateListener; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionStateListener.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionStateListener.java deleted file mode 100644 index 7d4ad197065..00000000000 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionStateListener.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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.quotas; - -import java.io.IOException; - -import org.apache.hadoop.hbase.HRegionInfo; -import org.apache.hadoop.hbase.classification.InterfaceAudience; - -/** - * The listener interface for receiving region state events. - */ -@InterfaceAudience.Private -public interface RegionStateListener { - - /** - * Process region split event. - * @param hri An instance of HRegionInfo - * @throws IOException - */ - void onRegionSplit(HRegionInfo hri) throws IOException; - - /** - * Process region split reverted event. - * @param hri An instance of HRegionInfo - * @throws IOException Signals that an I/O exception has occurred. - */ - void onRegionSplitReverted(HRegionInfo hri) throws IOException; - - /** - * Process region merge event. - * @param hri An instance of HRegionInfo - * @throws IOException - */ - void onRegionMerged(HRegionInfo hri) throws IOException; -}