diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java index 81787870d56..f8cf7b30ccf 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java @@ -81,6 +81,13 @@ public class HFileSystem extends FilterFileSystem { this.useHBaseChecksum = useHBaseChecksum; fs.initialize(getDefaultUri(conf), conf); + + // disable checksum verification for local fileSystem, see HBASE-11218 + if (fs instanceof LocalFileSystem) { + fs.setWriteChecksum(false); + fs.setVerifyChecksum(false); + } + addLocationsOrderInterceptor(conf); // If hbase checksum verification is switched on, then create a new diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentListener.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentListener.java index 8680e194fae..9df5ccb8a6d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentListener.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentListener.java @@ -39,7 +39,6 @@ public interface AssignmentListener { /** * The region was closed on the region server. * @param regionInfo The closed region. - * @param serverName The remote servers name. */ void regionClosed(final HRegionInfo regionInfo); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java index 6aef257f472..01a1bf184cb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMasterCommandLine.java @@ -30,6 +30,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.CoordinatedStateManager; import org.apache.hadoop.hbase.CoordinatedStateManagerFactory; import org.apache.hadoop.hbase.MasterNotRunningException; @@ -178,6 +179,7 @@ public class HMasterCommandLine extends ServerCommandLine { } conf.set(HConstants.ZOOKEEPER_CLIENT_PORT, Integer.toString(clientPort)); + conf.setInt(HConstants.ZK_SESSION_TIMEOUT, 10 *1000); // Need to have the zk cluster shutdown when master is shutdown. // Run a subclass that does the zk cluster shutdown on its way out. LocalHBaseCluster cluster = new LocalHBaseCluster(conf, conf.getInt("hbase.masters", 1), diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java index aefd4990dbf..e32f0ea66ac 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java @@ -151,7 +151,7 @@ public class MiniZooKeeperCluster { // running all the ZK servers for (int i = 0; i < numZooKeeperServers; i++) { File dir = new File(baseDir, "zookeeper_"+i).getAbsoluteFile(); - recreateDir(dir); + createDir(dir); int tickTimeToUse; if (this.tickTime > 0) { tickTimeToUse = this.tickTime; @@ -201,14 +201,11 @@ public class MiniZooKeeperCluster { return clientPort; } - private void recreateDir(File dir) throws IOException { - if (dir.exists()) { - if(!FileUtil.fullyDelete(dir)) { - throw new IOException("Could not delete zk base directory: " + dir); - } - } + private void createDir(File dir) throws IOException { try { - dir.mkdirs(); + if (!dir.exists()) { + dir.mkdirs(); + } } catch (SecurityException e) { throw new IOException("creating dir: " + dir, e); } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java index e9e5eb6d0f1..38242948acd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java @@ -957,6 +957,20 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility { miniClusterRunning = false; LOG.info("Minicluster is down"); } + + /** + * @return True if we removed the test dirs + * @throws IOException + */ + @Override + public boolean cleanupTestDir() throws IOException { + boolean ret = super.cleanupTestDir(); + if (deleteDir(this.clusterTestDir)) { + this.clusterTestDir = null; + return ret & true; + } + return false; + } /** * Shutdown HBase mini cluster. Does not shutdown zk or dfs if running. diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java index 1a85bc525f4..7a075a65c5a 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildBase.java @@ -65,9 +65,9 @@ public class TestOfflineMetaRebuildBase extends OfflineMetaRebuildTestCore { assertTrue(fsck.rebuildMeta(false)); // bring up the minicluster - TEST_UTIL.startMiniZKCluster(); // tables seem enabled by default + TEST_UTIL.startMiniZKCluster(); TEST_UTIL.restartHBaseCluster(3); - + TEST_UTIL.getHBaseAdmin().enableTable(table); ZooKeeperWatcher zkw = HBaseTestingUtility.getZooKeeperWatcher(TEST_UTIL); LOG.info("Waiting for no more RIT"); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java index 9cf8516ecce..a3225bd5870 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildHole.java @@ -96,8 +96,7 @@ public class TestOfflineMetaRebuildHole extends OfflineMetaRebuildTestCore { assertErrors(doFsck(conf, false), new ERROR_CODE[] { ERROR_CODE.NOT_IN_META_OR_DEPLOYED, ERROR_CODE.NOT_IN_META_OR_DEPLOYED, - ERROR_CODE.NOT_IN_META_OR_DEPLOYED, - ERROR_CODE.HOLE_IN_REGION_CHAIN}); + ERROR_CODE.NOT_IN_META_OR_DEPLOYED}); } } diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java index 34098ba1ade..9a17948e9e9 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/hbck/TestOfflineMetaRebuildOverlap.java @@ -107,8 +107,7 @@ public class TestOfflineMetaRebuildOverlap extends OfflineMetaRebuildTestCore { ERROR_CODE.NOT_IN_META_OR_DEPLOYED, ERROR_CODE.NOT_IN_META_OR_DEPLOYED, ERROR_CODE.NOT_IN_META_OR_DEPLOYED, - ERROR_CODE.NOT_IN_META_OR_DEPLOYED, - ERROR_CODE.HOLE_IN_REGION_CHAIN}); + ERROR_CODE.NOT_IN_META_OR_DEPLOYED}); } }