Class MetadataTableEncoder

java.lang.Object
org.apache.beam.sdk.io.gcp.bigtable.changestreams.encoder.MetadataTableEncoder

@Internal public class MetadataTableEncoder extends Object
Helper methods that simplifies some conversion and extraction of metadata table content.
  • 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

      public static @Nullable 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 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 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.