diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 31923bd133..090264303f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:ff1a5832623e1b694203b89253dbfe4c2d4a33aae1baf60d323b1245672331eb + digest: sha256:5ee35ee919254a3d1e7d4f8abbf1b8c8869ade317ceb2e4df709af1b4b3e9ca1 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..c8f413b0da --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + open-pull-requests-limit: 0 + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + open-pull-requests-limit: 0 \ No newline at end of file diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 4895c9631f..cfadd22ce9 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -97,33 +97,28 @@ colorlog==6.7.0 \ --hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \ --hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5 # via gcp-docuploader -cryptography==38.0.3 \ - --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ - --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ - --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ - --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ - --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ - --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ - --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ - --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ - --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ - --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ - --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ - --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ - --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ - --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ - --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ - --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ - --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ - --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ - --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ - --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ - --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ - --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ - --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ - --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ - --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ - --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 +cryptography==39.0.1 \ + --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ + --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ + --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ + --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ + --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ + --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ + --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ + --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ + --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ + --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ + --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ + --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ + --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ + --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ + --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ + --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ + --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ + --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ + --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ + --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ + --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 # via # gcp-releasetool # secretstorage @@ -379,10 +374,6 @@ secretstorage==3.3.3 \ --hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \ --hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99 # via keyring -setuptools==65.6.3 \ - --hash=sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54 \ - --hash=sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75 - # via -r requirements.in six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 diff --git a/CHANGELOG.md b/CHANGELOG.md index 432ff418c8..bf8f7438f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.19.1](https://github.com/googleapis/java-bigtable/compare/v2.19.0...v2.19.1) (2023-02-16) + + +### Bug Fixes + +* Change the return type of Heartbeat::getEstimatedLowWatermark to long ([#1631](https://github.com/googleapis/java-bigtable/issues/1631)) ([a101494](https://github.com/googleapis/java-bigtable/commit/a101494909226114fd951c94348878bf38453793)) +* Fix connectivity error count calculation ([#1632](https://github.com/googleapis/java-bigtable/issues/1632)) ([0803785](https://github.com/googleapis/java-bigtable/commit/0803785694874001a6ffbfe3245e84a23cb905ae)) +* **test:** Fix flaky test ([#1633](https://github.com/googleapis/java-bigtable/issues/1633)) ([fc29cd3](https://github.com/googleapis/java-bigtable/commit/fc29cd35101fd6a6262aea8648bc06bd20ce3d10)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#1626](https://github.com/googleapis/java-bigtable/issues/1626)) ([0865023](https://github.com/googleapis/java-bigtable/commit/08650238a806367c94072b51029010272c966148)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#1627](https://github.com/googleapis/java-bigtable/issues/1627)) ([782e81f](https://github.com/googleapis/java-bigtable/commit/782e81f6e64c1d8015fddf2219d590c77217584d)) + ## [2.19.0](https://github.com/googleapis/java-bigtable/compare/v2.18.4...v2.19.0) (2023-02-10) diff --git a/README.md b/README.md index 52d6496fa9..9d40fee296 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: com.google.cloud libraries-bom - 26.6.0 + 26.8.0 pom import @@ -41,7 +41,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-bigtable - 2.18.4 + 2.19.0 ``` @@ -49,20 +49,20 @@ If you are using Maven without BOM, 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:26.7.0') +implementation platform('com.google.cloud:libraries-bom:26.8.0') 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.18.4' +implementation 'com.google.cloud:google-cloud-bigtable:2.19.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.18.4" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.19.0" ``` ## Authentication diff --git a/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index 4b44947a5f..4430a17979 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom com.google.cloud @@ -63,42 +63,42 @@ com.google.cloud google-cloud-bigtable - 2.19.0 + 2.19.1 com.google.cloud google-cloud-bigtable-emulator - 0.156.0 + 0.156.1 com.google.cloud google-cloud-bigtable-emulator-core - 0.156.0 + 0.156.1 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 com.google.cloud google-cloud-bigtable-stats - 2.19.0 + 2.19.1 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index c399e91f0f..e2228f0122 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml index b58fbe9431..cae1c193c3 100644 --- a/google-cloud-bigtable-emulator-core/pom.xml +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -7,11 +7,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.19.0 + 2.19.1 google-cloud-bigtable-emulator-core - 0.156.0 + 0.156.1 A Java wrapper for the Cloud Bigtable emulator. diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index f86c2212c9..16c27613b7 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.156.0 + 0.156.1 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 scm:git:git@github.com:googleapis/java-bigtable.git @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import @@ -99,7 +99,7 @@ com.google.cloud google-cloud-bigtable-emulator-core - 0.156.0 + 0.156.1 diff --git a/google-cloud-bigtable-stats/pom.xml b/google-cloud-bigtable-stats/pom.xml index ee96b4c204..1adeddbe74 100644 --- a/google-cloud-bigtable-stats/pom.xml +++ b/google-cloud-bigtable-stats/pom.xml @@ -5,7 +5,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 4.0.0 @@ -13,7 +13,7 @@ through Stackdriver. Built-in metrics will be implemented with shaded OpenCensus so it won't interfere with customer's application metrics. --> google-cloud-bigtable-stats - 2.19.0 + 2.19.1 Experimental project to shade OpenCensus dependencies. @@ -21,7 +21,7 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index 5e5f8c9733..807562164d 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -86,4 +86,11 @@ com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver com/google/api/gax/rpc/StateCheckingResponseObserver + + + 7006 + com/google/cloud/bigtable/data/v2/models/Heartbeat + *getEstimatedLowWatermark* + long + diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index 4e4b83c4e9..4c68901cde 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.19.0 + 2.19.1 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 - 2.19.0 + 2.19.1 google-cloud-bigtable @@ -49,14 +49,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 99a889652f..6bba41a172 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -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.19.0"; + public static String VERSION = "2.19.1"; // {x-version-update-end} } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java index 2e2b40b327..cfd45c1ae9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java @@ -18,7 +18,7 @@ import com.google.api.core.InternalApi; import com.google.auto.value.AutoValue; import com.google.bigtable.v2.ReadChangeStreamResponse; -import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; import java.io.Serializable; import javax.annotation.Nonnull; @@ -29,8 +29,7 @@ public abstract class Heartbeat implements ChangeStreamRecord, Serializable { private static final long serialVersionUID = 7316215828353608504L; private static Heartbeat create( - ChangeStreamContinuationToken changeStreamContinuationToken, - Timestamp estimatedLowWatermark) { + ChangeStreamContinuationToken changeStreamContinuationToken, long estimatedLowWatermark) { return new AutoValue_Heartbeat(changeStreamContinuationToken, estimatedLowWatermark); } @@ -38,12 +37,12 @@ private static Heartbeat create( static Heartbeat fromProto(@Nonnull ReadChangeStreamResponse.Heartbeat heartbeat) { return create( ChangeStreamContinuationToken.fromProto(heartbeat.getContinuationToken()), - heartbeat.getEstimatedLowWatermark()); + Timestamps.toNanos(heartbeat.getEstimatedLowWatermark())); } @InternalApi("Intended for use by the BigtableIO in apache/beam only.") public abstract ChangeStreamContinuationToken getChangeStreamContinuationToken(); @InternalApi("Intended for use by the BigtableIO in apache/beam only.") - public abstract Timestamp getEstimatedLowWatermark(); + public abstract long getEstimatedLowWatermark(); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java index d1b6a4b53e..cb3791360a 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java @@ -71,9 +71,6 @@ class BuiltinMetricsTracer extends BigtableTracer { private String zone = "global"; private String cluster = "unspecified"; - // gfe stats - private AtomicLong gfeMissingHeaders = new AtomicLong(0); - @VisibleForTesting BuiltinMetricsTracer( OperationType operationType, SpanName spanName, StatsRecorderWrapper recorder) { @@ -208,10 +205,10 @@ public void recordGfeMetadata(@Nullable Long latency, @Nullable Throwable throwa // zone information if (latency != null) { recorder.putGfeLatencies(latency); + recorder.putGfeMissingHeaders(0); } else { - gfeMissingHeaders.incrementAndGet(); + recorder.putGfeMissingHeaders(1); } - recorder.putGfeMissingHeaders(gfeMissingHeaders.get()); } @Override diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java index 2637352bd8..08dc275b1e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java @@ -24,6 +24,7 @@ import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; import com.google.protobuf.ByteString; import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; import com.google.rpc.Status; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -119,7 +120,8 @@ public void heartbeatTest() { .build(); Heartbeat actualHeartbeat = Heartbeat.fromProto(heartbeatProto); - assertThat(actualHeartbeat.getEstimatedLowWatermark()).isEqualTo(lowWatermark); + assertThat(actualHeartbeat.getEstimatedLowWatermark()) + .isEqualTo(Timestamps.toNanos(lowWatermark)); assertThat(actualHeartbeat.getChangeStreamContinuationToken().getPartition()) .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); assertThat(actualHeartbeat.getChangeStreamContinuationToken().getToken()).isEqualTo(token); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java index 17849c9250..70ff23a439 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java @@ -32,6 +32,7 @@ import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; import com.google.protobuf.ByteString; import com.google.protobuf.Timestamp; +import com.google.protobuf.util.Timestamps; import com.google.rpc.Status; import java.util.Collections; import java.util.List; @@ -80,7 +81,7 @@ public void heartbeatTest() { assertThat(heartbeat.getChangeStreamContinuationToken().getToken()) .isEqualTo(heartbeatProto.getContinuationToken().getToken()); assertThat(heartbeat.getEstimatedLowWatermark()) - .isEqualTo(heartbeatProto.getEstimatedLowWatermark()); + .isEqualTo(Timestamps.toNanos(heartbeatProto.getEstimatedLowWatermark())); } @Test diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java index b745d7ef2d..afc35959e4 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java @@ -141,7 +141,8 @@ public void test() throws Exception { .build()) .setToken(heartbeat.getChangeStreamContinuationToken().getToken()) .build()) - .setEstimatedLowWatermark(heartbeat.getEstimatedLowWatermark()) + .setEstimatedLowWatermark( + Timestamps.fromNanos(heartbeat.getEstimatedLowWatermark())) .build(); actualResults.add( ReadChangeStreamTest.Result.newBuilder() diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java index a2c6d417b3..4d7903dd27 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java @@ -244,7 +244,7 @@ public void testGfeMetrics() { // The first time the request was retried, it'll increment missing header counter verify(statsRecorderWrapper, times(fakeService.getAttemptCounter().get())) .putGfeMissingHeaders(gfeMissingHeaders.capture()); - assertThat(gfeMissingHeaders.getValue()).isEqualTo(1); + assertThat(gfeMissingHeaders.getAllValues()).containsExactly(1L, 0L); assertThat(status.getAllValues()).containsExactly("UNAVAILABLE", "OK"); assertThat(tableId.getAllValues()).containsExactly(TABLE_ID, TABLE_ID); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java index 0f9ad21fa0..8a8c6d7709 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java @@ -34,7 +34,6 @@ import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.common.collect.Lists; -import com.google.common.collect.Queues; import com.google.common.collect.Range; import com.google.common.truth.Truth; import com.google.protobuf.ByteString; @@ -48,6 +47,7 @@ import java.io.IOException; import java.util.List; import java.util.Queue; +import java.util.concurrent.LinkedBlockingDeque; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -300,7 +300,7 @@ private List getResults(Query query) { } private static class TestBigtableService extends BigtableGrpc.BigtableImplBase { - Queue expectations = Queues.newArrayDeque(); + Queue expectations = new LinkedBlockingDeque<>(); int i = -1; @Override diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index bc56f62658..95a87d6af3 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 60a9c4f2ef..e07cdd7639 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import diff --git a/pom.xml b/pom.xml index 8cd1455fbf..e25c83c964 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.19.0 + 2.19.1 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -153,27 +153,27 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 com.google.cloud google-cloud-bigtable - 2.19.0 + 2.19.1 diff --git a/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 30d02562e3..2184cb186a 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.19.0 + 2.19.1 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import diff --git a/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index c81b15f807..82c334af22 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.19.0 + 2.19.1 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.19.0 + 2.19.1 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.19.0 + 2.19.1 pom import com.google.cloud google-cloud-bigtable-bom - 2.19.0 + 2.19.1 pom import diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index d1c45e7ab7..176040b1c7 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigtable - 2.18.4 + 2.19.0 diff --git a/samples/native-image-sample/pom.xml b/samples/native-image-sample/pom.xml index b141ee118d..1f8ff485ac 100644 --- a/samples/native-image-sample/pom.xml +++ b/samples/native-image-sample/pom.xml @@ -29,7 +29,7 @@ com.google.cloud libraries-bom - 26.6.0 + 26.8.0 pom import @@ -89,7 +89,7 @@ org.graalvm.buildtools junit-platform-native - 0.9.19 + 0.9.20 test @@ -99,7 +99,7 @@ org.graalvm.buildtools native-maven-plugin - 0.9.19 + 0.9.20 true com.example.bigtable.NativeImageBigtableSample diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e2583833ab..c554da70c9 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.19.0 + 2.19.1 diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index 9c85d84b33..f58844f347 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -30,7 +30,7 @@ com.google.cloud libraries-bom - 26.6.0 + 26.8.0 pom import diff --git a/test-proxy/README.md b/test-proxy/README.md index 287c3a0f13..be9906138e 100644 --- a/test-proxy/README.md +++ b/test-proxy/README.md @@ -24,13 +24,13 @@ mvn clean install Start the proxy on default port 9999 ``` -java -jar target/google-cloud-bigtable-test-proxy-.jar +java -jar target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar ``` Start the proxy on a different port ``` -java -Dport=1 -jar target/google-cloud-bigtable-test-proxy-.jar +java -Dport=1 -jar target/google-cloud-bigtable-test-proxy-0.0.1-SNAPSHOT.jar ``` ## Run the test cases diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml index 1a7680563b..98c710f83f 100644 --- a/test-proxy/pom.xml +++ b/test-proxy/pom.xml @@ -12,11 +12,11 @@ google-cloud-bigtable-parent com.google.cloud - 2.19.0 + 2.19.1 - 2.19.0 + 2.19.1 diff --git a/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java index 54d02a7018..c668ca5e30 100644 --- a/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java +++ b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java @@ -217,6 +217,8 @@ public synchronized void createClient( BigtableDataSettings.Builder settingsBuilder = BigtableDataSettings.newBuilder() + // disable channel refreshing when creating an emulator + .setRefreshingChannel(false) .setProjectId(request.getProjectId()) .setInstanceId(request.getInstanceId()) .setAppProfileId(request.getAppProfileId()); diff --git a/test-proxy/src/main/proto/v2_test_proxy.proto b/test-proxy/src/main/proto/test_proxy.proto similarity index 68% rename from test-proxy/src/main/proto/v2_test_proxy.proto rename to test-proxy/src/main/proto/test_proxy.proto index 43b540c463..432e49a1e5 100644 --- a/test-proxy/src/main/proto/v2_test_proxy.proto +++ b/test-proxy/src/main/proto/test_proxy.proto @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// https://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -14,152 +14,192 @@ syntax = "proto3"; -package bigtable.client.test; +package google.bigtable.testproxy; +import "google/api/client.proto"; import "google/bigtable/v2/bigtable.proto"; import "google/bigtable/v2/data.proto"; import "google/protobuf/duration.proto"; import "google/rpc/status.proto"; +option go_package = "./testproxypb"; option java_multiple_files = true; option java_package = "com.google.cloud.bigtable.testproxy"; -option go_package = "./testproxypb"; - -// The `status` field of response messages always represents an error returned -// by the client binding, e.g. never a problem in either the proxy logic or -// test driver to proxy communication. After receiving a response from the -// proxy, the test driver should always check its `status` field. -// -// [test driver] <--> [test proxy <--> client binding] <--> [Cloud Bigtable] -// ^^^^ -// `status` represents success or errors -// returned from the client binding. -// -// Status propagation design examples, assuming the C++ client: -// -// // For CloudBigtableV2TestProxy.ReadRow -// StatusOr> result = table.ReadRow(row_key, filter); -// -// Set RowResult.status to OK iff result.status() is OK. -// OK is required even if the bool is false, indicating the row wasn't found. -// -// // For CloudBigtableV2TestProxy.BulkMutateRows -// std::vector failed = table.BulkApply(bulk_mutation); -// -// The semantics are less obvious for BulkApply(), because some mutations -// failing doesn't indicate the overall RPC fails. In such case, test proxy -// should disambiguate between RPC failure and individual entry failure, and -// set MutateRowsResult.status according to the overall RPC status. -// -// The final decision regarding semantics must be documented for the -// CloudBigtableV2TestProxy service in this file. +// Request to test proxy service to create a client object. message CreateClientRequest { + // A unique ID associated with the client object to be created. string client_id = 1; + // The "host:port" address of the data API endpoint (i.e. the backend being // proxied to). Example: 127.0.0.1:38543. If you want to connect to a local // emulator via BIGTABLE_EMULATOR_HOST environment variable, you can use // "emulator" instead of "host:port" for this field. string data_target = 2; + // The project for all calls on this client. string project_id = 3; + // The instance for all calls on this client. string instance_id = 4; + // Optional app profile for all calls on this client. // Some client bindings allow specifying the app profile on a per-operation // basis. We don't yet support this in the proxy API, but may in the future. string app_profile_id = 5; + // If provided, a custom timeout will be set for each API call conducted by // the created client. Otherwise, the default timeout from the client library // will be used. Note that the override applies to all the methods. google.protobuf.Duration per_operation_timeout = 6; } +// Response from test proxy service for CreateClientRequest. message CreateClientResponse {} +// Request to test proxy service to close a client object. message CloseClientRequest { + // The ID of the target client object. string client_id = 1; } +// Response from test proxy service for CloseClientRequest. message CloseClientResponse {} +// Request to test proxy service to remove a client object. message RemoveClientRequest { + // The ID of the target client object. string client_id = 1; } +// Response from test proxy service for RemoveClientRequest. message RemoveClientResponse {} +// Request to test proxy service to read a row. message ReadRowRequest { + // The ID of the target client object. string client_id = 1; + // The unique name of the table from which to read the row. // Values are of the form // `projects//instances//tables/`. string table_name = 4; + + // The row key of the target row. string row_key = 2; + + // The row filter to be applied to the target row. google.bigtable.v2.RowFilter filter = 3; } +// Response from test proxy service for ReadRowRequest or +// ReadModifyWriteRowRequest. message RowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The contents of a single row. google.bigtable.v2.Row row = 2; } +// Request to test proxy service to read rows. message ReadRowsRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.ReadRowsRequest request = 2; + // The streaming read can be canceled before all items are seen. // Has no effect if non-positive. int32 cancel_after_rows = 3; } +// Response from test proxy service for ReadRowsRequest. message RowsResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The contents of rows. repeated google.bigtable.v2.Row row = 2; } +// Request to test proxy service to mutate a row. message MutateRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.MutateRowRequest request = 2; } +// Response from test proxy service for MutateRowRequest. message MutateRowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; } +// Request to test proxy service to mutate rows. message MutateRowsRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.MutateRowsRequest request = 2; } +// Response from test proxy service for MutateRowsRequest. message MutateRowsResult { - // Overall RPC status + // The RPC status from the client binding, corresponding to the + // whole operation. google.rpc.Status status = 1; - // To record individual entry failures + + // The results corresponding to the failed rows. repeated google.bigtable.v2.MutateRowsResponse.Entry entry = 2; } +// Request to test proxy service to check and mutate a row. message CheckAndMutateRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.CheckAndMutateRowRequest request = 2; } +// Response from test proxy service for CheckAndMutateRowRequest. message CheckAndMutateRowResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The raw response from the Bigtable server. google.bigtable.v2.CheckAndMutateRowResponse result = 2; } +// Request to test proxy service to sample row keys. message SampleRowKeysRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.SampleRowKeysRequest request = 2; } +// Response from test proxy service for SampleRowKeysRequest. message SampleRowKeysResult { + // The RPC status from the client binding. google.rpc.Status status = 1; + + // The raw responses from the Bigtable server. repeated google.bigtable.v2.SampleRowKeysResponse sample = 2; } +// Request to test proxy service to read modify write a row. message ReadModifyWriteRowRequest { + // The ID of the target client object. string client_id = 1; + + // The raw request to the Bigtable server. google.bigtable.v2.ReadModifyWriteRowRequest request = 2; } @@ -180,17 +220,22 @@ message ReadModifyWriteRowRequest { // understand that the underlying operation will continue to be executed even // after the deadline expires. service CloudBigtableV2TestProxy { + option (google.api.default_host) = + "bigtable-test-proxy-not-accessible.googleapis.com"; + // Client management: // // Creates a client in the proxy. // Each client has its own dedicated channel(s), and can be used concurrently // and independently with other clients. - rpc CreateClient(CreateClientRequest) returns (CreateClientResponse); + rpc CreateClient(CreateClientRequest) returns (CreateClientResponse) {} + // Closes a client in the proxy, making it not accept new requests. - rpc CloseClient(CloseClientRequest) returns (CloseClientResponse); + rpc CloseClient(CloseClientRequest) returns (CloseClientResponse) {} + // Removes a client in the proxy, making it inaccessible. Client closing // should be done by CloseClient() separately. - rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse); + rpc RemoveClient(RemoveClientRequest) returns (RemoveClientResponse) {} // Bigtable operations: for each operation, you should use the synchronous or // asynchronous variant of the client method based on the `use_async_method` @@ -200,24 +245,24 @@ service CloudBigtableV2TestProxy { // Reads a row with the client instance. // The result row may not be present in the response. // Callers should check for it (e.g. calling has_row() in C++). - rpc ReadRow(ReadRowRequest) returns (RowResult); + rpc ReadRow(ReadRowRequest) returns (RowResult) {} // Reads rows with the client instance. - rpc ReadRows(ReadRowsRequest) returns (RowsResult); + rpc ReadRows(ReadRowsRequest) returns (RowsResult) {} // Writes a row with the client instance. - rpc MutateRow(MutateRowRequest) returns (MutateRowResult); + rpc MutateRow(MutateRowRequest) returns (MutateRowResult) {} // Writes multiple rows with the client instance. - rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult); + rpc BulkMutateRows(MutateRowsRequest) returns (MutateRowsResult) {} // Performs a check-and-mutate-row operation with the client instance. rpc CheckAndMutateRow(CheckAndMutateRowRequest) - returns (CheckAndMutateRowResult); + returns (CheckAndMutateRowResult) {} // Obtains a row key sampling with the client instance. - rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult); + rpc SampleRowKeys(SampleRowKeysRequest) returns (SampleRowKeysResult) {} // Performs a read-modify-write operation with the client. - rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult); + rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) returns (RowResult) {} } diff --git a/versions.txt b/versions.txt index 75bb0406be..ca60d29965 100644 --- a/versions.txt +++ b/versions.txt @@ -1,10 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.19.0:2.19.0 -grpc-google-cloud-bigtable-admin-v2:2.19.0:2.19.0 -grpc-google-cloud-bigtable-v2:2.19.0:2.19.0 -proto-google-cloud-bigtable-admin-v2:2.19.0:2.19.0 -proto-google-cloud-bigtable-v2:2.19.0:2.19.0 -google-cloud-bigtable-emulator:0.156.0:0.156.0 -google-cloud-bigtable-emulator-core:2.19.0:2.19.0 +google-cloud-bigtable:2.19.1:2.19.1 +grpc-google-cloud-bigtable-admin-v2:2.19.1:2.19.1 +grpc-google-cloud-bigtable-v2:2.19.1:2.19.1 +proto-google-cloud-bigtable-admin-v2:2.19.1:2.19.1 +proto-google-cloud-bigtable-v2:2.19.1:2.19.1 +google-cloud-bigtable-emulator:0.156.1:0.156.1 +google-cloud-bigtable-emulator-core:2.19.1:2.19.1