-
Notifications
You must be signed in to change notification settings - Fork 61
feat: modernization part 2 #1748
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
base: main
Are you sure you want to change the base?
Conversation
|
Here is the summary of changes. You are about to add 3 region tags.
You are about to delete 13 region tags.
This comment is generated by snippet-bot.
|
|
Warning: This pull request is touching the following templated files:
|
|
The CI is really not cooperating here (timeouts, quota errors, etc) but the code itself should be okay to review. |
mutianf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did all the data API examples go?
|
|
||
| // Imports the Admin library | ||
| const {BigtableTableAdminClient} = require('@google-cloud/bigtable').admin.v2; | ||
| const {TableAdminClient} = require('@google-cloud/bigtable').admin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this sample reflect the new CUJ?
await tableAdmin.waitForConsistency('tablename');
or
const [token] = await tableAdmin.generateConsistencyToken({
name: 'tablename',
});
// overload/etc, may be a separate method
await tableAdmin.waitForConsistency(token);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's now a separate sample for waitForConsistency:
I don't want to remove the existing one just because those methods are still valid and work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure as long as we want this sample to show up for the bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async region tags then this should be fine, but I'm not sure what the requirements are here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this a bit in the last meeting, but since there's another tomorrow, let's just ask again.
samples/generated/admin/v2/bigtable_table_admin.generate_consistency_token.js
Show resolved
Hide resolved
| versions: 1, | ||
| }, | ||
| }; | ||
| const updatedMetadata = GcRuleBuilder.rule({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this example can be added to the modifyColumnFamilies example as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might've missed one, but I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm not sure I see where it's missing - can you paste a link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mutianf Were you talking about https://github.com/googleapis/nodejs-bigtable/pull/1748/changes/BASE..95e039f8357066000eff23da6209444a5f12a41a#diff-7d7f18b5a162a0662ec29b46106e166c5d47c01dea9b048ce05f32c39a79840fR155? It looks like it builds the rule using union, but was there another that uses the rule method?
…and restore optimization
| await adminClient.checkOptimizeRestoredTableProgress( | ||
| optimizeTableOperationName, | ||
| ); | ||
| const [table] = await optimizeLRO.promise(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I remember modelling my code after the Python code which performs two operations shown by each of the await calls deleted above. Does the checkOptimizeRestoredTableProgress call basically return the same LRO as the gax.operation( call in the deleted snippet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's basically a copy of gapic's checkRestoreTableProgress, but modified to work with the optimize operation:
nodejs-bigtable/src/admin/table.ts
Line 89 in 9732446
| async checkOptimizeRestoredTableProgress( |
I don't have the original handy, but IIRC it had similarities.
| import {describe, it} from 'mocha'; | ||
|
|
||
| describe('GcRuleBuilder', () => { | ||
| it('has working TypeScript types', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new changes, are there tests anywhere that ensure the full sample from the doc https://docs.google.com/document/d/14aOXOpEbwpYJe7-p6E-PUgoy0vn4AKI7zP0Man0prLo/edit?tab=t.0#heading=h.d7jxtor70ekh runs without errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure there's a very similar one in the table admin tests, but maybe we could update that one to do what's in the doc, since it's more comprehensive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a few nits and checks.
danieljbruce
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few more responses.
|
|
||
| // Imports the Admin library | ||
| const {BigtableTableAdminClient} = require('@google-cloud/bigtable').admin.v2; | ||
| const {TableAdminClient} = require('@google-cloud/bigtable').admin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figure as long as we want this sample to show up for the bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async region tags then this should be fine, but I'm not sure what the requirements are here.
| versions: 1, | ||
| }, | ||
| }; | ||
| const updatedMetadata = GcRuleBuilder.rule({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mutianf Were you talking about https://github.com/googleapis/nodejs-bigtable/pull/1748/changes/BASE..95e039f8357066000eff23da6209444a5f12a41a#diff-7d7f18b5a162a0662ec29b46106e166c5d47c01dea9b048ce05f32c39a79840fR155? It looks like it builds the rule using union, but was there another that uses the rule method?
This is a follow-up for these two PRs:
#1739
#1740
This takes care of some missing pieces that were discovered by further discussion:
There is still a CI issue that will need to be corrected before this can be merged. I don't think it's the result of this change, but I also don't want to chance it.