-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat: Add admin APIs for AuthorizedView #2175
Conversation
Change-Id: Ie31eae6da61ed0d0462e029f6247924785b239bf
15abda4
to
feb960c
Compare
...e-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java
Show resolved
Hide resolved
Change-Id: If52e3a32c3259f652f1f7d34b013d1ec1fc0a773
...e-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java
Show resolved
Hide resolved
...e-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java
Show resolved
Hide resolved
...d-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java
Show resolved
Hide resolved
...src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java
Show resolved
Hide resolved
Change-Id: I2e7f04d0f7815d014928a924d4a4f26adb2b655d
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.
Looks pretty good. I think the only thing that might be missing is to update the cleanupStale rule:
return this; | ||
} | ||
|
||
/** Configures if safety warnings should be disabled. */ |
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.
nit. please expand what safety means 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.
Done.
I don't think we need to update that since when a table is deleted, all the authorized views inside that table are also cascading deleted. |
Change-Id: Iac28b6cbef3088e4e2d43d90655155369361c347
} | ||
|
||
/** Gets the list of column qualifiers included in this authorized view. */ | ||
public ImmutableList<ByteString> getQualifiers() { |
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.
Change the API to return List cause we don't want to leak guava dependencies:
public List<ByteString> getQualifiers() {
return ImmutableList.copyOf(...);
}
} | ||
|
||
/** Gets the list of column qualifier prefixes included in this authorized view. */ | ||
public ImmutableList<ByteString> getQualifierPrefixes() { |
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.
Same here.
} | ||
|
||
/** Gets the row prefixes to be included in this subset view. */ | ||
public ImmutableList<ByteString> getRowPrefixes() { |
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.
same here
} | ||
|
||
/** Gets the map from familyId to familySubsets in this subset view. */ | ||
public ImmutableMap<String, FamilySubsets> getFamilySubsets() { |
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.
same here
/** Adds a new familyId with its familySubsets to the subset view. */ | ||
public SubsetView addFamilySubsets(String familyId, FamilySubsets familySubsets) { | ||
if (this.builder.containsFamilySubsets(familyId)) { | ||
// If the familyId exists, append the familySubsets to the existing value. |
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 the default behavior be replacing instead of merging?
.setAuthorizedViewType( | ||
SubsetView.create() | ||
.addRowPrefix("row#") | ||
.addFamilySubsets("cf1", FamilySubsets.create().addQualifier("qualifier")) |
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.
once we update the logic to replace, we probably also need to update this test
Change-Id: Ibdb2c8a62dc55c44059d5ec2296c57c7d430baa4
595cfa1
to
e28c385
Compare
Change-Id: Ie31eae6da61ed0d0462e029f6247924785b239bf