private void verifyTableDataExists(WarehouseInstance warehouse, Path dbDataPath, String tableName,
                                     boolean shouldExists) throws IOException {
    FileSystem fileSystem = FileSystem.get(warehouse.warehouseRoot.toUri(), warehouse.getConf());
    Path tablePath = new Path(dbDataPath, tableName);
    Path dataFilePath = new Path(tablePath, "000000_0");
    Assert.assertEquals(shouldExists, fileSystem.exists(dbDataPath));
    Assert.assertEquals(shouldExists, fileSystem.exists(tablePath));
    Assert.assertEquals(shouldExists, fileSystem.exists(dataFilePath));
  }
Test replication scenarios with staging on replica.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExclusiveReplica.java