Buggy code:
public class MultilevelPlot { private static final Log LOG = LogFactory . getLog ( MultilevelPlot . class ) ; private static final String InputMBR = "mbr" ; private static final String MaxLevelsPerReducer = "MultilevelPlot.MaxLevelsPerMachine" ; private static final String FlatPartitioningLevelThreshold = "MultilevelPlot.FlatPartitioningLevelThreshold" ; public static class FlatPartition extends MapReduceBase implements Mapper < Rectangle , Iterable < ? extends Shape > , TileIndex , RasterLayer > , Reducer < TileIndex , RasterLayer , TileIndex , RasterLayer > { private int minLevel ; private int maxLevel ; private GridInfo bottomGrid ; private Rectangle inputMBR ; private Rasterizer rasterizer ; private int tileWidth ; private int tileHeight ; private double bufferSizeXMaxLevel ; private double bufferSizeYMaxLevel ; private boolean writeOutput ; private boolean smooth ; @ Override public void configure ( JobConf job ) { } @ Override public void map ( Rectangle partitionMBR , Iterable < ? extends Shape > shapes , OutputCollector < TileIndex , RasterLayer > output , Reporter reporter ) throws IOException { } @ Override public void reduce ( TileIndex tileID , Iterator < RasterLayer > intermediateLayers , OutputCollector < TileIndex , RasterLayer > output , Reporter reporter ) throws IOException { } } public static class MultiLevelOutputCommitter extends FileOutputCommitter { @ Override public void commitJob ( JobContext context ) throws IOException { } } public static class PyramidPartition extends MapReduceBase implements Mapper < Rectangle , Iterable < ? extends Shape > , TileIndex , Shape > , Reducer < TileIndex , Shape , TileIndex , RasterLayer > { private int minLevel ; private int maxLevel ; private int maxLevelToReplicate ; private Rectangle inputMBR ; private GridInfo bottomGrid ; private Rasterizer rasterizer ; private double bufferSizeXMaxLevel ; private double bufferSizeYMaxLevel ; private int maxLevelsPerReducer ; private int tileWidth ; private int tileHeight ; private int radius ; private boolean writeOutput ; private boolean smooth ; @ Override public void configure ( JobConf job ) { } @ Override public void map ( Rectangle inputMBR , Iterable < ? extends Shape > shapes , OutputCollector < TileIndex , Shape > output , Reporter reporter ) throws IOException { } @ Override public void reduce ( TileIndex tileID , Iterator < Shape > shapes , OutputCollector < TileIndex , RasterLayer > output , Reporter reporter ) throws IOException { } } public static RunningJob plotMapReduce ( Path [ ] inFiles , Path outFile , Class < ? extends Rasterizer > rasterizerClass , OperationsParams params ) throws IOException { } public static RunningJob plot ( Path [ ] inPaths , Path outPath , Class < ? extends Rasterizer > rasterizerClass , OperationsParams params ) throws IOException { String [ ] strLevels = params . get ( "levels" , "7" ) . split ( "\\.\\." ) ; int minLevel ; int maxLevel ; if ( ( strLevels . length ) == 1 ) { minLevel = 0 ; maxLevel = ( Integer . parseInt ( strLevels [ 0 ] ) ) - 1 ; } else { minLevel = Integer . parseInt ( strLevels [ 0 ] ) ; maxLevel = Integer . parseInt ( strLevels [ 1 ] ) ; } FileSystem outFS = outPath . getFileSystem ( params ) ; <START_BUG> outFS . create ( outPath ) ; <END_BUG> int maxLevelWithFlatPartitioning = params . getInt ( MultilevelPlot . FlatPartitioningLevelThreshold , 4 ) ; RunningJob runningJob = null ; if ( minLevel <= maxLevelWithFlatPartitioning ) { OperationsParams flatPartitioning = new OperationsParams ( params ) ; flatPartitioning . set ( "levels" , ( ( minLevel + ".." ) + ( Math . min ( maxLevelWithFlatPartitioning , maxLevel ) ) ) ) ; flatPartitioning . set ( "partition" , "flat" ) ; MultilevelPlot . LOG . info ( ( "Using<seq2seq4repair_space>flat<seq2seq4repair_space>partitioning<seq2seq4repair_space>in<seq2seq4repair_space>levels<seq2seq4repair_space>" + ( flatPartitioning . get ( "levels" ) ) ) ) ; runningJob = MultilevelPlot . plotMapReduce ( inPaths , new Path ( outPath , "flat" ) , rasterizerClass , flatPartitioning ) ; } if ( maxLevel > maxLevelWithFlatPartitioning ) { OperationsParams pyramidPartitioning = new OperationsParams ( params ) ; pyramidPartitioning . set ( "levels" , ( ( ( Math . max ( minLevel , ( maxLevelWithFlatPartitioning + 1 ) ) ) + ".." ) + maxLevel ) ) ; pyramidPartitioning . set ( "partition" , "pyramid" ) ; MultilevelPlot . LOG . info ( ( "Using<seq2seq4repair_space>pyramid<seq2seq4repair_space>partitioning<seq2seq4repair_space>in<seq2seq4repair_space>levels<seq2seq4repair_space>" + ( pyramidPartitioning . get ( "levels" ) ) ) ) ; runningJob = MultilevelPlot . plotMapReduce ( inPaths , new Path ( outPath , "pyramid" ) , rasterizerClass , pyramidPartitioning ) ; } LineReader templateFileReader = new LineReader ( MultilevelPlot . class . getResourceAsStream ( "//zoom_view.html" ) ) ; PrintStream htmlOut = new PrintStream ( outFS . create ( new Path ( outPath , "index.html" ) ) ) ; Text line = new Text ( ) ; while ( ( templateFileReader . readLine ( line ) ) > 0 ) { String lineStr = line . toString ( ) ; lineStr = lineStr . replace ( "#{TILE_WIDTH}" , Integer . toString ( params . getInt ( "tilewidth" , 256 ) ) ) ; lineStr = lineStr . replace ( "#{TILE_HEIGHT}" , Integer . toString ( params . getInt ( "tileheight" , 256 ) ) ) ; lineStr = lineStr . replace ( "#{MAX_ZOOM}" , Integer . toString ( maxLevel ) ) ; lineStr = lineStr . replace ( "#{MIN_ZOOM}" , Integer . toString ( minLevel ) ) ; lineStr = lineStr . replace ( "#{TILE_URL}" , ( ( "(zoom<seq2seq4repair_space><=<seq2seq4repair_space>" + maxLevelWithFlatPartitioning ) + "?<seq2seq4repair_space>'flat'<seq2seq4repair_space>:<seq2seq4repair_space>'pyramid')+('//tile_'<seq2seq4repair_space>+<seq2seq4repair_space>zoom<seq2seq4repair_space>+<seq2seq4repair_space>'_'<seq2seq4repair_space>+<seq2seq4repair_space>coord.x<seq2seq4repair_space>+<seq2seq4repair_space>'-'<seq2seq4repair_space>+<seq2seq4repair_space>coord.y<seq2seq4repair_space>+<seq2seq4repair_space>'.png')" ) ) ; htmlOut . println ( lineStr ) ; } templateFileReader . close ( ) ; htmlOut . close ( ) ; return runningJob ; } }

Fix:
outFS . mkdirs ( outPath ) ;