HADOOP-17531.Addendum: DistCp: Reduce memory usage on copying huge directories. (#2820). Contributed by Ayush Saxena.

Signed-off-by: Steve Loughran <stevel@apache.org>
This commit is contained in:
Ayush Saxena 2021-03-27 03:01:41 +05:30 committed by GitHub
parent 1fed18bb2d
commit f5c1557288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@
import java.lang.management.ThreadInfo; import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean; import java.lang.management.ThreadMXBean;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -70,7 +71,6 @@
import org.mockito.stubbing.Answer; import org.mockito.stubbing.Answer;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.apache.hadoop.thirdparty.com.google.common.base.Charsets;
import org.apache.hadoop.thirdparty.com.google.common.base.Joiner; import org.apache.hadoop.thirdparty.com.google.common.base.Joiner;
import org.apache.hadoop.thirdparty.com.google.common.collect.Sets; import org.apache.hadoop.thirdparty.com.google.common.collect.Sets;
@ -927,7 +927,7 @@ private static CompletableFuture<Path> put(FileSystem fs,
return submit(EXECUTOR, () -> { return submit(EXECUTOR, () -> {
try (DurationInfo ignore = try (DurationInfo ignore =
new DurationInfo(LOG, false, "Creating %s", path)) { new DurationInfo(LOG, false, "Creating %s", path)) {
createFile(fs, path, true, text.getBytes(Charsets.UTF_8)); createFile(fs, path, true, text.getBytes(StandardCharsets.UTF_8));
return path; return path;
} }
}); });