Skip to content
2 changes: 1 addition & 1 deletion google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-sources/.*</arg>
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:MissingSummary:OFF -Xep:InlineMeSuggester:OFF -Xep:AutoValueImmutableFields:OFF -Xep:ObjectEqualsForPrimitives:OFF</arg>

<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,8 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
}

/**
* <p>This method is obsolete. For the recommended proto-based approach, please see
* {@link com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
* This method is obsolete. For the recommended proto-based approach, please see {@link
* com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient#restoreTableAsync(com.google.bigtable.admin.v2.RestoreTableRequest)}.
*
* <p>Restores a backup to a new table with the specified configuration asynchronously.
*
Expand All @@ -1442,7 +1442,7 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
* },
* MoreExecutors.directExecutor()
* );
* </pre>
* }</pre>
*/
@ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.")
public ApiFuture<RestoredTableResult> restoreTableAsync(RestoreTableRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.google.cloud.bigtable.admin.v2.internal;

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

public static String formatTableName(String projectId, String instanceId, TableId tableId) {
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId.getTableId();
}

public static String formatMaterializedViewName(
@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) {
return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting toProto() {
return proto;
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -320,6 +321,7 @@ MultiClusterRoutingUseAny toProto() {
return proto;
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -426,6 +428,7 @@ com.google.bigtable.admin.v2.AppProfile.StandardIsolation toProto() {
return proto;
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down Expand Up @@ -527,6 +530,7 @@ public DataBoostIsolationReadOnly toProto() {
return proto;
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public EncryptionInfo getEncryptionInfo() {
return EncryptionInfo.fromProto(proto.getEncryptionInfo());
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public String getKmsKeyName() {
return null;
}

@SuppressWarnings("EqualsGetClass")
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest toProto(String p
return this.builder.build();
}

@SuppressWarnings({"EqualsGetClass", "ObjectEqualsForPrimitives"})
@Override
public boolean equals(Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.google.cloud.bigtable.admin.v2.models;

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

builder.setInstanceId(instanceId);
builder.getInstanceBuilder().setDisplayName(instanceId);
builder.getInstanceBuilder().setType(Type.PRODUCTION);
builder.getInstanceBuilder().setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION);
}

/**
Expand Down Expand Up @@ -156,7 +155,7 @@ public CreateInstanceRequest addCluster(
CreateClusterRequest clusterRequest =
CreateClusterRequest.of("ignored-instance-id", clusterId)
.setZone(zone)
.setServeNodes(serveNodes)
.setScalingMode(StaticClusterSize.of(serveNodes))
.setStorageType(storageType);
clusterRequests.add(clusterRequest);

Expand Down Expand Up @@ -212,7 +211,7 @@ public CreateInstanceRequest addCmekCluster(
CreateClusterRequest clusterRequest =
CreateClusterRequest.of("ignored-instance-id", clusterId)
.setZone(zone)
.setServeNodes(serveNodes)
.setScalingMode(StaticClusterSize.of(serveNodes))
.setStorageType(storageType)
.setKmsKeyName(kmsKeyName);
clusterRequests.add(clusterRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @see com.google.bigtable.admin.v2.Type
*/
@BetaApi
@SuppressWarnings("SameNameButDifferent")
public interface Type {
/**
* These types are marker types that allow types to be used as the input to aggregate function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.google.api.core.InternalApi;
import com.google.bigtable.admin.v2.Instance;
import com.google.bigtable.admin.v2.Instance.Type;
import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest;
import com.google.cloud.bigtable.admin.v2.internal.NameUtil;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -64,7 +63,7 @@ public UpdateInstanceRequest setDisplayName(@Nonnull String displayName) {
*/
@SuppressWarnings("WeakerAccess")
public UpdateInstanceRequest setProductionType() {
builder.getInstanceBuilder().setType(Type.PRODUCTION);
builder.getInstanceBuilder().setType(Instance.Type.PRODUCTION);
updateFieldMask(Instance.TYPE_FIELD_NUMBER);

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof UpdateTableRequest)) return false;
UpdateTableRequest that = (UpdateTableRequest) o;
return Objects.equals(requestBuilder, that.requestBuilder);
if (requestBuilder == that.requestBuilder) {
return true;
}
if (requestBuilder == null || that.requestBuilder == null) {
return false;
}
return Objects.equals(requestBuilder.build(), that.requestBuilder.build());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ private AwaitConsistencyCallable createAwaitConsistencyCallable() {
.setInitialRetryDelay(Duration.ofSeconds(10))
.setRetryDelayMultiplier(1.0)
.setMaxRetryDelay(Duration.ofSeconds(10))
.setJittered(true)
// These rpc timeouts are ignored, instead the rpc timeouts defined for
// generateConsistencyToken and checkConsistency callables will be used.
.setInitialRpcTimeout(Duration.ZERO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public com.google.rpc.Status toProto() {
return proto;
}

@Override
public String toString() {
return proto.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
*/
@BetaApi
@InternalApi
@SuppressWarnings({"SameNameButDifferent", "JavaLangClash"})
public interface Type {

@AutoValue
Expand All @@ -57,7 +58,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -74,7 +75,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -91,7 +92,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -108,7 +109,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -125,7 +126,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -142,7 +143,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -159,7 +160,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand All @@ -176,7 +177,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand Down Expand Up @@ -241,7 +242,7 @@ public int getColumnIndex(java.lang.String fieldName) {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name();
}
}
Expand Down Expand Up @@ -324,7 +325,7 @@ public int hashCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name() + "{fields=" + fields.toString() + "}";
}
}
Expand All @@ -349,7 +350,7 @@ public SqlType<Elem> getElementType() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name() + "{elementType=" + getElementType().getCode() + "}";
}
}
Expand Down Expand Up @@ -381,7 +382,7 @@ public SqlType<V> getValueType() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name()
+ "{keyType="
+ getKeyType().toString()
Expand Down Expand Up @@ -422,7 +423,7 @@ public java.lang.String getMessageName() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name() + "{message=" + getMessageName() + "}";
}
}
Expand Down Expand Up @@ -531,7 +532,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name()
+ "{messageName="
+ getMessageName()
Expand Down Expand Up @@ -577,7 +578,7 @@ public Code getCode() {
}

@Override
public java.lang.String toString() {
public final java.lang.String toString() {
return getCode().name()
+ "{enumName="
+ getEnumName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1783,10 +1783,9 @@ public Batcher<RowMutationEntry, Void> newBulkMutationBatcher(@Nonnull String ta
* GrpcCallContext)} instead.
*/
@Deprecated
@BetaApi("This surface is likely to change as the batching surface evolves.")
public Batcher<RowMutationEntry, Void> newBulkMutationBatcher(
@Nonnull String tableId, @Nullable GrpcCallContext ctx) {
return stub.newMutateRowsBatcher(tableId, ctx);
return stub.newMutateRowsBatcher(TableId.of(tableId), ctx);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public static String formatTableName(
return formatInstanceName(projectId, instanceId) + "/tables/" + tableId;
}

public static String formatTableName(
@Nonnull String projectId, @Nonnull String instanceId, @Nonnull TableId tableId) {
return formatTableName(projectId, instanceId, tableId.getTableId());
}

public static String formatAuthorizedViewName(
@Nonnull String projectId,
@Nonnull String instanceId,
Expand All @@ -56,11 +61,29 @@ public static String formatAuthorizedViewName(
return formatTableName(projectId, instanceId, tableId) + "/authorizedViews/" + authorizedViewId;
}

public static String formatAuthorizedViewName(
@Nonnull String projectId,
@Nonnull String instanceId,
@Nonnull AuthorizedViewId authorizedViewId) {
return formatTableName(projectId, instanceId, authorizedViewId.getTableId())
+ "/authorizedViews/"
+ authorizedViewId.getAuthorizedViewId();
}

public static String formatMaterializedViewName(
@Nonnull String projectId, @Nonnull String instanceId, @Nonnull String materializedViewId) {
return formatInstanceName(projectId, instanceId) + "/materializedViews/" + materializedViewId;
}

public static String formatMaterializedViewName(
@Nonnull String projectId,
@Nonnull String instanceId,
@Nonnull MaterializedViewId materializedViewId) {
return formatInstanceName(projectId, instanceId)
+ "/materializedViews/"
+ materializedViewId.getMaterializedViewId();
}

public static String extractTableIdFromTableName(@Nonnull String fullTableName) {
Matcher matcher = TABLE_PATTERN.matcher(fullTableName);
if (!matcher.matches()) {
Expand Down
Loading
Loading