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 su...@apache.org on 2021/09/23 22:16:42 UTC
[hadoop] branch branch-3.3 updated (99d84b9 -> ff26a77)
This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a change to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git.
from 99d84b9 YARN-9606. Set sslfactory for AuthenticatedURL() while creating LogsCLI#webServiceClient. Contributed by Bilwa S T.
new 9fd0832 Revert "MAPREDUCE-7303. Fix TestJobResourceUploader failures after HADOOP-16878. Contributed by Peter Bacsko."
new ff26a77 Revert "HADOOP-16878. FileUtil.copy() to throw IOException if the source and destination are the same (#2383)"
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../src/main/java/org/apache/hadoop/fs/FileUtil.java | 6 ------
.../test/java/org/apache/hadoop/fs/TestFsShellCopy.java | 16 +---------------
.../apache/hadoop/hdfs/TestDistributedFileSystem.java | 16 ----------------
.../apache/hadoop/mapreduce/TestJobResourceUploader.java | 12 ++----------
4 files changed, 3 insertions(+), 47 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[hadoop] 01/02: Revert "MAPREDUCE-7303. Fix TestJobResourceUploader
failures after HADOOP-16878. Contributed by Peter Bacsko."
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit 9fd0832a998c9ddfe4d85d82f22ae09412f2763d
Author: Chao Sun <su...@apache.org>
AuthorDate: Tue Sep 21 12:46:20 2021 -0700
Revert "MAPREDUCE-7303. Fix TestJobResourceUploader failures after HADOOP-16878. Contributed by Peter Bacsko."
This reverts commit c40f0f1eb34df64449472f698d1d68355f109e9b.
---
.../org/apache/hadoop/mapreduce/TestJobResourceUploader.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java
index c49d771..bbfe2fb 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/TestJobResourceUploader.java
@@ -399,7 +399,6 @@ public class TestJobResourceUploader {
Path expectedRemotePath) throws IOException, URISyntaxException {
Path dstPath = new Path("hdfs://localhost:1234/home/hadoop/");
DistributedFileSystem fs = mock(DistributedFileSystem.class);
- when(fs.makeQualified(any(Path.class))).thenReturn(dstPath);
// make sure that FileUtils.copy() doesn't try to copy anything
when(fs.mkdirs(any(Path.class))).thenReturn(false);
when(fs.getUri()).thenReturn(dstPath.toUri());
@@ -408,7 +407,6 @@ public class TestJobResourceUploader {
JobConf jConf = new JobConf();
Path originalPath = spy(path);
FileSystem localFs = mock(FileSystem.class);
- when(localFs.makeQualified(any(Path.class))).thenReturn(path);
FileStatus fileStatus = mock(FileStatus.class);
when(localFs.getFileStatus(any(Path.class))).thenReturn(fileStatus);
when(fileStatus.isDirectory()).thenReturn(true);
@@ -422,14 +420,8 @@ public class TestJobResourceUploader {
originalPath, jConf, (short) 1);
ArgumentCaptor<Path> pathCaptor = ArgumentCaptor.forClass(Path.class);
- verify(fs, times(2)).makeQualified(pathCaptor.capture());
- List<Path> paths = pathCaptor.getAllValues();
- // first call is invoked on a path which was created by the test,
- // but the second one is created in copyRemoteFiles()
- Assert.assertEquals("Expected remote path",
- expectedRemotePath, paths.get(0));
- Assert.assertEquals("Expected remote path",
- expectedRemotePath, paths.get(1));
+ verify(fs).makeQualified(pathCaptor.capture());
+ Assert.assertEquals("Path", expectedRemotePath, pathCaptor.getValue());
}
private void testErasureCodingSetting(boolean defaultBehavior)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org
[hadoop] 02/02: Revert "HADOOP-16878. FileUtil.copy() to throw
IOException if the source and destination are the same (#2383)"
Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git
commit ff26a7700db05074183e5dbcd56ad18b51c95128
Author: Chao Sun <su...@apache.org>
AuthorDate: Tue Sep 21 12:46:25 2021 -0700
Revert "HADOOP-16878. FileUtil.copy() to throw IOException if the source and destination are the same (#2383)"
This reverts commit 54c40cbf49f2ebf4bbc1976279a6eba7a2c5fe23.
---
.../src/main/java/org/apache/hadoop/fs/FileUtil.java | 6 ------
.../test/java/org/apache/hadoop/fs/TestFsShellCopy.java | 16 +---------------
.../apache/hadoop/hdfs/TestDistributedFileSystem.java | 16 ----------------
3 files changed, 1 insertion(+), 37 deletions(-)
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
index 312fd4d..82ad513 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java
@@ -398,12 +398,6 @@ public class FileUtil {
Configuration conf) throws IOException {
Path src = srcStatus.getPath();
dst = checkDest(src.getName(), dstFS, dst, overwrite);
-
- if (srcFS.makeQualified(src).equals(dstFS.makeQualified(dst))) {
- throw new PathOperationException("Source (" + src + ") and destination " +
- "(" + dst + ") are equal in the copy command.");
- }
-
if (srcStatus.isDirectory()) {
checkDependencies(srcFS, src, dstFS, dst);
if (!dstFS.mkdirs(dst)) {
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellCopy.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellCopy.java
index e3c4ee0..91cc9bc 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellCopy.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFsShellCopy.java
@@ -35,7 +35,6 @@ import java.io.PrintStream;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.test.GenericTestUtils;
-import org.apache.hadoop.test.LambdaTestUtils;
import org.apache.hadoop.util.StringUtils;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -177,20 +176,7 @@ public class TestFsShellCopy {
checkPut(dirPath, targetDir, true);
}
- @Test
- public void testCopyBetweenFsEqualPath() throws Exception {
- Path testRoot = new Path(testRootDir, "testPutFile");
- lfs.delete(testRoot, true);
- lfs.mkdirs(testRoot);
-
- Path filePath = new Path(testRoot, "sameSourceTarget");
- lfs.create(filePath).close();
- final FileStatus status = lfs.getFileStatus(filePath);
- LambdaTestUtils.intercept(PathOperationException.class, () ->
- FileUtil.copy(lfs, status, lfs, filePath, false, true, conf)
- );
- }
-
+
private void checkPut(Path srcPath, Path targetDir, boolean useWindowsPath)
throws Exception {
lfs.delete(targetDir, true);
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
index e96bd62..c4c5e17 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java
@@ -65,7 +65,6 @@ import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileSystem.Statistics.StatisticsData;
-import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.FsServerDefaults;
import org.apache.hadoop.fs.FileChecksum;
import org.apache.hadoop.fs.FileStatus;
@@ -76,7 +75,6 @@ import org.apache.hadoop.fs.MD5MD5CRC32FileChecksum;
import org.apache.hadoop.fs.Options.ChecksumOpt;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathIsNotEmptyDirectoryException;
-import org.apache.hadoop.fs.PathOperationException;
import org.apache.hadoop.fs.RemoteIterator;
import org.apache.hadoop.fs.StorageStatistics.LongStatistic;
import org.apache.hadoop.fs.StorageType;
@@ -2107,18 +2105,4 @@ public class TestDistributedFileSystem {
assertFalse(result.isSupported());
}
}
-
- @Test
- public void testCopyBetweenFsEqualPath() throws Exception {
- Configuration conf = getTestConfiguration();
- try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build()) {
- cluster.waitActive();
- final DistributedFileSystem dfs = cluster.getFileSystem();
- Path filePath = new Path("/dir/file");
- dfs.create(filePath).close();
- FileStatus fstatus = dfs.getFileStatus(filePath);
- LambdaTestUtils.intercept(PathOperationException.class,
- () -> FileUtil.copy(dfs, fstatus, dfs, filePath, false, true, conf));
- }
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org