Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 8764474

Browse files
committed
Merge branch 'main' of github.com:googleapis/java-bigtable
Change-Id: Idd1e0fb830a1f52bac26a45ab86b59596d29c0c3
2 parents e96c5e0 + f7894c0 commit 8764474

150 files changed

Lines changed: 1457 additions & 1280 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google-cloud-bigtable/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
<compilerArgs>
428428
<arg>-XDcompilePolicy=simple</arg>
429429
<arg>--should-stop=ifError=FLOW</arg>
430-
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
430+
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:MissingSummary:OFF -Xep:InlineMeSuggester:OFF -Xep:AutoValueImmutableFields:OFF -Xep:ObjectEqualsForPrimitives:OFF -Xep:JavaDurationGetSecondsToToSeconds:OFF</arg>
431431

432432
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
433433
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,7 @@ public ApiFuture<Void> dropAllRowsAsync(String tableId) {
10421042
* @throws com.google.api.gax.retrying.PollException when polling exceeds the total timeout
10431043
*/
10441044
@ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.")
1045+
@Deprecated
10451046
public void awaitReplication(String tableId) {
10461047
// TODO(igorbernstein2): remove usage of typesafe names
10471048
com.google.bigtable.admin.v2.TableName tableName =
@@ -1418,8 +1419,8 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
14181419
}
14191420

14201421
/**
1421-
* <p>This method is obsolete. For the recommended proto-based approach, please see
1422-
* {@link com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
1422+
* This method is obsolete. For the recommended proto-based approach, please see {@link
1423+
* com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
14231424
*
14241425
* <p>Restores a backup to a new table with the specified configuration asynchronously.
14251426
*
@@ -1442,7 +1443,7 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
14421443
* },
14431444
* MoreExecutors.directExecutor()
14441445
* );
1445-
* </pre>
1446+
* }</pre>
14461447
*/
14471448
@ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.")
14481449
public ApiFuture<RestoredTableResult> restoreTableAsync(RestoreTableRequest request) {
@@ -1667,6 +1668,7 @@ public Backup apply(com.google.bigtable.admin.v2.Backup backupProto) {
16671668
*/
16681669
@SuppressWarnings("WeakerAccess")
16691670
@ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.")
1671+
@Deprecated
16701672
public ApiFuture<Void> awaitReplicationAsync(final String tableId) {
16711673
// TODO(igorbernstein2): remove usage of typesafe names
16721674
com.google.bigtable.admin.v2.TableName tableName =

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.google.cloud.bigtable.admin.v2.internal;
1717

1818
import com.google.api.core.InternalApi;
19+
import com.google.cloud.bigtable.data.v2.models.TableId;
1920
import java.util.regex.Matcher;
2021
import java.util.regex.Pattern;
2122
import javax.annotation.Nonnull;
@@ -53,6 +54,10 @@ public static String formatTableName(String projectId, String instanceId, String
5354
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId;
5455
}
5556

57+
public static String formatTableName(String projectId, String instanceId, TableId tableId) {
58+
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId.getTableId();
59+
}
60+
5661
public static String formatMaterializedViewName(
5762
@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) {
5863
return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId;

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting toProto() {
223223
return proto;
224224
}
225225

226+
@SuppressWarnings("EqualsGetClass")
226227
@Override
227228
public boolean equals(Object o) {
228229
if (this == o) {
@@ -320,6 +321,7 @@ MultiClusterRoutingUseAny toProto() {
320321
return proto;
321322
}
322323

324+
@SuppressWarnings("EqualsGetClass")
323325
@Override
324326
public boolean equals(Object o) {
325327
if (this == o) {
@@ -426,6 +428,7 @@ com.google.bigtable.admin.v2.AppProfile.StandardIsolation toProto() {
426428
return proto;
427429
}
428430

431+
@SuppressWarnings("EqualsGetClass")
429432
@Override
430433
public boolean equals(Object o) {
431434
if (this == o) {
@@ -527,6 +530,7 @@ public DataBoostIsolationReadOnly toProto() {
527530
return proto;
528531
}
529532

533+
@SuppressWarnings("EqualsGetClass")
530534
@Override
531535
public boolean equals(Object o) {
532536
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public EncryptionInfo getEncryptionInfo() {
223223
return EncryptionInfo.fromProto(proto.getEncryptionInfo());
224224
}
225225

226+
@SuppressWarnings("EqualsGetClass")
226227
@Override
227228
public boolean equals(Object o) {
228229
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public String getKmsKeyName() {
214214
return null;
215215
}
216216

217+
@SuppressWarnings("EqualsGetClass")
217218
@Override
218219
public boolean equals(Object o) {
219220
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest toProto(String p
177177
return this.builder.build();
178178
}
179179

180+
@SuppressWarnings({"EqualsGetClass", "ObjectEqualsForPrimitives"})
180181
@Override
181182
public boolean equals(Object o) {
182183
if (this == o) {

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package com.google.cloud.bigtable.admin.v2.models;
1717

1818
import com.google.api.core.InternalApi;
19-
import com.google.bigtable.admin.v2.Instance.Type;
2019
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
2120
import com.google.common.base.Preconditions;
2221
import com.google.common.collect.Lists;
@@ -74,7 +73,7 @@ private CreateInstanceRequest(@Nonnull String instanceId) {
7473

7574
builder.setInstanceId(instanceId);
7675
builder.getInstanceBuilder().setDisplayName(instanceId);
77-
builder.getInstanceBuilder().setType(Type.PRODUCTION);
76+
builder.getInstanceBuilder().setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION);
7877
}
7978

8079
/**
@@ -156,7 +155,7 @@ public CreateInstanceRequest addCluster(
156155
CreateClusterRequest clusterRequest =
157156
CreateClusterRequest.of("ignored-instance-id", clusterId)
158157
.setZone(zone)
159-
.setServeNodes(serveNodes)
158+
.setScalingMode(StaticClusterSize.of(serveNodes))
160159
.setStorageType(storageType);
161160
clusterRequests.add(clusterRequest);
162161

@@ -212,7 +211,7 @@ public CreateInstanceRequest addCmekCluster(
212211
CreateClusterRequest clusterRequest =
213212
CreateClusterRequest.of("ignored-instance-id", clusterId)
214213
.setZone(zone)
215-
.setServeNodes(serveNodes)
214+
.setScalingMode(StaticClusterSize.of(serveNodes))
216215
.setStorageType(storageType)
217216
.setKmsKeyName(kmsKeyName);
218217
clusterRequests.add(clusterRequest);

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public com.google.bigtable.admin.v2.AuthorizedView.SubsetView toProto() {
105105
}
106106

107107
@Override
108+
@SuppressWarnings("EqualsGetClass")
108109
public boolean equals(Object o) {
109110
if (this == o) {
110111
return true;

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @see com.google.bigtable.admin.v2.Type
2828
*/
2929
@BetaApi
30+
@SuppressWarnings("SameNameButDifferent")
3031
public interface Type {
3132
/**
3233
* These types are marker types that allow types to be used as the input to aggregate function.
@@ -51,8 +52,9 @@ static Type fromProto(com.google.bigtable.admin.v2.Type source) {
5152
return Aggregate.fromProto(source.getAggregateType());
5253
case KIND_NOT_SET:
5354
return Raw.create();
55+
default:
56+
throw new UnsupportedOperationException();
5457
}
55-
throw new UnsupportedOperationException();
5658
}
5759

5860
/** The raw type denotes the absence of a type. */
@@ -203,8 +205,9 @@ static Encoding fromProto(com.google.bigtable.admin.v2.Type.Int64.Encoding sourc
203205
return BigEndianBytes.create();
204206
case ENCODING_NOT_SET:
205207
return BigEndianBytes.create();
208+
default:
209+
throw new UnsupportedOperationException();
206210
}
207-
throw new UnsupportedOperationException();
208211
}
209212

210213
@AutoValue

0 commit comments

Comments
 (0)