cloudera/search — pull request #1 by gabrielreid (2013-10-15 08:37:35+00:00)
Title: Remove recursive delete from MR tool execution

The current MapReduceIndexerTool does a recursive delete of the output directory if it already exists. This is potentially very dangerous -- for example, if the root directory is provided to the tool as an output directory, the full contents of HDFS will be wiped out.

This PR includes a simple removal of the recursive delete, but a better approach would probably be to optionally create a temp directory that is then deleted when running in GoLive mode (as is done in at [1]), and having the requirement that the provided output directory does not exist when the tool is run when not run in GoLive mode (or if GoLive mode is run with a custom output directory).

[1] https://github.com/NGDATA/hbase-indexer/blob/batch-indexing/hbase-indexer-mr/src/main/java/com/ngdata/hbaseindexer/mr/HBaseIndexingOptions.java#L102