Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples: add delete samples #1472

Merged
merged 10 commits into from
Apr 11, 2023
Merged

Conversation

kolea2
Copy link
Collaborator

@kolea2 kolea2 commented Oct 21, 2022

No description provided.

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Oct 21, 2022
@snippet-bot
Copy link

snippet-bot bot commented Oct 21, 2022

Here is the summary of changes.

You are about to add 7 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added api: bigtable Issues related to the googleapis/java-bigtable API. samples Issues that are directly related to samples. labels Oct 21, 2022
Copy link
Contributor

@billyjacobson billyjacobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these! Let me know if you have any questions

public void deleteColumnFamily(
String projectId, String instanceId, String tableId, String rowKey, String familyName) {
try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) {
dataClient.mutateRow(RowMutation.create(tableId, rowKey).deleteFamily(familyName));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I saw the delete table example, I rethought about this one. This is a bit unclear because you're not deleting the entire column family from the table right? You're just deleting the data in the family for the row?

Anyway, if needed might want a separate example doing deleting column families from the table if it is needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably clarified by the documentation/reading the code – I think I might've been thrown off by it since I didn't know you can delete all the column family data for a row and defaulting to thinking about deleting CF for the table

public void deleteColumnFamily(
String projectId, String instanceId, String tableId, String rowKey, String familyName) {
try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) {
dataClient.mutateRow(RowMutation.create(tableId, rowKey).deleteFamily(familyName));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably clarified by the documentation/reading the code – I think I might've been thrown off by it since I didn't know you can delete all the column family data for a row and defaulting to thinking about deleting CF for the table

@kolea2 kolea2 added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 11, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 11, 2023
@gcf-owl-bot gcf-owl-bot bot requested review from a team as code owners April 11, 2023 14:42
@kolea2 kolea2 added the automerge Merge the pull request once unit tests and other checks pass. label Apr 11, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit d9afa06 into googleapis:main Apr 11, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Apr 11, 2023
@kolea2 kolea2 deleted the deletes-samples branch April 11, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable API. samples Issues that are directly related to samples. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants