List<TRowResult> entry = client.scannerGet(scanner); if (entry.isEmpty()) { break; List<TRowResult> entry = client.scannerGet(scanner); if (entry.isEmpty()) { System.out.println("Scanner finished");
int scannerId = client.scannerOpenWithScan(ByteBuffer.wrap(TABLE), // co ThriftExample-5-Scan1 Scan with an instance of TScan. This is the most convenient approach. Print the results in a loop. scan, null); for (TRowResult result : client.scannerGet(scannerId)) { System.out.println("No. columns: " + result.getColumnsSize()); for (Map.Entry<ByteBuffer, TCell> column : for (TRowResult result : client.scannerGet(scannerId)) { System.out.println("No. columns: " + result.getColumnsSize()); for (Map.Entry<ByteBuffer, TCell> column :
int scannerId = client.scannerOpenWithScan(ByteBuffer.wrap(TABLE), scan, null); for (TRowResult result : client.scannerGet(scannerId)) { System.out.println("No. columns: " + result.getColumnsSize()); for (Map.Entry<ByteBuffer, TCell> column : scannerId = client.scannerOpen(ByteBuffer.wrap(TABLE), ByteBuffer.wrap(Bytes.toBytes("")), columnNames, null); for (TRowResult result : client.scannerGet(scannerId)) { System.out.println("No. columns: " + result.getColumnsSize()); for (Map.Entry<ByteBuffer, TCell> column :
List<TRowResult> entry = client.scannerGet(scanner); if (entry.isEmpty()) { break; List<TRowResult> entry = client.scannerGet(scanner); if (entry.isEmpty()) { System.out.println("Scanner finished");
@Test(timeout = TestConstants.ITEST_TIMEOUT) public void test() throws Exception { ArrayList<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>(); ColumnDescriptor cd = new ColumnDescriptor(); cd.name = FAMILY1; columns.add(cd); cd = new ColumnDescriptor(); cd.name = FAMILY2; columns.add(cd); Hbase.Client client = controller.getThriftClient(); client.createTable(TABLE, columns); ArrayList<Mutation> mutations = new ArrayList<Mutation>(); mutations.add(new Mutation(false, COLUMN, VALUE, true)); client.mutateRow(TABLE, ROW, mutations, null); int scan1 = client.scannerOpen(TABLE, FIRST, Lists.newArrayList(FAMILY1), null); List<TRowResult> rows = client.scannerGet(scan1); assertThat(rows.size(), is(1)); assertThat(Bytes.toString(rows.get(0).getRow()), is("testRow")); assertTrue("No more rows", client.scannerGet(scan1).isEmpty()); client.scannerClose(scan1); int scan2 = client.scannerOpen(TABLE, FIRST, Lists.newArrayList(FAMILY2), null); assertTrue("No more rows", client.scannerGet(scan2).isEmpty()); client.scannerClose(scan2); }