@@ -75,7 +75,17 @@ private static void doHelloWorld(String projectId, String zone, String clusterId
75
75
// Write some rows to the table
76
76
print ("Write some greetings to the table" );
77
77
for (int i = 0 ; i < GREETINGS .length ; i ++) {
78
- // Each row has a unique row key
78
+ // Each row has a unique row key.
79
+ //
80
+ // Note: This example uses sequential numeric IDs for simplicity, but
81
+ // this can result in poor performance in a production application.
82
+ // Since rows are stored in sorted order by key, sequential keys can
83
+ // result in poor distribution of operations across nodes.
84
+ //
85
+ // For more information about how to design a Bigtable schema for the
86
+ // best performance, see the documentation:
87
+ //
88
+ // https://cloud.google.com/bigtable/docs/schema-design
79
89
String rowKey = "greeting" + i ;
80
90
81
91
// Put a single row into the table. We could also pass a list of Puts to write a batch.
@@ -88,8 +98,8 @@ private static void doHelloWorld(String projectId, String zone, String clusterId
88
98
String rowKey = "greeting0" ;
89
99
Result getResult = table .get (new Get (Bytes .toBytes (rowKey )));
90
100
String greeting = Bytes .toString (getResult .getValue (COLUMN_FAMILY_NAME , COLUMN_NAME ));
91
- System .out .println (
92
- String . format ( "Get a single greeting by row key: %s = %s" , rowKey , greeting ) );
101
+ System .out .println ("Get a single greeting by row key" );
102
+ System . out . printf ( " \t %s = %s\n " , rowKey , greeting );
93
103
94
104
// Now scan across all rows.
95
105
Scan scan = new Scan ();
0 commit comments