public void readSingleRow ( ) { // [START bigtable_hw_get_by_key_veneer] try { System . out . println ( "\nReading a single row by row key" ) ; Row row = dataClient . readRow ( tableId , ROW_KEY_PREFIX + 0 ) ; System . out . println ( "Row: " + row . getKey ( ) . toStringUtf8 ( ) ) ; for ( RowCell cell : row . 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 from a non-existent table: " + e . getMessage ( ) ) ; } // [END bigtable_hw_get_by_key_veneer] }
Demonstrates how to read a single row from a table .