private void verifyDir(int expectedDeltas, String tblName, String partName, String pattern) throws Exception {
    Path warehouse = new Path(getWarehouseDir());
    tblName = tblName.toLowerCase();

    FileSystem fs = FileSystem.get(warehouse.toUri(), hiveConf);
    FileStatus[] status = fs.listStatus(new Path(warehouse, tblName + "/" + partName),
        FileUtils.HIDDEN_FILES_PATH_FILTER);

    int sawDeltaTimes = 0;
    for (int i = 0; i < status.length; i++) {
      if (status[i].getPath().getName().matches(pattern)) {
        sawDeltaTimes++;
      }
    }
    Assert.assertEquals(expectedDeltas, sawDeltaTimes);
  }
Test cleaner for TXN_TO_WRITE_ID table.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands2.java