Skip to content

Releases: SpineEventEngine/gcloud-java

1.9.1

27 Sep 16:23
43e6946
Compare
Choose a tag to compare

This is a minor release of Spine's Google Cloud library in 1.x family, which, however, brings a minor breaking change into API.

Custom column mappings via DsColumnMapping

In particular, it is now possible to override the default mappings provided by DsColumnMapping. Previously, SPI users could only extend DsColumnMapping's behavior by overriding this method:

protected void setupCustomMapping(
            ImmutableMap.Builder<Class<?>, ColumnTypeMapping<?, ? extends Value<?>>> builder);

It was good enough if one wanted to append their mapping rules. But such an approach did not allow to re-define the existing (framework-default) mapping — since a builder of ImmutableMap was passed, preventing from having duplicate keys.

This method is now made final, effectively closing it as an extension point.

Now, the API for SPI users implies overriding another method:

@SPI
protected ImmutableMap<Class<?>, ColumnTypeMapping<?, ? extends Value<?>>> customMapping()

This one allows to return an immutable map of mappings, combining them into the final result, giving priority to those values which were provided by SPI users.

Please see the documentation for DsColumnMapping for more details.

How to use it

Referring to the original issue, end-users may configure how Timestamp.getDefaultValue() is stored for some column. In the example below, a Datastore-specific null is written for such values to the corresponding property of respective Datastore Entity:

/**
 * A mapping similar to the default one,
 * but telling to store {@link Timestamp}s as {@code null}s.
 */
public final class CustomMapping extends DsColumnMapping {

    @Override
    protected ImmutableMap<Class<?>, ColumnTypeMapping<?, ? extends Value<?>>> customMapping() {
        return ImmutableMap.of(Timestamp.class, ofNullableTimestamp());
    }

    @SuppressWarnings("UnnecessaryLambda" /* For brevity */)
    private static ColumnTypeMapping<Timestamp, Value<?>> ofNullableTimestamp() {
        return timestamp -> {
            if (timestamp.equals(Timestamp.getDefaultInstance())) {
                return NullValue.of();
            }
            return TimestampValue.of(
                    ofTimeSecondsAndNanos(timestamp.getSeconds(), timestamp.getNanos())
            );
        };
    }
}

See #186 for more detail on the change.

1.9.0

20 May 14:45
4f56de1
Compare
Choose a tag to compare

This is a part of Spine 1.9.0 release.

Here is a list of updates:

  • Support of the shard pick-up result distinguishing introduced in core-java (#181). See core-java#1505 for more detail.

  • Updates of third-party dependencies:

    • Cloud Datastore is now 2.14.2,
    • Cloud Pub/Sub is used at 1.105.8,
    • Cloud Trace version becomes 2.14.0.

1.8.2

29 Jun 11:38
e09443c
Compare
Choose a tag to compare

This is a part of Spine release in version 1.8.2.

With this update, gcloud-java modules now support the changes recently introduced in core-java.

Also, the versions of Google Cloud client libraries were updated:

  • Cloud Datastore version is set to 2.8.0;
  • Cloud Pubsub V1 version is set to 1.101.1;
  • Cloud Trace version is set to 2.2.0.

1.8.0

16 Dec 17:43
2a6e934
Compare
Choose a tag to compare

This is another public release of Spine libraries which streamline the development of apps running under GCP.

It supports all the features recently introduced in the corresponding core-java:1.8.0 release.

Migration

In order to support the API change introduced in core-java#1433, the datastore library updates the storage schema. Instead of the ShardSessionRecord.node field, ShardSessionRecord.worker field is now used.

ShardSessionRecords are short-lived by their nature, so the simplest migration strategy would be to pause or stop the application instances, drop all remaining ShardSessionRecords and migrate the traffic to the updated version of the application.

Special attention should be paid to the Datastore indexes, which previously could be created in the applications built on top of Spine datastore library. In case ShardSessionRecord.node was included into any indexes, it might be a good idea to include ShardSessionRecord.worker field instead.

1.7.0

15 Dec 13:47
044aa16
Compare
Choose a tag to compare

A public release of GCP-related Spine libraries.

Infrastructure

The libraries now do not use implementation for compile-only annotations like errorprone annotations but use the newly introduced compileOnlyApi configuration for such dependencies (see #158).

Dependency upgrades

  • Cloud Datastore: 1.102.2 -> 1.105.3
  • Cloud Pub/Sub protos: 1.89.0 -> 1.92.1
  • Cloud Trace: 0.109.3-beta -> 1.2.8

Compare v1.6.0 and v1.7.0.

1.6.0

09 Sep 19:39
1c71f67
Compare
Choose a tag to compare

A public release of Datastore-related Spine libraries.

Notable changes

  1. The definition of Pub/Sub push request message is added [#150].
    
It can be used for endpoints that are used with Pub/Sub push subscriptions in order to easily transform incoming JSON data into a respective Protobuf definitions.

  2. The project build scripts are migrated to Kotlin [#148].

1.5.0

09 Mar 13:59
50dcc5f
Compare
Choose a tag to compare

This release brings the support of the latest features introduced in the framework.

Please see the release notes of core-java for the details.

1.3.0

17 Dec 23:01
f47d4f7
Compare
Choose a tag to compare

A public release of the Datastore-related Spine libraries.

1.2.0

08 Nov 17:29
e300228
Compare
Choose a tag to compare

This release brings a couple of API improvements to the library.

Notable changes:

  • A new API for Datastore transactions is introduced, making them thread-safe (#132).
  • All Datastore-related test utilities are moved to a separate testutil-gcloud module (#131).

1.0.0

05 Aug 15:39
0a388b8
Compare
Choose a tag to compare

This is the first public release of Spine libraries supporting the Google Cloud.