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.coders.AvroCoder.class) public class PartitionMetadata extends java.lang.Object implements java.io.Serializable
Model 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 class
PartitionMetadata.Builder
Partition metadata builder for better user experience.static class
PartitionMetadata.State
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(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 boolean
equals(java.lang.Object o)
com.google.cloud.Timestamp
getCreatedAt()
The time at which this partition was first detected and created in the metadata table.com.google.cloud.Timestamp
getEndTimestamp()
The end time for querying this given partition.com.google.cloud.Timestamp
getFinishedAt()
The time at which the connector finished processing this partition.long
getHeartbeatMillis()
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.String
getPartitionToken()
Unique partition identifier, which can be used to perform a change stream query.com.google.cloud.Timestamp
getRunningAt()
The time at which the connector started processing this partition.com.google.cloud.Timestamp
getScheduledAt()
The time at which this partition was scheduled to be queried.com.google.cloud.Timestamp
getStartTimestamp()
It is the start time at which the partition started existing in Cloud Spanner.PartitionMetadata.State
getState()
The state in which the current partition is in.com.google.cloud.Timestamp
getWatermark()
The time for which all records with a timestamp less than it have been processed.int
hashCode()
static PartitionMetadata.Builder
newBuilder()
Creates a builder for constructing a partition metadata instance.PartitionMetadata.Builder
toBuilder()
Transforms the instance into a builder, so field values can be modified.java.lang.String
toString()
-
-
-
Constructor Detail
-
PartitionMetadata
public 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, @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
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newBuilder
public static PartitionMetadata.Builder newBuilder()
Creates a builder for constructing a partition metadata instance.
-
-