Class PartitionMetadata.Builder
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.model.PartitionMetadata.Builder
-
- Enclosing class:
- PartitionMetadata
public static class PartitionMetadata.Builder extends java.lang.ObjectPartition metadata builder for better user experience. Defaults for all fields are nulls.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartitionMetadatabuild()Builds aPartitionMetadatafrom the given fields.PartitionMetadata.BuildersetCreatedAt(com.google.cloud.Timestamp createdAt)Sets the time at which the partition was created.PartitionMetadata.BuildersetEndTimestamp(com.google.cloud.Timestamp endTimestamp)Sets the end time of the partition.PartitionMetadata.BuildersetFinishedAt(com.google.cloud.Timestamp finishedAt)Sets the time at which the partition finished running.PartitionMetadata.BuildersetHeartbeatMillis(long heartbeatMillis)Sets the heartbeat interval in millis.PartitionMetadata.BuildersetParentTokens(java.util.HashSet<java.lang.String> parentTokens)Sets the collection of parent partition identifiers.PartitionMetadata.BuildersetPartitionToken(java.lang.String partitionToken)Sets the unique partition identifier.PartitionMetadata.BuildersetRunningAt(com.google.cloud.Timestamp runningAt)Sets the time at which the partition started running.PartitionMetadata.BuildersetScheduledAt(com.google.cloud.Timestamp scheduledAt)Sets the time at which the partition was scheduled.PartitionMetadata.BuildersetStartTimestamp(com.google.cloud.Timestamp startTimestamp)Sets the start time of the partition.PartitionMetadata.BuildersetState(PartitionMetadata.State state)Sets the current state of the partition.PartitionMetadata.BuildersetWatermark(com.google.cloud.Timestamp watermark)Sets the watermark (last processed timestamp) for the partition.
-
-
-
Method Detail
-
setPartitionToken
public PartitionMetadata.Builder setPartitionToken(java.lang.String partitionToken)
Sets the unique partition identifier.
-
setParentTokens
public PartitionMetadata.Builder setParentTokens(@Nullable java.util.HashSet<java.lang.String> parentTokens)
Sets the collection of parent partition identifiers.
-
setStartTimestamp
public PartitionMetadata.Builder setStartTimestamp(com.google.cloud.Timestamp startTimestamp)
Sets the start time of the partition.
-
setEndTimestamp
public PartitionMetadata.Builder setEndTimestamp(com.google.cloud.Timestamp endTimestamp)
Sets the end time of the partition.
-
setHeartbeatMillis
public PartitionMetadata.Builder setHeartbeatMillis(long heartbeatMillis)
Sets the heartbeat interval in millis.
-
setState
public PartitionMetadata.Builder setState(PartitionMetadata.State state)
Sets the current state of the partition.
-
setWatermark
public PartitionMetadata.Builder setWatermark(com.google.cloud.Timestamp watermark)
Sets the watermark (last processed timestamp) for the partition.
-
setCreatedAt
public PartitionMetadata.Builder setCreatedAt(com.google.cloud.Timestamp createdAt)
Sets the time at which the partition was created.
-
setScheduledAt
public PartitionMetadata.Builder setScheduledAt(@Nullable com.google.cloud.Timestamp scheduledAt)
Sets the time at which the partition was scheduled.
-
setRunningAt
public PartitionMetadata.Builder setRunningAt(@Nullable com.google.cloud.Timestamp runningAt)
Sets the time at which the partition started running.
-
setFinishedAt
public PartitionMetadata.Builder setFinishedAt(@Nullable com.google.cloud.Timestamp finishedAt)
Sets the time at which the partition finished running.
-
build
public PartitionMetadata build()
Builds aPartitionMetadatafrom the given fields. Mandatory fields are:- partition token
- parent tokens
- start timestamp
- heartbeat millis
- state
- watermark
-
-