/** Runs a GridMix data-generation job. */
  private static void runDataGenJob(Configuration conf, Path tempDir)
      throws IOException, ClassNotFoundException, InterruptedException {
    JobClient client = new JobClient(conf);

    // get the local job runner
    conf.setInt(MRJobConfig.NUM_MAPS, 1);

    Job job = new Job(conf);

    CompressionEmulationUtil.configure(job);
    job.setInputFormatClass(CustomInputFormat.class);

    // set the output path
    FileOutputFormat.setOutputPath(job, tempDir);

    // submit and wait for completion
    job.submit();
    int ret = job.waitForCompletion(true) ? 0 : 1;

    assertEquals("Job Failed", 0, ret);
  }