Class PartitionMetadataMapper
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.mapper.PartitionMetadataMapper
-
public class PartitionMetadataMapper extends java.lang.Object
This class is responsible for transforming aStruct
to aPartitionMetadata
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PartitionMetadata
from(com.google.cloud.spanner.Struct row)
Transforms aStruct
representing a partition metadata row into aPartitionMetadata
model.
-
-
-
Method Detail
-
from
public PartitionMetadata from(com.google.cloud.spanner.Struct row)
Transforms aStruct
representing a partition metadata row into aPartitionMetadata
model. TheStruct
is expected to have the following fields:PartitionMetadataAdminDao.COLUMN_PARTITION_TOKEN
: non-nullableString
representing the partition unique identifier.PartitionMetadataAdminDao.COLUMN_PARENT_TOKENS
: non-nullableList
ofString
representing the partition parents' unique identifiers.PartitionMetadataAdminDao.COLUMN_START_TIMESTAMP
: non-nullableTimestamp
representing the start time at which the partition started existing in Cloud Spanner.PartitionMetadataAdminDao.COLUMN_END_TIMESTAMP
: non-nullableTimestamp
representing the end time for querying this partition.PartitionMetadataAdminDao.COLUMN_HEARTBEAT_MILLIS
: non-nullableLong
representing the number of milliseconds after the stream is idle, which a heartbeat record will be emitted.PartitionMetadataAdminDao.COLUMN_STATE
: non-nullableString
representing thePartitionMetadata.State
in which the partition is in.PartitionMetadataAdminDao.COLUMN_WATERMARK
: non-nullableTimestamp
representing the time for which all records with a timestamp less than it have been processed.PartitionMetadataAdminDao.COLUMN_CREATED_AT
: non-nullableTimestamp
representing the time at which this partition was first detected.PartitionMetadataAdminDao.COLUMN_SCHEDULED_AT
: nullableTimestamp
representing the time at which this partition was scheduled to be queried.PartitionMetadataAdminDao.COLUMN_RUNNING_AT
: nullableTimestamp
representing the time at which the connector started processing this partition.PartitionMetadataAdminDao.COLUMN_FINISHED_AT
: nullableTimestamp
representing the time at which the connector finished processing this partition.
- Parameters:
row
- theStruct
row to be converted. It should contain all the fields as specified above.- Returns:
- a
PartitionMetadata
with the mappedStruct
field values.
-
-