Skip to content

Commit 25a489b

Browse files
fix: correcting region tags for Hbase filter and read snippets (GoogleCloudPlatform#4535)
1 parent 9e6a630 commit 25a489b

2 files changed

Lines changed: 46 additions & 46 deletions

File tree

bigtable/hbase/snippets/src/main/java/com/example/bigtable/Filters.java

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.example.bigtable;
1818

19-
// [START bigtable_filters_print]
19+
// [START bigtable_filters_print_hbase]
2020

2121
import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;
2222

@@ -58,7 +58,7 @@ public class Filters {
5858

5959
// Write your code here.
6060
// [START_EXCLUDE]
61-
// [START bigtable_filters_limit_row_sample]
61+
// [START bigtable_filters_limit_row_sample_hbase]
6262
public static void filterLimitRowSample() {
6363
// TODO(developer): Replace these variables before running the sample.
6464
String projectId = "my-project-id";
@@ -73,9 +73,9 @@ public static void filterLimitRowSample(String projectId, String instanceId, Str
7373
Scan scan = new Scan().setFilter(filter);
7474
readWithFilter(projectId, instanceId, tableId, scan);
7575
}
76-
// [END bigtable_filters_limit_row_sample]
76+
// [END bigtable_filters_limit_row_sample_hbase]
7777

78-
// [START bigtable_filters_limit_row_regex]
78+
// [START bigtable_filters_limit_row_regex_hbase]
7979
public static void filterLimitRowRegex() {
8080
// TODO(developer): Replace these variables before running the sample.
8181
String projectId = "my-project-id";
@@ -90,9 +90,9 @@ public static void filterLimitRowRegex(String projectId, String instanceId, Stri
9090
Scan scan = new Scan().setFilter(filter).setMaxVersions();
9191
readWithFilter(projectId, instanceId, tableId, scan);
9292
}
93-
// [END bigtable_filters_limit_row_regex]
93+
// [END bigtable_filters_limit_row_regex_hbase]
9494

95-
// [START bigtable_filters_limit_cells_per_col]
95+
// [START bigtable_filters_limit_cells_per_col_hbase]
9696
public static void filterLimitCellsPerCol() {
9797
// TODO(developer): Replace these variables before running the sample.
9898
String projectId = "my-project-id";
@@ -106,9 +106,9 @@ public static void filterLimitCellsPerCol(String projectId, String instanceId, S
106106
Scan scan = new Scan().setMaxVersions(2);
107107
readWithFilter(projectId, instanceId, tableId, scan);
108108
}
109-
// [END bigtable_filters_limit_cells_per_col]
109+
// [END bigtable_filters_limit_cells_per_col_hbase]
110110

111-
// [START bigtable_filters_limit_cells_per_row]
111+
// [START bigtable_filters_limit_cells_per_row_hbase]
112112
public static void filterLimitCellsPerRow() {
113113
// TODO(developer): Replace these variables before running the sample.
114114
String projectId = "my-project-id";
@@ -125,9 +125,9 @@ public static void filterLimitCellsPerRow(String projectId, String instanceId, S
125125
Scan scan = new Scan().setFilter(filter);
126126
readWithFilter(projectId, instanceId, tableId, scan);
127127
}
128-
// [END bigtable_filters_limit_cells_per_row]
128+
// [END bigtable_filters_limit_cells_per_row_hbase]
129129

130-
// [START bigtable_filters_limit_cells_per_row_offset]
130+
// [START bigtable_filters_limit_cells_per_row_offset_hbase]
131131
public static void filterLimitCellsPerRowOffset() {
132132
// TODO(developer): Replace these variables before running the sample.
133133
String projectId = "my-project-id";
@@ -143,9 +143,9 @@ public static void filterLimitCellsPerRowOffset(
143143
Scan scan = new Scan().setFilter(filter);
144144
readWithFilter(projectId, instanceId, tableId, scan);
145145
}
146-
// [END bigtable_filters_limit_cells_per_row_offset]
146+
// [END bigtable_filters_limit_cells_per_row_offset_hbase]
147147

148-
// [START bigtable_filters_limit_col_family_regex]
148+
// [START bigtable_filters_limit_col_family_regex_hbase]
149149
public static void filterLimitColFamilyRegex() {
150150
// TODO(developer): Replace these variables before running the sample.
151151
String projectId = "my-project-id";
@@ -161,9 +161,9 @@ public static void filterLimitColFamilyRegex(
161161
Scan scan = new Scan().setFilter(filter);
162162
readWithFilter(projectId, instanceId, tableId, scan);
163163
}
164-
// [END bigtable_filters_limit_col_family_regex]
164+
// [END bigtable_filters_limit_col_family_regex_hbase]
165165

166-
// [START bigtable_filters_limit_col_qualifier_regex]
166+
// [START bigtable_filters_limit_col_qualifier_regex_hbase]
167167
public static void filterLimitColQualifierRegex() {
168168
// TODO(developer): Replace these variables before running the sample.
169169
String projectId = "my-project-id";
@@ -180,9 +180,9 @@ public static void filterLimitColQualifierRegex(
180180
Scan scan = new Scan().setFilter(filter);
181181
readWithFilter(projectId, instanceId, tableId, scan);
182182
}
183-
// [END bigtable_filters_limit_col_qualifier_regex]
183+
// [END bigtable_filters_limit_col_qualifier_regex_hbase]
184184

185-
// [START bigtable_filters_limit_col_range]
185+
// [START bigtable_filters_limit_col_range_hbase]
186186
public static void filterLimitColRange() {
187187
// TODO(developer): Replace these variables before running the sample.
188188
String projectId = "my-project-id";
@@ -200,9 +200,9 @@ public static void filterLimitColRange(String projectId, String instanceId, Stri
200200
Scan scan = new Scan().addFamily(Bytes.toBytes("cell_plan")).setFilter(filter).setMaxVersions();
201201
readWithFilter(projectId, instanceId, tableId, scan);
202202
}
203-
// [END bigtable_filters_limit_col_range]
203+
// [END bigtable_filters_limit_col_range_hbase]
204204

205-
// [START bigtable_filters_limit_value_range]
205+
// [START bigtable_filters_limit_value_range_hbase]
206206
public static void filterLimitValueRange() {
207207
// TODO(developer): Replace these variables before running the sample.
208208
String projectId = "my-project-id";
@@ -229,9 +229,9 @@ public static void filterLimitValueRange(String projectId, String instanceId, St
229229
Scan scan = new Scan().setFilter(filter);
230230
readWithFilter(projectId, instanceId, tableId, scan);
231231
}
232-
// [END bigtable_filters_limit_value_range]
232+
// [END bigtable_filters_limit_value_range_hbase]
233233

234-
// [START bigtable_filters_limit_value_regex]
234+
// [START bigtable_filters_limit_value_regex_hbase]
235235
public static void filterLimitValueRegex() {
236236
// TODO(developer): Replace these variables before running the sample.
237237
String projectId = "my-project-id";
@@ -247,9 +247,9 @@ public static void filterLimitValueRegex(String projectId, String instanceId, St
247247
Scan scan = new Scan().setFilter(filter);
248248
readWithFilter(projectId, instanceId, tableId, scan);
249249
}
250-
// [END bigtable_filters_limit_value_regex]
250+
// [END bigtable_filters_limit_value_regex_hbase]
251251

252-
// [START bigtable_filters_limit_timestamp_range]
252+
// [START bigtable_filters_limit_timestamp_range_hbase]
253253
public static void filterLimitTimestampRange() {
254254
// TODO(developer): Replace these variables before running the sample.
255255
String projectId = "my-project-id";
@@ -270,9 +270,9 @@ public static void filterLimitTimestampRange(
270270
System.out.println("There was an issue with your timestamp \n" + e.toString());
271271
}
272272
}
273-
// [END bigtable_filters_limit_timestamp_range]
273+
// [END bigtable_filters_limit_timestamp_range_hbase]
274274

275-
// [START bigtable_filters_limit_block_all]
275+
// [START bigtable_filters_limit_block_all_hbase]
276276
public static void filterLimitBlockAll() {
277277
// TODO(developer): Replace these variables before running the sample.
278278
String projectId = "my-project-id";
@@ -287,9 +287,9 @@ public static void filterLimitBlockAll(String projectId, String instanceId, Stri
287287
Scan scan = new Scan().setFilter(filter);
288288
readWithFilter(projectId, instanceId, tableId, scan);
289289
}
290-
// [END bigtable_filters_limit_block_all]
290+
// [END bigtable_filters_limit_block_all_hbase]
291291

292-
// [START bigtable_filters_composing_chain]
292+
// [START bigtable_filters_composing_chain_hbase]
293293
public static void filterComposingChain() {
294294
// TODO(developer): Replace these variables before running the sample.
295295
String projectId = "my-project-id";
@@ -310,9 +310,9 @@ public static void filterComposingChain(String projectId, String instanceId, Str
310310
Scan scan = new Scan().setFilter(filter);
311311
readWithFilter(projectId, instanceId, tableId, scan);
312312
}
313-
// [END bigtable_filters_composing_chain]
313+
// [END bigtable_filters_composing_chain_hbase]
314314

315-
// [START bigtable_filters_composing_interleave]
315+
// [START bigtable_filters_composing_interleave_hbase]
316316
public static void filterComposingInterleave() {
317317
// TODO(developer): Replace these variables before running the sample.
318318
String projectId = "my-project-id";
@@ -336,7 +336,7 @@ public static void filterComposingInterleave(
336336
Scan scan = new Scan().setFilter(filter).setMaxVersions();
337337
readWithFilter(projectId, instanceId, tableId, scan);
338338
}
339-
// [END bigtable_filters_composing_interleave]
339+
// [END bigtable_filters_composing_interleave_hbase]
340340
// [END_EXCLUDE]
341341

342342
public static void readWithFilter(
@@ -376,4 +376,4 @@ private static void printRow(Result row) {
376376
System.out.println();
377377
}
378378
}
379-
// [END bigtable_filters_print]
379+
// [END bigtable_filters_print_hbase]

bigtable/hbase/snippets/src/main/java/com/example/bigtable/Reads.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package com.example.bigtable;
1818

19-
// [START bigtable_reads_print]
19+
// [START bigtable_reads_print_hbase]
2020

2121
import com.google.cloud.bigtable.hbase.BigtableConfiguration;
2222
import java.io.IOException;
@@ -43,7 +43,7 @@ public class Reads {
4343

4444
// Write your code here.
4545
// [START_EXCLUDE]
46-
// [START bigtable_reads_row]
46+
// [START bigtable_reads_row_hbase]
4747
public static void readRow() {
4848
// TODO(developer): Replace these variables before running the sample.
4949
String projectId = "my-project-id";
@@ -69,9 +69,9 @@ public static void readRow(String projectId, String instanceId, String tableId)
6969
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
7070
}
7171
}
72-
// [END bigtable_reads_row]
72+
// [END bigtable_reads_row_hbase]
7373

74-
// [START bigtable_reads_row_partial]
74+
// [START bigtable_reads_row_partial_hbase]
7575
public static void readRowPartial() {
7676
// TODO(developer): Replace these variables before running the sample.
7777
String projectId = "my-project-id";
@@ -98,9 +98,9 @@ public static void readRowPartial(String projectId, String instanceId, String ta
9898
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
9999
}
100100
}
101-
// [END bigtable_reads_row_partial]
101+
// [END bigtable_reads_row_partial_hbase]
102102

103-
// [START bigtable_reads_rows]
103+
// [START bigtable_reads_rows_hbase]
104104
public static void readRows() {
105105
// TODO(developer): Replace these variables before running the sample.
106106
String projectId = "my-project-id";
@@ -129,9 +129,9 @@ public static void readRows(String projectId, String instanceId, String tableId)
129129
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
130130
}
131131
}
132-
// [END bigtable_reads_rows]
132+
// [END bigtable_reads_rows_hbase]
133133

134-
// [START bigtable_reads_row_range]
134+
// [START bigtable_reads_row_range_hbase]
135135
public static void readRowRange() {
136136
// TODO(developer): Replace these variables before running the sample.
137137
String projectId = "my-project-id";
@@ -163,9 +163,9 @@ public static void readRowRange(String projectId, String instanceId, String tabl
163163
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
164164
}
165165
}
166-
// [END bigtable_reads_row_range]
166+
// [END bigtable_reads_row_range_hbase]
167167

168-
// [START bigtable_reads_row_ranges]
168+
// [START bigtable_reads_row_ranges_hbase]
169169
public static void readRowRanges() {
170170
// TODO(developer): Replace these variables before running the sample.
171171
String projectId = "my-project-id";
@@ -207,9 +207,9 @@ public static void readRowRanges(String projectId, String instanceId, String tab
207207
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
208208
}
209209
}
210-
// [END bigtable_reads_row_ranges]
210+
// [END bigtable_reads_row_ranges_hbase]
211211

212-
// [START bigtable_reads_prefix]
212+
// [START bigtable_reads_prefix_hbase]
213213
public static void readPrefix() {
214214
// TODO(developer): Replace these variables before running the sample.
215215
String projectId = "my-project-id";
@@ -235,9 +235,9 @@ public static void readPrefix(String projectId, String instanceId, String tableI
235235
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
236236
}
237237
}
238-
// [END bigtable_reads_prefix]
238+
// [END bigtable_reads_prefix_hbase]
239239

240-
// [START bigtable_reads_filter]
240+
// [START bigtable_reads_filter_hbase]
241241
public static void readFilter() {
242242
// TODO(developer): Replace these variables before running the sample.
243243
String projectId = "my-project-id";
@@ -267,7 +267,7 @@ public static void readFilter(String projectId, String instanceId, String tableI
267267
"Unable to initialize service client, as a network error occurred: \n" + e.toString());
268268
}
269269
}
270-
// [END bigtable_reads_filter]
270+
// [END bigtable_reads_filter_hbase]
271271
// [END_EXCLUDE]
272272

273273
private static void printRow(Result row) {
@@ -288,4 +288,4 @@ private static void printRow(Result row) {
288288
System.out.println();
289289
}
290290
}
291-
// [END bigtable_reads_print]
291+
// [END bigtable_reads_print_hbase]

0 commit comments

Comments
 (0)