You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by br...@apache.org on 2016/11/17 13:51:29 UTC
[2/3] hadoop git commit: HDFS-11134. Fix bind exception threw in
TestRenameWhileOpen. Contributed By Yiqun Lin.
HDFS-11134. Fix bind exception threw in TestRenameWhileOpen. Contributed By Yiqun Lin.
(cherry picked from commit b2d4b7b1b902aa830d44889d7747a4e1b816ab9d)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3e5a85f3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3e5a85f3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3e5a85f3
Branch: refs/heads/branch-2
Commit: 3e5a85f35eb7fe477da49c83a54b08010c91cbab
Parents: 47526a2
Author: Brahma Reddy Battula <br...@apache.org>
Authored: Thu Nov 17 10:22:30 2016 +0530
Committer: Brahma Reddy Battula <br...@apache.org>
Committed: Thu Nov 17 10:24:21 2016 +0530
----------------------------------------------------------------------
.../apache/hadoop/hdfs/TestRenameWhileOpen.java | 45 ++++++--------------
1 file changed, 12 insertions(+), 33 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/3e5a85f3/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRenameWhileOpen.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
index 949fc74..827577d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
@@ -72,8 +72,6 @@ public class TestRenameWhileOpen {
doNothing().when(spyLog).endCurrentLogSegment(Mockito.anyBoolean());
DFSTestUtil.setEditLogForTesting(cluster.getNamesystem(), spyLog);
- final int nnport = cluster.getNameNodePort();
-
// create file1.
Path dir1 = new Path("/user/a+b/dir1");
Path file1 = new Path(dir1, "file1");
@@ -111,22 +109,18 @@ public class TestRenameWhileOpen {
// for file3, since we just added a block to that file.
cluster.getNameNode().stop();
- // Restart cluster with the same namenode port as before.
+ // Restart cluster.
cluster.shutdown();
try {Thread.sleep(2*MAX_IDLE_TIME);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
// restart cluster yet again. This triggers the code to read in
// persistent leases from the edit log.
cluster.shutdown();
try {Thread.sleep(5000);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
fs = cluster.getFileSystem();
@@ -161,7 +155,6 @@ public class TestRenameWhileOpen {
try {
cluster.waitActive();
fs = cluster.getFileSystem();
- final int nnport = cluster.getNameNodePort();
// create file1.
Path dir1 = new Path("/user/dir1");
@@ -185,22 +178,18 @@ public class TestRenameWhileOpen {
Path dir3 = new Path("/user/dir3");
fs.rename(dir1, dir3);
- // restart cluster with the same namenode port as before.
+ // restart cluster.
// This ensures that leases are persisted in fsimage.
cluster.shutdown();
try {Thread.sleep(2*MAX_IDLE_TIME);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
// restart cluster yet again. This triggers the code to read in
// persistent leases from fsimage.
cluster.shutdown();
try {Thread.sleep(5000);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
fs = cluster.getFileSystem();
@@ -236,7 +225,6 @@ public class TestRenameWhileOpen {
try {
cluster.waitActive();
fs = cluster.getFileSystem();
- final int nnport = cluster.getNameNodePort();
// create file1.
Path dir1 = new Path("/user/dir1");
@@ -252,22 +240,18 @@ public class TestRenameWhileOpen {
fs.rename(file1, dir2);
- // restart cluster with the same namenode port as before.
+ // restart cluster.
// This ensures that leases are persisted in fsimage.
cluster.shutdown();
try {Thread.sleep(2*MAX_IDLE_TIME);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
// restart cluster yet again. This triggers the code to read in
// persistent leases from fsimage.
cluster.shutdown();
try {Thread.sleep(5000);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
fs = cluster.getFileSystem();
@@ -301,7 +285,6 @@ public class TestRenameWhileOpen {
try {
cluster.waitActive();
fs = cluster.getFileSystem();
- final int nnport = cluster.getNameNodePort();
// create file1.
Path dir1 = new Path("/user/dir1");
@@ -316,22 +299,18 @@ public class TestRenameWhileOpen {
fs.rename(file1, dir2);
- // restart cluster with the same namenode port as before.
+ // restart cluster.
// This ensures that leases are persisted in fsimage.
cluster.shutdown();
try {Thread.sleep(2*MAX_IDLE_TIME);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
// restart cluster yet again. This triggers the code to read in
// persistent leases from fsimage.
cluster.shutdown();
try {Thread.sleep(5000);} catch (InterruptedException e) {}
- cluster = new MiniDFSCluster.Builder(conf).nameNodePort(nnport)
- .format(false)
- .build();
+ cluster = new MiniDFSCluster.Builder(conf).format(false).build();
cluster.waitActive();
fs = cluster.getFileSystem();
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org