Class StreamEventMetadata.Builder

java.lang.Object
io.debezium.connector.spanner.db.model.StreamEventMetadata.Builder
Enclosing class:
StreamEventMetadata

public static class StreamEventMetadata.Builder extends Object
  • Field Details

    • partitionToken

      private String partitionToken
    • recordTimestamp

      private com.google.cloud.Timestamp recordTimestamp
    • partitionStartTimestamp

      private com.google.cloud.Timestamp partitionStartTimestamp
    • partitionEndTimestamp

      private com.google.cloud.Timestamp partitionEndTimestamp
    • queryStartedAt

      private com.google.cloud.Timestamp queryStartedAt
    • recordStreamStartedAt

      private com.google.cloud.Timestamp recordStreamStartedAt
    • recordStreamEndedAt

      private com.google.cloud.Timestamp recordStreamEndedAt
    • recordReadAt

      private com.google.cloud.Timestamp recordReadAt
    • totalStreamTimeMillis

      private long totalStreamTimeMillis
    • numberOfRecordsRead

      private long numberOfRecordsRead
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withPartitionToken

      public StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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
    • withQueryStartedAt

      public StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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 StreamEventMetadata.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

      public StreamEventMetadata build()
      Returns:
      ChangeStreamRecordMetadata