private void checkBackendTableSize(String tableName, int size) throws SQLException {
    String connectionStr = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.CONNECT_URL_KEY);
    Connection conn = DriverManager.getConnection(connectionStr);
    Statement stmt = conn.createStatement();

    ResultSet rs = stmt.executeQuery("SELECT COUNT(1) FROM " + tableName);
    rs.next();
    Assert.assertEquals(tableName + " table should contain " + size + " rows", size,
        rs.getLong(1));
  }
Checks if the HMS backend db row number is as expected. If they are not, an
{@link AssertionError} is thrown.
@param tableName The table in which we count the rows
@param size The expected row number
@throws SQLException If there is a problem connecting to / querying the backend DB
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java