Class PartitionMetadata
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 ClassesModifier and TypeClassDescriptionstatic 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
ConstructorsConstructorDescriptionPartitionMetadata
(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 TypeMethodDescriptionboolean
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.getState()
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
hashCode()
static PartitionMetadata.Builder
Creates a builder for constructing a partition metadata instance.Transforms the instance into a builder, so field values can be modified.toString()
-
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
Unique partition identifier, which can be used to perform a change stream query. -
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
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
The time at which this partition was scheduled to be queried. -
getRunningAt
The time at which the connector started processing this partition. -
getFinishedAt
The time at which the connector finished processing this partition. -
toBuilder
Transforms the instance into a builder, so field values can be modified. -
equals
-
hashCode
public int hashCode() -
toString
-
newBuilder
Creates a builder for constructing a partition metadata instance.
-