-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support AuthorizedView in bigtable data client
Change-Id: I1e54cab5b384d76166183ac72105a4cbac59979b chore: Address review comments Change-Id: I1d9c8bc54d204dbe6752161291cbd4158ee1d6b5 chore: Add @deprecated annotation and reformat javadoc Change-Id: I3c4a0fcbecc124a9517e48a1fc747c7b8dade40e chore: Remove ReadRow(s)Options Change-Id: Ib35bdac2cd51f302fd919671324fb2c0d630af0e chore: Minor doc and test fix Change-Id: I3c8e1fa624ec0423433eae15059b5e59e9727c70 Chore: Address comments Change-Id: I8886e907ebb797a67b36240417c2e609b6f5857a Rename SampleRowKeys to SampleRowKeysRequest Change-Id: I8dda7ee1df31b184d04938cbc2f9f984d84138b4 Add javadoc for extractTargetId and hide scopedForAuthorizedView Change-Id: I38718ae9badf24db6edc1b62fc06e4d3222faeb8 fix extractTableId to correctly handle authorized view name Change-Id: I1e66fc1440a29d3861e3ee6464911324633cc5af
- Loading branch information
Lixia Chen
committed
Mar 27, 2024
1 parent
13d1df3
commit 512818e
Showing
36 changed files
with
4,546 additions
and
228 deletions.
There are no files selected for viewing
831 changes: 822 additions & 9 deletions
831
...le-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...oud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.bigtable.data.v2.models; | ||
|
||
import com.google.api.core.InternalApi; | ||
import com.google.auto.value.AutoValue; | ||
import com.google.cloud.bigtable.data.v2.internal.NameUtil; | ||
import com.google.common.base.Preconditions; | ||
|
||
/** | ||
* An implementation of a {@link TargetId} for authorized views. | ||
* | ||
* <p>See {@link com.google.cloud.bigtable.admin.v2.models.AuthorizedView} for more details about an | ||
* authorized view. | ||
*/ | ||
@AutoValue | ||
public abstract class AuthorizedViewId implements TargetId { | ||
/** Constructs a new AuthorizedViewId object from the specified tableId and authorizedViewId. */ | ||
public static AuthorizedViewId of(String tableId, String authorizedViewId) { | ||
Preconditions.checkNotNull(tableId, "table id can't be null."); | ||
Preconditions.checkNotNull(authorizedViewId, "authorized view id can't be null."); | ||
return new AutoValue_AuthorizedViewId(tableId, authorizedViewId); | ||
} | ||
|
||
abstract String getTableId(); | ||
|
||
abstract String getAuthorizedViewId(); | ||
|
||
@Override | ||
@InternalApi | ||
public String toResourceName(String projectId, String instanceId) { | ||
return NameUtil.formatAuthorizedViewName( | ||
projectId, instanceId, getTableId(), getAuthorizedViewId()); | ||
} | ||
|
||
@Override | ||
@InternalApi | ||
public boolean scopedForAuthorizedView() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.