[ 
https://issues.apache.org/jira/browse/HDFS-17611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879185#comment-17879185
 ] 

ASF GitHub Bot commented on HDFS-17611:
---------------------------------------

steveloughran commented on code in PR #7025:
URL: https://github.com/apache/hadoop/pull/7025#discussion_r1743537144


##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java:
##########
@@ -438,6 +446,15 @@ protected DistCpContext getContext() {
     return context;
   }
 
+  /**
+   * Sets the current context.
+   *
+   * @param context context to be set to.
+   */
+  public void setContext(DistCpContext context) {

Review Comment:
   is this for testing or part of the public API?



##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java:
##########
@@ -181,15 +180,24 @@ public int run(String[] argv) {
     return DistCpConstants.SUCCESS;
   }
 
+  public Job execute() throws Exception {

Review Comment:
   add javadoc, emphasise it is the original entry point



##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java:
##########
@@ -139,10 +139,9 @@ public int run(String[] argv) {
     }
     
     try {
-      context = new DistCpContext(OptionsParser.parse(argv));
-      checkSplitLargeFile();
-      setTargetPathExists();
-      LOG.info("Input Options: " + context);
+      DistCpContext ctx = new DistCpContext(OptionsParser.parse(argv));
+      LOG.info("Input Options: " + ctx);

Review Comment:
   move to using {} in log...the + is only there because it was originally 
commons-logging





> Move all DistCp execution logic to execute()
> --------------------------------------------
>
>                 Key: HDFS-17611
>                 URL: https://issues.apache.org/jira/browse/HDFS-17611
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Felix N
>            Assignee: Felix N
>            Priority: Minor
>              Labels: pull-request-available
>
> Many code flows create a DistCp instance and call the public method execute() 
> to get the Job object for better control over the distcp job but some logics 
> are only called by the run() method. Should move these lines over to 
> execute().



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to