GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Bigtable Java samples by elisheva-qlogic · Pull Request #3946 · googleapis/google-cloud-java Conversation
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good start, I added some comments, but didn't do a full review. Can you help me understand how samples work? how/who uses the comment tags? What are snippets? Why are other products differentiate between examples and snippets?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
elisheva-qlogic
force-pushed
the
samples
branch
from
4f20ff6 to
514b3ab
Compare
elisheva-qlogic
force-pushed
the
samples
branch
from
4f35dbf to
7ad20e5
Compare
igorbernstein2
requested changes
|
| String TABLE_ID, | ||
| String ROW_KEY_PREFIX, | ||
| String COLUMN_FAMILY_ID, | ||
| String COLUMN_QUALIFIER) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| dataClient.mutateRow(rowMutation); | ||
| System.out.println(greetings[i]); | ||
| } | ||
| } catch (Exception e) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| System.out.println(greetings[i]); | ||
| } | ||
| } catch (Exception e) { | ||
| System.out.println("Exception while writing to table: " + e.getMessage()); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } catch (Exception e) { | ||
| System.out.println("Exception while writing to table: " + e.getMessage()); | ||
| } | ||
| return mutation; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } catch (Exception e) { | ||
| System.out.println("Exception while reading table: " + e.getMessage()); | ||
| } | ||
| return rowStream; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| public static Table createTable( | ||
| BigtableTableAdminClient adminClient, String TABLE_ID, String COLUMN_FAMILY_ID) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| public class HelloWorld { | ||
|
|
||
| public static void main(String... args) throws Exception { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| final String GCLOUD_PROJECT = args[0]; | ||
| final String INSTANCE_ID = args[1]; | ||
| final String TABLE_ID = "table"; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| private static final String ROW_KEY_PREFIX = "test-rowKey"; | ||
| private static BigtableDataClient dataClient; | ||
| private static BigtableTableAdminClient adminClient; | ||
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The main change is that HelloWorld sample is restructured. If this looks good, I will work on restructuring TableAdmin and InstanceAdmin samples like this as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| private static String instanceId; | ||
| private static String tableId; | ||
| private static BigtableDataClient dataClient; | ||
| private static BigtableTableAdminClient adminClient; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| deleteTable(); | ||
| garbageCollect(); | ||
| } catch (ApiException e) { | ||
| System.err.println("Exception while running HelloWorld: " + e.getMessage()); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // [END connecting_to_bigtable] | ||
| } | ||
|
|
||
| public void run() throws Exception { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!adminClient.exists(tableId)) { | ||
| CreateTableRequest createTableRequest = | ||
| CreateTableRequest.of(tableId).addFamily(columnFamily); | ||
| System.out.println("Creating table: " + tableId); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| private static final String tablePrefix = "table"; | ||
| private static final String columnFamily = "cf1"; | ||
| private static final String columnQualifier = "greeting"; | ||
| private static final String rowKeyPrefix = "rowKey"; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| dataClient.mutateRow(rowMutation); | ||
| System.out.println(greetings[i]); | ||
| } | ||
| } catch (ApiException e) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public void readTable() { | ||
| // [START scanning_all_rows] | ||
| try { | ||
| System.out.println("\n================= Reading the entire table ================="); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| adminClient.deleteTable(tableId); | ||
| } | ||
| } | ||
| } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| System.out.println(greetings[i]); | ||
| } | ||
| } catch (NotFoundException e) { | ||
| System.err.println("Exception while writing to table: " + e.getMessage()); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| tableId = generateTableId(); | ||
| helloWorld = new HelloWorld(instanceName.getProject(), instanceName.getInstance(), tableId); | ||
| if (!adminClient.exists(tableId)) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| // Read a single row | ||
| OutputStream outputStream = new ByteArrayOutputStream(); | ||
| System.setOut(new PrintStream(outputStream)); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing this in favor of #4274 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
🤖 I have created a release *beep* *boop* --- <details><summary>2.63.0</summary> ## [2.63.0](googleapis/sdk-platform-java@v2.62.3...v2.63.0) (2025-10-16) ### Features * **librariangen:** add bazel package ([#3940](googleapis/sdk-platform-java#3940)) ([d6bd0e0](googleapis/sdk-platform-java@d6bd0e0)) * **librariangen:** add execv package ([#3932](googleapis/sdk-platform-java#3932)) ([7fc08a5](googleapis/sdk-platform-java@7fc08a5)) * **librariangen:** add protoc package ([#3935](googleapis/sdk-platform-java#3935)) ([c3f7b9f](googleapis/sdk-platform-java@c3f7b9f)) * **librariangen:** add request package ([#3933](googleapis/sdk-platform-java#3933)) ([c478a98](googleapis/sdk-platform-java@c478a98)) * **librariangen:** scaffold Java language container for Librarian ([#3926](googleapis/sdk-platform-java#3926)) ([aec74aa](googleapis/sdk-platform-java@aec74aa)) ### Dependencies * Bump errorprone-annotations to v2.42.0 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * Bump guava to v33.5.0 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * Bump j2objc-annotations to v3.1 ([4fa48a2](googleapis/sdk-platform-java@4fa48a2)) * update google auth library dependencies to v1.40.0 ([#3945](googleapis/sdk-platform-java#3945)) ([4b2c98e](googleapis/sdk-platform-java@4b2c98e)) * Upgrade Google Http Java Client to v2.0.2 ([#3946](googleapis/sdk-platform-java#3946)) ([89d518c](googleapis/sdk-platform-java@89d518c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.