public void readTable ( ) { // [START bigtable_hw_scan_all_veneer] try { System . out . println ( "\nReading the entire table" ) ; Query query = Query . create ( tableId ) ; ServerStream < Row > rowStream = dataClient . readRows ( query ) ; for ( Row r : rowStream ) { System . out . println ( "Row Key: " + r . getKey ( ) . toStringUtf8 ( ) ) ; for ( RowCell cell : r . getCells ( ) ) { System . out . printf ( "Family: %s Qualifier: %s Value: %s%n" , cell . getFamily ( ) , cell . getQualifier ( ) . toStringUtf8 ( ) , cell . getValue ( ) . toStringUtf8 ( ) ) ; } } } catch ( NotFoundException e ) { System . err . println ( "Failed to read a non-existent table: " + e . getMessage ( ) ) ; } // [END bigtable_hw_scan_all_veneer] }
Demonstrates how to read an entire table .