HBASE-3100 stop splitting in TestMergeTable, and add debug

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1022003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-10-13 05:39:11 +00:00
parent 8dc8fea2f3
commit 25ae7a7b20
5 changed files with 27 additions and 11 deletions

View File

@ -312,9 +312,10 @@ public interface HRegionInterface extends HBaseRPCProtocolVersion, Stoppable, Ab
* Closes the specified region.
* @param region region to close
* @return true if closing region, false if not
* @throws IOException
*/
public boolean closeRegion(final HRegionInfo region)
throws NotServingRegionException;
throws IOException;
// Region administrative methods

View File

@ -67,6 +67,7 @@ import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperListener;
import org.apache.hadoop.hbase.zookeeper.ZKUtil.NodeAndData;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.zookeeper.KeeperException;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
@ -786,9 +787,17 @@ public class AssignmentManager extends ZooKeeperListener {
// Send CLOSE RPC
try {
serverManager.sendRegionClose(regions.get(region), state.getRegion());
} catch (NotServingRegionException e) {
LOG.warn("Attempted to close region " + region.getRegionNameAsString() +
" but got an NSRE", e);
} catch (IOException e) {
if (e instanceof RemoteException) {
e = ((RemoteException)e).unwrapRemoteException();
}
if (e instanceof NotServingRegionException) {
LOG.warn("Attempted to close region " + region.getRegionNameAsString() +
" but got an NSRE", e);
}
// For now call abort if unexpected exception -- seeing it up in hudson.
// St.Ack 20101012
this.master.abort("Remote unexpected exception", e);
} catch (Throwable t) {
// For now call abort if unexpected exception -- seeing it up in hudson.
// St.Ack 20101012

View File

@ -31,14 +31,12 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.hbase.Chore;
import org.apache.hadoop.hbase.HMsg;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HServerInfo;
import org.apache.hadoop.hbase.HServerLoad;
import org.apache.hadoop.hbase.NotServingRegionException;
import org.apache.hadoop.hbase.PleaseHoldException;
import org.apache.hadoop.hbase.Server;
import org.apache.hadoop.hbase.Stoppable;
@ -50,6 +48,8 @@ import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
import org.apache.hadoop.hbase.master.metrics.MasterMetrics;
import org.apache.hadoop.hbase.regionserver.Leases.LeaseStillHeldException;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.util.StringUtils;
/**
* The ServerManager class manages info about region servers - HServerInfo,
@ -542,10 +542,10 @@ public class ServerManager {
* @param server server to open a region
* @param regionName region to open
* @return true if server acknowledged close, false if not
* @throws NotServingRegionException
* @throws IOException
*/
public void sendRegionClose(HServerInfo server, HRegionInfo region)
throws NotServingRegionException {
throws IOException {
HRegionInterface hri = getServerConnection(server);
if(hri == null) {
LOG.warn("Attempting to send CLOSE RPC to server " +

View File

@ -19,6 +19,8 @@
*/
package org.apache.hadoop.hbase.master.handler;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HRegionInfo;
@ -35,9 +37,7 @@ import org.apache.zookeeper.KeeperException;
*/
public class OpenedRegionHandler extends EventHandler implements TotesHRegionInfo {
private static final Log LOG = LogFactory.getLog(OpenedRegionHandler.class);
private final AssignmentManager assignmentManager;
private final RegionTransitionData data;
private final HRegionInfo regionInfo;
private final HServerInfo serverInfo;
private final OpenedPriority priority;
@ -60,8 +60,12 @@ public class OpenedRegionHandler extends EventHandler implements TotesHRegionInf
AssignmentManager assignmentManager, RegionTransitionData data,
HRegionInfo regionInfo, HServerInfo serverInfo) {
super(server, EventType.RS_ZK_REGION_OPENED);
try {
throw new IOException("IGNORE");
} catch (IOException e) {
e.printStackTrace();
}
this.assignmentManager = assignmentManager;
this.data = data;
this.regionInfo = regionInfo;
this.serverInfo = serverInfo;
if(regionInfo.isRootRegion()) {

View File

@ -74,6 +74,8 @@ public class TestMergeTable {
// Set maximum regionsize down.
UTIL.getConfiguration().setLong("hbase.hregion.max.filesize", 64L * 1024L * 1024L);
// Make it so we don't compact and then split.
UTIL.getConfiguration().setInt("hbase.hstore.compactionThreshold", 30);
// Startup hdfs. Its in here we'll be putting our manually made regions.
UTIL.startMiniDFSCluster(1);
// Create hdfs hbase rootdir.