[ https://issues.apache.org/jira/browse/HADOOP-10775?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Loughran updated HADOOP-10775: ------------------------------------ Attachment: HADOOP-10775-005.patch This is a bigger patch which tries to do a full cleanup of shell, as well as setting up for unit tests on the (static) resolution of hadoop home and winutils. # addresses javadoc warnings across {{Shell}} # strip trailing spaces # move to SLF4J # factor out inner algorithms for locating/validating hadoop home and winutils static fields into package-scoped methods. # Add tests for the now visible-resolution functions. # fix a bug (credit [~andy.seaborne]) which would trigger an {{IndexOutOfBoundsException}} if {{HADOOP_HOME}} or {{hadoop.home.dir}} was set to the single quote {{"}} character. Now all leading and trailing quotes are stripped; tests validate this. # report the empty "" path to Hadoop home as a specific error, not simply a "relative path supplied". # {{getWinutilsPath()}} raises an RTE if called and winutils is null. That includes on Unix, where it is implicitly null. # tag as Deprecated tests which rely on {{WINUTILS}} references, even if null. # downgrade any constructor-time warnings about winutils not being found to being at debug level —as now attempts to fetch the path will trigger meaningful exceptions in the codepaths attempting to do so. The change in {{getWinutilsPath()}} is something which could be flagged as incompatible. There's nothing in the Hadoop codebase which appears to break with this change, all that is happing is that NPEs are being replaced with useful text. > Shell operations to fail with meaningful errors on windows if winutils.exe > not found > ------------------------------------------------------------------------------------ > > Key: HADOOP-10775 > URL: https://issues.apache.org/jira/browse/HADOOP-10775 > Project: Hadoop Common > Issue Type: Improvement > Components: util > Affects Versions: trunk-win, 2.7.1 > Environment: windows > Reporter: Steve Loughran > Assignee: Steve Loughran > Priority: Minor > Attachments: HADOOP-10775-002.patch, HADOOP-10775-003.patch, > HADOOP-10775-004.patch, HADOOP-10775-005.patch, HADOOP-10775.patch > > > If {{winutils.exe}} can't be found {{HADOOP_HOME}} wrong/unset or other > causes, then an error is logged -but when any of the {{Shell}} operations are > used, an NPE is raised rather than something meaningful. > The error message at setup time should be preserved and then raised before > any attempt to invoke a winutils-driven process made -- This message was sent by Atlassian JIRA (v6.3.4#6332)