From c15b3bca86a0f973ccdddd020f3ff2d5767ff1bd Mon Sep 17 00:00:00 2001 From: Andrew Olson Date: Thu, 16 May 2019 16:11:12 +0200 Subject: [PATCH] HADOOP-16294: Enable access to input options by DistCp subclasses. Adding a protected-scope getter for the DistCpOptions, so that a subclass does not need to save its own copy of the inputOptions supplied to its constructor, if it wishes to override the createInputFileListing method with logic similar to the original implementation, i.e. calling CopyListing#buildListing with a path and input options. Author: Andrew Olson --- .../src/main/java/org/apache/hadoop/tools/DistCp.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java index 4f79975ede..a1a2075831 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java @@ -416,6 +416,15 @@ private Path createMetaFolderPath() throws Exception { return metaFolderPath; } + /** + * Returns the context. + * + * @return the context + */ + protected DistCpContext getContext() { + return context; + } + /** * Main function of the DistCp program. Parses the input arguments (via OptionsParser), * and invokes the DistCp::run() method, via the ToolRunner.