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 cn...@apache.org on 2015/06/06 18:20:40 UTC
[1/2] hadoop git commit: HADOOP-12055. Deprecate usage of
NativeIO#link. Contributed by Andrew Wang.
Repository: hadoop
Updated Branches:
refs/heads/branch-2 1a6cdf97b -> 1d1841d40
refs/heads/trunk b3ffa8700 -> e46cb8000
HADOOP-12055. Deprecate usage of NativeIO#link. Contributed by Andrew Wang.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e46cb800
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e46cb800
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e46cb800
Branch: refs/heads/trunk
Commit: e46cb800028c95f9bce575d05268cd10d0913222
Parents: b3ffa87
Author: cnauroth <cn...@apache.org>
Authored: Sat Jun 6 09:17:03 2015 -0700
Committer: cnauroth <cn...@apache.org>
Committed: Sat Jun 6 09:17:03 2015 -0700
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++
.../java/org/apache/hadoop/io/nativeio/NativeIO.java | 11 +++++++++++
.../apache/hadoop/hdfs/server/datanode/DataStorage.java | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e46cb800/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 4b1d0d1..eacc3be 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -640,6 +640,8 @@ Release 2.8.0 - UNRELEASED
HADOOP-12056. Use DirectoryStream in DiskChecker#checkDirs to detect
errors when listing a directory. (Zhihai Xu via wang)
+ HADOOP-12055. Deprecate usage of NativeIO#link. (Andrew Wang via cnauroth)
+
OPTIMIZATIONS
HADOOP-11785. Reduce the number of listStatus operation in distcp
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e46cb800/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
index bc6e62a..688b955 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
@@ -881,6 +881,17 @@ public class NativeIO {
}
}
+ /**
+ * Creates a hardlink "dst" that points to "src".
+ *
+ * This is deprecated since JDK7 NIO can create hardlinks via the
+ * {@link java.nio.file.Files} API.
+ *
+ * @param src source file
+ * @param dst hardlink location
+ * @throws IOException
+ */
+ @Deprecated
public static void link(File src, File dst) throws IOException {
if (!nativeLoaded) {
HardLink.createHardLink(src, dst);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/e46cb800/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
index 089e032..0bd08dd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
@@ -1044,7 +1044,7 @@ public class DataStorage extends Storage {
idBasedLayoutSingleLinks.size());
for (int j = iCopy; j < upperBound; j++) {
LinkArgs cur = idBasedLayoutSingleLinks.get(j);
- NativeIO.link(cur.src, cur.dst);
+ HardLink.createHardLink(cur.src, cur.dst);
}
return null;
}
[2/2] hadoop git commit: HADOOP-12055. Deprecate usage of
NativeIO#link. Contributed by Andrew Wang.
Posted by cn...@apache.org.
HADOOP-12055. Deprecate usage of NativeIO#link. Contributed by Andrew Wang.
(cherry picked from commit e46cb800028c95f9bce575d05268cd10d0913222)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/1d1841d4
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/1d1841d4
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/1d1841d4
Branch: refs/heads/branch-2
Commit: 1d1841d40fc8ed38c4e08e865f589a176c4ad21f
Parents: 1a6cdf9
Author: cnauroth <cn...@apache.org>
Authored: Sat Jun 6 09:17:03 2015 -0700
Committer: cnauroth <cn...@apache.org>
Committed: Sat Jun 6 09:17:11 2015 -0700
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++
.../java/org/apache/hadoop/io/nativeio/NativeIO.java | 11 +++++++++++
.../apache/hadoop/hdfs/server/datanode/DataStorage.java | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/1d1841d4/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 025c761..2bdfcdf 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -150,6 +150,8 @@ Release 2.8.0 - UNRELEASED
HADOOP-12056. Use DirectoryStream in DiskChecker#checkDirs to detect
errors when listing a directory. (Zhihai Xu via wang)
+ HADOOP-12055. Deprecate usage of NativeIO#link. (Andrew Wang via cnauroth)
+
OPTIMIZATIONS
HADOOP-11785. Reduce the number of listStatus operation in distcp
http://git-wip-us.apache.org/repos/asf/hadoop/blob/1d1841d4/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
index bc6e62a..688b955 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/NativeIO.java
@@ -881,6 +881,17 @@ public class NativeIO {
}
}
+ /**
+ * Creates a hardlink "dst" that points to "src".
+ *
+ * This is deprecated since JDK7 NIO can create hardlinks via the
+ * {@link java.nio.file.Files} API.
+ *
+ * @param src source file
+ * @param dst hardlink location
+ * @throws IOException
+ */
+ @Deprecated
public static void link(File src, File dst) throws IOException {
if (!nativeLoaded) {
HardLink.createHardLink(src, dst);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/1d1841d4/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
index 089e032..0bd08dd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java
@@ -1044,7 +1044,7 @@ public class DataStorage extends Storage {
idBasedLayoutSingleLinks.size());
for (int j = iCopy; j < upperBound; j++) {
LinkArgs cur = idBasedLayoutSingleLinks.get(j);
- NativeIO.link(cur.src, cur.dst);
+ HardLink.createHardLink(cur.src, cur.dst);
}
return null;
}