protected int countRows(final Table table, final byte[]... families) throws IOException { return UTIL.countRows(table, families); } }
protected int countRows(final Table table, final byte[]... families) throws Exception { return UTIL.countRows(table, families); } }
/** * Counts the number of rows to verify data loss or non-dataloss. */ int countRows() throws IOException { return TEST_UTIL.countRows(tbl); }
protected int countRows(final Table table, final byte[]... families) throws IOException { return UTIL.countRows(table, families); } }
protected int countRows(Table table, byte[]... families) throws IOException { return TEST_UTIL.countRows(table, families); }
protected int countRows(Table table) throws IOException { return TEST_UTIL.countRows(table); }
/** * Return the number of rows in the given table. * @param table to count rows * @return count of rows */ public static int countRows(final Table table) throws IOException { return countRows(table, new Scan()); }
/** * Counts the number of rows to verify data loss or non-dataloss. */ int countRows(byte[] start, byte[] end) throws IOException { return TEST_UTIL.countRows(tbl, new Scan(start, end)); }
public int countRows(final Region region) throws IOException { return countRows(region, new Scan()); }
/** * Gets the number of rows in the given table. * @param table to get the scanner * @return the number of rows */ public static int countMobRows(final Table table) throws IOException { Scan scan = new Scan(); // Do not retrieve the mob data when scanning scan.setAttribute(MobConstants.MOB_SCAN_RAW, Bytes.toBytes(Boolean.TRUE)); return HBaseTestingUtility.countRows(table, scan); } }
public int countRows(final Table table, final byte[]... families) throws IOException { Scan scan = new Scan(); for (byte[] family: families) { scan.addFamily(family); } return countRows(table, scan); }
private void wait(Table target, int expectedCount, String msg) throws IOException, InterruptedException { for (int i = 0; i < NB_RETRIES; i++) { int rowCount_ht2TargetAtPeer1 = utility2.countRows(target); if (i == NB_RETRIES - 1) { assertEquals(msg, expectedCount, rowCount_ht2TargetAtPeer1); } if (expectedCount == rowCount_ht2TargetAtPeer1) { break; } Thread.sleep(SLEEP_TIME); } } }
private void assertRowCount(final Table t, final int expected) throws IOException { assertEquals(expected, TEST_UTIL.countRows(t, new Scan())); }
private void wait(int slaveNumber, Table target, int expectedCount) throws IOException, InterruptedException { int count = 0; for (int i = 0; i < NB_RETRIES; i++) { if (i == NB_RETRIES - 1) { fail("Waited too much time for bulkloaded data replication. Current count=" + count + ", expected count=" + expectedCount); } count = utilities[slaveNumber].countRows(target); if (count != expectedCount) { LOG.info("Waiting more time for bulkloaded data replication."); Thread.sleep(SLEEP_TIME); } else { break; } } }
public int countRows(final Region region, final Scan scan) throws IOException { InternalScanner scanner = region.getScanner(scan); try { return countRows(scanner); } finally { scanner.close(); } }
/** * Return the number of rows in the given table. */ public int countRows(final TableName tableName) throws IOException { Table table = getConnection().getTable(tableName); try { return countRows(table); } finally { table.close(); } }
public static void verifyRowCount(final HBaseTestingUtility util, final TableName tableName, long expectedRows) throws IOException { Table table = util.getConnection().getTable(tableName); try { assertEquals(expectedRows, util.countRows(table)); } finally { table.close(); } }
/** * Tests the case where a Scan can throw an IOException in the middle of the seek / reseek leaving * the server side RegionScanner to be in dirty state. The client has to ensure that the * ClientScanner does not get an exception and also sees all the data. * @throws IOException * @throws InterruptedException */ @Test public void testClientScannerIsResetWhenScanThrowsIOException() throws IOException, InterruptedException { reset(); THROW_ONCE.set(true); // throw exceptions only once TableName tableName = TableName.valueOf(name.getMethodName()); try (Table t = TEST_UTIL.createTable(tableName, FAMILY)) { int rowCount = TEST_UTIL.loadTable(t, FAMILY, false); TEST_UTIL.getAdmin().flush(tableName); inject(); int actualRowCount = TEST_UTIL.countRows(t, new Scan().addColumn(FAMILY, FAMILY)); assertEquals(rowCount, actualRowCount); } assertTrue(REQ_COUNT.get() > 0); }
@Test public void testOpenRegionReplica() throws Exception { openRegion(HTU, getRS(), hriSecondary); try { //load some data to primary HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary Assert.assertEquals(1000, HTU.countRows(table)); } finally { HTU.deleteNumericRows(table, f, 0, 1000); closeRegion(HTU, getRS(), hriSecondary); } }
@Test public void testRegionReplicaGets() throws Exception { try { //load some data to primary HTU.loadNumericRows(table, f, 0, 1000); // assert that we can read back from primary Assert.assertEquals(1000, HTU.countRows(table)); // flush so that region replica can read HRegion region = getRS().getRegionByEncodedName(hriPrimary.getEncodedName()); region.flush(true); openRegion(HTU, getRS(), hriSecondary); // first try directly against region region = getRS().getRegion(hriSecondary.getEncodedName()); assertGet(region, 42, true); assertGetRpc(hriSecondary, 42, true); } finally { HTU.deleteNumericRows(table, HConstants.CATALOG_FAMILY, 0, 1000); closeRegion(HTU, getRS(), hriSecondary); } }