Importing Solr HDFS code for a backport.
Moving back to org.apache due to protected fields.
Pushing back to older outputstream api.

fsync to sync, etc.
Moved as much duplicate code as possible into a different package.

To avoid clashing with the originals.
Backporting to simple APIs.
Further backported to 0.20.2
Added Solr 4.6+ style configuration.
Moving back to org.apache as it breaks otherwise.
Completing move back to org.apache
Attempting to simplify further.