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 cd...@apache.org on 2017/05/18 00:30:56 UTC
[1/5] hadoop git commit: HADOOP-14434. Use MoveFileEx to allow
renaming a file when the destination exists. Contributed by Lukas Majercak
Repository: hadoop
Updated Branches:
refs/heads/branch-2 94755e2d6 -> 4bb056544
refs/heads/branch-2.7 0823fb72a -> 2b58fb8b0
refs/heads/branch-2.8 c61956dd1 -> 475b50b44
refs/heads/branch-2.8.1 820496fbb -> 954f9ce65
refs/heads/trunk eb7791b47 -> ef9e536a7
HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination exists. Contributed by Lukas Majercak
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ef9e536a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ef9e536a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ef9e536a
Branch: refs/heads/trunk
Commit: ef9e536a7137d209985d25a4769712c2db2c52bf
Parents: eb7791b
Author: Chris Douglas <cd...@apache.org>
Authored: Wed May 17 17:21:03 2017 -0700
Committer: Chris Douglas <cd...@apache.org>
Committed: Wed May 17 17:21:03 2017 -0700
----------------------------------------------------------------------
.../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +-
.../test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef9e536a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
index a7d4b55..242a456 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
@@ -1204,7 +1204,7 @@ done:
if (!src) goto done; // exception was thrown
dst = (LPCWSTR) (*env)->GetStringChars(env, jdst, NULL);
if (!dst) goto done; // exception was thrown
- if (!MoveFile(src, dst)) {
+ if (!MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING)) {
throw_ioe(env, GetLastError());
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/ef9e536a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
index b2445a3..436f10a 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
@@ -510,7 +510,7 @@ public class TestNativeIO {
Assert.assertEquals(Errno.ENOENT, e.getErrno());
}
}
-
+
// Test renaming a file to itself. It should succeed and do nothing.
File sourceFile = new File(TEST_DIR, "source");
Assert.assertTrue(sourceFile.createNewFile());
@@ -536,7 +536,9 @@ public class TestNativeIO {
}
}
- FileUtils.deleteQuietly(TEST_DIR);
+ // Test renaming to an existing file
+ assertTrue(targetFile.exists());
+ NativeIO.renameTo(sourceFile, targetFile);
}
@Test(timeout=10000)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[5/5] hadoop git commit: HADOOP-14434. Use MoveFileEx to allow
renaming a file when the destination exists. Contributed by Lukas Majercak
Posted by cd...@apache.org.
HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination exists. Contributed by Lukas Majercak
(cherry picked from commit ef9e536a7137d209985d25a4769712c2db2c52bf)
(cherry picked from commit 4bb056544341726dd051353f1cc8430b801bf391)
(cherry picked from commit 475b50b44cebf5e5b4622e4092f4a447569b1b2b)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2b58fb8b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2b58fb8b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2b58fb8b
Branch: refs/heads/branch-2.7
Commit: 2b58fb8b03ceeb930c2788052443f065ea007af4
Parents: 0823fb7
Author: Chris Douglas <cd...@apache.org>
Authored: Wed May 17 17:21:03 2017 -0700
Committer: Chris Douglas <cd...@apache.org>
Committed: Wed May 17 17:30:20 2017 -0700
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++
.../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +-
.../test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java | 6 ++++--
3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b58fb8b/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 2ddc0c4..515a93e 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -148,6 +148,9 @@ Release 2.7.4 - UNRELEASED
HADOOP-12173. NetworkTopology::add calls toString always.
(Inigo Goiri via cdouglas)
+ HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination
+ exists. (Lukas Majercak via cdouglas)
+
Release 2.7.3 - 2016-08-25
INCOMPATIBLE CHANGES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b58fb8b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
index 071d830..6f07fbe 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
@@ -1162,7 +1162,7 @@ done:
if (!src) goto done; // exception was thrown
dst = (LPCWSTR) (*env)->GetStringChars(env, jdst, NULL);
if (!dst) goto done; // exception was thrown
- if (!MoveFile(src, dst)) {
+ if (!MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING)) {
throw_ioe(env, GetLastError());
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b58fb8b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
index bf3ece7..513465f 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
@@ -543,7 +543,7 @@ public class TestNativeIO {
Assert.assertEquals(Errno.ENOENT, e.getErrno());
}
}
-
+
// Test renaming a file to itself. It should succeed and do nothing.
File sourceFile = new File(TEST_DIR, "source");
Assert.assertTrue(sourceFile.createNewFile());
@@ -569,7 +569,9 @@ public class TestNativeIO {
}
}
- FileUtils.deleteQuietly(TEST_DIR);
+ // Test renaming to an existing file
+ assertTrue(targetFile.exists());
+ NativeIO.renameTo(sourceFile, targetFile);
}
@Test(timeout=10000)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[4/5] hadoop git commit: HADOOP-14434. Use MoveFileEx to allow
renaming a file when the destination exists. Contributed by Lukas Majercak
Posted by cd...@apache.org.
HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination exists. Contributed by Lukas Majercak
(cherry picked from commit ef9e536a7137d209985d25a4769712c2db2c52bf)
(cherry picked from commit 4bb056544341726dd051353f1cc8430b801bf391)
(cherry picked from commit 475b50b44cebf5e5b4622e4092f4a447569b1b2b)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/954f9ce6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/954f9ce6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/954f9ce6
Branch: refs/heads/branch-2.8.1
Commit: 954f9ce657cb8843220457995ee20ae89273349b
Parents: 820496f
Author: Chris Douglas <cd...@apache.org>
Authored: Wed May 17 17:21:03 2017 -0700
Committer: Chris Douglas <cd...@apache.org>
Committed: Wed May 17 17:25:30 2017 -0700
----------------------------------------------------------------------
.../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +-
.../test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/954f9ce6/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
index a7d4b55..242a456 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
@@ -1204,7 +1204,7 @@ done:
if (!src) goto done; // exception was thrown
dst = (LPCWSTR) (*env)->GetStringChars(env, jdst, NULL);
if (!dst) goto done; // exception was thrown
- if (!MoveFile(src, dst)) {
+ if (!MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING)) {
throw_ioe(env, GetLastError());
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/954f9ce6/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
index e6f25dc..0f2c640 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
@@ -532,7 +532,7 @@ public class TestNativeIO {
Assert.assertEquals(Errno.ENOENT, e.getErrno());
}
}
-
+
// Test renaming a file to itself. It should succeed and do nothing.
File sourceFile = new File(TEST_DIR, "source");
Assert.assertTrue(sourceFile.createNewFile());
@@ -558,7 +558,9 @@ public class TestNativeIO {
}
}
- FileUtils.deleteQuietly(TEST_DIR);
+ // Test renaming to an existing file
+ assertTrue(targetFile.exists());
+ NativeIO.renameTo(sourceFile, targetFile);
}
@Test(timeout=10000)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[3/5] hadoop git commit: HADOOP-14434. Use MoveFileEx to allow
renaming a file when the destination exists. Contributed by Lukas Majercak
Posted by cd...@apache.org.
HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination exists. Contributed by Lukas Majercak
(cherry picked from commit ef9e536a7137d209985d25a4769712c2db2c52bf)
(cherry picked from commit 4bb056544341726dd051353f1cc8430b801bf391)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/475b50b4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/475b50b4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/475b50b4
Branch: refs/heads/branch-2.8
Commit: 475b50b44cebf5e5b4622e4092f4a447569b1b2b
Parents: c61956d
Author: Chris Douglas <cd...@apache.org>
Authored: Wed May 17 17:21:03 2017 -0700
Committer: Chris Douglas <cd...@apache.org>
Committed: Wed May 17 17:25:08 2017 -0700
----------------------------------------------------------------------
.../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +-
.../test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/475b50b4/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
index a7d4b55..242a456 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
@@ -1204,7 +1204,7 @@ done:
if (!src) goto done; // exception was thrown
dst = (LPCWSTR) (*env)->GetStringChars(env, jdst, NULL);
if (!dst) goto done; // exception was thrown
- if (!MoveFile(src, dst)) {
+ if (!MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING)) {
throw_ioe(env, GetLastError());
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/475b50b4/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
index e6f25dc..0f2c640 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
@@ -532,7 +532,7 @@ public class TestNativeIO {
Assert.assertEquals(Errno.ENOENT, e.getErrno());
}
}
-
+
// Test renaming a file to itself. It should succeed and do nothing.
File sourceFile = new File(TEST_DIR, "source");
Assert.assertTrue(sourceFile.createNewFile());
@@ -558,7 +558,9 @@ public class TestNativeIO {
}
}
- FileUtils.deleteQuietly(TEST_DIR);
+ // Test renaming to an existing file
+ assertTrue(targetFile.exists());
+ NativeIO.renameTo(sourceFile, targetFile);
}
@Test(timeout=10000)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[2/5] hadoop git commit: HADOOP-14434. Use MoveFileEx to allow
renaming a file when the destination exists. Contributed by Lukas Majercak
Posted by cd...@apache.org.
HADOOP-14434. Use MoveFileEx to allow renaming a file when the destination exists. Contributed by Lukas Majercak
(cherry picked from commit ef9e536a7137d209985d25a4769712c2db2c52bf)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4bb05654
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4bb05654
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4bb05654
Branch: refs/heads/branch-2
Commit: 4bb056544341726dd051353f1cc8430b801bf391
Parents: 94755e2
Author: Chris Douglas <cd...@apache.org>
Authored: Wed May 17 17:21:03 2017 -0700
Committer: Chris Douglas <cd...@apache.org>
Committed: Wed May 17 17:24:36 2017 -0700
----------------------------------------------------------------------
.../main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c | 2 +-
.../test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/4bb05654/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
index a7d4b55..242a456 100644
--- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
+++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/io/nativeio/NativeIO.c
@@ -1204,7 +1204,7 @@ done:
if (!src) goto done; // exception was thrown
dst = (LPCWSTR) (*env)->GetStringChars(env, jdst, NULL);
if (!dst) goto done; // exception was thrown
- if (!MoveFile(src, dst)) {
+ if (!MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING)) {
throw_ioe(env, GetLastError());
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/4bb05654/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
index e6f25dc..0f2c640 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/nativeio/TestNativeIO.java
@@ -532,7 +532,7 @@ public class TestNativeIO {
Assert.assertEquals(Errno.ENOENT, e.getErrno());
}
}
-
+
// Test renaming a file to itself. It should succeed and do nothing.
File sourceFile = new File(TEST_DIR, "source");
Assert.assertTrue(sourceFile.createNewFile());
@@ -558,7 +558,9 @@ public class TestNativeIO {
}
}
- FileUtils.deleteQuietly(TEST_DIR);
+ // Test renaming to an existing file
+ assertTrue(targetFile.exists());
+ NativeIO.renameTo(sourceFile, targetFile);
}
@Test(timeout=10000)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org