All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hudi.avro.model.HoodieMetadataRecord Maven / Gradle / Ivy

/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.apache.hudi.avro.model;

import org.apache.avro.specific.SpecificData;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;

@SuppressWarnings("all")
/** A record saved within the Metadata Table */
@org.apache.avro.specific.AvroGenerated
public class HoodieMetadataRecord extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = -9146049859013126167L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HoodieMetadataRecord\",\"namespace\":\"org.apache.hudi.avro.model\",\"doc\":\"A record saved within the Metadata Table\",\"fields\":[{\"name\":\"key\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":\"int\",\"doc\":\"Type of the metadata record\"},{\"name\":\"filesystemMetadata\",\"type\":[\"null\",{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"HoodieMetadataFileInfo\",\"fields\":[{\"name\":\"size\",\"type\":\"long\",\"doc\":\"Size of the file\"},{\"name\":\"isDeleted\",\"type\":\"boolean\",\"doc\":\"True if this file has been deleted\"}]},\"avro.java.string\":\"String\"}],\"doc\":\"Contains information about partitions and files within the dataset\"},{\"name\":\"BloomFilterMetadata\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"HoodieMetadataBloomFilter\",\"doc\":\"Data file bloom filter details\",\"fields\":[{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Bloom filter type code\"},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"Instant timestamp when this metadata was created/updated\"},{\"name\":\"bloomFilter\",\"type\":\"bytes\",\"doc\":\"Bloom filter binary byte array\"},{\"name\":\"isDeleted\",\"type\":\"boolean\",\"doc\":\"Bloom filter entry valid/deleted flag\"}]}],\"doc\":\"Metadata Index of bloom filters for all data files in the user table\",\"default\":null},{\"name\":\"ColumnStatsMetadata\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"HoodieMetadataColumnStats\",\"doc\":\"Data file column statistics\",\"fields\":[{\"name\":\"fileName\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"File name for which this column statistics applies\",\"default\":null},{\"name\":\"columnName\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"Column name for which this column statistics applies\",\"default\":null},{\"name\":\"minValue\",\"type\":[\"null\",{\"type\":\"record\",\"name\":\"BooleanWrapper\",\"doc\":\"A record wrapping boolean type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"boolean\"}]},{\"type\":\"record\",\"name\":\"IntWrapper\",\"doc\":\"A record wrapping int type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"LongWrapper\",\"doc\":\"A record wrapping long type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"long\"}]},{\"type\":\"record\",\"name\":\"FloatWrapper\",\"doc\":\"A record wrapping float type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"float\"}]},{\"type\":\"record\",\"name\":\"DoubleWrapper\",\"doc\":\"A record wrapping double type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"double\"}]},{\"type\":\"record\",\"name\":\"BytesWrapper\",\"doc\":\"A record wrapping bytes type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"bytes\"}]},{\"type\":\"record\",\"name\":\"StringWrapper\",\"doc\":\"A record wrapping string type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"DateWrapper\",\"doc\":\"A record wrapping Date logical type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"int\"}]},{\"type\":\"record\",\"name\":\"DecimalWrapper\",\"doc\":\"A record wrapping Decimal logical type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":30,\"scale\":15}}]},{\"type\":\"record\",\"name\":\"TimeMicrosWrapper\",\"doc\":\"A record wrapping Time-micros logical type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":{\"type\":\"long\",\"logicalType\":\"time-micros\"}}]},{\"type\":\"record\",\"name\":\"TimestampMicrosWrapper\",\"doc\":\"A record wrapping Timestamp-micros logical type to be able to be used it w/in Avro's Union\",\"fields\":[{\"name\":\"value\",\"type\":\"long\"}]}],\"doc\":\"Minimum value in the range. Based on user data table schema, we can convert this to appropriate type\",\"default\":null},{\"name\":\"maxValue\",\"type\":[\"null\",\"BooleanWrapper\",\"IntWrapper\",\"LongWrapper\",\"FloatWrapper\",\"DoubleWrapper\",\"BytesWrapper\",\"StringWrapper\",\"DateWrapper\",\"DecimalWrapper\",\"TimeMicrosWrapper\",\"TimestampMicrosWrapper\"],\"doc\":\"Maximum value in the range. Based on user data table schema, we can convert it to appropriate type\",\"default\":null},{\"name\":\"valueCount\",\"type\":[\"null\",\"long\"],\"doc\":\"Total count of values\",\"default\":null},{\"name\":\"nullCount\",\"type\":[\"null\",\"long\"],\"doc\":\"Total count of null values\",\"default\":null},{\"name\":\"totalSize\",\"type\":[\"null\",\"long\"],\"doc\":\"Total storage size on disk\",\"default\":null},{\"name\":\"totalUncompressedSize\",\"type\":[\"null\",\"long\"],\"doc\":\"Total uncompressed storage size on disk\",\"default\":null},{\"name\":\"isDeleted\",\"type\":\"boolean\",\"doc\":\"Column range entry valid/deleted flag\"}]}],\"doc\":\"Metadata Index of column statistics for all data files in the user table\",\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }

  private static SpecificData MODEL$ = new SpecificData();

  private static final BinaryMessageEncoder ENCODER =
      new BinaryMessageEncoder(MODEL$, SCHEMA$);

  private static final BinaryMessageDecoder DECODER =
      new BinaryMessageDecoder(MODEL$, SCHEMA$);

  /**
   * Return the BinaryMessageDecoder instance used by this class.
   */
  public static BinaryMessageDecoder getDecoder() {
    return DECODER;
  }

  /**
   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
   */
  public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
    return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
  }

  /** Serializes this HoodieMetadataRecord to a ByteBuffer. */
  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
    return ENCODER.encode(this);
  }

  /** Deserializes a HoodieMetadataRecord from a ByteBuffer. */
  public static HoodieMetadataRecord fromByteBuffer(
      java.nio.ByteBuffer b) throws java.io.IOException {
    return DECODER.decode(b);
  }

  @Deprecated public java.lang.String key;
  /** Type of the metadata record */
  @Deprecated public int type;
  /** Contains information about partitions and files within the dataset */
  @Deprecated public java.util.Map filesystemMetadata;
  /** Metadata Index of bloom filters for all data files in the user table */
  @Deprecated public org.apache.hudi.avro.model.HoodieMetadataBloomFilter BloomFilterMetadata;
  /** Metadata Index of column statistics for all data files in the user table */
  @Deprecated public org.apache.hudi.avro.model.HoodieMetadataColumnStats ColumnStatsMetadata;

  /**
   * Default constructor.  Note that this does not initialize fields
   * to their default values from the schema.  If that is desired then
   * one should use newBuilder().
   */
  public HoodieMetadataRecord() {}

  /**
   * All-args constructor.
   * @param key The new value for key
   * @param type Type of the metadata record
   * @param filesystemMetadata Contains information about partitions and files within the dataset
   * @param BloomFilterMetadata Metadata Index of bloom filters for all data files in the user table
   * @param ColumnStatsMetadata Metadata Index of column statistics for all data files in the user table
   */
  public HoodieMetadataRecord(java.lang.String key, java.lang.Integer type, java.util.Map filesystemMetadata, org.apache.hudi.avro.model.HoodieMetadataBloomFilter BloomFilterMetadata, org.apache.hudi.avro.model.HoodieMetadataColumnStats ColumnStatsMetadata) {
    this.key = key;
    this.type = type;
    this.filesystemMetadata = filesystemMetadata;
    this.BloomFilterMetadata = BloomFilterMetadata;
    this.ColumnStatsMetadata = ColumnStatsMetadata;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call.
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return key;
    case 1: return type;
    case 2: return filesystemMetadata;
    case 3: return BloomFilterMetadata;
    case 4: return ColumnStatsMetadata;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  // Used by DatumReader.  Applications should not call.
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: key = (java.lang.String)value$; break;
    case 1: type = (java.lang.Integer)value$; break;
    case 2: filesystemMetadata = (java.util.Map)value$; break;
    case 3: BloomFilterMetadata = (org.apache.hudi.avro.model.HoodieMetadataBloomFilter)value$; break;
    case 4: ColumnStatsMetadata = (org.apache.hudi.avro.model.HoodieMetadataColumnStats)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'key' field.
   * @return The value of the 'key' field.
   */
  public java.lang.String getKey() {
    return key;
  }

  /**
   * Sets the value of the 'key' field.
   * @param value the value to set.
   */
  public void setKey(java.lang.String value) {
    this.key = value;
  }

  /**
   * Gets the value of the 'type' field.
   * @return Type of the metadata record
   */
  public java.lang.Integer getType() {
    return type;
  }

  /**
   * Sets the value of the 'type' field.
   * Type of the metadata record
   * @param value the value to set.
   */
  public void setType(java.lang.Integer value) {
    this.type = value;
  }

  /**
   * Gets the value of the 'filesystemMetadata' field.
   * @return Contains information about partitions and files within the dataset
   */
  public java.util.Map getFilesystemMetadata() {
    return filesystemMetadata;
  }

  /**
   * Sets the value of the 'filesystemMetadata' field.
   * Contains information about partitions and files within the dataset
   * @param value the value to set.
   */
  public void setFilesystemMetadata(java.util.Map value) {
    this.filesystemMetadata = value;
  }

  /**
   * Gets the value of the 'BloomFilterMetadata' field.
   * @return Metadata Index of bloom filters for all data files in the user table
   */
  public org.apache.hudi.avro.model.HoodieMetadataBloomFilter getBloomFilterMetadata() {
    return BloomFilterMetadata;
  }

  /**
   * Sets the value of the 'BloomFilterMetadata' field.
   * Metadata Index of bloom filters for all data files in the user table
   * @param value the value to set.
   */
  public void setBloomFilterMetadata(org.apache.hudi.avro.model.HoodieMetadataBloomFilter value) {
    this.BloomFilterMetadata = value;
  }

  /**
   * Gets the value of the 'ColumnStatsMetadata' field.
   * @return Metadata Index of column statistics for all data files in the user table
   */
  public org.apache.hudi.avro.model.HoodieMetadataColumnStats getColumnStatsMetadata() {
    return ColumnStatsMetadata;
  }

  /**
   * Sets the value of the 'ColumnStatsMetadata' field.
   * Metadata Index of column statistics for all data files in the user table
   * @param value the value to set.
   */
  public void setColumnStatsMetadata(org.apache.hudi.avro.model.HoodieMetadataColumnStats value) {
    this.ColumnStatsMetadata = value;
  }

  /**
   * Creates a new HoodieMetadataRecord RecordBuilder.
   * @return A new HoodieMetadataRecord RecordBuilder
   */
  public static org.apache.hudi.avro.model.HoodieMetadataRecord.Builder newBuilder() {
    return new org.apache.hudi.avro.model.HoodieMetadataRecord.Builder();
  }

  /**
   * Creates a new HoodieMetadataRecord RecordBuilder by copying an existing Builder.
   * @param other The existing builder to copy.
   * @return A new HoodieMetadataRecord RecordBuilder
   */
  public static org.apache.hudi.avro.model.HoodieMetadataRecord.Builder newBuilder(org.apache.hudi.avro.model.HoodieMetadataRecord.Builder other) {
    return new org.apache.hudi.avro.model.HoodieMetadataRecord.Builder(other);
  }

  /**
   * Creates a new HoodieMetadataRecord RecordBuilder by copying an existing HoodieMetadataRecord instance.
   * @param other The existing instance to copy.
   * @return A new HoodieMetadataRecord RecordBuilder
   */
  public static org.apache.hudi.avro.model.HoodieMetadataRecord.Builder newBuilder(org.apache.hudi.avro.model.HoodieMetadataRecord other) {
    return new org.apache.hudi.avro.model.HoodieMetadataRecord.Builder(other);
  }

  /**
   * RecordBuilder for HoodieMetadataRecord instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.String key;
    /** Type of the metadata record */
    private int type;
    /** Contains information about partitions and files within the dataset */
    private java.util.Map filesystemMetadata;
    /** Metadata Index of bloom filters for all data files in the user table */
    private org.apache.hudi.avro.model.HoodieMetadataBloomFilter BloomFilterMetadata;
    private org.apache.hudi.avro.model.HoodieMetadataBloomFilter.Builder BloomFilterMetadataBuilder;
    /** Metadata Index of column statistics for all data files in the user table */
    private org.apache.hudi.avro.model.HoodieMetadataColumnStats ColumnStatsMetadata;
    private org.apache.hudi.avro.model.HoodieMetadataColumnStats.Builder ColumnStatsMetadataBuilder;

    /** Creates a new Builder */
    private Builder() {
      super(SCHEMA$);
    }

    /**
     * Creates a Builder by copying an existing Builder.
     * @param other The existing Builder to copy.
     */
    private Builder(org.apache.hudi.avro.model.HoodieMetadataRecord.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.key)) {
        this.key = data().deepCopy(fields()[0].schema(), other.key);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.type)) {
        this.type = data().deepCopy(fields()[1].schema(), other.type);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.filesystemMetadata)) {
        this.filesystemMetadata = data().deepCopy(fields()[2].schema(), other.filesystemMetadata);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.BloomFilterMetadata)) {
        this.BloomFilterMetadata = data().deepCopy(fields()[3].schema(), other.BloomFilterMetadata);
        fieldSetFlags()[3] = true;
      }
      if (other.hasBloomFilterMetadataBuilder()) {
        this.BloomFilterMetadataBuilder = org.apache.hudi.avro.model.HoodieMetadataBloomFilter.newBuilder(other.getBloomFilterMetadataBuilder());
      }
      if (isValidValue(fields()[4], other.ColumnStatsMetadata)) {
        this.ColumnStatsMetadata = data().deepCopy(fields()[4].schema(), other.ColumnStatsMetadata);
        fieldSetFlags()[4] = true;
      }
      if (other.hasColumnStatsMetadataBuilder()) {
        this.ColumnStatsMetadataBuilder = org.apache.hudi.avro.model.HoodieMetadataColumnStats.newBuilder(other.getColumnStatsMetadataBuilder());
      }
    }

    /**
     * Creates a Builder by copying an existing HoodieMetadataRecord instance
     * @param other The existing instance to copy.
     */
    private Builder(org.apache.hudi.avro.model.HoodieMetadataRecord other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.key)) {
        this.key = data().deepCopy(fields()[0].schema(), other.key);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.type)) {
        this.type = data().deepCopy(fields()[1].schema(), other.type);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.filesystemMetadata)) {
        this.filesystemMetadata = data().deepCopy(fields()[2].schema(), other.filesystemMetadata);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.BloomFilterMetadata)) {
        this.BloomFilterMetadata = data().deepCopy(fields()[3].schema(), other.BloomFilterMetadata);
        fieldSetFlags()[3] = true;
      }
      this.BloomFilterMetadataBuilder = null;
      if (isValidValue(fields()[4], other.ColumnStatsMetadata)) {
        this.ColumnStatsMetadata = data().deepCopy(fields()[4].schema(), other.ColumnStatsMetadata);
        fieldSetFlags()[4] = true;
      }
      this.ColumnStatsMetadataBuilder = null;
    }

    /**
      * Gets the value of the 'key' field.
      * @return The value.
      */
    public java.lang.String getKey() {
      return key;
    }

    /**
      * Sets the value of the 'key' field.
      * @param value The value of 'key'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setKey(java.lang.String value) {
      validate(fields()[0], value);
      this.key = value;
      fieldSetFlags()[0] = true;
      return this;
    }

    /**
      * Checks whether the 'key' field has been set.
      * @return True if the 'key' field has been set, false otherwise.
      */
    public boolean hasKey() {
      return fieldSetFlags()[0];
    }


    /**
      * Clears the value of the 'key' field.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder clearKey() {
      key = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /**
      * Gets the value of the 'type' field.
      * Type of the metadata record
      * @return The value.
      */
    public java.lang.Integer getType() {
      return type;
    }

    /**
      * Sets the value of the 'type' field.
      * Type of the metadata record
      * @param value The value of 'type'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setType(int value) {
      validate(fields()[1], value);
      this.type = value;
      fieldSetFlags()[1] = true;
      return this;
    }

    /**
      * Checks whether the 'type' field has been set.
      * Type of the metadata record
      * @return True if the 'type' field has been set, false otherwise.
      */
    public boolean hasType() {
      return fieldSetFlags()[1];
    }


    /**
      * Clears the value of the 'type' field.
      * Type of the metadata record
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder clearType() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /**
      * Gets the value of the 'filesystemMetadata' field.
      * Contains information about partitions and files within the dataset
      * @return The value.
      */
    public java.util.Map getFilesystemMetadata() {
      return filesystemMetadata;
    }

    /**
      * Sets the value of the 'filesystemMetadata' field.
      * Contains information about partitions and files within the dataset
      * @param value The value of 'filesystemMetadata'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setFilesystemMetadata(java.util.Map value) {
      validate(fields()[2], value);
      this.filesystemMetadata = value;
      fieldSetFlags()[2] = true;
      return this;
    }

    /**
      * Checks whether the 'filesystemMetadata' field has been set.
      * Contains information about partitions and files within the dataset
      * @return True if the 'filesystemMetadata' field has been set, false otherwise.
      */
    public boolean hasFilesystemMetadata() {
      return fieldSetFlags()[2];
    }


    /**
      * Clears the value of the 'filesystemMetadata' field.
      * Contains information about partitions and files within the dataset
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder clearFilesystemMetadata() {
      filesystemMetadata = null;
      fieldSetFlags()[2] = false;
      return this;
    }

    /**
      * Gets the value of the 'BloomFilterMetadata' field.
      * Metadata Index of bloom filters for all data files in the user table
      * @return The value.
      */
    public org.apache.hudi.avro.model.HoodieMetadataBloomFilter getBloomFilterMetadata() {
      return BloomFilterMetadata;
    }

    /**
      * Sets the value of the 'BloomFilterMetadata' field.
      * Metadata Index of bloom filters for all data files in the user table
      * @param value The value of 'BloomFilterMetadata'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setBloomFilterMetadata(org.apache.hudi.avro.model.HoodieMetadataBloomFilter value) {
      validate(fields()[3], value);
      this.BloomFilterMetadataBuilder = null;
      this.BloomFilterMetadata = value;
      fieldSetFlags()[3] = true;
      return this;
    }

    /**
      * Checks whether the 'BloomFilterMetadata' field has been set.
      * Metadata Index of bloom filters for all data files in the user table
      * @return True if the 'BloomFilterMetadata' field has been set, false otherwise.
      */
    public boolean hasBloomFilterMetadata() {
      return fieldSetFlags()[3];
    }

    /**
     * Gets the Builder instance for the 'BloomFilterMetadata' field and creates one if it doesn't exist yet.
     * Metadata Index of bloom filters for all data files in the user table
     * @return This builder.
     */
    public org.apache.hudi.avro.model.HoodieMetadataBloomFilter.Builder getBloomFilterMetadataBuilder() {
      if (BloomFilterMetadataBuilder == null) {
        if (hasBloomFilterMetadata()) {
          setBloomFilterMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataBloomFilter.newBuilder(BloomFilterMetadata));
        } else {
          setBloomFilterMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataBloomFilter.newBuilder());
        }
      }
      return BloomFilterMetadataBuilder;
    }

    /**
     * Sets the Builder instance for the 'BloomFilterMetadata' field
     * Metadata Index of bloom filters for all data files in the user table
     * @param value The builder instance that must be set.
     * @return This builder.
     */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setBloomFilterMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataBloomFilter.Builder value) {
      clearBloomFilterMetadata();
      BloomFilterMetadataBuilder = value;
      return this;
    }

    /**
     * Checks whether the 'BloomFilterMetadata' field has an active Builder instance
     * Metadata Index of bloom filters for all data files in the user table
     * @return True if the 'BloomFilterMetadata' field has an active Builder instance
     */
    public boolean hasBloomFilterMetadataBuilder() {
      return BloomFilterMetadataBuilder != null;
    }

    /**
      * Clears the value of the 'BloomFilterMetadata' field.
      * Metadata Index of bloom filters for all data files in the user table
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder clearBloomFilterMetadata() {
      BloomFilterMetadata = null;
      BloomFilterMetadataBuilder = null;
      fieldSetFlags()[3] = false;
      return this;
    }

    /**
      * Gets the value of the 'ColumnStatsMetadata' field.
      * Metadata Index of column statistics for all data files in the user table
      * @return The value.
      */
    public org.apache.hudi.avro.model.HoodieMetadataColumnStats getColumnStatsMetadata() {
      return ColumnStatsMetadata;
    }

    /**
      * Sets the value of the 'ColumnStatsMetadata' field.
      * Metadata Index of column statistics for all data files in the user table
      * @param value The value of 'ColumnStatsMetadata'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setColumnStatsMetadata(org.apache.hudi.avro.model.HoodieMetadataColumnStats value) {
      validate(fields()[4], value);
      this.ColumnStatsMetadataBuilder = null;
      this.ColumnStatsMetadata = value;
      fieldSetFlags()[4] = true;
      return this;
    }

    /**
      * Checks whether the 'ColumnStatsMetadata' field has been set.
      * Metadata Index of column statistics for all data files in the user table
      * @return True if the 'ColumnStatsMetadata' field has been set, false otherwise.
      */
    public boolean hasColumnStatsMetadata() {
      return fieldSetFlags()[4];
    }

    /**
     * Gets the Builder instance for the 'ColumnStatsMetadata' field and creates one if it doesn't exist yet.
     * Metadata Index of column statistics for all data files in the user table
     * @return This builder.
     */
    public org.apache.hudi.avro.model.HoodieMetadataColumnStats.Builder getColumnStatsMetadataBuilder() {
      if (ColumnStatsMetadataBuilder == null) {
        if (hasColumnStatsMetadata()) {
          setColumnStatsMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataColumnStats.newBuilder(ColumnStatsMetadata));
        } else {
          setColumnStatsMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataColumnStats.newBuilder());
        }
      }
      return ColumnStatsMetadataBuilder;
    }

    /**
     * Sets the Builder instance for the 'ColumnStatsMetadata' field
     * Metadata Index of column statistics for all data files in the user table
     * @param value The builder instance that must be set.
     * @return This builder.
     */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder setColumnStatsMetadataBuilder(org.apache.hudi.avro.model.HoodieMetadataColumnStats.Builder value) {
      clearColumnStatsMetadata();
      ColumnStatsMetadataBuilder = value;
      return this;
    }

    /**
     * Checks whether the 'ColumnStatsMetadata' field has an active Builder instance
     * Metadata Index of column statistics for all data files in the user table
     * @return True if the 'ColumnStatsMetadata' field has an active Builder instance
     */
    public boolean hasColumnStatsMetadataBuilder() {
      return ColumnStatsMetadataBuilder != null;
    }

    /**
      * Clears the value of the 'ColumnStatsMetadata' field.
      * Metadata Index of column statistics for all data files in the user table
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieMetadataRecord.Builder clearColumnStatsMetadata() {
      ColumnStatsMetadata = null;
      ColumnStatsMetadataBuilder = null;
      fieldSetFlags()[4] = false;
      return this;
    }

    @Override
    @SuppressWarnings("unchecked")
    public HoodieMetadataRecord build() {
      try {
        HoodieMetadataRecord record = new HoodieMetadataRecord();
        record.key = fieldSetFlags()[0] ? this.key : (java.lang.String) defaultValue(fields()[0]);
        record.type = fieldSetFlags()[1] ? this.type : (java.lang.Integer) defaultValue(fields()[1]);
        record.filesystemMetadata = fieldSetFlags()[2] ? this.filesystemMetadata : (java.util.Map) defaultValue(fields()[2]);
        if (BloomFilterMetadataBuilder != null) {
          record.BloomFilterMetadata = this.BloomFilterMetadataBuilder.build();
        } else {
          record.BloomFilterMetadata = fieldSetFlags()[3] ? this.BloomFilterMetadata : (org.apache.hudi.avro.model.HoodieMetadataBloomFilter) defaultValue(fields()[3]);
        }
        if (ColumnStatsMetadataBuilder != null) {
          record.ColumnStatsMetadata = this.ColumnStatsMetadataBuilder.build();
        } else {
          record.ColumnStatsMetadata = fieldSetFlags()[4] ? this.ColumnStatsMetadata : (org.apache.hudi.avro.model.HoodieMetadataColumnStats) defaultValue(fields()[4]);
        }
        return record;
      } catch (java.lang.Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumWriter
    WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);

  @Override public void writeExternal(java.io.ObjectOutput out)
    throws java.io.IOException {
    WRITER$.write(this, SpecificData.getEncoder(out));
  }

  @SuppressWarnings("unchecked")
  private static final org.apache.avro.io.DatumReader
    READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);

  @Override public void readExternal(java.io.ObjectInput in)
    throws java.io.IOException {
    READER$.read(this, SpecificData.getDecoder(in));
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy