java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.model.PartitionMetadata
All Implemented Interfaces:
Serializable

@DefaultCoder(AvroCoder.class) public class PartitionMetadata extends Object implements Serializable
Model for the partition metadata database table used in the Connector.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Partition metadata builder for better user experience.
    static enum 
    The state at which a partition can be in the system: CREATED: the partition has been created, but no query has been done against it yet.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PartitionMetadata(String partitionToken, HashSet<String> parentTokens, com.google.cloud.Timestamp startTimestamp, com.google.cloud.Timestamp endTimestamp, long heartbeatMillis, PartitionMetadata.State state, com.google.cloud.Timestamp watermark, com.google.cloud.Timestamp createdAt, com.google.cloud.Timestamp scheduledAt, com.google.cloud.Timestamp runningAt, com.google.cloud.Timestamp finishedAt)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    com.google.cloud.Timestamp
    The time at which this partition was first detected and created in the metadata table.
    com.google.cloud.Timestamp
    The end time for querying this given partition.
    com.google.cloud.Timestamp
    The time at which the connector finished processing this partition.
    long
    The number of milliseconds after the stream is idle, which a heartbeat record will be emitted in the change stream query.
    The unique partition identifiers of the parent partitions where this child partition originated from.
    Unique partition identifier, which can be used to perform a change stream query.
    com.google.cloud.Timestamp
    The time at which the connector started processing this partition.
    com.google.cloud.Timestamp
    The time at which this partition was scheduled to be queried.
    com.google.cloud.Timestamp
    It is the start time at which the partition started existing in Cloud Spanner.
    The state in which the current partition is in.
    com.google.cloud.Timestamp
    The time for which all records with a timestamp less than it have been processed.
    int
     
    Creates a builder for constructing a partition metadata instance.
    Transforms the instance into a builder, so field values can be modified.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PartitionMetadata

      public PartitionMetadata(String partitionToken, @Nullable HashSet<String> parentTokens, com.google.cloud.Timestamp startTimestamp, com.google.cloud.Timestamp endTimestamp, long heartbeatMillis, PartitionMetadata.State state, com.google.cloud.Timestamp watermark, com.google.cloud.Timestamp createdAt, @Nullable com.google.cloud.Timestamp scheduledAt, @Nullable com.google.cloud.Timestamp runningAt, @Nullable com.google.cloud.Timestamp finishedAt)
  • Method Details

    • getPartitionToken

      public String getPartitionToken()
      Unique partition identifier, which can be used to perform a change stream query.
    • getParentTokens

      @Nullable public HashSet<String> getParentTokens()
      The unique partition identifiers of the parent partitions where this child partition originated from.
    • getStartTimestamp

      public com.google.cloud.Timestamp getStartTimestamp()
      It is the start time at which the partition started existing in Cloud Spanner. This timestamp can be used to perform a change stream query for the partition.
    • getEndTimestamp

      public com.google.cloud.Timestamp getEndTimestamp()
      The end time for querying this given partition. It does not necessarily mean that the partition exists until this time, but it will be the timestamp used on its change stream query.
    • getHeartbeatMillis

      public long getHeartbeatMillis()
      The number of milliseconds after the stream is idle, which a heartbeat record will be emitted in the change stream query.
    • getState

      public PartitionMetadata.State getState()
      The state in which the current partition is in.
    • getWatermark

      public com.google.cloud.Timestamp getWatermark()
      The time for which all records with a timestamp less than it have been processed.
    • getCreatedAt

      public com.google.cloud.Timestamp getCreatedAt()
      The time at which this partition was first detected and created in the metadata table.
    • getScheduledAt

      @Nullable public com.google.cloud.Timestamp getScheduledAt()
      The time at which this partition was scheduled to be queried.
    • getRunningAt

      @Nullable public com.google.cloud.Timestamp getRunningAt()
      The time at which the connector started processing this partition.
    • getFinishedAt

      @Nullable public com.google.cloud.Timestamp getFinishedAt()
      The time at which the connector finished processing this partition.
    • toBuilder

      public PartitionMetadata.Builder toBuilder()
      Transforms the instance into a builder, so field values can be modified.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newBuilder

      public static PartitionMetadata.Builder newBuilder()
      Creates a builder for constructing a partition metadata instance.