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
igorbernstein2
left a comment
There was a problem hiding this comment.
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.
nit. please expand what safety means here
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.
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() { |
| } | ||
|
|
||
| /** Gets the row prefixes to be included in this subset view. */ | ||
| public ImmutableList<ByteString> getRowPrefixes() { |
| } | ||
|
|
||
| /** Gets the map from familyId to familySubsets in this subset view. */ | ||
| public ImmutableMap<String, FamilySubsets> getFamilySubsets() { |
| /** 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.
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.
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