From 731a583c2bf6e37cdc248bea645305ffabde07ec Mon Sep 17 00:00:00 2001 From: Uma Maheswara Rao G Date: Sun, 21 Jul 2013 12:27:38 +0000 Subject: [PATCH] HDFS-4602. TestBookKeeperHACheckpoints fails. Contributed by Uma Maheswara Rao G. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1505362 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../TestBookKeeperHACheckpoints.java | 24 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index f545f6d2c0..e0c439b91f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -262,6 +262,8 @@ Release 2.3.0 - UNRELEASED BUG FIXES + HDFS-4602. TestBookKeeperHACheckpoints fails. (umamahesh) + Release 2.1.1-beta - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/test/java/org/apache/hadoop/contrib/bkjournal/TestBookKeeperHACheckpoints.java b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/test/java/org/apache/hadoop/contrib/bkjournal/TestBookKeeperHACheckpoints.java index cb7ba3f324..02d477be75 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/test/java/org/apache/hadoop/contrib/bkjournal/TestBookKeeperHACheckpoints.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/test/java/org/apache/hadoop/contrib/bkjournal/TestBookKeeperHACheckpoints.java @@ -17,19 +17,18 @@ */ package org.apache.hadoop.contrib.bkjournal; -import org.apache.hadoop.hdfs.server.namenode.ha.TestStandbyCheckpoints; -import org.apache.hadoop.hdfs.MiniDFSCluster; -import org.apache.hadoop.hdfs.MiniDFSNNTopology; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.DFSConfigKeys; - +import org.apache.hadoop.hdfs.MiniDFSCluster; +import org.apache.hadoop.hdfs.MiniDFSNNTopology; import org.apache.hadoop.hdfs.server.namenode.ha.HATestUtil; - -import org.junit.Before; -import org.junit.After; - -import org.junit.BeforeClass; +import org.apache.hadoop.hdfs.server.namenode.ha.TestStandbyCheckpoints; +import org.apache.hadoop.io.compress.CompressionCodecFactory; import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +import com.google.common.collect.ImmutableList; /** * Runs the same tests as TestStandbyCheckpoints, but @@ -40,6 +39,7 @@ public class TestBookKeeperHACheckpoints extends TestStandbyCheckpoints { static int numBookies = 3; static int journalCount = 0; + @SuppressWarnings("rawtypes") @Override @Before public void setupCluster() throws Exception { @@ -51,7 +51,11 @@ public void setupCluster() throws Exception { BKJMUtil.createJournalURI("/checkpointing" + journalCount++) .toString()); BKJMUtil.addJournalManagerDefinition(conf); - + conf.setBoolean(DFSConfigKeys.DFS_IMAGE_COMPRESS_KEY, true); + conf.set(DFSConfigKeys.DFS_IMAGE_COMPRESSION_CODEC_KEY, SlowCodec.class + .getCanonicalName()); + CompressionCodecFactory.setCodecClasses(conf, ImmutableList + . of(SlowCodec.class)); MiniDFSNNTopology topology = new MiniDFSNNTopology() .addNameservice(new MiniDFSNNTopology.NSConf("ns1") .addNN(new MiniDFSNNTopology.NNConf("nn1").setHttpPort(10001))