Skip to content

Commit

Permalink
Merge branch 'main' into fgac-change
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul2393 committed Jul 20, 2022
2 parents b719060 + 9728c84 commit 62e124e
Show file tree
Hide file tree
Showing 60 changed files with 9,492 additions and 406 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:6d4e3a15c62cfdcb823d60e16da7521e7c6fc00eba07c8ff12e4de9924a57d28
# created: 2022-06-29T23:17:33.110417661Z
digest: sha256:04f254abfe5f47fe73ae6f91d68d55c3b76e722a4943066c3bb0ce03573b4ad9
# created: 2022-07-18T21:44:23.94208526Z
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [6.27.0](https://github.com/googleapis/java-spanner/compare/v6.26.0...v6.27.0) (2022-07-19)


### Features

* Adding new fields for Instance Create Time and Update Time ([#1913](https://github.com/googleapis/java-spanner/issues/1913)) ([2c71e02](https://github.com/googleapis/java-spanner/commit/2c71e0233333803f271931f6ef471b7eacfa52d7))


### Dependencies

* update dependency com.google.cloud:google-cloud-monitoring to v3.3.1 ([#1933](https://github.com/googleapis/java-spanner/issues/1933)) ([e3d646b](https://github.com/googleapis/java-spanner/commit/e3d646bae4abf2215d44f282d4faf722c638b823))
* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#1944](https://github.com/googleapis/java-spanner/issues/1944)) ([765d11b](https://github.com/googleapis/java-spanner/commit/765d11b2e5ee7b1f12d2d27a139f92efbc1caa07))
* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#1945](https://github.com/googleapis/java-spanner/issues/1945)) ([0da75b8](https://github.com/googleapis/java-spanner/commit/0da75b819d6e9d0f7c6850d77656e46b76ddad6d))
* update dependency org.graalvm.sdk:graal-sdk to v22.2.0 ([#1953](https://github.com/googleapis/java-spanner/issues/1953)) ([c7f1040](https://github.com/googleapis/java-spanner/commit/c7f1040d849901194e5672b270ccee7fbc695d17))

## [6.26.0](https://github.com/googleapis/java-spanner/compare/v6.25.7...v6.26.0) (2022-07-13)


### Features

* Adding two new fields for Instance create_time and update_time ([#1908](https://github.com/googleapis/java-spanner/issues/1908)) ([00b3817](https://github.com/googleapis/java-spanner/commit/00b38178e851401e293aa457f7ba5ea593a7b7c5))
* changes to support data, timestamp and arrays in IT tests ([#1840](https://github.com/googleapis/java-spanner/issues/1840)) ([c667653](https://github.com/googleapis/java-spanner/commit/c667653ec380dccbf205e7b419843da11cf4155a))
* Error Details Improvement ([c8a2184](https://github.com/googleapis/java-spanner/commit/c8a2184c51cc92ec35c759eff68e614fc78fb2e6))
* Error Details Improvement ([#1929](https://github.com/googleapis/java-spanner/issues/1929)) ([c8a2184](https://github.com/googleapis/java-spanner/commit/c8a2184c51cc92ec35c759eff68e614fc78fb2e6))


### Bug Fixes

* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-spanner/issues/1485)) ([#1946](https://github.com/googleapis/java-spanner/issues/1946)) ([fd0b845](https://github.com/googleapis/java-spanner/commit/fd0b84523535ba583a1b56acbea98835191daa06))


### Dependencies

* update dependency com.google.cloud:google-cloud-trace to v2.3.0 ([#1934](https://github.com/googleapis/java-spanner/issues/1934)) ([2813eb2](https://github.com/googleapis/java-spanner/commit/2813eb21c9f168e8dea149e40dac188933c7e2db))

## [6.25.7](https://github.com/googleapis/java-spanner/compare/v6.25.6...v6.25.7) (2022-06-30)


Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Java idiomatic client for [Cloud Spanner][product-docs].

## Quickstart

If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:

```xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>25.4.0</version>
<version>26.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -41,28 +41,28 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>6.25.8</version>
<version>6.26.1</version>
</dependency>

```

If you are using Gradle 5.x or later, add this to your dependencies
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:25.4.0')
implementation platform('com.google.cloud:libraries-bom:26.0.0')
implementation 'com.google.cloud:google-cloud-spanner'
```
If you are using Gradle without BOM, add this to your dependencies
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-spanner:6.25.8'
implementation 'com.google.cloud:google-cloud-spanner:6.26.1'
```

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

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.25.8"
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.26.1"
```

## Authentication
Expand Down
18 changes: 9 additions & 9 deletions google-cloud-spanner-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
Expand Down Expand Up @@ -53,43 +53,43 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<type>test-jar</type>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-admin-instance-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-admin-instance-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
22 changes: 19 additions & 3 deletions google-cloud-spanner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<packaging>jar</packaging>
<name>Google Cloud Spanner</name>
<url>https://github.com/googleapis/java-spanner</url>
<description>Java idiomatic client for Google Cloud Spanner.</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-parent</artifactId>
<version>6.25.8-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>6.27.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-spanner</site.installationModule>
<opencensus.version>0.31.1</opencensus.version>
<graalvm.version>22.1.0.1</graalvm.version>
<graalvm.version>22.2.0</graalvm.version>
<spanner.testenv.config.class>com.google.cloud.spanner.GceTestEnvConfig</spanner.testenv.config.class>
<spanner.testenv.instance>projects/gcloud-devel/instances/spanner-testing-east1</spanner.testenv.instance>
<spanner.gce.config.project_id>gcloud-devel</spanner.gce.config.project_id>
Expand Down Expand Up @@ -271,6 +271,10 @@
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
Expand Down Expand Up @@ -308,12 +312,24 @@
</dependency>

<!-- Need testing utility classes for generated gRPC clients tests -->
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-grpc</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
import com.google.cloud.Policy;
import com.google.cloud.Timestamp;
import com.google.cloud.spanner.Options.ListOption;
import com.google.longrunning.Operation;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
Expand Down Expand Up @@ -61,6 +62,18 @@ public Builder setDisplayName(String displayName) {
return this;
}

@Override
Builder setUpdateTime(Timestamp updateTime) {
infoBuilder.setUpdateTime(updateTime);
return this;
}

@Override
Builder setCreateTime(Timestamp createTime) {
infoBuilder.setCreateTime(createTime);
return this;
}

@Override
public Builder setNodeCount(int nodeCount) {
infoBuilder.setNodeCount(nodeCount);
Expand Down Expand Up @@ -205,6 +218,8 @@ static Instance fromProto(
.setInstanceConfigId(InstanceConfigId.of(proto.getConfig()))
.setDisplayName(proto.getDisplayName())
.setNodeCount(proto.getNodeCount())
.setCreateTime(Timestamp.fromProto(proto.getCreateTime()))
.setUpdateTime(Timestamp.fromProto(proto.getUpdateTime()))
.setProcessingUnits(proto.getProcessingUnits());
State state;
switch (proto.getState()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.base.Preconditions.checkNotNull;

import com.google.cloud.FieldSelector;
import com.google.cloud.Timestamp;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableMap;
import com.google.protobuf.FieldMask;
Expand Down Expand Up @@ -77,6 +78,14 @@ public abstract static class Builder {

public abstract Builder setDisplayName(String displayName);

Builder setUpdateTime(Timestamp updateTime) {
throw new UnsupportedOperationException("Unimplemented");
}

Builder setCreateTime(Timestamp createTime) {
throw new UnsupportedOperationException("Unimplemented");
}

/**
* Sets the number of nodes for the instance. Exactly one of processing units or node count must
* be set when creating a new instance.
Expand Down Expand Up @@ -110,6 +119,8 @@ static class BuilderImpl extends Builder {
private int processingUnits;
private State state;
private Map<String, String> labels;
private Timestamp updateTime;
private Timestamp createTime;

BuilderImpl(InstanceId id) {
this.id = id;
Expand All @@ -124,6 +135,8 @@ static class BuilderImpl extends Builder {
this.processingUnits = instance.processingUnits;
this.state = instance.state;
this.labels = new HashMap<>(instance.labels);
this.updateTime = instance.updateTime;
this.createTime = instance.createTime;
}

@Override
Expand All @@ -138,6 +151,18 @@ public BuilderImpl setDisplayName(String displayName) {
return this;
}

@Override
Builder setUpdateTime(Timestamp updateTime) {
this.updateTime = updateTime;
return this;
}

@Override
Builder setCreateTime(Timestamp createTime) {
this.createTime = createTime;
return this;
}

@Override
public BuilderImpl setNodeCount(int nodeCount) {
this.nodeCount = nodeCount;
Expand Down Expand Up @@ -181,6 +206,8 @@ public InstanceInfo build() {
private final int processingUnits;
private final State state;
private final ImmutableMap<String, String> labels;
private final Timestamp updateTime;
private final Timestamp createTime;

InstanceInfo(BuilderImpl builder) {
this.id = builder.id;
Expand All @@ -190,6 +217,8 @@ public InstanceInfo build() {
this.processingUnits = builder.processingUnits;
this.state = builder.state;
this.labels = ImmutableMap.copyOf(builder.labels);
this.updateTime = builder.updateTime;
this.createTime = builder.createTime;
}

/** Returns the identifier of the instance. */
Expand All @@ -207,6 +236,14 @@ public String getDisplayName() {
return displayName;
}

public Timestamp getUpdateTime() {
return updateTime;
}

public Timestamp getCreateTime() {
return createTime;
}

/** Returns the node count of the instance. */
public int getNodeCount() {
return nodeCount;
Expand Down Expand Up @@ -241,6 +278,8 @@ public String toString() {
.add("processingUnits", processingUnits)
.add("state", state)
.add("labels", labels)
.add("createTime", createTime)
.add("updateTime", updateTime)
.toString();
}

Expand All @@ -259,12 +298,23 @@ public boolean equals(Object o) {
&& nodeCount == that.nodeCount
&& processingUnits == that.processingUnits
&& state == that.state
&& Objects.equals(labels, that.labels);
&& Objects.equals(labels, that.labels)
&& Objects.equals(updateTime, that.updateTime)
&& Objects.equals(createTime, that.createTime);
}

@Override
public int hashCode() {
return Objects.hash(id, configId, displayName, nodeCount, processingUnits, state, labels);
return Objects.hash(
id,
configId,
displayName,
nodeCount,
processingUnits,
state,
labels,
updateTime,
createTime);
}

com.google.spanner.admin.instance.v1.Instance toProto() {
Expand Down

0 comments on commit 62e124e

Please sign in to comment.