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

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

There is a newer version: 1.0.0-beta2
Show newest version
/**
 * Autogenerated by Avro
 *
 * DO NOT EDIT DIRECTLY
 */
package org.apache.hudi.avro.model;

import org.apache.avro.specific.SpecificData;

@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class HoodieRollbackMetadata extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  private static final long serialVersionUID = 4483563505512710939L;
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HoodieRollbackMetadata\",\"namespace\":\"org.apache.hudi.avro.model\",\"fields\":[{\"name\":\"startRollbackTime\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timeTakenInMillis\",\"type\":\"long\"},{\"name\":\"totalFilesDeleted\",\"type\":\"int\"},{\"name\":\"commitsRollback\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"partitionMetadata\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"HoodieRollbackPartitionMetadata\",\"fields\":[{\"name\":\"partitionPath\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"successDeleteFiles\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"failedDeleteFiles\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}},{\"name\":\"rollbackLogFiles\",\"type\":[\"null\",{\"type\":\"map\",\"values\":\"long\",\"avro.java.string\":\"String\"}],\"default\":null},{\"name\":\"logFilesFromFailedCommit\",\"type\":[\"null\",{\"type\":\"map\",\"values\":\"long\",\"avro.java.string\":\"String\"}],\"default\":null}]},\"avro.java.string\":\"String\"}},{\"name\":\"version\",\"type\":[\"int\",\"null\"],\"default\":1},{\"name\":\"instantsRollback\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"HoodieInstantInfo\",\"fields\":[{\"name\":\"commitTime\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"action\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},\"default\":[]},\"default\":[]}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.String startRollbackTime;
  @Deprecated public long timeTakenInMillis;
  @Deprecated public int totalFilesDeleted;
  @Deprecated public java.util.List commitsRollback;
  @Deprecated public java.util.Map partitionMetadata;
  @Deprecated public java.lang.Integer version;
  @Deprecated public java.util.List instantsRollback;

  /**
   * 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 HoodieRollbackMetadata() {}

  /**
   * All-args constructor.
   * @param startRollbackTime The new value for startRollbackTime
   * @param timeTakenInMillis The new value for timeTakenInMillis
   * @param totalFilesDeleted The new value for totalFilesDeleted
   * @param commitsRollback The new value for commitsRollback
   * @param partitionMetadata The new value for partitionMetadata
   * @param version The new value for version
   * @param instantsRollback The new value for instantsRollback
   */
  public HoodieRollbackMetadata(java.lang.String startRollbackTime, java.lang.Long timeTakenInMillis, java.lang.Integer totalFilesDeleted, java.util.List commitsRollback, java.util.Map partitionMetadata, java.lang.Integer version, java.util.List instantsRollback) {
    this.startRollbackTime = startRollbackTime;
    this.timeTakenInMillis = timeTakenInMillis;
    this.totalFilesDeleted = totalFilesDeleted;
    this.commitsRollback = commitsRollback;
    this.partitionMetadata = partitionMetadata;
    this.version = version;
    this.instantsRollback = instantsRollback;
  }

  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 startRollbackTime;
    case 1: return timeTakenInMillis;
    case 2: return totalFilesDeleted;
    case 3: return commitsRollback;
    case 4: return partitionMetadata;
    case 5: return version;
    case 6: return instantsRollback;
    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: startRollbackTime = (java.lang.String)value$; break;
    case 1: timeTakenInMillis = (java.lang.Long)value$; break;
    case 2: totalFilesDeleted = (java.lang.Integer)value$; break;
    case 3: commitsRollback = (java.util.List)value$; break;
    case 4: partitionMetadata = (java.util.Map)value$; break;
    case 5: version = (java.lang.Integer)value$; break;
    case 6: instantsRollback = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

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

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

  /**
   * Gets the value of the 'timeTakenInMillis' field.
   * @return The value of the 'timeTakenInMillis' field.
   */
  public java.lang.Long getTimeTakenInMillis() {
    return timeTakenInMillis;
  }

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

  /**
   * Gets the value of the 'totalFilesDeleted' field.
   * @return The value of the 'totalFilesDeleted' field.
   */
  public java.lang.Integer getTotalFilesDeleted() {
    return totalFilesDeleted;
  }

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

  /**
   * Gets the value of the 'commitsRollback' field.
   * @return The value of the 'commitsRollback' field.
   */
  public java.util.List getCommitsRollback() {
    return commitsRollback;
  }

  /**
   * Sets the value of the 'commitsRollback' field.
   * @param value the value to set.
   */
  public void setCommitsRollback(java.util.List value) {
    this.commitsRollback = value;
  }

  /**
   * Gets the value of the 'partitionMetadata' field.
   * @return The value of the 'partitionMetadata' field.
   */
  public java.util.Map getPartitionMetadata() {
    return partitionMetadata;
  }

  /**
   * Sets the value of the 'partitionMetadata' field.
   * @param value the value to set.
   */
  public void setPartitionMetadata(java.util.Map value) {
    this.partitionMetadata = value;
  }

  /**
   * Gets the value of the 'version' field.
   * @return The value of the 'version' field.
   */
  public java.lang.Integer getVersion() {
    return version;
  }

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

  /**
   * Gets the value of the 'instantsRollback' field.
   * @return The value of the 'instantsRollback' field.
   */
  public java.util.List getInstantsRollback() {
    return instantsRollback;
  }

  /**
   * Sets the value of the 'instantsRollback' field.
   * @param value the value to set.
   */
  public void setInstantsRollback(java.util.List value) {
    this.instantsRollback = value;
  }

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

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

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

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

    private java.lang.String startRollbackTime;
    private long timeTakenInMillis;
    private int totalFilesDeleted;
    private java.util.List commitsRollback;
    private java.util.Map partitionMetadata;
    private java.lang.Integer version;
    private java.util.List instantsRollback;

    /** 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.HoodieRollbackMetadata.Builder other) {
      super(other);
      if (isValidValue(fields()[0], other.startRollbackTime)) {
        this.startRollbackTime = data().deepCopy(fields()[0].schema(), other.startRollbackTime);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.timeTakenInMillis)) {
        this.timeTakenInMillis = data().deepCopy(fields()[1].schema(), other.timeTakenInMillis);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.totalFilesDeleted)) {
        this.totalFilesDeleted = data().deepCopy(fields()[2].schema(), other.totalFilesDeleted);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.commitsRollback)) {
        this.commitsRollback = data().deepCopy(fields()[3].schema(), other.commitsRollback);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.partitionMetadata)) {
        this.partitionMetadata = data().deepCopy(fields()[4].schema(), other.partitionMetadata);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.version)) {
        this.version = data().deepCopy(fields()[5].schema(), other.version);
        fieldSetFlags()[5] = true;
      }
      if (isValidValue(fields()[6], other.instantsRollback)) {
        this.instantsRollback = data().deepCopy(fields()[6].schema(), other.instantsRollback);
        fieldSetFlags()[6] = true;
      }
    }

    /**
     * Creates a Builder by copying an existing HoodieRollbackMetadata instance
     * @param other The existing instance to copy.
     */
    private Builder(org.apache.hudi.avro.model.HoodieRollbackMetadata other) {
            super(SCHEMA$);
      if (isValidValue(fields()[0], other.startRollbackTime)) {
        this.startRollbackTime = data().deepCopy(fields()[0].schema(), other.startRollbackTime);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.timeTakenInMillis)) {
        this.timeTakenInMillis = data().deepCopy(fields()[1].schema(), other.timeTakenInMillis);
        fieldSetFlags()[1] = true;
      }
      if (isValidValue(fields()[2], other.totalFilesDeleted)) {
        this.totalFilesDeleted = data().deepCopy(fields()[2].schema(), other.totalFilesDeleted);
        fieldSetFlags()[2] = true;
      }
      if (isValidValue(fields()[3], other.commitsRollback)) {
        this.commitsRollback = data().deepCopy(fields()[3].schema(), other.commitsRollback);
        fieldSetFlags()[3] = true;
      }
      if (isValidValue(fields()[4], other.partitionMetadata)) {
        this.partitionMetadata = data().deepCopy(fields()[4].schema(), other.partitionMetadata);
        fieldSetFlags()[4] = true;
      }
      if (isValidValue(fields()[5], other.version)) {
        this.version = data().deepCopy(fields()[5].schema(), other.version);
        fieldSetFlags()[5] = true;
      }
      if (isValidValue(fields()[6], other.instantsRollback)) {
        this.instantsRollback = data().deepCopy(fields()[6].schema(), other.instantsRollback);
        fieldSetFlags()[6] = true;
      }
    }

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

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

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


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

    /**
      * Gets the value of the 'timeTakenInMillis' field.
      * @return The value.
      */
    public java.lang.Long getTimeTakenInMillis() {
      return timeTakenInMillis;
    }

    /**
      * Sets the value of the 'timeTakenInMillis' field.
      * @param value The value of 'timeTakenInMillis'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setTimeTakenInMillis(long value) {
      validate(fields()[1], value);
      this.timeTakenInMillis = value;
      fieldSetFlags()[1] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'timeTakenInMillis' field.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder clearTimeTakenInMillis() {
      fieldSetFlags()[1] = false;
      return this;
    }

    /**
      * Gets the value of the 'totalFilesDeleted' field.
      * @return The value.
      */
    public java.lang.Integer getTotalFilesDeleted() {
      return totalFilesDeleted;
    }

    /**
      * Sets the value of the 'totalFilesDeleted' field.
      * @param value The value of 'totalFilesDeleted'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setTotalFilesDeleted(int value) {
      validate(fields()[2], value);
      this.totalFilesDeleted = value;
      fieldSetFlags()[2] = true;
      return this;
    }

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


    /**
      * Clears the value of the 'totalFilesDeleted' field.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder clearTotalFilesDeleted() {
      fieldSetFlags()[2] = false;
      return this;
    }

    /**
      * Gets the value of the 'commitsRollback' field.
      * @return The value.
      */
    public java.util.List getCommitsRollback() {
      return commitsRollback;
    }

    /**
      * Sets the value of the 'commitsRollback' field.
      * @param value The value of 'commitsRollback'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setCommitsRollback(java.util.List value) {
      validate(fields()[3], value);
      this.commitsRollback = value;
      fieldSetFlags()[3] = true;
      return this;
    }

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


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

    /**
      * Gets the value of the 'partitionMetadata' field.
      * @return The value.
      */
    public java.util.Map getPartitionMetadata() {
      return partitionMetadata;
    }

    /**
      * Sets the value of the 'partitionMetadata' field.
      * @param value The value of 'partitionMetadata'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setPartitionMetadata(java.util.Map value) {
      validate(fields()[4], value);
      this.partitionMetadata = value;
      fieldSetFlags()[4] = true;
      return this;
    }

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


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

    /**
      * Gets the value of the 'version' field.
      * @return The value.
      */
    public java.lang.Integer getVersion() {
      return version;
    }

    /**
      * Sets the value of the 'version' field.
      * @param value The value of 'version'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setVersion(java.lang.Integer value) {
      validate(fields()[5], value);
      this.version = value;
      fieldSetFlags()[5] = true;
      return this;
    }

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


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

    /**
      * Gets the value of the 'instantsRollback' field.
      * @return The value.
      */
    public java.util.List getInstantsRollback() {
      return instantsRollback;
    }

    /**
      * Sets the value of the 'instantsRollback' field.
      * @param value The value of 'instantsRollback'.
      * @return This builder.
      */
    public org.apache.hudi.avro.model.HoodieRollbackMetadata.Builder setInstantsRollback(java.util.List value) {
      validate(fields()[6], value);
      this.instantsRollback = value;
      fieldSetFlags()[6] = true;
      return this;
    }

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


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

    @Override
    public HoodieRollbackMetadata build() {
      try {
        HoodieRollbackMetadata record = new HoodieRollbackMetadata();
        record.startRollbackTime = fieldSetFlags()[0] ? this.startRollbackTime : (java.lang.String) defaultValue(fields()[0]);
        record.timeTakenInMillis = fieldSetFlags()[1] ? this.timeTakenInMillis : (java.lang.Long) defaultValue(fields()[1]);
        record.totalFilesDeleted = fieldSetFlags()[2] ? this.totalFilesDeleted : (java.lang.Integer) defaultValue(fields()[2]);
        record.commitsRollback = fieldSetFlags()[3] ? this.commitsRollback : (java.util.List) defaultValue(fields()[3]);
        record.partitionMetadata = fieldSetFlags()[4] ? this.partitionMetadata : (java.util.Map) defaultValue(fields()[4]);
        record.version = fieldSetFlags()[5] ? this.version : (java.lang.Integer) defaultValue(fields()[5]);
        record.instantsRollback = fieldSetFlags()[6] ? this.instantsRollback : (java.util.List) defaultValue(fields()[6]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }

  private static final org.apache.avro.io.DatumWriter
    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);

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

  private static final org.apache.avro.io.DatumReader
    READER$ = new org.apache.avro.specific.SpecificDatumReader(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