diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java index 1defc67c5e..339cb68a8f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java @@ -15,11 +15,7 @@ */ package com.google.cloud.bigtable.data.v2.models; -import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeInstant; -import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; - import com.google.api.core.InternalApi; -import com.google.api.core.ObsoleteApi; import com.google.auto.value.AutoValue; import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange; import com.google.cloud.bigtable.data.v2.stub.changestream.ChangeStreamRecordMerger; @@ -82,7 +78,7 @@ static Builder createUserMutation( .setRowKey(rowKey) .setType(MutationType.USER) .setSourceClusterId(sourceClusterId) - .setCommitTime(commitTimestamp) + .setCommitTimestamp(commitTimestamp) .setTieBreaker(tieBreaker); } @@ -97,7 +93,7 @@ static Builder createGcMutation( .setRowKey(rowKey) .setType(MutationType.GARBAGE_COLLECTION) .setSourceClusterId("") - .setCommitTime(commitTimestamp) + .setCommitTimestamp(commitTimestamp) .setTieBreaker(tieBreaker); } @@ -113,14 +109,7 @@ static Builder createGcMutation( @Nonnull public abstract String getSourceClusterId(); - /** This method is obsolete. Use {@link #getCommitTime()} instead. */ - @ObsoleteApi("Use getCommitTime() instead") - public abstract org.threeten.bp.Instant getCommitTimestamp(); - - /** Get the commit timestamp of the current mutation. */ - public java.time.Instant getCommitTime() { - return toJavaTimeInstant(getCommitTimestamp()); - } + public abstract java.time.Instant getCommitTimestamp(); /** * Get the tie breaker of the current mutation. This is used to resolve conflicts when multiple @@ -132,14 +121,8 @@ public java.time.Instant getCommitTime() { @Nonnull public abstract String getToken(); - /** This method is obsolete. Use {@link #getEstimatedLowWatermarkTime()} instead. */ - @ObsoleteApi("Use getEstimatedLowWatermarkTime() instead") - public abstract org.threeten.bp.Instant getEstimatedLowWatermark(); - /** Get the low watermark of the current mutation. */ - public java.time.Instant getEstimatedLowWatermarkTime() { - return toJavaTimeInstant(getEstimatedLowWatermark()); - } + public abstract java.time.Instant getEstimatedLowWatermark(); /** Get the list of mods of the current mutation. */ @Nonnull @@ -160,13 +143,7 @@ abstract static class Builder { abstract Builder setSourceClusterId(@Nonnull String sourceClusterId); - Builder setCommitTime(java.time.Instant commitTimestamp) { - return setCommitTimestamp(toThreetenInstant(commitTimestamp)); - } - - /** This method is obsolete. Use {@link #setCommitTime(java.time.Instant)} instead. */ - @ObsoleteApi("Use setCommitTime(java.time.Instant) instead") - abstract Builder setCommitTimestamp(org.threeten.bp.Instant commitTimestamp); + abstract Builder setCommitTimestamp(java.time.Instant commitTimestamp); abstract Builder setTieBreaker(int tieBreaker); @@ -174,13 +151,7 @@ Builder setCommitTime(java.time.Instant commitTimestamp) { abstract Builder setToken(@Nonnull String token); - Builder setLowWatermarkTime(java.time.Instant estimatedLowWatermark) { - return setEstimatedLowWatermark(toThreetenInstant(estimatedLowWatermark)); - } - - /** This method is obsolete. Use {@link #setLowWatermarkTime(java.time.Instant)} instead. */ - @ObsoleteApi("Use setEstimatedLowWatermarkInstant(java.time.Instant) instead") - abstract Builder setEstimatedLowWatermark(org.threeten.bp.Instant estimatedLowWatermark); + abstract Builder setEstimatedLowWatermark(java.time.Instant estimatedLowWatermark); Builder setCell( @Nonnull String familyName, diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java index 217caa93f2..56394ad31c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java @@ -177,7 +177,7 @@ public void finishCell() { public ChangeStreamRecord finishChangeStreamMutation( String token, Instant estimatedLowWatermark) { this.changeStreamMutationBuilder.setToken(token); - this.changeStreamMutationBuilder.setLowWatermarkTime(estimatedLowWatermark); + this.changeStreamMutationBuilder.setEstimatedLowWatermark(estimatedLowWatermark); return this.changeStreamMutationBuilder.build(); } 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 0cf792ee1b..9f38b604f8 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 @@ -15,14 +15,11 @@ */ package com.google.cloud.bigtable.data.v2.models; -import static com.google.api.gax.util.TimeConversionUtils.toJavaTimeInstant; -import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; - import com.google.api.core.InternalApi; -import com.google.api.core.ObsoleteApi; import com.google.auto.value.AutoValue; import com.google.bigtable.v2.ReadChangeStreamResponse; import java.io.Serializable; +import java.time.Instant; import javax.annotation.Nonnull; /** A simple wrapper for {@link ReadChangeStreamResponse.Heartbeat}. */ @@ -32,17 +29,15 @@ public abstract class Heartbeat implements ChangeStreamRecord, Serializable { private static final long serialVersionUID = 7316215828353608504L; private static Heartbeat create( - ChangeStreamContinuationToken changeStreamContinuationToken, - java.time.Instant estimatedLowWatermark) { - return new AutoValue_Heartbeat( - changeStreamContinuationToken, toThreetenInstant(estimatedLowWatermark)); + ChangeStreamContinuationToken changeStreamContinuationToken, Instant estimatedLowWatermark) { + return new AutoValue_Heartbeat(changeStreamContinuationToken, estimatedLowWatermark); } /** Wraps the protobuf {@link ReadChangeStreamResponse.Heartbeat}. */ static Heartbeat fromProto(@Nonnull ReadChangeStreamResponse.Heartbeat heartbeat) { return create( ChangeStreamContinuationToken.fromProto(heartbeat.getContinuationToken()), - java.time.Instant.ofEpochSecond( + Instant.ofEpochSecond( heartbeat.getEstimatedLowWatermark().getSeconds(), heartbeat.getEstimatedLowWatermark().getNanos())); } @@ -50,12 +45,6 @@ static Heartbeat fromProto(@Nonnull ReadChangeStreamResponse.Heartbeat heartbeat @InternalApi("Intended for use by the BigtableIO in apache/beam only.") public abstract ChangeStreamContinuationToken getChangeStreamContinuationToken(); - /** This method is obsolete. Use {@link #getEstimatedLowWatermarkInstant()} instead. */ - @ObsoleteApi("Use getEstimatedLowWatermarkInstant() instead") - public abstract org.threeten.bp.Instant getEstimatedLowWatermark(); - @InternalApi("Intended for use by the BigtableIO in apache/beam only.") - public java.time.Instant getEstimatedLowWatermarkInstant() { - return toJavaTimeInstant(getEstimatedLowWatermark()); - } + public abstract Instant getEstimatedLowWatermark(); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java index 966da60c84..05514da9fd 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java @@ -15,7 +15,6 @@ */ package com.google.cloud.bigtable.data.v2.models; -import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; import static com.google.common.truth.Truth.assertThat; import com.google.bigtable.v2.MutateRowRequest; @@ -46,10 +45,6 @@ public class ChangeStreamMutationTest { RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); private static final Instant FAKE_COMMIT_TIMESTAMP = Instant.ofEpochSecond(0, 1000L); private static final Instant FAKE_LOW_WATERMARK = Instant.ofEpochSecond(0, 2000L); - private static final org.threeten.bp.Instant FAKE_COMMIT_TIMESTAMP_THREETEN = - toThreetenInstant(FAKE_COMMIT_TIMESTAMP); - private static final org.threeten.bp.Instant FAKE_LOW_WATERMARK_THREETEN = - toThreetenInstant(FAKE_LOW_WATERMARK); @Test public void userInitiatedMutationTest() throws IOException, ClassNotFoundException { @@ -78,20 +73,18 @@ public void userInitiatedMutationTest() throws IOException, ClassNotFoundExcepti Value.rawTimestamp(1000), Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) .setToken("fake-token") - .setLowWatermarkTime(FAKE_LOW_WATERMARK) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Test the getters. assertThat(changeStreamMutation.getRowKey()).isEqualTo(ByteString.copyFromUtf8("key")); assertThat(changeStreamMutation.getType()).isEqualTo(ChangeStreamMutation.MutationType.USER); assertThat(changeStreamMutation.getSourceClusterId()).isEqualTo("fake-source-cluster-id"); - assertThat(changeStreamMutation.getCommitTime()).isEqualTo(FAKE_COMMIT_TIMESTAMP); - assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP_THREETEN); + assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP); assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); - assertThat(changeStreamMutation.getEstimatedLowWatermarkTime()).isEqualTo(FAKE_LOW_WATERMARK); - assertThat(changeStreamMutation.getEstimatedLowWatermark()) - .isEqualTo(FAKE_LOW_WATERMARK_THREETEN); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); // Test serialization. ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -120,7 +113,7 @@ public void gcMutationTest() throws IOException, ClassNotFoundException { ByteString.copyFromUtf8("fake-qualifier"), Range.TimestampRange.create(1000L, 2000L)) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Test the getters. @@ -128,13 +121,11 @@ public void gcMutationTest() throws IOException, ClassNotFoundException { assertThat(changeStreamMutation.getType()) .isEqualTo(ChangeStreamMutation.MutationType.GARBAGE_COLLECTION); Assert.assertTrue(changeStreamMutation.getSourceClusterId().isEmpty()); - assertThat(changeStreamMutation.getCommitTime()).isEqualTo(FAKE_COMMIT_TIMESTAMP); - assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP_THREETEN); + assertThat(changeStreamMutation.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP); assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); - assertThat(changeStreamMutation.getEstimatedLowWatermarkTime()).isEqualTo(FAKE_LOW_WATERMARK); - assertThat(changeStreamMutation.getEstimatedLowWatermark()) - .isEqualTo(FAKE_LOW_WATERMARK_THREETEN); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); // Test serialization. ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -172,7 +163,7 @@ public void toRowMutationTest() { Value.rawTimestamp(1000), Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Convert it to a rowMutation and construct a MutateRowRequest. @@ -215,7 +206,7 @@ public void toRowMutationWithoutTokenShouldFailTest() { ChangeStreamMutation.createUserMutation( ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) .deleteFamily("fake-family") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN); + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK); Assert.assertThrows(IllegalStateException.class, builder::build); } @@ -255,7 +246,7 @@ public void toRowMutationEntryTest() { Value.rawTimestamp(1000), Value.rawValue(ByteString.copyFrom(Longs.toByteArray(1234L)))) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Convert it to a rowMutationEntry and construct a MutateRowRequest. @@ -295,7 +286,7 @@ public void toRowMutationEntryWithoutTokenShouldFailTest() { ChangeStreamMutation.createUserMutation( ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) .deleteFamily("fake-family") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN); + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK); Assert.assertThrows(IllegalStateException.class, builder::build); } @@ -320,7 +311,7 @@ public void testWithLongValue() { 1000L, ByteString.copyFrom(Longs.toByteArray(1L))) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); RowMutation rowMutation = changeStreamMutation.toRowMutation(TABLE_ID); 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 14697f430e..888a9ee198 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 @@ -129,7 +129,7 @@ public void heartbeatTest() { .build(); Heartbeat actualHeartbeat = Heartbeat.fromProto(heartbeatProto); - assertThat(actualHeartbeat.getEstimatedLowWatermarkInstant()) + assertThat(actualHeartbeat.getEstimatedLowWatermark()) .isEqualTo(Instant.ofEpochSecond(lowWatermark.getSeconds(), lowWatermark.getNanos())); assertThat(actualHeartbeat.getChangeStreamContinuationToken().getPartition()) .isEqualTo(ByteStringRange.create(rowRange.getStartKeyClosed(), rowRange.getEndKeyOpen())); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java index 80b4b15b2f..f6146d794d 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java @@ -15,7 +15,6 @@ */ package com.google.cloud.bigtable.data.v2.models; -import static com.google.api.gax.util.TimeConversionUtils.toThreetenInstant; import static com.google.common.truth.Truth.assertThat; import com.google.bigtable.v2.Mutation; @@ -42,8 +41,6 @@ public class DefaultChangeStreamRecordAdapterTest { private ChangeStreamRecordBuilder changeStreamRecordBuilder; private static final Instant FAKE_COMMIT_TIMESTAMP = Instant.ofEpochSecond(0L, 1000L); private static final Instant FAKE_LOW_WATERMARK = Instant.ofEpochSecond(0L, 2000L); - private static final org.threeten.bp.Instant FAKE_LOW_WATERMARK_THREETEN = - toThreetenInstant(FAKE_LOW_WATERMARK); @Rule public ExpectedException expect = ExpectedException.none(); @@ -62,7 +59,7 @@ public void isHeartbeatTest() { ChangeStreamMutation.createGcMutation( ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) .setToken("token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); Assert.assertTrue(adapter.isHeartbeat(heartbeatRecord)); Assert.assertFalse(adapter.isHeartbeat(closeStreamRecord)); @@ -76,8 +73,8 @@ public void getTokenFromHeartbeatTest() { ReadChangeStreamResponse.Heartbeat.newBuilder() .setEstimatedLowWatermark( Timestamp.newBuilder() - .setSeconds(FAKE_LOW_WATERMARK_THREETEN.getEpochSecond()) - .setNanos(FAKE_LOW_WATERMARK_THREETEN.getNano())) + .setSeconds(FAKE_LOW_WATERMARK.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK.getNano())) .setContinuationToken( StreamContinuationToken.newBuilder().setToken("heartbeat-token").build()) .build()); @@ -102,7 +99,7 @@ public void isChangeStreamMutationTest() { ChangeStreamMutation.createGcMutation( ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) .setToken("token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); Assert.assertFalse(adapter.isChangeStreamMutation(heartbeatRecord)); Assert.assertFalse(adapter.isChangeStreamMutation(closeStreamRecord)); @@ -115,7 +112,7 @@ public void getTokenFromChangeStreamMutationTest() { ChangeStreamMutation.createGcMutation( ByteString.copyFromUtf8("key"), FAKE_COMMIT_TIMESTAMP, 0) .setToken("change-stream-mutation-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); Assert.assertEquals( adapter.getTokenFromChangeStreamMutation(changeStreamMutationRecord), @@ -136,8 +133,8 @@ public void heartbeatTest() { ReadChangeStreamResponse.Heartbeat.newBuilder() .setEstimatedLowWatermark( Timestamp.newBuilder() - .setSeconds(FAKE_LOW_WATERMARK_THREETEN.getEpochSecond()) - .setNanos(FAKE_LOW_WATERMARK_THREETEN.getNano()) + .setSeconds(FAKE_LOW_WATERMARK.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK.getNano()) .build()) .setContinuationToken( StreamContinuationToken.newBuilder().setToken("random-token").build()) @@ -189,7 +186,7 @@ public void singleDeleteFamilyTest() { ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) .deleteFamily("fake-family") .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. @@ -228,7 +225,7 @@ public void singleDeleteCellTest() { ByteString.copyFromUtf8("fake-qualifier"), Range.TimestampRange.create(1000L, 2000L)) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. @@ -261,7 +258,7 @@ public void singleNonChunkedCellTest() { 100L, ByteString.copyFromUtf8("fake-value")) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. @@ -293,7 +290,7 @@ public void singleChunkedCellTest() { 100L, ByteString.copyFromUtf8("fake-value1-value2")) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. @@ -330,7 +327,7 @@ public void multipleChunkedCellsTest() { } expectedChangeStreamMutationBuilder .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN); + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. changeStreamRecordBuilder.startUserMutation( @@ -372,7 +369,7 @@ public void multipleDifferentModsTest() { 100L, ByteString.copyFromUtf8("chunked-value")) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN); + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK); // Create the ChangeStreamMutation through the ChangeStreamRecordBuilder. changeStreamRecordBuilder.startUserMutation( @@ -421,7 +418,7 @@ public void resetTest() { ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0) .deleteFamily("fake-family") .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); changeStreamRecordBuilder.startUserMutation( ByteString.copyFromUtf8("key"), "fake-source-cluster-id", FAKE_COMMIT_TIMESTAMP, 0); @@ -441,7 +438,7 @@ public void resetTest() { 100L, ByteString.copyFromUtf8("fake-value1-value2")) .setToken("fake-token") - .setEstimatedLowWatermark(FAKE_LOW_WATERMARK_THREETEN) + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) .build(); changeStreamRecordBuilder.startUserMutation( 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 58cc09a61a..a966e18831 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 @@ -33,13 +33,13 @@ import com.google.protobuf.ByteString; import com.google.protobuf.Timestamp; import com.google.rpc.Status; +import java.time.Instant; import java.util.Collections; import java.util.List; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Instant; /** * Additional tests in addition to {@link ReadChangeStreamMergingAcceptanceTest}. @@ -85,9 +85,9 @@ public void heartbeatTest() { Instant.ofEpochSecond( heartbeatProto.getEstimatedLowWatermark().getSeconds(), heartbeatProto.getEstimatedLowWatermark().getNanos())); - assertThat(heartbeat.getEstimatedLowWatermarkInstant()) + assertThat(heartbeat.getEstimatedLowWatermark()) .isEqualTo( - java.time.Instant.ofEpochSecond( + Instant.ofEpochSecond( heartbeatProto.getEstimatedLowWatermark().getSeconds(), heartbeatProto.getEstimatedLowWatermark().getNanos())); }