m-trieu commented on code in PR #30995: URL: https://github.com/apache/beam/pull/30995#discussion_r1579744865
########## sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java: ########## @@ -2075,6 +2078,8 @@ static ReadChangeStream create() { abstract @Nullable Boolean getCreateOrUpdateMetadataTable(); + abstract @Nullable Duration getBacklogReplicationAdjustment(); Review Comment: Can this be Optional<Duration> autovalue should support this ########## sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/changestreams/dofn/ReadChangeStreamPartitionDoFn.java: ########## @@ -63,15 +64,32 @@ public class ReadChangeStreamPartitionDoFn private final DaoFactory daoFactory; private final ChangeStreamMetrics metrics; private final ActionFactory actionFactory; + private final Duration backlogReplicationAdjustment; private SizeEstimator<KV<ByteString, ChangeStreamRecord>> sizeEstimator; private ReadChangeStreamPartitionAction readChangeStreamPartitionAction; + private final JodaClock clock; Review Comment: See comment above about using Supplier ########## sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/changestreams/dofn/JodaClock.java: ########## @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * 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, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.beam.sdk.io.gcp.bigtable.changestreams.dofn; + +import java.io.Serializable; +import org.joda.time.Instant; + +/** Simple clock interface to get an instant in a test friendly way. */ +interface JodaClock extends Serializable { Review Comment: How about SerializableSupplier with type parameter It can just extend Java Supplier interface I.e ''' @FunctionalInterface interface SerializableSupplier<T> extends Supplier<T> ''' Then instead of taking JodaClock as a parameter you can just take 'SerializableSupplier<Instant> clock' -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org