@Test
  public void testGetInputSummaryWithInputEstimator()
      throws IOException, HiveException {
    final int BYTES_PER_FILE = 10;
    final int NUM_OF_ROWS = 5;

    final Collection<Path> testPaths = Arrays.asList(new Path("p1/test.txt"),
        new Path("p2/test.txt"), new Path("p3/test.txt"),
        new Path("p4/test.txt"), new Path("p5/test.txt"));

    jobConf.setInt(
        HiveConf.ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS.varname, 2);

    properties.setProperty(hive_metastoreConstants.META_TABLE_STORAGE,
        InputEstimatorTestClass.class.getName());
    InputEstimatorTestClass.setEstimation(
        new InputEstimator.Estimation(NUM_OF_ROWS, BYTES_PER_FILE));

    /*
     * Let's write more bytes to the files to test that Estimator is actually
     * working returning the file size not from the filesystem
     */
    ContentSummary summary =
        runTestGetInputSummary(jobConf, properties, testPaths,
            BYTES_PER_FILE * 2, HiveInputFormat.class, Collections.emptyMap());
    assertEquals(testPaths.size() * BYTES_PER_FILE, summary.getLength());

    // Current getInputSummary() returns -1 for each file found
    assertEquals(testPaths.size() * -1, summary.getFileCount());

    // Current getInputSummary() returns -1 for each file found
    assertEquals(testPaths.size() * -1, summary.getDirectoryCount());

    // Test deprecated mapred.dfsclient.parallelism.max
    jobConf.setInt(
        HiveConf.ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS.varname, 0);
    jobConf.setInt(
        HiveConf.ConfVars.HIVE_EXEC_INPUT_LISTING_MAX_THREADS.varname, 2);

    properties.setProperty(hive_metastoreConstants.META_TABLE_STORAGE,
        InputEstimatorTestClass.class.getName());
    InputEstimatorTestClass.setEstimation(
        new InputEstimator.Estimation(NUM_OF_ROWS, BYTES_PER_FILE));

    /*
     * Let's write more bytes to the files to test that Estimator is actually
     * working returning the file size not from the filesystem
     */
    summary = runTestGetInputSummary(jobConf, properties, testPaths,
        BYTES_PER_FILE * 2, HiveInputFormat.class, Collections.emptyMap());
    assertEquals(testPaths.size() * BYTES_PER_FILE, summary.getLength());

    // Current getInputSummary() returns -1 for each file found
    assertEquals(testPaths.size() * -1, summary.getFileCount());

    // Current getInputSummary() returns -1 for each file found
    assertEquals(testPaths.size() * -1, summary.getDirectoryCount());
  }
Read several files so that their information is cached, then delete those
files and read them again to see if the results were cached from the first
read. If the cache is not working, the sizes will be off since the files no
longer exist in the file system.

@throws Exception e
ql/src/test/org/apache/hadoop/hive/ql/exec/TestGetInputSummary.java