Class MetadataTableEncoder
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.bigtable.changestreams.encoder.MetadataTableEncoder
-
@Internal public class MetadataTableEncoder extends java.lang.ObjectHelper methods that simplifies some conversion and extraction of metadata table content.
-
-
Constructor Summary
Constructors Constructor Description MetadataTableEncoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisRowLocked(com.google.cloud.bigtable.data.v2.models.Row row)Returns true if row is locked.static java.util.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.static @Nullable java.lang.StringparseLockUuid(com.google.cloud.bigtable.data.v2.models.Row row)Returns the uuid from a row.static @Nullable java.lang.StringparseTokenFromRow(com.google.cloud.bigtable.data.v2.models.Row row)Read the continuation token cell of a row from ReadRows.static @Nullable org.joda.time.InstantparseWatermarkFromRow(com.google.cloud.bigtable.data.v2.models.Row row)Read the watermark cell of a row from ReadRows.static @Nullable org.joda.time.InstantparseWatermarkLastUpdatedFromRow(com.google.cloud.bigtable.data.v2.models.Row row)Return the timestamp (the time it was updated) of the watermark cell.
-
-
-
Method Detail
-
parseWatermarkFromRow
public static @Nullable org.joda.time.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 org.joda.time.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
public static @Nullable java.lang.String parseTokenFromRow(com.google.cloud.bigtable.data.v2.models.Row row)
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
public static @Nullable java.lang.String parseLockUuid(com.google.cloud.bigtable.data.v2.models.Row row)
Returns the uuid from a row.- Parameters:
row- to extract the uuid- Returns:
- the uuid of the row
-
parseInitialContinuationTokens
public static java.util.List<com.google.cloud.bigtable.data.v2.models.ChangeStreamContinuationToken> parseInitialContinuationTokens(com.google.cloud.bigtable.data.v2.models.Row row) throws com.google.protobuf.InvalidProtocolBufferExceptionReturn a list of initial token from a row.- Parameters:
row- to extract the initial tokens- Returns:
- a list of tokens from the row
- Throws:
com.google.protobuf.InvalidProtocolBufferException- when failed to parse tokens.
-
-