Class PartitionMetadata
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.model.PartitionMetadata
-
- All Implemented Interfaces:
java.io.Serializable
@DefaultCoder(org.apache.beam.sdk.extensions.avro.coders.AvroCoder.class) public class PartitionMetadata extends java.lang.Object implements java.io.SerializableModel for the partition metadata database table used in the Connector.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPartitionMetadata.BuilderPartition metadata builder for better user experience.static classPartitionMetadata.StateThe 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(java.lang.String partitionToken, java.util.HashSet<java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)com.google.cloud.TimestampgetCreatedAt()The time at which this partition was first detected and created in the metadata table.com.google.cloud.TimestampgetEndTimestamp()The end time for querying this given partition.com.google.cloud.TimestampgetFinishedAt()The time at which the connector finished processing this partition.longgetHeartbeatMillis()The number of milliseconds after the stream is idle, which a heartbeat record will be emitted in the change stream query.java.util.HashSet<java.lang.String>getParentTokens()The unique partition identifiers of the parent partitions where this child partition originated from.java.lang.StringgetPartitionToken()Unique partition identifier, which can be used to perform a change stream query.com.google.cloud.TimestampgetRunningAt()The time at which the connector started processing this partition.com.google.cloud.TimestampgetScheduledAt()The time at which this partition was scheduled to be queried.com.google.cloud.TimestampgetStartTimestamp()It is the start time at which the partition started existing in Cloud Spanner.PartitionMetadata.StategetState()The state in which the current partition is in.com.google.cloud.TimestampgetWatermark()The time for which all records with a timestamp less than it have been processed.inthashCode()static PartitionMetadata.BuildernewBuilder()Creates a builder for constructing a partition metadata instance.PartitionMetadata.BuildertoBuilder()Transforms the instance into a builder, so field values can be modified.java.lang.StringtoString()
-
-
-
Constructor Detail
-
PartitionMetadata
public PartitionMetadata(java.lang.String partitionToken, @Nullable java.util.HashSet<java.lang.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 Detail
-
getPartitionToken
public java.lang.String getPartitionToken()
Unique partition identifier, which can be used to perform a change stream query.
-
getParentTokens
@Nullable public java.util.HashSet<java.lang.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 java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
newBuilder
public static PartitionMetadata.Builder newBuilder()
Creates a builder for constructing a partition metadata instance.
-
-