Class MetadataTableEncoder
java.lang.Object
org.apache.beam.sdk.io.gcp.bigtable.changestreams.encoder.MetadataTableEncoder
Helper methods that simplifies some conversion and extraction of metadata table content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isRowLocked
(com.google.cloud.bigtable.data.v2.models.Row row) Returns true if row is locked.static List
<com.google.cloud.bigtable.data.v2.models.ChangeStreamContinuationToken> parseInitialContinuationTokens
(com.google.cloud.bigtable.data.v2.models.Row row) Return a list of initial token from a row.parseLockUuid
(com.google.cloud.bigtable.data.v2.models.Row row) Returns the uuid from a row.parseTokenFromRow
(com.google.cloud.bigtable.data.v2.models.Row row) Read the continuation token cell of a row from ReadRows.parseWatermarkFromRow
(com.google.cloud.bigtable.data.v2.models.Row row) Read the watermark cell of a row from ReadRows.parseWatermarkLastUpdatedFromRow
(com.google.cloud.bigtable.data.v2.models.Row row) Return the timestamp (the time it was updated) of the watermark cell.
-
Constructor Details
-
MetadataTableEncoder
public MetadataTableEncoder()
-
-
Method Details
-
parseWatermarkFromRow
public static @Nullable Instant parseWatermarkFromRow(com.google.cloud.bigtable.data.v2.models.Row row) Read the watermark cell of a row from ReadRows.- Parameters:
row
- row to extract the watermark from- Returns:
- the watermark of the row
-
parseWatermarkLastUpdatedFromRow
public static @Nullable Instant parseWatermarkLastUpdatedFromRow(com.google.cloud.bigtable.data.v2.models.Row row) Return the timestamp (the time it was updated) of the watermark cell.- Parameters:
row
- row to extract the timestamp from- Returns:
- the timestamp of the watermark cell.
-
parseTokenFromRow
Read the continuation token cell of a row from ReadRows.- Parameters:
row
- to extract the token from- Returns:
- the token of the row
-
isRowLocked
public static boolean isRowLocked(com.google.cloud.bigtable.data.v2.models.Row row) Returns true if row is locked.- Parameters:
row
- to evaluate if it's locked- Returns:
- true if row is locked. Otherwise, false.
-
parseLockUuid
Returns the uuid from a row.- Parameters:
row
- to extract the uuid- Returns:
- the uuid of the row
-
parseInitialContinuationTokens
public static List<com.google.cloud.bigtable.data.v2.models.ChangeStreamContinuationToken> parseInitialContinuationTokens(com.google.cloud.bigtable.data.v2.models.Row row) throws InvalidProtocolBufferException Return a list of initial token from a row.- Parameters:
row
- to extract the initial tokens- Returns:
- a list of tokens from the row
- Throws:
InvalidProtocolBufferException
- when failed to parse tokens.
-