Class AsyncWatermarkCache
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.cache.AsyncWatermarkCache
-
- All Implemented Interfaces:
WatermarkCache
public class AsyncWatermarkCache extends java.lang.Object implements WatermarkCache
Asynchronously compute the earliest partition watermark and stores it in memory. The value will be recomputed periodically, as configured by the refresh rate.On every period, we will call
PartitionMetadataDao#getUnfinishedMinWatermark()to refresh the value.
-
-
Constructor Summary
Constructors Constructor Description AsyncWatermarkCache(PartitionMetadataDao dao, org.joda.time.Duration refreshRate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.cloud.TimestampgetUnfinishedMinWatermark()Fetches the earliest partition watermark from the partition metadata table that is not in aPartitionMetadata.State.FINISHEDstate.
-
-
-
Constructor Detail
-
AsyncWatermarkCache
public AsyncWatermarkCache(PartitionMetadataDao dao, org.joda.time.Duration refreshRate)
-
-
Method Detail
-
getUnfinishedMinWatermark
@Nullable public com.google.cloud.Timestamp getUnfinishedMinWatermark()
Description copied from interface:WatermarkCacheFetches the earliest partition watermark from the partition metadata table that is not in aPartitionMetadata.State.FINISHEDstate.- Specified by:
getUnfinishedMinWatermarkin interfaceWatermarkCache- Returns:
- the earliest partition watermark which is not in a
PartitionMetadata.State.FINISHEDstate.
-
-