From 1bc3a436dcc1362db9c49b8da185ee93b67239b4 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 8 Feb 2008 22:56:57 +0000 Subject: [PATCH] HBASE-418 Move HMaster and related classes into master package Part 3: Missed non-moved file edits. git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@620024 13f79535-47bb-0310-9956-ffa450edef68 --- bin/hbase | 2 +- conf/hbase-default.xml | 13 +++++++------ conf/hbase-site.xml | 6 ++++++ src/java/org/apache/hadoop/hbase/HBaseAdmin.java | 1 + src/java/org/apache/hadoop/hbase/HConnection.java | 1 + .../org/apache/hadoop/hbase/HConnectionManager.java | 1 + src/java/org/apache/hadoop/hbase/HLog.java | 2 +- src/java/org/apache/hadoop/hbase/HRegion.java | 12 +++++++----- src/java/org/apache/hadoop/hbase/HRegionServer.java | 1 + src/java/org/apache/hadoop/hbase/HStoreFile.java | 6 +++--- .../org/apache/hadoop/hbase/LocalHBaseCluster.java | 3 ++- .../hadoop/hbase/generated/master/master_jsp.java | 4 ++-- src/test/hbase-site.xml | 12 +++--------- .../org/apache/hadoop/hbase/MiniHBaseCluster.java | 1 + .../org/apache/hadoop/hbase/TestInfoServers.java | 2 +- .../org/apache/hadoop/hbase/master/OOMEHMaster.java | 6 +++++- src/webapps/master/master.jsp | 8 ++++---- 17 files changed, 47 insertions(+), 34 deletions(-) diff --git a/bin/hbase b/bin/hbase index 4e3f12b5da2..c90b2263e48 100755 --- a/bin/hbase +++ b/bin/hbase @@ -160,7 +160,7 @@ unset IFS if [ "$COMMAND" = "shell" ] ; then CLASS='org.apache.hadoop.hbase.Shell' elif [ "$COMMAND" = "master" ] ; then - CLASS='org.apache.hadoop.hbase.HMaster' + CLASS='org.apache.hadoop.hbase.master.HMaster' elif [ "$COMMAND" = "regionserver" ] ; then CLASS='org.apache.hadoop.hbase.HRegionServer' elif [ "$COMMAND" = "rest" ] ; then diff --git a/conf/hbase-default.xml b/conf/hbase-default.xml index 5dfb0b5feee..53d003c6b85 100644 --- a/conf/hbase-default.xml +++ b/conf/hbase-default.xml @@ -30,6 +30,13 @@ a single process. + + hbase.rootdir + file:///${hadoop.tmp.dir}/hbase + The directory shared by region servers. + Should be fully-qualified to include the filesystem. + + hbase.master.info.port 60010 @@ -69,12 +76,6 @@ opening proxy to remote region server. - - hbase.rootdir - ${hadoop.tmp.dir}/hbase - The directory shared by region servers. - - hbase.client.pause 10000 diff --git a/conf/hbase-site.xml b/conf/hbase-site.xml index dbccd1dbb5c..550ea02f5a1 100644 --- a/conf/hbase-site.xml +++ b/conf/hbase-site.xml @@ -22,4 +22,10 @@ */ --> + + hbase.rootdir + ${hadoop.tmp.dir}/hbase + The directory shared by region servers. + + diff --git a/src/java/org/apache/hadoop/hbase/HBaseAdmin.java b/src/java/org/apache/hadoop/hbase/HBaseAdmin.java index 838c4bc9ffc..7bb5663a737 100644 --- a/src/java/org/apache/hadoop/hbase/HBaseAdmin.java +++ b/src/java/org/apache/hadoop/hbase/HBaseAdmin.java @@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.ipc.RemoteException; +import org.apache.hadoop.hbase.master.HMasterInterface; /** * Provides administrative functions for HBase diff --git a/src/java/org/apache/hadoop/hbase/HConnection.java b/src/java/org/apache/hadoop/hbase/HConnection.java index 5900af18db5..b49d49364ea 100644 --- a/src/java/org/apache/hadoop/hbase/HConnection.java +++ b/src/java/org/apache/hadoop/hbase/HConnection.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.util.SortedMap; import org.apache.hadoop.io.Text; +import org.apache.hadoop.hbase.master.HMasterInterface; /** * diff --git a/src/java/org/apache/hadoop/hbase/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/HConnectionManager.java index 8f038581cae..0409b0746aa 100644 --- a/src/java/org/apache/hadoop/hbase/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/HConnectionManager.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.io.HbaseMapWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.ipc.RemoteException; +import org.apache.hadoop.hbase.master.HMasterInterface; /** * A non-instantiable class that manages connections to multiple tables in diff --git a/src/java/org/apache/hadoop/hbase/HLog.java b/src/java/org/apache/hadoop/hbase/HLog.java index ec3e814ae7c..a98413a3b5c 100644 --- a/src/java/org/apache/hadoop/hbase/HLog.java +++ b/src/java/org/apache/hadoop/hbase/HLog.java @@ -494,7 +494,7 @@ public class HLog implements HConstants { * @param conf HBaseConfiguration * @throws IOException */ - static void splitLog(Path rootDir, Path srcDir, FileSystem fs, + public static void splitLog(Path rootDir, Path srcDir, FileSystem fs, Configuration conf) throws IOException { Path logfiles[] = fs.listPaths(new Path[] { srcDir }); LOG.info("splitting " + logfiles.length + " log(s) in " + diff --git a/src/java/org/apache/hadoop/hbase/HRegion.java b/src/java/org/apache/hadoop/hbase/HRegion.java index 42ce6e68e42..2987e129fea 100644 --- a/src/java/org/apache/hadoop/hbase/HRegion.java +++ b/src/java/org/apache/hadoop/hbase/HRegion.java @@ -1788,7 +1788,7 @@ public class HRegion implements HConstants { * * @throws IOException */ - static HRegion createHRegion(final HRegionInfo info, final Path rootDir, + public static HRegion createHRegion(final HRegionInfo info, final Path rootDir, final HBaseConfiguration conf) throws IOException { Path tableDir = HTableDescriptor.getTableDir(rootDir, info.getTableDesc().getName()); @@ -1811,7 +1811,8 @@ public class HRegion implements HConstants { * @throws IOException * @see {@link #removeRegionFromMETA(HRegion, HRegion)} */ - static void addRegionToMETA(HRegion meta, HRegion r) throws IOException { + public static void addRegionToMETA(HRegion meta, HRegion r) + throws IOException { meta.checkResources(); // The row key is the region name Text row = r.getRegionName(); @@ -1839,7 +1840,7 @@ public class HRegion implements HConstants { * @throws IOException * @see {@link #addRegionToMETA(HRegion, HRegion)} */ - static void removeRegionFromMETA(final HRegionInterface srvr, + public static void removeRegionFromMETA(final HRegionInterface srvr, final Text metaRegionName, final Text regionName) throws IOException { srvr.deleteAll(metaRegionName, regionName, HConstants.LATEST_TIMESTAMP); @@ -1854,7 +1855,7 @@ public class HRegion implements HConstants { * @throws IOException * @see {@link #addRegionToMETA(HRegion, HRegion)} */ - static void offlineRegionInMETA(final HRegionInterface srvr, + public static void offlineRegionInMETA(final HRegionInterface srvr, final Text metaRegionName, final HRegionInfo info) throws IOException { BatchUpdate b = new BatchUpdate(info.getRegionName()); @@ -1876,7 +1877,8 @@ public class HRegion implements HConstants { * @throws IOException * @return True if deleted. */ - static boolean deleteRegion(FileSystem fs, Path rootdir, HRegionInfo info) + public static boolean deleteRegion(FileSystem fs, Path rootdir, + HRegionInfo info) throws IOException { Path p = HRegion.getRegionDir(rootdir, info); if (LOG.isDebugEnabled()) { diff --git a/src/java/org/apache/hadoop/hbase/HRegionServer.java b/src/java/org/apache/hadoop/hbase/HRegionServer.java index eee332ec825..8978a0667c3 100644 --- a/src/java/org/apache/hadoop/hbase/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/HRegionServer.java @@ -66,6 +66,7 @@ import org.apache.hadoop.io.Writable; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.net.DNS; import org.apache.hadoop.util.StringUtils; +import org.apache.hadoop.hbase.master.HMasterRegionInterface; /** * HRegionServer makes a set of HRegions available to clients. It checks in with diff --git a/src/java/org/apache/hadoop/hbase/HStoreFile.java b/src/java/org/apache/hadoop/hbase/HStoreFile.java index c76d4d488b3..f2c040d8b4e 100644 --- a/src/java/org/apache/hadoop/hbase/HStoreFile.java +++ b/src/java/org/apache/hadoop/hbase/HStoreFile.java @@ -521,19 +521,19 @@ public class HStoreFile implements HConstants { ((encodedRegionName != null) ? "." + encodedRegionName : ""); } - static Path getMapDir(Path dir, String encodedRegionName, Text colFamily) { + public static Path getMapDir(Path dir, String encodedRegionName, Text colFamily) { return new Path(dir, new Path(encodedRegionName, new Path(colFamily.toString(), HSTORE_DATFILE_DIR))); } /** @return the info directory path */ - static Path getInfoDir(Path dir, String encodedRegionName, Text colFamily) { + public static Path getInfoDir(Path dir, String encodedRegionName, Text colFamily) { return new Path(dir, new Path(encodedRegionName, new Path(colFamily.toString(), HSTORE_INFO_DIR))); } /** @return the bloom filter directory path */ - static Path getFilterDir(Path dir, String encodedRegionName, Text colFamily) { + public static Path getFilterDir(Path dir, String encodedRegionName, Text colFamily) { return new Path(dir, new Path(encodedRegionName, new Path(colFamily.toString(), HSTORE_FILTER_DIR))); } diff --git a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java index faf71134f7a..4c1a7b1a3e7 100644 --- a/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java +++ b/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.ReflectionUtils; +import org.apache.hadoop.hbase.master.HMaster; /** * This class creates a single process HBase cluster. One thread is created for @@ -268,7 +269,7 @@ public class LocalHBaseCluster implements HConstants { * @return The passed c configuration modified if hbase.master * value was 'local' otherwise, unaltered. */ - static HBaseConfiguration doLocal(final HBaseConfiguration c) { + public static HBaseConfiguration doLocal(final HBaseConfiguration c) { if (!isLocal(c)) { return c; } diff --git a/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java b/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java index b8303aaeb3d..dc9ebdd94aa 100644 --- a/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java +++ b/src/java/org/apache/hadoop/hbase/generated/master/master_jsp.java @@ -6,9 +6,9 @@ import javax.servlet.jsp.*; import java.util.*; import org.apache.hadoop.io.Text; import org.apache.hadoop.util.VersionInfo; -import org.apache.hadoop.hbase.HMaster; +import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.HMaster.MetaRegion; +import org.apache.hadoop.hbase.master.HMaster.MetaRegion; import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.HServerInfo; import org.apache.hadoop.hbase.HServerAddress; diff --git a/src/test/hbase-site.xml b/src/test/hbase-site.xml index 0a9597f8249..51dff63ef62 100644 --- a/src/test/hbase-site.xml +++ b/src/test/hbase-site.xml @@ -22,13 +22,6 @@ */ --> - - fs.default.name - - Use hdfs as file system by default. Modify this to run on - local file system. - - hbase.regionserver.msginterval 1000 @@ -106,8 +99,9 @@ hbase.rootdir - /hbase - location of HBase instance in dfs + hdfs://localhost:42273/hbase + Location of HBase test hbase instance (42273 is hbase + on a telephone pad) hbase.hregion.max.filesize diff --git a/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java b/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java index 020f53de9e5..a1be610fc5c 100644 --- a/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java +++ b/src/test/org/apache/hadoop/hbase/MiniHBaseCluster.java @@ -29,6 +29,7 @@ import org.apache.hadoop.fs.Path; import org.apache.log4j.Logger; import org.apache.hadoop.hbase.util.FSUtils; +import org.apache.hadoop.hbase.master.HMaster; /** * This class creates a single process HBase cluster. One thread is created for diff --git a/src/test/org/apache/hadoop/hbase/TestInfoServers.java b/src/test/org/apache/hadoop/hbase/TestInfoServers.java index d9efb2d4efd..afa8dea6fa1 100644 --- a/src/test/org/apache/hadoop/hbase/TestInfoServers.java +++ b/src/test/org/apache/hadoop/hbase/TestInfoServers.java @@ -58,7 +58,7 @@ public class TestInfoServers extends HBaseTestCase { a.createTable(new HTableDescriptor(getName())); assertTrue(a.tableExists(new Text(getName()))); try { - int port = miniHbase.getMaster().infoServer.getPort(); + int port = miniHbase.getMaster().getInfoServer().getPort(); assertHasExpectedContent(new URL("http://localhost:" + port + "/index.html"), "Master"); port = miniHbase.getRegionThreads().get(0).getRegionServer(). diff --git a/src/test/org/apache/hadoop/hbase/master/OOMEHMaster.java b/src/test/org/apache/hadoop/hbase/master/OOMEHMaster.java index 67bc573ecc4..72b3a9b895b 100644 --- a/src/test/org/apache/hadoop/hbase/master/OOMEHMaster.java +++ b/src/test/org/apache/hadoop/hbase/master/OOMEHMaster.java @@ -17,13 +17,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.hadoop.hbase; +package org.apache.hadoop.hbase.master; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HServerAddress; +import org.apache.hadoop.hbase.HServerInfo; +import org.apache.hadoop.hbase.HMsg; /** * An HMaster that runs out of memory. diff --git a/src/webapps/master/master.jsp b/src/webapps/master/master.jsp index 27c508256c4..d1ae59db0fa 100644 --- a/src/webapps/master/master.jsp +++ b/src/webapps/master/master.jsp @@ -2,9 +2,9 @@ import="java.util.*" import="org.apache.hadoop.io.Text" import="org.apache.hadoop.util.VersionInfo" - import="org.apache.hadoop.hbase.HMaster" - import="org.apache.hadoop.hbase.HConstants" - import="org.apache.hadoop.hbase.HMaster.MetaRegion" + import="org.apache.hadoop.hbase.master.HMaster" + import="org.apache.hadoop.hbase.HConstants" + import="org.apache.hadoop.hbase.master.HMaster.MetaRegion" import="org.apache.hadoop.hbase.HBaseAdmin" import="org.apache.hadoop.hbase.HServerInfo" import="org.apache.hadoop.hbase.HServerAddress" @@ -12,7 +12,7 @@ import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.hql.ShowCommand" import="org.apache.hadoop.hbase.hql.TableFormatter" - import="org.apache.hadoop.hbase.hql.ReturnMsg" + import="org.apache.hadoop.hbase.hql.ReturnMsg" import="org.apache.hadoop.hbase.hql.formatter.HtmlTableFormatter" import="org.apache.hadoop.hbase.HTableDescriptor" %><% HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);