Class ChangeStreamRecordMetadata.Builder

java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.model.ChangeStreamRecordMetadata.Builder
Enclosing class:
ChangeStreamRecordMetadata

public static class ChangeStreamRecordMetadata.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withPartitionToken

      public ChangeStreamRecordMetadata.Builder withPartitionToken(String partitionToken)
      Sets the partition token where this record originated from.
      Parameters:
      partitionToken - the partition token to be set
      Returns:
      Builder
    • withRecordTimestamp

      public ChangeStreamRecordMetadata.Builder withRecordTimestamp(com.google.cloud.Timestamp recordTimestamp)
      Sets the timestamp of when this record occurred.
      Parameters:
      recordTimestamp - the timestamp to be set
      Returns:
      Builder
    • withPartitionStartTimestamp

      public ChangeStreamRecordMetadata.Builder withPartitionStartTimestamp(com.google.cloud.Timestamp partitionStartTimestamp)
      Sets the start time for the partition change stream query that originated this record.
      Parameters:
      partitionStartTimestamp - the timestamp to be set
      Returns:
      Builder
    • withPartitionEndTimestamp

      public ChangeStreamRecordMetadata.Builder withPartitionEndTimestamp(com.google.cloud.Timestamp partitionEndTimestamp)
      Sets the end time for the partition change stream query that originated this record.
      Parameters:
      partitionEndTimestamp - the timestamp to be set
      Returns:
      Builder
    • withPartitionCreatedAt

      public ChangeStreamRecordMetadata.Builder withPartitionCreatedAt(com.google.cloud.Timestamp partitionCreatedAt)
      Sets the time at which this partition was first detected and created in the metadata table.
      Parameters:
      partitionCreatedAt - the timestamp to be set
      Returns:
      Builder
    • withPartitionScheduledAt

      public ChangeStreamRecordMetadata.Builder withPartitionScheduledAt(@Nullable com.google.cloud.Timestamp partitionScheduledAt)
      Sets the time at which this partition was scheduled to be queried.
      Parameters:
      partitionScheduledAt - the timestamp to be set
      Returns:
      Builder
    • withPartitionRunningAt

      public ChangeStreamRecordMetadata.Builder withPartitionRunningAt(@Nullable com.google.cloud.Timestamp partitionRunningAt)
      Sets the time at which the connector started processing this partition.
      Parameters:
      partitionRunningAt - the timestamp to be set
      Returns:
      Builder
    • withQueryStartedAt

      public ChangeStreamRecordMetadata.Builder withQueryStartedAt(com.google.cloud.Timestamp queryStartedAt)
      Sets the time that the change stream query which produced this record started.
      Parameters:
      queryStartedAt - the timestamp to be set
      Returns:
      Builder
    • withRecordStreamStartedAt

      public ChangeStreamRecordMetadata.Builder withRecordStreamStartedAt(com.google.cloud.Timestamp recordStreamStartedAt)
      Sets the time at which the record started to be streamed.
      Parameters:
      recordStreamStartedAt - the timestamp to be set
      Returns:
      Builder
    • withRecordStreamEndedAt

      public ChangeStreamRecordMetadata.Builder withRecordStreamEndedAt(com.google.cloud.Timestamp recordStreamEndedAt)
      Sets the time at which the record finished streaming.
      Parameters:
      recordStreamEndedAt - the timestamp to be set
      Returns:
      Builder
    • withRecordReadAt

      public ChangeStreamRecordMetadata.Builder withRecordReadAt(com.google.cloud.Timestamp recordReadAt)
      Sets the time at which the record was fully read.
      Parameters:
      recordReadAt - the timestamp to be set
      Returns:
      Builder
    • withTotalStreamTimeMillis

      public ChangeStreamRecordMetadata.Builder withTotalStreamTimeMillis(long totalStreamTimeMillis)
      Sets the total streaming time (in millis) for this record.
      Parameters:
      totalStreamTimeMillis - the total time in millis
      Returns:
      Builder
    • withNumberOfRecordsRead

      public ChangeStreamRecordMetadata.Builder withNumberOfRecordsRead(long numberOfRecordsRead)
      Sets the number of records read in the partition change stream query before reading this record.
      Parameters:
      numberOfRecordsRead - the number of records read
      Returns:
      Builder
    • build

      Returns:
      ChangeStreamRecordMetadata