@@ -140,7 +140,9 @@ public int run(String[] argv) {
140140
141141 try {
142142 context = new DistCpContext (OptionsParser .parse (argv ));
143- LOG .info ("Input Options: {}" , context );
143+ checkSplitLargeFile ();
144+ setTargetPathExists ();
145+ LOG .info ("Input Options: " + context );
144146 } catch (Throwable e ) {
145147 LOG .error ("Invalid arguments: " , e );
146148 System .err .println ("Invalid arguments: " + e .getMessage ());
@@ -150,7 +152,7 @@ public int run(String[] argv) {
150152
151153 Job job = null ;
152154 try {
153- job = execute (true );
155+ job = execute ();
154156 } catch (InvalidInputException e ) {
155157 LOG .error ("Invalid input: " , e );
156158 return DistCpConstants .INVALID_ARGUMENT ;
@@ -167,7 +169,7 @@ public int run(String[] argv) {
167169 LOG .error ("Exception encountered " , e );
168170 return DistCpConstants .UNKNOWN_ERROR ;
169171 } finally {
170- // Blocking distcp so close the job after it's done
172+ //Blocking distcp so close the job after its done
171173 if (job != null && context .shouldBlock ()) {
172174 try {
173175 job .close ();
@@ -179,31 +181,15 @@ public int run(String[] argv) {
179181 return DistCpConstants .SUCCESS ;
180182 }
181183
182- /**
183- * Original entrypoint of a distcp job. Calls {@link DistCp#execute(boolean)}
184- * without doing extra context checks and setting some configs.
185- * @return Job handle
186- * @throws Exception when fails to submit distcp job or distcp job fails
187- */
188- public Job execute () throws Exception {
189- return execute (false );
190- }
191-
192184 /**
193185 * Implements the core-execution. Creates the file-list for copy,
194186 * and launches the Hadoop-job, to do the copy.
195- * @param extraContextChecks if true, does extra context checks and sets some configs.
196187 * @return Job handle
197- * @throws Exception when fails to submit distcp job or distcp job fails, or context checks fail
188+ * @throws Exception
198189 */
199- public Job execute (boolean extraContextChecks ) throws Exception {
190+ public Job execute () throws Exception {
200191 Preconditions .checkState (context != null ,
201192 "The DistCpContext should have been created before running DistCp!" );
202- if (extraContextChecks ) {
203- checkSplitLargeFile ();
204- setTargetPathExists ();
205- }
206-
207193 Job job = createAndSubmitJob ();
208194
209195 if (context .shouldBlock ()) {
0 commit comments