Program: 94455
Project: 94455
Buggy source:
private void setupConfig(final Configuration conf,final Job job) throws DataProviderException {
  try {
    zoomLevel=context.getZoomlevel();
    if (zoomLevel != 0) {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_ZOOMLEVEL,Integer.toString(zoomLevel));
    }
    if (doBulk || forceBulk) {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_JOBTYPE,MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_BULK);
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_PREFIX + Integer.toString(zoomLevel),MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_BULK);
    }
 else {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_JOBTYPE,MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_DIRECT);
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_PREFIX + Integer.toString(zoomLevel),MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_DIRECT);
    }
    Properties props=AccumuloConnector.getAccumuloProperties();
    if (props != null) {
      String enc=AccumuloConnector.encodeAccumuloProperties("String_Node_Str");
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_RESOURCE,enc);
      if (props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE) == null) {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE,this.table);
      }
 else {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE,props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE));
      }
      if (conf.get(MrGeoConstants.MRGEO_PROTECTION_LEVEL) != null) {
        cv=new ColumnVisibility(conf.get(MrGeoConstants.MRGEO_PROTECTION_LEVEL));
      }
      if (cv == null) {
        if (props.containsKey(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ)) {
          conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ,props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ));
          cv=new ColumnVisibility(props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ));
        }
      }
 else {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ,new String(cv.getExpression()));
      }
    }
    if (doBulk || forceBulk) {
      LongRectangle outTileBounds=tileBounds.toLongRectangle();
      if (props.containsKey(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR)) {
        workDir=props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR);
        if (workDir != null) {
          workDir+=File.separator;
        }
      }
 else {
        workDir="String_Node_Str";
      }
      workDir+=AccumuloMrsImagePyramidFileOutputFormat.class.getSimpleName() + File.separator + this.table+ File.separator;
      Path wd=new Path(workDir);
      FileSystem fs=FileSystem.get(conf);
      if (fs.exists(wd)) {
        fs.delete(wd,true);
      }
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR,workDir);
      if (job != null) {
        ArrayList<Pair<Long,Long>> splitPoints=new ArrayList<Pair<Long,Long>>();
        long step=bulkThreshold / outTileBounds.getWidth();
        long rem=bulkThreshold % outTileBounds.getWidth();
        if (rem > 0) {
          step++;
        }
        for (long y=outTileBounds.getMinY(); y <= outTileBounds.getMaxY(); y+=step) {
          Pair<Long,Long> cur=new Pair<Long,Long>(outTileBounds.getMinX(),y);
          splitPoints.add(cur);
        }
        PrintStream out=null;
        try {
          out=new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir + "String_Node_Str"))));
          for (          Pair<Long,Long> p : splitPoints) {
            long split=TMSUtils.tileid(p.getFirst(),p.getSecond(),zoomLevel);
            Text t=new Text(longToBytes(split));
            out.println(new String(Base64.encodeBase64(TextUtil.getBytes(t))));
            log.debug("String_Node_Str" + p.getFirst() + "String_Node_Str"+ p.getSecond()+ "String_Node_Str"+ split+ "String_Node_Str"+ t.getLength());
          }
          job.setNumReduceTasks(splitPoints.size() + 1);
          out.close();
          job.setPartitionerClass(AccumuloMrGeoRangePartitioner.class);
          AccumuloMrGeoRangePartitioner.setSplitFile(job,workDir + "String_Node_Str");
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
          throw new DataProviderException("String_Node_Str");
        }
        job.setOutputFormatClass(AccumuloMrsImagePyramidFileOutputFormat.class);
      }
      Path workFilesPath=new Path(workDir + "String_Node_Str");
      if (job != null) {
        AccumuloMrsImagePyramidFileOutputFormat.setOutputPath(job,workFilesPath);
      }
 else {
        Path outputDir=workFilesPath.getFileSystem(conf).makeQualified(workFilesPath);
        conf.set(AccumuloMrsImagePyramidFileOutputFormat.OUTDIR,outputDir.toString());
      }
    }
 else {
      if (job != null) {
        log.info("String_Node_Str" + AccumuloMrsImagePyramidOutputFormat.class.getCanonicalName());
        job.setOutputFormatClass(AccumuloMrsImagePyramidOutputFormat.class);
        AccumuloMrsImagePyramidOutputFormat.setJob(job);
        log.info("String_Node_Str" + zoomLevel);
        log.info("String_Node_Str" + cv.toString());
        log.info("String_Node_Str" + MrGeoAccumuloConstants.MRGEO_DEFAULT_NUM_REDUCERS);
        job.setNumReduceTasks(MrGeoAccumuloConstants.MRGEO_DEFAULT_NUM_REDUCERS);
      }
    }
    if (job != null) {
      job.setOutputKeyClass(TileIdWritable.class);
      job.setOutputValueClass(RasterWritable.class);
    }
  }
 catch (  IOException ioe) {
    throw new DataProviderException("String_Node_Str",ioe);
  }
}

Fixed version (ground truth):
private void setupConfig(final Configuration conf,final Job job) throws DataProviderException {
  try {
    zoomLevel=context.getZoomlevel();
    if (zoomLevel != 0) {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_ZOOMLEVEL,Integer.toString(zoomLevel));
    }
    if (doBulk || forceBulk) {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_JOBTYPE,MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_BULK);
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_PREFIX + Integer.toString(zoomLevel),MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_BULK);
    }
 else {
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_JOBTYPE,MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_DIRECT);
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_PREFIX + Integer.toString(zoomLevel),MrGeoAccumuloConstants.MRGEO_ACC_VALUE_JOB_DIRECT);
    }
    Properties props=AccumuloConnector.getAccumuloProperties();
    if (props != null) {
      String enc=AccumuloConnector.encodeAccumuloProperties("String_Node_Str");
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_RESOURCE,enc);
      if (props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE) == null) {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE,this.table);
      }
 else {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE,props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_OUTPUT_TABLE));
      }
      if (conf.get(MrGeoConstants.MRGEO_PROTECTION_LEVEL) != null) {
        cv=new ColumnVisibility(conf.get(MrGeoConstants.MRGEO_PROTECTION_LEVEL));
      }
      if (cv == null) {
        if (props.containsKey(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ)) {
          conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ,props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ));
          cv=new ColumnVisibility(props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ));
        }
      }
 else {
        conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_VIZ,new String(cv.getExpression()));
      }
    }
    if (doBulk || forceBulk) {
      LongRectangle outTileBounds=tileBounds.toLongRectangle();
      if (props.containsKey(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR)) {
        workDir=props.getProperty(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR);
        if (workDir != null) {
          workDir+=File.separator;
        }
      }
 else {
        workDir="String_Node_Str";
      }
      workDir+=AccumuloMrsImagePyramidFileOutputFormat.class.getSimpleName() + File.separator + this.table+ File.separator;
      Path wd=new Path(workDir);
      FileSystem fs=FileSystem.get(conf);
      if (fs.exists(wd)) {
        fs.delete(wd,true);
      }
      conf.set(MrGeoAccumuloConstants.MRGEO_ACC_KEY_WORKDIR,workDir);
      if (job != null) {
        ArrayList<Pair<Long,Long>> splitPoints=new ArrayList<Pair<Long,Long>>();
        long step=bulkThreshold / outTileBounds.getWidth();
        long rem=bulkThreshold % outTileBounds.getWidth();
        if (rem > 0) {
          step++;
        }
        for (long y=outTileBounds.getMinY(); y <= outTileBounds.getMaxY(); y+=step) {
          Pair<Long,Long> cur=new Pair<Long,Long>(outTileBounds.getMinX(),y);
          splitPoints.add(cur);
        }
        PrintStream out=null;
        try {
          out=new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir + "String_Node_Str"))));
          for (          Pair<Long,Long> p : splitPoints) {
            long split=TMSUtils.tileid(p.getFirst(),p.getSecond(),zoomLevel);
            Text t=new Text(longToBytes(split));
            out.println(new String(Base64.encodeBase64(TextUtil.getBytes(t))));
            log.debug("String_Node_Str" + p.getFirst() + "String_Node_Str"+ p.getSecond()+ "String_Node_Str"+ split+ "String_Node_Str"+ t.getLength());
          }
          job.setNumReduceTasks(splitPoints.size() + 1);
          out.close();
          job.setPartitionerClass(AccumuloMrGeoRangePartitioner.class);
          AccumuloMrGeoRangePartitioner.setSplitFile(job,workDir + "String_Node_Str");
        }
 catch (        IOException ioe) {
          ioe.printStackTrace();
          throw new DataProviderException("String_Node_Str");
        }
        job.setOutputFormatClass(AccumuloMrsImagePyramidFileOutputFormat.class);
      }
      Path workFilesPath=new Path(workDir + "String_Node_Str");
      if (job != null) {
        AccumuloMrsImagePyramidFileOutputFormat.setOutputPath(job,workFilesPath);
      }
 else {
        Path outputDir=workFilesPath.getFileSystem(conf).makeQualified(workFilesPath);
        conf.set("String_Node_Str",outputDir.toString());
        conf.set("String_Node_Str",outputDir.toString());
      }
    }
 else {
      if (job != null) {
        log.info("String_Node_Str" + AccumuloMrsImagePyramidOutputFormat.class.getCanonicalName());
        job.setOutputFormatClass(AccumuloMrsImagePyramidOutputFormat.class);
        AccumuloMrsImagePyramidOutputFormat.setJob(job);
        log.info("String_Node_Str" + zoomLevel);
        log.info("String_Node_Str" + cv.toString());
        log.info("String_Node_Str" + MrGeoAccumuloConstants.MRGEO_DEFAULT_NUM_REDUCERS);
        job.setNumReduceTasks(MrGeoAccumuloConstants.MRGEO_DEFAULT_NUM_REDUCERS);
      }
    }
    if (job != null) {
      job.setOutputKeyClass(TileIdWritable.class);
      job.setOutputValueClass(RasterWritable.class);
    }
  }
 catch (  IOException ioe) {
    throw new DataProviderException("String_Node_Str",ioe);
  }
}