From 542abcf26d5e01e989774c58da22974ddaeaa7f0 Mon Sep 17 00:00:00 2001 From: Jim Kellerman Date: Fri, 23 Jan 2009 22:37:01 +0000 Subject: [PATCH] HBASE-1121 Cluster confused about where -ROOT- is git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@737213 13f79535-47bb-0310-9956-ffa450edef68 --- conf/hbase-default.xml | 10 +--- src/java/org/apache/hadoop/hbase/HMsg.java | 59 ++++++++++++------- .../hbase/client/HConnectionManager.java | 5 +- .../hbase/master/ProcessRegionClose.java | 2 +- .../hbase/master/ProcessRegionOpen.java | 2 +- .../master/ProcessRegionStatusChange.java | 26 ++++---- .../hadoop/hbase/master/RegionManager.java | 11 ++-- .../hadoop/hbase/master/ServerManager.java | 33 +++++++---- .../hadoop/hbase/regionserver/HLog.java | 2 +- .../hbase/regionserver/HRegionServer.java | 57 ++++++++++-------- src/test/hbase-site.xml | 15 ++--- .../hadoop/hbase/TestSerialization.java | 4 +- 12 files changed, 134 insertions(+), 92 deletions(-) diff --git a/conf/hbase-default.xml b/conf/hbase-default.xml index d392a912123..5ffc5a43de3 100644 --- a/conf/hbase-default.xml +++ b/conf/hbase-default.xml @@ -182,10 +182,10 @@ hbase.regionserver.hlog.blocksize - 67108864 + 1048576 Block size for HLog files. To minimize potential data loss, the size should be (avg key length) * (avg value length) * flushlogentries. - Default 64MB. + Default 1MB. @@ -232,12 +232,6 @@ Used as sleep interval by service threads such as META scanner and log roller. - - hbase.regionserver.safemode.period - 120000 - Time to wait on regionserver startup before beginning - compactions and memcache flushes. - hbase.hregion.memcache.flush.size 67108864 diff --git a/src/java/org/apache/hadoop/hbase/HMsg.java b/src/java/org/apache/hadoop/hbase/HMsg.java index 47970acdffb..2c1f70a9df1 100644 --- a/src/java/org/apache/hadoop/hbase/HMsg.java +++ b/src/java/org/apache/hadoop/hbase/HMsg.java @@ -114,23 +114,7 @@ public class HMsg implements Writable { private Type type = null; private HRegionInfo info = null; private byte[] message = null; - - // Some useful statics. Use these rather than create a new HMsg each time. - //TODO: move the following to HRegionServer - public static final HMsg REPORT_EXITING = new HMsg(Type.MSG_REPORT_EXITING); - public static final HMsg REPORT_QUIESCED = new HMsg(Type.MSG_REPORT_QUIESCED); - //TODO: Move to o.a.h.h.master - public static final HMsg REGIONSERVER_QUIESCE = - new HMsg(Type.MSG_REGIONSERVER_QUIESCE); - //TODO: Move to o.a.h.h.master - public static final HMsg REGIONSERVER_STOP = - new HMsg(Type.MSG_REGIONSERVER_STOP); - //TODO: Move to o.a.h.h.master - public static final HMsg CALL_SERVER_STARTUP = - new HMsg(Type.MSG_CALL_SERVER_STARTUP); - //TODO: Move to o.a.h.h.master - public static final HMsg [] EMPTY_HMSG_ARRAY = new HMsg[0]; - + private boolean safeMode = false; /** Default constructor. Used during deserialization */ public HMsg() { @@ -138,11 +122,11 @@ public class HMsg implements Writable { } /** - * Construct a message with the specified message and HRegionInfo + * Construct a message with the specified message and empty HRegionInfo * @param type Message type */ public HMsg(final HMsg.Type type) { - this(type, new HRegionInfo(), null); + this(type, new HRegionInfo(), null, false); } /** @@ -151,7 +135,20 @@ public class HMsg implements Writable { * @param hri Region to which message type applies */ public HMsg(final HMsg.Type type, final HRegionInfo hri) { - this(type, hri, null); + this(type, hri, null, false); + } + + /** + * Constructor used by master to inform region servers if we are still in + * safe mode. + * + * @param type + * @param hri + * @param safeMode + */ + public HMsg(final HMsg.Type type, final HRegionInfo hri, + final boolean safeMode) { + this(type, hri, null, safeMode); } /** @@ -163,6 +160,19 @@ public class HMsg implements Writable { * @param msg Optional message (Stringified exception, etc.) */ public HMsg(final HMsg.Type type, final HRegionInfo hri, final byte[] msg) { + this(type, hri, msg, false); + } + + /** + * Used by the master to inform region servers if we are still in safe mode + * + * @param type + * @param hri + * @param msg + * @param safemode + */ + public HMsg(final HMsg.Type type, final HRegionInfo hri, final byte[] msg, + final boolean safemode) { if (type == null) { throw new NullPointerException("Message type cannot be null"); } @@ -172,6 +182,7 @@ public class HMsg implements Writable { } this.info = hri; this.message = msg; + this.safeMode = safemode; } /** @@ -198,6 +209,11 @@ public class HMsg implements Writable { public byte[] getMessage() { return this.message; } + + /** @return safe mode */ + public boolean isInSafeMode() { + return this.safeMode; + } @Override public String toString() { @@ -211,6 +227,7 @@ public class HMsg implements Writable { if (this.message != null && this.message.length > 0) { sb.append(": " + Bytes.toString(this.message)); } + sb.append(": safeMode=" + safeMode); return sb.toString(); } @@ -244,6 +261,7 @@ public class HMsg implements Writable { out.writeBoolean(true); Bytes.writeByteArray(out, this.message); } + out.writeBoolean(this.safeMode); } public void readFields(DataInput in) throws IOException { @@ -254,5 +272,6 @@ public class HMsg implements Writable { if (hasMessage) { this.message = Bytes.readByteArray(in); } + this.safeMode = in.readBoolean(); } } diff --git a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java index 5fd1bca9a86..78ec9829f0f 100644 --- a/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java +++ b/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java @@ -134,6 +134,7 @@ public class HConnectionManager implements HConstants { private final Map servers = new ConcurrentHashMap(); + // Used by master and region servers during safe mode only private volatile HRegionLocation rootRegionLocation; private final Map> @@ -177,10 +178,12 @@ public class HConnectionManager implements HConstants { return this.pause * HConstants.RETRY_BACKOFF[ntries]; } + // Used by master and region servers during safe mode only public void unsetRootRegionLocation() { this.rootRegionLocation = null; } + // Used by master and region servers during safe mode only public void setRootRegionLocation(HRegionLocation rootRegion) { if (rootRegion == null) { throw new IllegalArgumentException( @@ -445,7 +448,7 @@ public class HConnectionManager implements HConstants { // second waits. The second thread will not do find. if (!useCache || rootRegionLocation == null) { - this.rootRegionLocation = locateRootRegion(); + return locateRootRegion(); } return rootRegionLocation; } diff --git a/src/java/org/apache/hadoop/hbase/master/ProcessRegionClose.java b/src/java/org/apache/hadoop/hbase/master/ProcessRegionClose.java index a3a29540c01..55373608f25 100644 --- a/src/java/org/apache/hadoop/hbase/master/ProcessRegionClose.java +++ b/src/java/org/apache/hadoop/hbase/master/ProcessRegionClose.java @@ -61,7 +61,7 @@ class ProcessRegionClose extends ProcessRegionStatusChange { Boolean result = null; if (offlineRegion) { result = - new RetryableMetaOperation(this.metaRegion, this.master) { + new RetryableMetaOperation(getMetaRegion(), this.master) { public Boolean call() throws IOException { LOG.info("region closed: " + regionInfo.getRegionNameAsString()); diff --git a/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java b/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java index cc4bf98319e..d32594f447a 100644 --- a/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java +++ b/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java @@ -64,7 +64,7 @@ class ProcessRegionOpen extends ProcessRegionStatusChange { @Override protected boolean process() throws IOException { Boolean result = - new RetryableMetaOperation(this.metaRegion, this.master) { + new RetryableMetaOperation(getMetaRegion(), this.master) { private final RegionHistorian historian = RegionHistorian.getInstance(); public Boolean call() throws IOException { diff --git a/src/java/org/apache/hadoop/hbase/master/ProcessRegionStatusChange.java b/src/java/org/apache/hadoop/hbase/master/ProcessRegionStatusChange.java index 39b26340213..e0ef0e2d9dd 100644 --- a/src/java/org/apache/hadoop/hbase/master/ProcessRegionStatusChange.java +++ b/src/java/org/apache/hadoop/hbase/master/ProcessRegionStatusChange.java @@ -29,8 +29,8 @@ import org.apache.hadoop.hbase.HRegionInfo; abstract class ProcessRegionStatusChange extends RegionServerOperation { protected final boolean isMetaTable; protected final HRegionInfo regionInfo; - protected final MetaRegion metaRegion; - protected final byte [] metaRegionName; + private volatile MetaRegion metaRegion = null; + protected volatile byte[] metaRegionName = null; /** * @param master @@ -40,15 +40,6 @@ abstract class ProcessRegionStatusChange extends RegionServerOperation { super(master); this.regionInfo = regionInfo; this.isMetaTable = regionInfo.isMetaTable(); - if (isMetaTable) { - this.metaRegionName = HRegionInfo.ROOT_REGIONINFO.getRegionName(); - this.metaRegion = new MetaRegion(master.getRootRegionLocation(), - this.metaRegionName, HConstants.EMPTY_START_ROW); - } else { - this.metaRegion = - master.regionManager.getFirstMetaRegionForRegion(regionInfo); - this.metaRegionName = this.metaRegion.getRegionName(); - } } protected boolean metaRegionAvailable() { @@ -71,4 +62,17 @@ abstract class ProcessRegionStatusChange extends RegionServerOperation { } return available; } + + protected MetaRegion getMetaRegion() { + if (isMetaTable) { + this.metaRegionName = HRegionInfo.ROOT_REGIONINFO.getRegionName(); + this.metaRegion = new MetaRegion(master.getRootRegionLocation(), + this.metaRegionName, HConstants.EMPTY_START_ROW); + } else { + this.metaRegion = + master.regionManager.getFirstMetaRegionForRegion(regionInfo); + this.metaRegionName = this.metaRegion.getRegionName(); + } + return this.metaRegion; + } } \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/master/RegionManager.java b/src/java/org/apache/hadoop/hbase/master/RegionManager.java index 0e81797ca29..fae9a6cef70 100644 --- a/src/java/org/apache/hadoop/hbase/master/RegionManager.java +++ b/src/java/org/apache/hadoop/hbase/master/RegionManager.java @@ -274,7 +274,8 @@ class RegionManager implements HConstants { " to server " + serverName); s.setPendingOpen(serverName); this.historian.addRegionAssignment(s.getRegionInfo(), serverName); - returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo())); + returnMsgs.add( + new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo(), inSafeMode())); if (--nregions <= 0) { break; } @@ -401,7 +402,8 @@ class RegionManager implements HConstants { " to the only server " + serverName); s.setPendingOpen(serverName); this.historian.addRegionAssignment(s.getRegionInfo(), serverName); - returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo())); + returnMsgs.add( + new HMsg(HMsg.Type.MSG_REGION_OPEN, s.getRegionInfo(), inSafeMode())); } } @@ -440,7 +442,7 @@ class RegionManager implements HConstants { currentRegion.getRegionNameAsString()); // make a message to close the region returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE, currentRegion, - OVERLOADED)); + OVERLOADED, inSafeMode())); // mark the region as closing setClosing(serverName, currentRegion, false); setPendingClose(currentRegion.getRegionName()); @@ -901,6 +903,7 @@ class RegionManager implements HConstants { public boolean inSafeMode() { if (safeMode) { if(isInitialMetaScanComplete() && regionsInTransition.size() == 0) { + master.connection.unsetRootRegionLocation(); safeMode = false; LOG.info("exiting safe mode"); } else { @@ -1065,7 +1068,7 @@ class RegionManager implements HConstants { if (LOG.isDebugEnabled()) { LOG.debug("Sending " + msg + " " + pair.getFirst() + " to " + addr); } - returnMsgs.add(new HMsg(msg, pair.getFirst())); + returnMsgs.add(new HMsg(msg, pair.getFirst(), inSafeMode())); i.remove(); } } diff --git a/src/java/org/apache/hadoop/hbase/master/ServerManager.java b/src/java/org/apache/hadoop/hbase/master/ServerManager.java index 9e3961f217a..79c245f17db 100644 --- a/src/java/org/apache/hadoop/hbase/master/ServerManager.java +++ b/src/java/org/apache/hadoop/hbase/master/ServerManager.java @@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.Leases; import org.apache.hadoop.hbase.LeaseListener; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionLocation; +import org.apache.hadoop.hbase.HMsg.Type; /** * The ServerManager class manages info about region servers - HServerInfo, @@ -52,6 +53,13 @@ import org.apache.hadoop.hbase.HRegionLocation; class ServerManager implements HConstants { static final Log LOG = LogFactory.getLog(ServerManager.class.getName()); + private static final HMsg REGIONSERVER_QUIESCE = + new HMsg(Type.MSG_REGIONSERVER_QUIESCE); + private static final HMsg REGIONSERVER_STOP = + new HMsg(Type.MSG_REGIONSERVER_STOP); + private static final HMsg CALL_SERVER_STARTUP = + new HMsg(Type.MSG_CALL_SERVER_STARTUP); + private static final HMsg [] EMPTY_HMSG_ARRAY = new HMsg[0]; private final AtomicInteger quiescedServers = new AtomicInteger(0); @@ -225,7 +233,7 @@ class ServerManager implements HConstants { if (msgs.length > 0) { if (msgs[0].isType(HMsg.Type.MSG_REPORT_EXITING)) { processRegionServerExit(serverName, msgs); - return HMsg.EMPTY_HMSG_ARRAY; + return EMPTY_HMSG_ARRAY; } else if (msgs[0].isType(HMsg.Type.MSG_REPORT_QUIESCED)) { LOG.info("Region server " + serverName + " quiesced"); quiescedServers.incrementAndGet(); @@ -245,10 +253,10 @@ class ServerManager implements HConstants { msgs[0].isType(HMsg.Type.MSG_REPORT_QUIESCED)) { // Server is already quiesced, but we aren't ready to shut down // return empty response - return HMsg.EMPTY_HMSG_ARRAY; + return EMPTY_HMSG_ARRAY; } // Tell the server to stop serving any user regions - return new HMsg [] {HMsg.REGIONSERVER_QUIESCE}; + return new HMsg [] {REGIONSERVER_QUIESCE}; } } @@ -256,7 +264,7 @@ class ServerManager implements HConstants { // Tell server to shut down if we are shutting down. This should // happen after check of MSG_REPORT_EXITING above, since region server // will send us one of these messages after it gets MSG_REGIONSERVER_STOP - return new HMsg [] {HMsg.REGIONSERVER_STOP}; + return new HMsg [] {REGIONSERVER_STOP}; } HServerInfo storedInfo = serversToServerInfo.get(serverName); @@ -267,7 +275,7 @@ class ServerManager implements HConstants { // The HBaseMaster may have been restarted. // Tell the RegionServer to start over and call regionServerStartup() - return new HMsg[]{HMsg.CALL_SERVER_STARTUP}; + return new HMsg[]{CALL_SERVER_STARTUP}; } else if (storedInfo.getStartCode() != serverInfo.getStartCode()) { // This state is reachable if: // @@ -287,7 +295,7 @@ class ServerManager implements HConstants { serversToServerInfo.notifyAll(); } - return new HMsg[]{HMsg.REGIONSERVER_STOP}; + return new HMsg[]{REGIONSERVER_STOP}; } else { return processRegionServerAllsWell(serverName, serverInfo, mostLoadedRegions, msgs); @@ -436,7 +444,8 @@ class ServerManager implements HConstants { synchronized (master.regionManager) { // Tell the region server to close regions that we have marked for closing. for (HRegionInfo i: master.regionManager.getMarkedToClose(serverName)) { - returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE, i)); + returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE, i, + master.regionManager.inSafeMode())); // Transition the region from toClose to closing state master.regionManager.setPendingClose(i.getRegionName()); } @@ -531,7 +540,8 @@ class ServerManager implements HConstants { // Otherwise the HMaster will think the Region was closed on purpose, // and then try to reopen it elsewhere; that's not what we want. returnMsgs.add(new HMsg(HMsg.Type.MSG_REGION_CLOSE_WITHOUT_REPORT, - region, "Duplicate assignment".getBytes())); + region, "Duplicate assignment".getBytes(), + master.regionManager.inSafeMode())); } else { if (region.isRootRegion()) { // it was assigned, and it's not a duplicate assignment, so take it out @@ -540,8 +550,10 @@ class ServerManager implements HConstants { // Store the Root Region location (in memory) HServerAddress rootServer = serverInfo.getServerAddress(); - master.connection.setRootRegionLocation( - new HRegionLocation(region, rootServer)); + if (master.regionManager.inSafeMode()) { + master.connection.setRootRegionLocation( + new HRegionLocation(region, rootServer)); + } master.regionManager.setRootRegionLocation(rootServer); } else { // Note that the table has been assigned and is waiting for the @@ -564,7 +576,6 @@ class ServerManager implements HConstants { synchronized (master.regionManager) { if (region.isRootRegion()) { // Root region - master.connection.unsetRootRegionLocation(); master.regionManager.unsetRootRegion(); if (region.isOffline()) { // Can't proceed without root region. Shutdown. diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HLog.java b/src/java/org/apache/hadoop/hbase/regionserver/HLog.java index 8abec91d89e..fbd2f4a26ab 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HLog.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HLog.java @@ -173,7 +173,7 @@ public class HLog implements HConstants, Syncable { this.flushlogentries = conf.getInt("hbase.regionserver.flushlogentries", 100); this.blocksize = - conf.getLong("hbase.regionserver.hlog.blocksize", 1024L * 1024L * 64L); + conf.getLong("hbase.regionserver.hlog.blocksize", 1024L * 1024L); this.optionalFlushInterval = conf.getLong("hbase.regionserver.optionallogflushinterval", 10 * 1000); this.threadWakeFrequency = conf.getLong(THREAD_WAKE_FREQUENCY, 10 * 1000); diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index d22fb328799..be4ba827f17 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -109,6 +109,8 @@ import org.apache.hadoop.util.StringUtils; */ public class HRegionServer implements HConstants, HRegionInterface, Runnable { static final Log LOG = LogFactory.getLog(HRegionServer.class); + private static final HMsg REPORT_EXITING = new HMsg(Type.MSG_REPORT_EXITING); + private static final HMsg REPORT_QUIESCED = new HMsg(Type.MSG_REPORT_QUIESCED); // Set when a report to the master comes back with a message asking us to // shutdown. Also set by call to stop when debugging or running unit tests @@ -200,8 +202,8 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { final LogRoller logRoller; final LogFlusher logFlusher; - // safemode processing - SafeModeThread safeModeThread; + // limit compactions while starting up + CompactionLimitThread compactionLimitThread; // flag set after we're done setting up server threads (used for testing) protected volatile boolean isOnline; @@ -317,7 +319,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { haveRootRegion.set(true); } } - long now = System.currentTimeMillis(); + long now = System.currentTimeMillis(); if (lastMsg != 0 && (now - lastMsg) >= serverLeaseTimeout) { // It has been way too long since we last reported to the master. LOG.warn("unable to report to master for " + (now - lastMsg) + @@ -361,6 +363,15 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { !restart && !stopRequested.get() && i < msgs.length; i++) { LOG.info(msgs[i].toString()); + if (safeMode.get()) { + if (!msgs[i].isInSafeMode()) { + this.connection.unsetRootRegionLocation(); + synchronized (safeMode) { + safeMode.set(false); + safeMode.notifyAll(); + } + } + } switch(msgs[i].getType()) { case MSG_CALL_SERVER_STARTUP: // We the MSG_CALL_SERVER_STARTUP on startup but we can also @@ -503,7 +514,7 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { } try { HMsg[] exitMsg = new HMsg[closedRegions.size() + 1]; - exitMsg[0] = HMsg.REPORT_EXITING; + exitMsg[0] = REPORT_EXITING; // Tell the master what regions we are/were serving int i = 1; for (HRegion region: closedRegions) { @@ -729,30 +740,24 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { /** * Thread for toggling safemode after some configurable interval. */ - private class SafeModeThread extends Thread { + private class CompactionLimitThread extends Thread { @Override public void run() { - // first, wait the required interval before turning off safemode - int safemodeInterval = - conf.getInt("hbase.regionserver.safemode.period", 120 * 1000); - try { - Thread.sleep(safemodeInterval); - } catch (InterruptedException ex) { - // turn off safemode and limits on the way out due to some kind of - // abnormal condition so we do not prevent such things as memcache - // flushes and worsen the situation - safeMode.set(false); - compactSplitThread.setLimit(-1); - if (LOG.isDebugEnabled()) { - LOG.debug(this.getName() + " exiting on interrupt"); + // First wait until we exit safe mode + synchronized (safeMode) { + while(safeMode.get()) { + LOG.debug("Waiting to exit safe mode"); + try { + safeMode.wait(); + } catch (InterruptedException e) { + // ignore + } } - return; } - LOG.info("leaving safe mode"); - safeMode.set(false); // now that safemode is off, slowly increase the per-cycle compaction // limit, finally setting it to unlimited (-1) + int compactionCheckInterval = conf.getInt("hbase.regionserver.thread.splitcompactcheckfrequency", 20 * 1000); @@ -1006,13 +1011,13 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { } // Set up the safe mode handler if safe mode has been configured. - if (conf.getInt("hbase.regionserver.safemode.period", 0) < 1) { + if (!conf.getBoolean("hbase.regionserver.safemode", true)) { safeMode.set(false); compactSplitThread.setLimit(-1); LOG.debug("skipping safe mode"); } else { - this.safeModeThread = new SafeModeThread(); - Threads.setDaemonThreadRunning(this.safeModeThread, n + ".safeMode", + this.compactionLimitThread = new CompactionLimitThread(); + Threads.setDaemonThreadRunning(this.compactionLimitThread, n + ".safeMode", handler); } @@ -1482,9 +1487,9 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable { } this.quiesced.set(true); if (onlineRegions.size() == 0) { - outboundMsgs.add(HMsg.REPORT_EXITING); + outboundMsgs.add(REPORT_EXITING); } else { - outboundMsgs.add(HMsg.REPORT_QUIESCED); + outboundMsgs.add(REPORT_QUIESCED); } } diff --git a/src/test/hbase-site.xml b/src/test/hbase-site.xml index 81e5730c99a..0158ad58d2f 100644 --- a/src/test/hbase-site.xml +++ b/src/test/hbase-site.xml @@ -97,6 +97,14 @@ invoking an optional cache flush. Default 60,000. + + hbase.regionserver.safemode + false + + Turn on/off safe mode in region server. Always on for production, always off + for tests. + + hbase.hregion.max.filesize 67108864 @@ -111,11 +119,4 @@ hadoop.log.dir ${user.dir}/../logs - - hbase.regionserver.safemode.period - 0 - Time to wait on regionserver startup before beginning - compactions and memcache flushes. - - diff --git a/src/test/org/apache/hadoop/hbase/TestSerialization.java b/src/test/org/apache/hadoop/hbase/TestSerialization.java index 18dadfe1266..94e09a4f64f 100644 --- a/src/test/org/apache/hadoop/hbase/TestSerialization.java +++ b/src/test/org/apache/hadoop/hbase/TestSerialization.java @@ -33,10 +33,12 @@ import org.apache.hadoop.hbase.util.Writables; */ public class TestSerialization extends HBaseTestCase { + @Override protected void setUp() throws Exception { super.setUp(); } + @Override protected void tearDown() throws Exception { super.tearDown(); } @@ -53,7 +55,7 @@ public class TestSerialization extends HBaseTestCase { } public void testHMsg() throws Exception { - HMsg m = HMsg.REGIONSERVER_QUIESCE; + HMsg m = new HMsg(HMsg.Type.MSG_REGIONSERVER_QUIESCE); byte [] mb = Writables.getBytes(m); HMsg deserializedHMsg = (HMsg)Writables.getWritable(mb, new HMsg()); assertTrue(m.equals(deserializedHMsg));