Skip to content

Commit

Permalink
Merge branch 'main' into generate-libraries-main
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Dec 16, 2024
2 parents 34db810 + 825e717 commit 07541f3
Show file tree
Hide file tree
Showing 77 changed files with 757 additions and 248 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0
- uses: googleapis/sdk-platform-java/.github/scripts@v2.51.0
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
shell: bash
run: .kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0
with:
bom-path: google-cloud-bigtable-bom/pom.xml
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.40.0"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0"
}

env_vars: {
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [2.50.0](https://github.com/googleapis/java-bigtable/compare/v2.49.0...v2.50.0) (2024-12-06)


### Features

* Add support for Row Affinity app profiles ([#2341](https://github.com/googleapis/java-bigtable/issues/2341)) ([cb4d60e](https://github.com/googleapis/java-bigtable/commit/cb4d60e8ce2079a270739ad91efb05cbb1ff74f8))

## [2.49.0](https://github.com/googleapis/java-bigtable/compare/v2.48.0...v2.49.0) (2024-12-03)


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-bigtable'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigtable:2.49.0'
implementation 'com.google.cloud:google-cloud-bigtable:2.50.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.49.0"
libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.50.0"
```

## Authentication
Expand Down Expand Up @@ -543,7 +543,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-bigtable.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.49.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.50.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
18 changes: 9 additions & 9 deletions google-cloud-bigtable-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.40.0</version>
<version>3.41.0</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -63,37 +63,37 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator</artifactId>
<version>0.186.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.186.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigtable-admin-v2</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigtable-admin-v2:current} -->
<version>2.50.0</version><!-- {x-version-update:grpc-google-cloud-bigtable-admin-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-bigtable-v2</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-bigtable-v2:current} -->
<version>2.50.0</version><!-- {x-version-update:grpc-google-cloud-bigtable-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigtable-admin-v2</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigtable-admin-v2:current} -->
<version>2.50.0</version><!-- {x-version-update:proto-google-cloud-bigtable-admin-v2:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-bigtable-v2</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-bigtable-v2:current} -->
<version>2.50.0</version><!-- {x-version-update:proto-google-cloud-bigtable-v2:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-bigtable-deps-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.40.0</version>
<version>3.41.0</version>
<relativePath/>
</parent>

<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->

<packaging>pom</packaging>
<description>
Expand Down Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>gapic-libraries-bom</artifactId>
<version>1.48.0</version>
<version>1.49.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-bigtable-emulator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<artifactId>google-cloud-bigtable-parent</artifactId>
<groupId>com.google.cloud</groupId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>

<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.186.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->

<description>
A Java wrapper for the Cloud Bigtable emulator.
Expand Down
10 changes: 5 additions & 5 deletions google-cloud-bigtable-emulator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>google-cloud-bigtable-emulator</artifactId>
<version>0.186.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<name>Google Cloud Java - Bigtable Emulator</name>
<url>https://github.com/googleapis/java-bigtable</url>
<description>
Expand All @@ -14,7 +14,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-parent</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>
<scm>
<connection>scm:git:[email protected]:googleapis/java-bigtable.git</connection>
Expand Down Expand Up @@ -81,14 +81,14 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -99,7 +99,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-emulator-core</artifactId>
<version>0.186.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
<version>0.187.0</version><!-- {x-version-update:google-cloud-bigtable-emulator:current} -->
</dependency>

<dependency>
Expand Down
33 changes: 33 additions & 0 deletions google-cloud-bigtable/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,37 @@
<className>com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider</className>
<method>*</method>
</difference>
<difference>
<!-- InternalApi was updated -->
<differenceType>7006</differenceType>
<className>com/google/cloud/bigtable/data/v2/internal/*</className>
<method>*getTimestamp(*)</method>
<to>java.time.Instant</to>
</difference>
<difference>
<!-- BetaApi was updated -->
<differenceType>7006</differenceType>
<className>com/google/cloud/bigtable/data/v2/models/sql/StructReader</className>
<method>*getTimestamp(*)</method>
<to>java.time.Instant</to>
</difference>
<difference>
<!-- BetaApi was updated -->
<differenceType>7005</differenceType>
<className>com/google/cloud/bigtable/data/v2/models/sql/Statement$Builder</className>
<method>*setTimestampParam(java.lang.String, org.threeten.bp.Instant)</method>
<to>*setTimestampParam(java.lang.String, java.time.Instant)</to>
</difference>
<difference>
<!-- ChangeStream api is internal, only used by apache/beam-->
<differenceType>7013</differenceType>
<className>com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation</className>
<method>*get*Time()</method>
</difference>
<difference>
<!-- Heartbeat is part of the ChangeStream api, which is internal and only used by apache/beam-->
<differenceType>7013</differenceType>
<className>com/google/cloud/bigtable/data/v2/models/Heartbeat</className>
<method>*getEstimatedLowWatermarkTime()</method>
</difference>
</differences>
10 changes: 5 additions & 5 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>google-cloud-bigtable</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<packaging>jar</packaging>
<name>Google Cloud Bigtable</name>
<url>https://github.com/googleapis/java-bigtable</url>
Expand All @@ -12,11 +12,11 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-parent</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
</parent>
<properties>
<!-- The version that will be embedded in the published jar via maven-resources-plugin -->
<java-bigtable.version>2.49.1-SNAPSHOT</java-bigtable.version><!-- {x-version-update:google-cloud-bigtable:current} -->
<java-bigtable.version>2.50.0</java-bigtable.version><!-- {x-version-update:google-cloud-bigtable:current} -->

<site.installationModule>google-cloud-bigtable</site.installationModule>

Expand Down Expand Up @@ -52,14 +52,14 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-deps-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigtable-bom</artifactId>
<version>2.49.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<version>2.50.0</version><!-- {x-version-update:google-cloud-bigtable:current} -->
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
@InternalApi("For internal use only")
public final class Version {
// {x-version-update-start:google-cloud-bigtable:current}
public static String VERSION = "2.49.1-SNAPSHOT";
public static String VERSION = "2.50.0";
// {x-version-update-end}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.google.api.core.InternalApi;
import com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly;
import com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny;
import com.google.bigtable.admin.v2.AppProfile.Priority;
import com.google.bigtable.admin.v2.AppProfile.StandardIsolation;
import com.google.bigtable.admin.v2.AppProfileName;
import com.google.common.base.Objects;
Expand Down Expand Up @@ -69,6 +68,10 @@ private AppProfile(@Nonnull com.google.bigtable.admin.v2.AppProfile proto) {
@SuppressWarnings("WeakerAccess")
public RoutingPolicy getPolicy() {
if (proto.hasMultiClusterRoutingUseAny()) {
if (proto.getMultiClusterRoutingUseAny().hasRowAffinity()) {
return MultiClusterRoutingPolicy.withRowAffinity(
ImmutableSet.copyOf(proto.getMultiClusterRoutingUseAny().getClusterIdsList()));
}
return MultiClusterRoutingPolicy.of(
ImmutableSet.copyOf(proto.getMultiClusterRoutingUseAny().getClusterIdsList()));
} else if (proto.hasSingleClusterRouting()) {
Expand Down Expand Up @@ -267,6 +270,34 @@ public static MultiClusterRoutingPolicy of(Set<String> clusterIds) {
MultiClusterRoutingUseAny.newBuilder().addAllClusterIds(clusterIds).build());
}

/** Creates a new instance of {@link MultiClusterRoutingPolicy}. */
public static MultiClusterRoutingPolicy withRowAffinity() {
return new MultiClusterRoutingPolicy(
MultiClusterRoutingUseAny.newBuilder()
.setRowAffinity(MultiClusterRoutingUseAny.RowAffinity.getDefaultInstance())
.build());
}

/**
* Creates a new instance of {@link MultiClusterRoutingPolicy} with row affinity enabled and
* specified cluster ids to route to.
*/
public static MultiClusterRoutingPolicy withRowAffinity(String... clusterIds) {
return withRowAffinity(ImmutableSet.copyOf(clusterIds));
}

/**
* Creates a new instance of {@link MultiClusterRoutingPolicy} with specified cluster ids to
* route to.
*/
public static MultiClusterRoutingPolicy withRowAffinity(Set<String> clusterIds) {
return new MultiClusterRoutingPolicy(
MultiClusterRoutingUseAny.newBuilder()
.addAllClusterIds(clusterIds)
.setRowAffinity(MultiClusterRoutingUseAny.RowAffinity.getDefaultInstance())
.build());
}

/*
* Returns the set of clusters to route to. The order is ignored; clusters will be
* tried in order of distance. If empty, all clusters are eligible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;
import java.time.Instant;
import java.util.List;
import org.threeten.bp.Instant;

/**
* Shared type implementations. Right now this is only used by SqlType but this will become a shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.threeten.bp.Duration;

/**
* Settings class to configure an instance of {@link BigtableDataClient}.
Expand Down Expand Up @@ -134,9 +133,11 @@ public static Builder newBuilderForEmulator(String hostname, int port) {
.setMaxInboundMessageSize(256 * 1024 * 1024)
.setChannelPoolSettings(ChannelPoolSettings.staticallySized(1))
.setChannelConfigurator(ManagedChannelBuilder::usePlaintext)
.setKeepAliveTime(Duration.ofSeconds(61)) // sends ping in this interval
.setKeepAliveTimeout(
Duration.ofSeconds(10)) // wait this long before considering the connection dead
.setKeepAliveTimeDuration(
java.time.Duration.ofSeconds(61)) // sends ping in this interval
.setKeepAliveTimeoutDuration(
java.time.Duration.ofSeconds(
10)) // wait this long before considering the connection dead
.build());

LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port);
Expand Down
Loading

0 comments on commit 07541f3

Please sign in to comment.