Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 262D1194DF for ; Sat, 16 Apr 2016 00:07:56 +0000 (UTC) Received: (qmail 11456 invoked by uid 500); 16 Apr 2016 00:07:43 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 11349 invoked by uid 500); 16 Apr 2016 00:07:43 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 10335 invoked by uid 99); 16 Apr 2016 00:07:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Apr 2016 00:07:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7B9CADFBA0; Sat, 16 Apr 2016 00:07:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wangda@apache.org To: common-commits@hadoop.apache.org Date: Sat, 16 Apr 2016 00:08:12 -0000 Message-Id: In-Reply-To: <76120e36f37945e6862773579cc3e424@git.apache.org> References: <76120e36f37945e6862773579cc3e424@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [32/50] [abbrv] hadoop git commit: HDFS-10283. o.a.h.hdfs.server.namenode.TestFSImageWithSnapshot#testSaveLoadImageWithAppending fails intermittently. Contributed by Mingliang Liu. HDFS-10283. o.a.h.hdfs.server.namenode.TestFSImageWithSnapshot#testSaveLoadImageWithAppending fails intermittently. Contributed by Mingliang Liu. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/89a83876 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/89a83876 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/89a83876 Branch: refs/heads/YARN-3368 Commit: 89a838769ff5b6c64565e6949b14d7fed05daf54 Parents: 4feed9b Author: Jing Zhao Authored: Fri Apr 15 10:49:21 2016 -0700 Committer: Jing Zhao Committed: Fri Apr 15 10:49:21 2016 -0700 ---------------------------------------------------------------------- .../namenode/TestFSImageWithSnapshot.java | 43 ++++++++++---------- 1 file changed, 22 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/89a83876/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImageWithSnapshot.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImageWithSnapshot.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImageWithSnapshot.java index 1904bbc..6be3950 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImageWithSnapshot.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSImageWithSnapshot.java @@ -47,6 +47,7 @@ import org.apache.hadoop.hdfs.server.namenode.snapshot.SnapshotTestHelper; import org.apache.hadoop.hdfs.util.Canceler; import org.apache.hadoop.test.GenericTestUtils; import org.apache.log4j.Level; + import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -62,7 +63,7 @@ public class TestFSImageWithSnapshot { } static final long seed = 0; - static final short REPLICATION = 3; + static final short NUM_DATANODES = 3; static final int BLOCKSIZE = 1024; static final long txid = 1; @@ -78,7 +79,7 @@ public class TestFSImageWithSnapshot { @Before public void setUp() throws Exception { conf = new Configuration(); - cluster = new MiniDFSCluster.Builder(conf).numDataNodes(REPLICATION) + cluster = new MiniDFSCluster.Builder(conf).numDataNodes(NUM_DATANODES) .build(); cluster.waitActive(); fsn = cluster.getNamesystem(); @@ -177,7 +178,7 @@ public class TestFSImageWithSnapshot { cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -188,7 +189,7 @@ public class TestFSImageWithSnapshot { hdfs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE); cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -215,7 +216,7 @@ public class TestFSImageWithSnapshot { hdfs.setSafeMode(SafeModeAction.SAFEMODE_LEAVE); cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -248,20 +249,20 @@ public class TestFSImageWithSnapshot { hdfs.createSnapshot(dir, "s" + ++s); Path sub1file1 = new Path(sub1, "sub1file1"); Path sub1file2 = new Path(sub1, "sub1file2"); - DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, REPLICATION, seed); - DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, REPLICATION, seed); + DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, (short) 1, seed); + DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, (short) 1, seed); checkImage(s); hdfs.createSnapshot(dir, "s" + ++s); Path sub2 = new Path(dir, "sub2"); Path sub2file1 = new Path(sub2, "sub2file1"); Path sub2file2 = new Path(sub2, "sub2file2"); - DFSTestUtil.createFile(hdfs, sub2file1, BLOCKSIZE, REPLICATION, seed); - DFSTestUtil.createFile(hdfs, sub2file2, BLOCKSIZE, REPLICATION, seed); + DFSTestUtil.createFile(hdfs, sub2file1, BLOCKSIZE, (short) 1, seed); + DFSTestUtil.createFile(hdfs, sub2file2, BLOCKSIZE, (short) 1, seed); checkImage(s); hdfs.createSnapshot(dir, "s" + ++s); - hdfs.setReplication(sub1file1, (short) (REPLICATION - 1)); + hdfs.setReplication(sub1file1, (short) 1); hdfs.delete(sub1file2, true); hdfs.setOwner(sub2, "dr.who", "unknown"); hdfs.delete(sub2file1, true); @@ -300,7 +301,7 @@ public class TestFSImageWithSnapshot { // restart the cluster, and format the cluster cluster = new MiniDFSCluster.Builder(conf).format(true) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -338,8 +339,8 @@ public class TestFSImageWithSnapshot { Path sub1 = new Path(dir, "sub1"); Path sub1file1 = new Path(sub1, "sub1file1"); Path sub1file2 = new Path(sub1, "sub1file2"); - DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, REPLICATION, seed); - DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, REPLICATION, seed); + DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, (short) 1, seed); + DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, (short) 1, seed); // 1. create snapshot s0 hdfs.allowSnapshot(dir); @@ -372,7 +373,7 @@ public class TestFSImageWithSnapshot { out.close(); cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(true) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -394,8 +395,8 @@ public class TestFSImageWithSnapshot { Path sub1 = new Path(dir, "sub1"); Path sub1file1 = new Path(sub1, "sub1file1"); Path sub1file2 = new Path(sub1, "sub1file2"); - DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, REPLICATION, seed); - DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, REPLICATION, seed); + DFSTestUtil.createFile(hdfs, sub1file1, BLOCKSIZE, (short) 1, seed); + DFSTestUtil.createFile(hdfs, sub1file2, BLOCKSIZE, (short) 1, seed); hdfs.allowSnapshot(dir); hdfs.createSnapshot(dir, "s0"); @@ -410,7 +411,7 @@ public class TestFSImageWithSnapshot { cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem(); @@ -440,7 +441,7 @@ public class TestFSImageWithSnapshot { // restart cluster cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); hdfs = cluster.getFileSystem(); @@ -478,7 +479,7 @@ public class TestFSImageWithSnapshot { Path newDir = new Path(subsubDir, "newdir"); Path newFile = new Path(newDir, "newfile"); hdfs.mkdirs(newDir); - DFSTestUtil.createFile(hdfs, newFile, BLOCKSIZE, REPLICATION, seed); + DFSTestUtil.createFile(hdfs, newFile, BLOCKSIZE, (short) 1, seed); // create another snapshot SnapshotTestHelper.createSnapshot(hdfs, dir, "s2"); @@ -491,7 +492,7 @@ public class TestFSImageWithSnapshot { // restart cluster cluster.shutdown(); - cluster = new MiniDFSCluster.Builder(conf).numDataNodes(REPLICATION) + cluster = new MiniDFSCluster.Builder(conf).numDataNodes(NUM_DATANODES) .format(false).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); @@ -504,7 +505,7 @@ public class TestFSImageWithSnapshot { cluster.shutdown(); cluster = new MiniDFSCluster.Builder(conf).format(false) - .numDataNodes(REPLICATION).build(); + .numDataNodes(NUM_DATANODES).build(); cluster.waitActive(); fsn = cluster.getNamesystem(); hdfs = cluster.getFileSystem();