[ 
https://issues.apache.org/jira/browse/HADOOP-16462?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

lifulong updated HADOOP-16462:
------------------------------
    Environment: 
{code:java}
// code placeholder
@Override
        public int run(String[] argv) {
        if (argv.length < 1) {
        OptionsParser.usage();
        return DistCpConstants.INVALID_ARGUMENT;
        }
        
        try {
        context = new DistCpContext(OptionsParser.parse(argv));
        checkSplitLargeFile();
        setTargetPathExists();
        LOG.info("Input Options: " + context);
        } catch (Throwable e) {
        LOG.error("Invalid arguments: ", e);
        System.err.println("Invalid arguments: " + e.getMessage());
        OptionsParser.usage();
        return DistCpConstants.INVALID_ARGUMENT;
        }
        
        try {
        execute();
        } catch (InvalidInputException e) {
        LOG.error("Invalid input: ", e);
        return DistCpConstants.INVALID_ARGUMENT;
        } catch (DuplicateFileException e) {
        LOG.error("Duplicate files in input path: ", e);
        return DistCpConstants.DUPLICATE_INPUT;
        } catch (AclsNotSupportedException e) {
        LOG.error("ACLs not supported on at least one file system: ", e);
        return DistCpConstants.ACLS_NOT_SUPPORTED;
        } catch (XAttrsNotSupportedException e) {
        LOG.error("XAttrs not supported on at least one file system: ", e);
        return DistCpConstants.XATTRS_NOT_SUPPORTED;
        } catch (Exception e) {
        LOG.error("Exception encountered ", e);
        return DistCpConstants.UNKNOWN_ERROR;
        }
        return DistCpConstants.SUCCESS;
        }
{code}
 

  was:
{code:java}
// code placeholder
@Override
        public int run(String[] argv) {
        if (argv.length < 1) {
        OptionsParser.usage();
        return DistCpConstants.INVALID_ARGUMENT;
        }
        
        try {
        context = new DistCpContext(OptionsParser.parse(argv));
        checkSplitLargeFile();
        setTargetPathExists();
        LOG.info("Input Options: " + context);
        } catch (Throwable e) {
        LOG.error("Invalid arguments: ", e);
        System.err.println("Invalid arguments: " + e.getMessage());
        OptionsParser.usage();
        return DistCpConstants.INVALID_ARGUMENT;
        }
        
        try {
        execute();
        } catch (InvalidInputException e) {
        LOG.error("Invalid input: ", e);
        return DistCpConstants.INVALID_ARGUMENT;
        } catch (DuplicateFileException e) {
        LOG.error("Duplicate files in input path: ", e);
        return DistCpConstants.DUPLICATE_INPUT;
        } catch (AclsNotSupportedException e) {
        LOG.error("ACLs not supported on at least one file system: ", e);
        return DistCpConstants.ACLS_NOT_SUPPORTED;
        } catch (XAttrsNotSupportedException e) {
        LOG.error("XAttrs not supported on at least one file system: ", e);
        return DistCpConstants.XATTRS_NOT_SUPPORTED;
        } catch (Exception e) {
        LOG.error("Exception encountered ", e);
        return DistCpConstants.UNKNOWN_ERROR;
        }
        return DistCpConstants.SUCCESS;
        }
{code}
 

distcp run method should throw exception other than -999 error code while the 
exception is not classify, for us to know the real reason it failed 


> distcp should throw exception other than -999 error code while the exception 
> is not classify, for us to know the real reason it failed 
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-16462
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16462
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: tools/distcp
>    Affects Versions: 3.1.1
>         Environment: {code:java}
> // code placeholder
> @Override
>       public int run(String[] argv) {
>       if (argv.length < 1) {
>       OptionsParser.usage();
>       return DistCpConstants.INVALID_ARGUMENT;
>       }
>       
>       try {
>       context = new DistCpContext(OptionsParser.parse(argv));
>       checkSplitLargeFile();
>       setTargetPathExists();
>       LOG.info("Input Options: " + context);
>       } catch (Throwable e) {
>       LOG.error("Invalid arguments: ", e);
>       System.err.println("Invalid arguments: " + e.getMessage());
>       OptionsParser.usage();
>       return DistCpConstants.INVALID_ARGUMENT;
>       }
>       
>       try {
>       execute();
>       } catch (InvalidInputException e) {
>       LOG.error("Invalid input: ", e);
>       return DistCpConstants.INVALID_ARGUMENT;
>       } catch (DuplicateFileException e) {
>       LOG.error("Duplicate files in input path: ", e);
>       return DistCpConstants.DUPLICATE_INPUT;
>       } catch (AclsNotSupportedException e) {
>       LOG.error("ACLs not supported on at least one file system: ", e);
>       return DistCpConstants.ACLS_NOT_SUPPORTED;
>       } catch (XAttrsNotSupportedException e) {
>       LOG.error("XAttrs not supported on at least one file system: ", e);
>       return DistCpConstants.XATTRS_NOT_SUPPORTED;
>       } catch (Exception e) {
>       LOG.error("Exception encountered ", e);
>       return DistCpConstants.UNKNOWN_ERROR;
>       }
>       return DistCpConstants.SUCCESS;
>       }
> {code}
>  
>            Reporter: lifulong
>            Priority: Minor
>




--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

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

Reply via email to