A slightly cleaned up version of David's patch from Hadoop-8079
Duplicating all of the command line logic will make things harder to maintain.
I wonder if it's time to revisit an approach like that of HADOOP-61, to move as much of the command line logic as possible out of shell scripts and into Java?
Doug, in several cases at the end you have to execute a shell command on windows or unix (or native code) because the operation is not implementable in pure java. Do you mean more like the approach of DU.java (to get disk usage)? With Du.java the the mainline code just calls Du.java but Du.java calls the unix shell or the windows cmd.
Change Variable name from DISABLEWINDOWS to DISABLEWINDOWS_TEMPORARILY - this should be more obvious to readers
Sanjay, yes, in some cases we do need OS-specific code. But we should minimize it and avoid duplication of logic when possible. This patch duplicates a lot of logic in the startup scripts that might instead be moved from scripts into Java.
The plan (as mentioned in HADOOP-8079) is to commit to branch and over time clean up the work based on feedback and reviews.
Doug I would like to move your comment/discussion to the main Jira (Hadoop-8079) so that it does not get lost when we I close this jira after committing the patch.
@Doug Your points are valid ones. We have been thinking about a holistic approach to this that works in a cross-platform manner. Windows (sans Cygwin) has Powershell and Windows Command Shell as scripting/automation environments. I would love to see a discussion as Sanjay points out on the main Jira (Hadoop-8079) around this. We are totally open to how we might as a community refactor the work between pure Java and native platform scripting environments.