Class BeamUtils

java.lang.Object
google.registry.beam.BeamUtils

public class BeamUtils extends Object
Static utilities for Beam pipelines.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    checkFieldsNotNull(com.google.common.collect.ImmutableList<String> fieldNames, org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord schemaAndRecord)
    Checks that no expected fields in the record are missing.
    static String
    createJobName(String prefix, Clock clock)
    Creates a beam job name and validates that it conforms to the requirements.
    static String
    extractField(org.apache.avro.generic.GenericRecord record, String fieldName)
    Extracts a string representation of a field in a GenericRecord.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeamUtils

      public BeamUtils()
  • Method Details

    • extractField

      public static String extractField(org.apache.avro.generic.GenericRecord record, String fieldName)
      Extracts a string representation of a field in a GenericRecord.
    • checkFieldsNotNull

      public static void checkFieldsNotNull(com.google.common.collect.ImmutableList<String> fieldNames, org.apache.beam.sdk.io.gcp.bigquery.SchemaAndRecord schemaAndRecord)
      Checks that no expected fields in the record are missing.

      Note that this simply makes sure the field is not null; it may still generate a parse error when interpreting the string representation of an object.

      Throws:
      IllegalStateException - if the record returns null for any field in fieldNames
    • createJobName

      public static String createJobName(String prefix, Clock clock)
      Creates a beam job name and validates that it conforms to the requirements.