diff --git a/CHANGES.txt b/CHANGES.txt index c7457b10ce4..1f8735f95e7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -922,6 +922,7 @@ Release 0.21.0 - Unreleased HBASE-2941 port HADOOP-6713 - threading scalability for RPC reads - to HBase HBASE-2782 QOS for META table access HBASE-3017 More log pruning + HBASE-3022 Change format of enum messages in o.a.h.h.executor package NEW FEATURES HBASE-1961 HBase EC2 scripts diff --git a/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java b/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java index 73a2d9557d0..4b0b77586a8 100644 --- a/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java @@ -100,31 +100,31 @@ public abstract class EventHandler implements Runnable, Comparable { public enum EventType { // Messages originating from RS (NOTE: there is NO direct communication from // RS to Master). These are a result of RS updates into ZK. - RS2ZK_REGION_CLOSING (1), // RS is in process of closing a region - RS2ZK_REGION_CLOSED (2), // RS has finished closing a region - RS2ZK_REGION_OPENING (3), // RS is in process of opening a region - RS2ZK_REGION_OPENED (4), // RS has finished opening a region + RS_ZK_REGION_CLOSING (1), // RS is in process of closing a region + RS_ZK_REGION_CLOSED (2), // RS has finished closing a region + RS_ZK_REGION_OPENING (3), // RS is in process of opening a region + RS_ZK_REGION_OPENED (4), // RS has finished opening a region // Messages originating from Master to RS - M2RS_OPEN_REGION (20), // Master asking RS to open a region - M2RS_OPEN_ROOT (21), // Master asking RS to open root - M2RS_OPEN_META (22), // Master asking RS to open meta - M2RS_CLOSE_REGION (23), // Master asking RS to close a region - M2RS_CLOSE_ROOT (24), // Master asking RS to close root - M2RS_CLOSE_META (25), // Master asking RS to close meta + M_RS_OPEN_REGION (20), // Master asking RS to open a region + M_RS_OPEN_ROOT (21), // Master asking RS to open root + M_RS_OPEN_META (22), // Master asking RS to open meta + M_RS_CLOSE_REGION (23), // Master asking RS to close a region + M_RS_CLOSE_ROOT (24), // Master asking RS to close root + M_RS_CLOSE_META (25), // Master asking RS to close meta // Messages originating from Client to Master - C2M_DELETE_TABLE (40), // Client asking Master to delete a table - C2M_DISABLE_TABLE (41), // Client asking Master to disable a table - C2M_ENABLE_TABLE (42), // Client asking Master to enable a table - C2M_MODIFY_TABLE (43), // Client asking Master to modify a table - C2M_ADD_FAMILY (44), // Client asking Master to add family to table - C2M_DELETE_FAMILY (45), // Client asking Master to delete family of table - C2M_MODIFY_FAMILY (46), // Client asking Master to modify family of table + C_M_DELETE_TABLE (40), // Client asking Master to delete a table + C_M_DISABLE_TABLE (41), // Client asking Master to disable a table + C_M_ENABLE_TABLE (42), // Client asking Master to enable a table + C_M_MODIFY_TABLE (43), // Client asking Master to modify a table + C_M_ADD_FAMILY (44), // Client asking Master to add family to table + C_M_DELETE_FAMILY (45), // Client asking Master to delete family of table + C_M_MODIFY_FAMILY (46), // Client asking Master to modify family of table // Updates from master to ZK. This is done by the master and there is // nothing to process by either Master or RS - M2ZK_REGION_OFFLINE (50), // Master adds this region as offline in ZK + M_ZK_REGION_OFFLINE (50), // Master adds this region as offline in ZK // Master controlled events to be executed on the master M_SERVER_SHUTDOWN (70); // Master is processing shutdown of a RS diff --git a/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java b/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java index d8a20abb608..92d864e5282 100644 --- a/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java +++ b/src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java @@ -106,39 +106,39 @@ public class ExecutorService { switch(type) { // Master executor services - case RS2ZK_REGION_CLOSED: + case RS_ZK_REGION_CLOSED: return ExecutorType.MASTER_CLOSE_REGION; - case RS2ZK_REGION_OPENED: + case RS_ZK_REGION_OPENED: return ExecutorType.MASTER_OPEN_REGION; case M_SERVER_SHUTDOWN: return ExecutorType.MASTER_SERVER_OPERATIONS; - case C2M_DELETE_TABLE: - case C2M_DISABLE_TABLE: - case C2M_ENABLE_TABLE: - case C2M_MODIFY_TABLE: + case C_M_DELETE_TABLE: + case C_M_DISABLE_TABLE: + case C_M_ENABLE_TABLE: + case C_M_MODIFY_TABLE: return ExecutorType.MASTER_TABLE_OPERATIONS; // RegionServer executor services - case M2RS_OPEN_REGION: + case M_RS_OPEN_REGION: return ExecutorType.RS_OPEN_REGION; - case M2RS_OPEN_ROOT: + case M_RS_OPEN_ROOT: return ExecutorType.RS_OPEN_ROOT; - case M2RS_OPEN_META: + case M_RS_OPEN_META: return ExecutorType.RS_OPEN_META; - case M2RS_CLOSE_REGION: + case M_RS_CLOSE_REGION: return ExecutorType.RS_CLOSE_REGION; - case M2RS_CLOSE_ROOT: + case M_RS_CLOSE_ROOT: return ExecutorType.RS_CLOSE_ROOT; - case M2RS_CLOSE_META: + case M_RS_CLOSE_META: return ExecutorType.RS_CLOSE_META; default: diff --git a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java index d1a061c7ec5..210b89d87c1 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java @@ -33,7 +33,6 @@ import java.util.NavigableMap; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import java.util.concurrent.locks.ReentrantLock; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -190,7 +189,7 @@ public class AssignmentManager extends ZooKeeperListener { MetaReader.getRegion(catalogTracker, data.getRegionName()).getFirst(); String encodedName = regionInfo.getEncodedName(); switch(data.getEventType()) { - case RS2ZK_REGION_CLOSING: + case RS_ZK_REGION_CLOSING: // Just insert region into RIT. // If this never updates the timeout will trigger new assignment regionsInTransition.put(encodedName, @@ -198,7 +197,7 @@ public class AssignmentManager extends ZooKeeperListener { data.getStamp())); break; - case RS2ZK_REGION_CLOSED: + case RS_ZK_REGION_CLOSED: // Region is closed, insert into RIT and handle it regionsInTransition.put(encodedName, new RegionState(regionInfo, RegionState.State.CLOSED, @@ -206,7 +205,7 @@ public class AssignmentManager extends ZooKeeperListener { new ClosedRegionHandler(master, this, data, regionInfo).process(); break; - case RS2ZK_REGION_OPENING: + case RS_ZK_REGION_OPENING: // Just insert region into RIT // If this never updates the timeout will trigger new assignment regionsInTransition.put(encodedName, @@ -214,7 +213,7 @@ public class AssignmentManager extends ZooKeeperListener { data.getStamp())); break; - case RS2ZK_REGION_OPENED: + case RS_ZK_REGION_OPENED: // Region is opened, insert into RIT and handle it regionsInTransition.put(encodedName, new RegionState(regionInfo, RegionState.State.OPENING, @@ -250,11 +249,11 @@ public class AssignmentManager extends ZooKeeperListener { ", server=" + data.getServerName() + ", region=" + prettyPrintedRegionName); RegionState regionState = regionsInTransition.get(encodedName); switch(data.getEventType()) { - case M2ZK_REGION_OFFLINE: + case M_ZK_REGION_OFFLINE: // Nothing to do. break; - case RS2ZK_REGION_CLOSING: + case RS_ZK_REGION_CLOSING: // Should see CLOSING after we have asked it to CLOSE or additional // times after already being in state of CLOSING if (regionState == null || @@ -269,7 +268,7 @@ public class AssignmentManager extends ZooKeeperListener { regionState.update(RegionState.State.CLOSING, data.getStamp()); break; - case RS2ZK_REGION_CLOSED: + case RS_ZK_REGION_CLOSED: // Should see CLOSED after CLOSING but possible after PENDING_CLOSE if (regionState == null || (!regionState.isPendingClose() && !regionState.isClosing())) { @@ -287,7 +286,7 @@ public class AssignmentManager extends ZooKeeperListener { this, data, regionState.getRegion())); break; - case RS2ZK_REGION_OPENING: + case RS_ZK_REGION_OPENING: // Should see OPENING after we have asked it to OPEN or additional // times after already being in state of OPENING if(regionState == null || @@ -303,7 +302,7 @@ public class AssignmentManager extends ZooKeeperListener { regionState.update(RegionState.State.OPENING, data.getStamp()); break; - case RS2ZK_REGION_OPENED: + case RS_ZK_REGION_OPENED: // Should see OPENED after OPENING but possible after PENDING_OPEN if(regionState == null || (!regionState.isPendingOpen() && !regionState.isOpening())) { diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java index 12f8f24a70b..aa582ab70d6 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java @@ -63,7 +63,7 @@ public class ClosedRegionHandler extends EventHandler implements TotesHRegionInf public ClosedRegionHandler(Server server, AssignmentManager assignmentManager, RegionTransitionData data, HRegionInfo regionInfo) { - super(server, EventType.RS2ZK_REGION_CLOSED); + super(server, EventType.RS_ZK_REGION_CLOSED); this.assignmentManager = assignmentManager; this.data = data; this.regionInfo = regionInfo; diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java index e20f15cf256..4b00e60139a 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/DeleteTableHandler.java @@ -34,7 +34,7 @@ public class DeleteTableHandler extends TableEventHandler { public DeleteTableHandler(byte [] tableName, Server server, final MasterServices masterServices) throws IOException { - super(EventType.C2M_DELETE_TABLE, tableName, server, masterServices); + super(EventType.C_M_DELETE_TABLE, tableName, server, masterServices); } @Override diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java index c3778e167ad..47a4aaa4fb7 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/DisableTableHandler.java @@ -44,7 +44,7 @@ public class DisableTableHandler extends EventHandler { public DisableTableHandler(Server server, byte [] tableName, CatalogTracker catalogTracker, AssignmentManager assignmentManager) throws TableNotFoundException, IOException { - super(server, EventType.C2M_DISABLE_TABLE); + super(server, EventType.C_M_DISABLE_TABLE); this.tableName = tableName; this.tableNameStr = Bytes.toString(this.tableName); this.assignmentManager = assignmentManager; diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java index 0fc1cc3cd4a..cb96fb619c6 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/EnableTableHandler.java @@ -45,7 +45,7 @@ public class EnableTableHandler extends EventHandler { public EnableTableHandler(Server server, byte [] tableName, CatalogTracker catalogTracker, AssignmentManager assignmentManager) throws TableNotFoundException, IOException { - super(server, EventType.C2M_ENABLE_TABLE); + super(server, EventType.C_M_ENABLE_TABLE); this.tableName = tableName; this.tableNameStr = Bytes.toString(tableName); this.ct = catalogTracker; diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java index 2dd5378dbac..6380520687a 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java @@ -34,7 +34,7 @@ public class ModifyTableHandler extends TableEventHandler { public ModifyTableHandler(final byte [] tableName, final HTableDescriptor htd, final Server server, final MasterServices masterServices) throws IOException { - super(EventType.C2M_MODIFY_TABLE, tableName, server, masterServices); + super(EventType.C_M_MODIFY_TABLE, tableName, server, masterServices); this.htd = htd; } diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java index 2cd2e809143..0a0b4656636 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java @@ -59,7 +59,7 @@ public class OpenedRegionHandler extends EventHandler implements TotesHRegionInf public OpenedRegionHandler(Server server, AssignmentManager assignmentManager, RegionTransitionData data, HRegionInfo regionInfo, HServerInfo serverInfo) { - super(server, EventType.RS2ZK_REGION_OPENED); + super(server, EventType.RS_ZK_REGION_OPENED); this.assignmentManager = assignmentManager; this.data = data; this.regionInfo = regionInfo; diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java index 148d766fe57..fcea483ec84 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/TableAddFamilyHandler.java @@ -40,7 +40,7 @@ public class TableAddFamilyHandler extends TableEventHandler { public TableAddFamilyHandler(byte[] tableName, HColumnDescriptor familyDesc, Server server, final MasterServices masterServices) throws IOException { - super(EventType.C2M_ADD_FAMILY, tableName, server, masterServices); + super(EventType.C_M_ADD_FAMILY, tableName, server, masterServices); this.familyDesc = familyDesc; } diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java index 1e4ee7fd709..a963c6c7937 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/TableDeleteFamilyHandler.java @@ -40,7 +40,7 @@ public class TableDeleteFamilyHandler extends TableEventHandler { public TableDeleteFamilyHandler(byte[] tableName, byte [] familyName, Server server, final MasterServices masterServices) throws IOException { - super(EventType.C2M_ADD_FAMILY, tableName, server, masterServices); + super(EventType.C_M_ADD_FAMILY, tableName, server, masterServices); this.familyName = familyName; } diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java index b420caedff6..40298938250 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/TableModifyFamilyHandler.java @@ -41,7 +41,7 @@ public class TableModifyFamilyHandler extends TableEventHandler { public TableModifyFamilyHandler(byte[] tableName, HColumnDescriptor familyDesc, Server server, final MasterServices masterServices) throws IOException { - super(EventType.C2M_MODIFY_FAMILY, tableName, server, masterServices); + super(EventType.C_M_MODIFY_FAMILY, tableName, server, masterServices); this.familyDesc = familyDesc; } diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java index 3963b387cf6..e8e95ed4ca8 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseMetaHandler.java @@ -38,6 +38,6 @@ public class CloseMetaHandler extends CloseRegionHandler { final RegionServerServices rsServices, final HRegionInfo regionInfo, final boolean abort, final boolean zk) { - super(server, rsServices, regionInfo, abort, zk, EventType.M2RS_CLOSE_META); + super(server, rsServices, regionInfo, abort, zk, EventType.M_RS_CLOSE_META); } } \ No newline at end of file diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java index 47a5ed4a45b..668f940f0d9 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRegionHandler.java @@ -75,7 +75,7 @@ public class CloseRegionHandler extends EventHandler { public CloseRegionHandler(final Server server, final RegionServerServices rsServices, final HRegionInfo regionInfo, final boolean abort, final boolean zk) { - this(server, rsServices, regionInfo, abort, zk, EventType.M2RS_CLOSE_REGION); + this(server, rsServices, regionInfo, abort, zk, EventType.M_RS_CLOSE_REGION); } protected CloseRegionHandler(final Server server, diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java index e96f70c6d67..fa38ad60670 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/CloseRootHandler.java @@ -38,6 +38,6 @@ public class CloseRootHandler extends CloseRegionHandler { public CloseRootHandler(final Server server, final RegionServerServices rsServices, HRegionInfo regionInfo, final boolean abort, final boolean zk) { - super(server, rsServices, regionInfo, abort, zk, EventType.M2RS_CLOSE_ROOT); + super(server, rsServices, regionInfo, abort, zk, EventType.M_RS_CLOSE_ROOT); } } \ No newline at end of file diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java index dfd2157b964..111c7e60dd4 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenMetaHandler.java @@ -31,6 +31,6 @@ import org.apache.hadoop.hbase.regionserver.RegionServerServices; public class OpenMetaHandler extends OpenRegionHandler { public OpenMetaHandler(final Server server, final RegionServerServices rsServices, HRegionInfo regionInfo) { - super(server,rsServices, regionInfo, EventType.M2RS_OPEN_META); + super(server,rsServices, regionInfo, EventType.M_RS_OPEN_META); } } diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java index 3216d3ab980..01475d5cc96 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRegionHandler.java @@ -48,7 +48,7 @@ public class OpenRegionHandler extends EventHandler { public OpenRegionHandler(final Server server, final RegionServerServices rsServices, HRegionInfo regionInfo) { - this(server, rsServices, regionInfo, EventType.M2RS_OPEN_REGION); + this(server, rsServices, regionInfo, EventType.M_RS_OPEN_REGION); } protected OpenRegionHandler(final Server server, diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java index 94a1ed95e11..3e5e1a6f72d 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/handler/OpenRootHandler.java @@ -31,6 +31,6 @@ import org.apache.hadoop.hbase.regionserver.RegionServerServices; public class OpenRootHandler extends OpenRegionHandler { public OpenRootHandler(final Server server, final RegionServerServices rsServices, HRegionInfo regionInfo) { - super(server, rsServices, regionInfo, EventType.M2RS_OPEN_ROOT); + super(server, rsServices, regionInfo, EventType.M_RS_OPEN_ROOT); } } diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java b/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java index 2ebcdf2fd51..c540ec87e49 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java @@ -1705,7 +1705,7 @@ public class HLog implements Syncable { * @return Path to file into which to dump split log edits. * @throws IOException */ - private static Path getRegionSplitEditsPath(final FileSystem fs, + static Path getRegionSplitEditsPath(final FileSystem fs, final Entry logEntry, final Path rootDir) throws IOException { Path tableDir = HTableDescriptor.getTableDir(rootDir, diff --git a/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java b/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java index 04a30cf831b..584baf1334e 100644 --- a/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java +++ b/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java @@ -129,7 +129,7 @@ public class ZKAssign { public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region, String serverName) throws KeeperException, KeeperException.NodeExistsException { - createNodeOffline(zkw, region, serverName, EventType.M2ZK_REGION_OFFLINE); + createNodeOffline(zkw, region, serverName, EventType.M_ZK_REGION_OFFLINE); } public static void createNodeOffline(ZooKeeperWatcher zkw, HRegionInfo region, @@ -170,7 +170,7 @@ public class ZKAssign { LOG.debug(zkw.prefix("Forcing existing unassigned node for " + region.getEncodedName() + " to OFFLINE state")); RegionTransitionData data = new RegionTransitionData( - EventType.M2ZK_REGION_OFFLINE, region.getRegionName(), serverName); + EventType.M_ZK_REGION_OFFLINE, region.getRegionName(), serverName); synchronized(zkw.getNodes()) { String node = getNodeName(zkw, region.getEncodedName()); zkw.getNodes().add(node); @@ -203,7 +203,7 @@ public class ZKAssign { LOG.debug(zkw.prefix("Creating (or updating) unassigned node for " + region.getEncodedName() + " with OFFLINE state")); RegionTransitionData data = new RegionTransitionData( - EventType.M2ZK_REGION_OFFLINE, region.getRegionName(), serverName); + EventType.M_ZK_REGION_OFFLINE, region.getRegionName(), serverName); synchronized(zkw.getNodes()) { String node = getNodeName(zkw, region.getEncodedName()); zkw.getNodes().add(node); @@ -240,7 +240,7 @@ public class ZKAssign { public static boolean deleteOpenedNode(ZooKeeperWatcher zkw, String regionName) throws KeeperException, KeeperException.NoNodeException { - return deleteNode(zkw, regionName, EventType.RS2ZK_REGION_OPENED); + return deleteNode(zkw, regionName, EventType.RS_ZK_REGION_OPENED); } /** @@ -266,7 +266,7 @@ public class ZKAssign { public static boolean deleteClosedNode(ZooKeeperWatcher zkw, String regionName) throws KeeperException, KeeperException.NoNodeException { - return deleteNode(zkw, regionName, EventType.RS2ZK_REGION_CLOSED); + return deleteNode(zkw, regionName, EventType.RS_ZK_REGION_CLOSED); } /** @@ -292,7 +292,7 @@ public class ZKAssign { public static boolean deleteClosingNode(ZooKeeperWatcher zkw, String regionName) throws KeeperException, KeeperException.NoNodeException { - return deleteNode(zkw, regionName, EventType.RS2ZK_REGION_CLOSING); + return deleteNode(zkw, regionName, EventType.RS_ZK_REGION_CLOSING); } /** @@ -395,7 +395,7 @@ public class ZKAssign { LOG.debug(zkw.prefix("Creating unassigned node for " + region.getEncodedName() + " in a CLOSING state")); RegionTransitionData data = new RegionTransitionData( - EventType.RS2ZK_REGION_CLOSING, region.getRegionName(), serverName); + EventType.RS_ZK_REGION_CLOSING, region.getRegionName(), serverName); synchronized(zkw.getNodes()) { String node = getNodeName(zkw, region.getEncodedName()); zkw.getNodes().add(node); @@ -433,8 +433,8 @@ public class ZKAssign { HRegionInfo region, String serverName, int expectedVersion) throws KeeperException { return transitionNode(zkw, region, serverName, - EventType.RS2ZK_REGION_CLOSING, - EventType.RS2ZK_REGION_CLOSED, expectedVersion); + EventType.RS_ZK_REGION_CLOSING, + EventType.RS_ZK_REGION_CLOSED, expectedVersion); } /** @@ -467,14 +467,14 @@ public class ZKAssign { HRegionInfo region, String serverName) throws KeeperException { return transitionNodeOpening(zkw, region, serverName, - EventType.M2ZK_REGION_OFFLINE); + EventType.M_ZK_REGION_OFFLINE); } public static int transitionNodeOpening(ZooKeeperWatcher zkw, HRegionInfo region, String serverName, final EventType beginState) throws KeeperException { return transitionNode(zkw, region, serverName, beginState, - EventType.RS2ZK_REGION_OPENING, -1); + EventType.RS_ZK_REGION_OPENING, -1); } /** @@ -507,8 +507,8 @@ public class ZKAssign { HRegionInfo region, String serverName, int expectedVersion) throws KeeperException { return transitionNode(zkw, region, serverName, - EventType.RS2ZK_REGION_OPENING, - EventType.RS2ZK_REGION_OPENING, expectedVersion); + EventType.RS_ZK_REGION_OPENING, + EventType.RS_ZK_REGION_OPENING, expectedVersion); } /** @@ -543,8 +543,8 @@ public class ZKAssign { HRegionInfo region, String serverName, int expectedVersion) throws KeeperException { return transitionNode(zkw, region, serverName, - EventType.RS2ZK_REGION_OPENING, - EventType.RS2ZK_REGION_OPENED, expectedVersion); + EventType.RS_ZK_REGION_OPENING, + EventType.RS_ZK_REGION_OPENED, expectedVersion); } /** diff --git a/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java b/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java index 40309276579..e5287d591db 100644 --- a/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java +++ b/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java @@ -217,7 +217,7 @@ public class TestAdmin { MasterServices services = TEST_UTIL.getMiniHBaseCluster().getMaster(); ExecutorService executor = services.getExecutorService(); AtomicBoolean done = new AtomicBoolean(false); - executor.registerListener(EventType.C2M_MODIFY_TABLE, new DoneListener(done)); + executor.registerListener(EventType.C_M_MODIFY_TABLE, new DoneListener(done)); this.admin.modifyTable(tableName, htd); while (!done.get()) { synchronized (done) { @@ -228,7 +228,7 @@ public class TestAdmin { } } } - executor.unregisterListener(EventType.C2M_MODIFY_TABLE); + executor.unregisterListener(EventType.C_M_MODIFY_TABLE); } /** diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java b/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java index 4976e5c882b..c4ea83ff996 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestMaster.java @@ -91,7 +91,7 @@ public class TestMaster { CountDownLatch proceed = new CountDownLatch(1); RegionOpenListener list = new RegionOpenListener(aboutToOpen, proceed); cluster.getMaster().executorService. - registerListener(EventType.RS2ZK_REGION_OPENED, list); + registerListener(EventType.RS_ZK_REGION_OPENED, list); LOG.info("Splitting table"); admin.split(TABLENAME); @@ -129,7 +129,7 @@ public class TestMaster { @Override public void afterProcess(EventHandler event) { - if (event.getEventType() != EventType.RS2ZK_REGION_OPENED) { + if (event.getEventType() != EventType.RS_ZK_REGION_OPENED) { return; } try { diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java b/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java index 24886120220..b68ec717bb5 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java @@ -78,7 +78,7 @@ public class TestRestartCluster { HMaster.MASTER); LOG.debug("Created UNASSIGNED zNode for ROOT and META regions in state " + - EventType.M2ZK_REGION_OFFLINE); + EventType.M_ZK_REGION_OFFLINE); // start the HB cluster LOG.info("Starting HBase cluster..."); diff --git a/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java b/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java index a172e2cbc89..86db194dead 100644 --- a/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java +++ b/src/test/java/org/apache/hadoop/hbase/master/TestZKBasedOpenCloseRegion.java @@ -106,15 +106,15 @@ public class TestZKBasedOpenCloseRegion { EventHandlerListener closeListener = new ReopenEventListener(hri.getRegionNameAsString(), - closeEventProcessed, EventType.RS2ZK_REGION_CLOSED); + closeEventProcessed, EventType.RS_ZK_REGION_CLOSED); cluster.getMaster().executorService. - registerListener(EventType.RS2ZK_REGION_CLOSED, closeListener); + registerListener(EventType.RS_ZK_REGION_CLOSED, closeListener); EventHandlerListener openListener = new ReopenEventListener(hri.getRegionNameAsString(), - reopenEventProcessed, EventType.RS2ZK_REGION_OPENED); + reopenEventProcessed, EventType.RS_ZK_REGION_OPENED); cluster.getMaster().executorService. - registerListener(EventType.RS2ZK_REGION_OPENED, openListener); + registerListener(EventType.RS_ZK_REGION_OPENED, openListener); LOG.info("Unassign " + hri.getRegionNameAsString()); cluster.getMaster().assignmentManager.unassign(hri); @@ -168,10 +168,10 @@ public class TestZKBasedOpenCloseRegion { if(event.getEventType() == eventType) { LOG.info("Finished processing " + eventType); String regionName = ""; - if(eventType == EventType.RS2ZK_REGION_OPENED) { + if(eventType == EventType.RS_ZK_REGION_OPENED) { TotesHRegionInfo hriCarrier = (TotesHRegionInfo)event; regionName = hriCarrier.getHRegionInfo().getRegionNameAsString(); - } else if(eventType == EventType.RS2ZK_REGION_CLOSED) { + } else if(eventType == EventType.RS_ZK_REGION_CLOSED) { TotesHRegionInfo hriCarrier = (TotesHRegionInfo)event; regionName = hriCarrier.getHRegionInfo().getRegionNameAsString(); } @@ -200,7 +200,7 @@ public class TestZKBasedOpenCloseRegion { EventHandlerListener listener = new CloseRegionEventListener(hri.getRegionNameAsString(), closeEventProcessed); - cluster.getMaster().executorService.registerListener(EventType.RS2ZK_REGION_CLOSED, listener); + cluster.getMaster().executorService.registerListener(EventType.RS_ZK_REGION_CLOSED, listener); cluster.getMaster().assignmentManager.unassign(hri); @@ -224,7 +224,7 @@ public class TestZKBasedOpenCloseRegion { @Override public void afterProcess(EventHandler event) { LOG.info("afterProcess(" + event + ")"); - if(event.getEventType() == EventType.RS2ZK_REGION_CLOSED) { + if(event.getEventType() == EventType.RS_ZK_REGION_CLOSED) { LOG.info("Finished processing CLOSE REGION"); TotesHRegionInfo hriCarrier = (TotesHRegionInfo)event; if (regionToClose.equals(hriCarrier.getHRegionInfo().getRegionNameAsString())) { @@ -238,7 +238,7 @@ public class TestZKBasedOpenCloseRegion { @Override public void beforeProcess(EventHandler event) { - if(event.getEventType() == EventType.M2RS_CLOSE_REGION) { + if(event.getEventType() == EventType.M_RS_CLOSE_REGION) { LOG.info("Received CLOSE RPC and beginning to process it"); } } diff --git a/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java b/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java index 976876c0727..321e4f77b0c 100644 --- a/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java +++ b/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestHLogSplit.java @@ -38,6 +38,7 @@ import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; @@ -129,6 +130,22 @@ public class TestHLogSplit { public void tearDown() throws Exception { } + /** + * @throws IOException + * @see https://issues.apache.org/jira/browse/HBASE-3020 + */ + @Test public void testRecoveredEditsPathForMeta() throws IOException { + FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration()); + byte [] encoded = HRegionInfo.FIRST_META_REGIONINFO.getEncodedNameAsBytes(); + long now = System.currentTimeMillis(); + HLog.Entry entry = + new HLog.Entry(new HLogKey(encoded, HConstants.META_TABLE_NAME, 1, now), + new WALEdit()); + Path p = HLog.getRegionSplitEditsPath(fs, entry, new Path("/")); + assertEquals(p.getParent().getParent(), + HRegionInfo.FIRST_META_REGIONINFO.getEncodedName()); + } + @Test(expected = IOException.class) public void testSplitFailsIfNewHLogGetsCreatedAfterSplitStarted() throws IOException {