org.apache.hudi.avro.model.HoodieCleanMetadata Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.apache.hudi.avro.model;
import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;
@org.apache.avro.specific.AvroGenerated
public class HoodieCleanMetadata extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -2821177179354565289L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"HoodieCleanMetadata\",\"namespace\":\"org.apache.hudi.avro.model\",\"fields\":[{\"name\":\"startCleanTime\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timeTakenInMillis\",\"type\":\"long\"},{\"name\":\"totalFilesDeleted\",\"type\":\"int\"},{\"name\":\"earliestCommitToRetain\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"lastCompletedCommitTimestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"default\":\"\"},{\"name\":\"partitionMetadata\",\"type\":{\"type\":\"map\",\"values\":{\"type\":\"record\",\"name\":\"HoodieCleanPartitionMetadata\",\"fields\":[{\"name\":\"partitionPath\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"policy\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"deletePathPatterns\",\"type\":{\"type\":\"array\",\"items\":{\"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\":\"isPartitionDeleted\",\"type\":[\"null\",\"boolean\"],\"default\":null}]},\"avro.java.string\":\"String\"}},{\"name\":\"version\",\"type\":[\"int\",\"null\"],\"default\":1},{\"name\":\"bootstrapPartitionMetadata\",\"type\":[\"null\",{\"type\":\"map\",\"values\":\"HoodieCleanPartitionMetadata\",\"avro.java.string\":\"String\",\"default\":null}],\"default\":null},{\"name\":\"extraMetadata\",\"type\":[\"null\",{\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\",\"default\":null}],\"default\":null}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private static final SpecificData MODEL$ = new SpecificData();
private static final BinaryMessageEncoder ENCODER =
new BinaryMessageEncoder<>(MODEL$, SCHEMA$);
private static final BinaryMessageDecoder DECODER =
new BinaryMessageDecoder<>(MODEL$, SCHEMA$);
/**
* Return the BinaryMessageEncoder instance used by this class.
* @return the message encoder used by this class
*/
public static BinaryMessageEncoder getEncoder() {
return ENCODER;
}
/**
* Return the BinaryMessageDecoder instance used by this class.
* @return the message decoder 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
* @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
*/
public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
return new BinaryMessageDecoder<>(MODEL$, SCHEMA$, resolver);
}
/**
* Serializes this HoodieCleanMetadata to a ByteBuffer.
* @return a buffer holding the serialized data for this instance
* @throws java.io.IOException if this instance could not be serialized
*/
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
return ENCODER.encode(this);
}
/**
* Deserializes a HoodieCleanMetadata from a ByteBuffer.
* @param b a byte buffer holding serialized data for an instance of this class
* @return a HoodieCleanMetadata instance decoded from the given buffer
* @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
*/
public static HoodieCleanMetadata fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
private java.lang.String startCleanTime;
private long timeTakenInMillis;
private int totalFilesDeleted;
private java.lang.String earliestCommitToRetain;
private java.lang.String lastCompletedCommitTimestamp;
private java.util.Map partitionMetadata;
private java.lang.Integer version;
private java.util.Map bootstrapPartitionMetadata;
private java.util.Map extraMetadata;
/**
* 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 HoodieCleanMetadata() {}
/**
* All-args constructor.
* @param startCleanTime The new value for startCleanTime
* @param timeTakenInMillis The new value for timeTakenInMillis
* @param totalFilesDeleted The new value for totalFilesDeleted
* @param earliestCommitToRetain The new value for earliestCommitToRetain
* @param lastCompletedCommitTimestamp The new value for lastCompletedCommitTimestamp
* @param partitionMetadata The new value for partitionMetadata
* @param version The new value for version
* @param bootstrapPartitionMetadata The new value for bootstrapPartitionMetadata
* @param extraMetadata The new value for extraMetadata
*/
public HoodieCleanMetadata(java.lang.String startCleanTime, java.lang.Long timeTakenInMillis, java.lang.Integer totalFilesDeleted, java.lang.String earliestCommitToRetain, java.lang.String lastCompletedCommitTimestamp, java.util.Map partitionMetadata, java.lang.Integer version, java.util.Map bootstrapPartitionMetadata, java.util.Map extraMetadata) {
this.startCleanTime = startCleanTime;
this.timeTakenInMillis = timeTakenInMillis;
this.totalFilesDeleted = totalFilesDeleted;
this.earliestCommitToRetain = earliestCommitToRetain;
this.lastCompletedCommitTimestamp = lastCompletedCommitTimestamp;
this.partitionMetadata = partitionMetadata;
this.version = version;
this.bootstrapPartitionMetadata = bootstrapPartitionMetadata;
this.extraMetadata = extraMetadata;
}
@Override
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
@Override
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
@Override
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return startCleanTime;
case 1: return timeTakenInMillis;
case 2: return totalFilesDeleted;
case 3: return earliestCommitToRetain;
case 4: return lastCompletedCommitTimestamp;
case 5: return partitionMetadata;
case 6: return version;
case 7: return bootstrapPartitionMetadata;
case 8: return extraMetadata;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
// Used by DatumReader. Applications should not call.
@Override
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: startCleanTime = value$ != null ? value$.toString() : null; break;
case 1: timeTakenInMillis = (java.lang.Long)value$; break;
case 2: totalFilesDeleted = (java.lang.Integer)value$; break;
case 3: earliestCommitToRetain = value$ != null ? value$.toString() : null; break;
case 4: lastCompletedCommitTimestamp = value$ != null ? value$.toString() : null; break;
case 5: partitionMetadata = (java.util.Map)value$; break;
case 6: version = (java.lang.Integer)value$; break;
case 7: bootstrapPartitionMetadata = (java.util.Map)value$; break;
case 8: extraMetadata = (java.util.Map)value$; break;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
/**
* Gets the value of the 'startCleanTime' field.
* @return The value of the 'startCleanTime' field.
*/
public java.lang.String getStartCleanTime() {
return startCleanTime;
}
/**
* Sets the value of the 'startCleanTime' field.
* @param value the value to set.
*/
public void setStartCleanTime(java.lang.String value) {
this.startCleanTime = value;
}
/**
* Gets the value of the 'timeTakenInMillis' field.
* @return The value of the 'timeTakenInMillis' field.
*/
public long getTimeTakenInMillis() {
return timeTakenInMillis;
}
/**
* Sets the value of the 'timeTakenInMillis' field.
* @param value the value to set.
*/
public void setTimeTakenInMillis(long value) {
this.timeTakenInMillis = value;
}
/**
* Gets the value of the 'totalFilesDeleted' field.
* @return The value of the 'totalFilesDeleted' field.
*/
public int getTotalFilesDeleted() {
return totalFilesDeleted;
}
/**
* Sets the value of the 'totalFilesDeleted' field.
* @param value the value to set.
*/
public void setTotalFilesDeleted(int value) {
this.totalFilesDeleted = value;
}
/**
* Gets the value of the 'earliestCommitToRetain' field.
* @return The value of the 'earliestCommitToRetain' field.
*/
public java.lang.String getEarliestCommitToRetain() {
return earliestCommitToRetain;
}
/**
* Sets the value of the 'earliestCommitToRetain' field.
* @param value the value to set.
*/
public void setEarliestCommitToRetain(java.lang.String value) {
this.earliestCommitToRetain = value;
}
/**
* Gets the value of the 'lastCompletedCommitTimestamp' field.
* @return The value of the 'lastCompletedCommitTimestamp' field.
*/
public java.lang.String getLastCompletedCommitTimestamp() {
return lastCompletedCommitTimestamp;
}
/**
* Sets the value of the 'lastCompletedCommitTimestamp' field.
* @param value the value to set.
*/
public void setLastCompletedCommitTimestamp(java.lang.String value) {
this.lastCompletedCommitTimestamp = 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 'bootstrapPartitionMetadata' field.
* @return The value of the 'bootstrapPartitionMetadata' field.
*/
public java.util.Map getBootstrapPartitionMetadata() {
return bootstrapPartitionMetadata;
}
/**
* Sets the value of the 'bootstrapPartitionMetadata' field.
* @param value the value to set.
*/
public void setBootstrapPartitionMetadata(java.util.Map value) {
this.bootstrapPartitionMetadata = value;
}
/**
* Gets the value of the 'extraMetadata' field.
* @return The value of the 'extraMetadata' field.
*/
public java.util.Map getExtraMetadata() {
return extraMetadata;
}
/**
* Sets the value of the 'extraMetadata' field.
* @param value the value to set.
*/
public void setExtraMetadata(java.util.Map value) {
this.extraMetadata = value;
}
/**
* Creates a new HoodieCleanMetadata RecordBuilder.
* @return A new HoodieCleanMetadata RecordBuilder
*/
public static org.apache.hudi.avro.model.HoodieCleanMetadata.Builder newBuilder() {
return new org.apache.hudi.avro.model.HoodieCleanMetadata.Builder();
}
/**
* Creates a new HoodieCleanMetadata RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new HoodieCleanMetadata RecordBuilder
*/
public static org.apache.hudi.avro.model.HoodieCleanMetadata.Builder newBuilder(org.apache.hudi.avro.model.HoodieCleanMetadata.Builder other) {
if (other == null) {
return new org.apache.hudi.avro.model.HoodieCleanMetadata.Builder();
} else {
return new org.apache.hudi.avro.model.HoodieCleanMetadata.Builder(other);
}
}
/**
* Creates a new HoodieCleanMetadata RecordBuilder by copying an existing HoodieCleanMetadata instance.
* @param other The existing instance to copy.
* @return A new HoodieCleanMetadata RecordBuilder
*/
public static org.apache.hudi.avro.model.HoodieCleanMetadata.Builder newBuilder(org.apache.hudi.avro.model.HoodieCleanMetadata other) {
if (other == null) {
return new org.apache.hudi.avro.model.HoodieCleanMetadata.Builder();
} else {
return new org.apache.hudi.avro.model.HoodieCleanMetadata.Builder(other);
}
}
/**
* RecordBuilder for HoodieCleanMetadata instances.
*/
@org.apache.avro.specific.AvroGenerated
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.String startCleanTime;
private long timeTakenInMillis;
private int totalFilesDeleted;
private java.lang.String earliestCommitToRetain;
private java.lang.String lastCompletedCommitTimestamp;
private java.util.Map partitionMetadata;
private java.lang.Integer version;
private java.util.Map bootstrapPartitionMetadata;
private java.util.Map extraMetadata;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$, MODEL$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(org.apache.hudi.avro.model.HoodieCleanMetadata.Builder other) {
super(other);
if (isValidValue(fields()[0], other.startCleanTime)) {
this.startCleanTime = data().deepCopy(fields()[0].schema(), other.startCleanTime);
fieldSetFlags()[0] = other.fieldSetFlags()[0];
}
if (isValidValue(fields()[1], other.timeTakenInMillis)) {
this.timeTakenInMillis = data().deepCopy(fields()[1].schema(), other.timeTakenInMillis);
fieldSetFlags()[1] = other.fieldSetFlags()[1];
}
if (isValidValue(fields()[2], other.totalFilesDeleted)) {
this.totalFilesDeleted = data().deepCopy(fields()[2].schema(), other.totalFilesDeleted);
fieldSetFlags()[2] = other.fieldSetFlags()[2];
}
if (isValidValue(fields()[3], other.earliestCommitToRetain)) {
this.earliestCommitToRetain = data().deepCopy(fields()[3].schema(), other.earliestCommitToRetain);
fieldSetFlags()[3] = other.fieldSetFlags()[3];
}
if (isValidValue(fields()[4], other.lastCompletedCommitTimestamp)) {
this.lastCompletedCommitTimestamp = data().deepCopy(fields()[4].schema(), other.lastCompletedCommitTimestamp);
fieldSetFlags()[4] = other.fieldSetFlags()[4];
}
if (isValidValue(fields()[5], other.partitionMetadata)) {
this.partitionMetadata = data().deepCopy(fields()[5].schema(), other.partitionMetadata);
fieldSetFlags()[5] = other.fieldSetFlags()[5];
}
if (isValidValue(fields()[6], other.version)) {
this.version = data().deepCopy(fields()[6].schema(), other.version);
fieldSetFlags()[6] = other.fieldSetFlags()[6];
}
if (isValidValue(fields()[7], other.bootstrapPartitionMetadata)) {
this.bootstrapPartitionMetadata = data().deepCopy(fields()[7].schema(), other.bootstrapPartitionMetadata);
fieldSetFlags()[7] = other.fieldSetFlags()[7];
}
if (isValidValue(fields()[8], other.extraMetadata)) {
this.extraMetadata = data().deepCopy(fields()[8].schema(), other.extraMetadata);
fieldSetFlags()[8] = other.fieldSetFlags()[8];
}
}
/**
* Creates a Builder by copying an existing HoodieCleanMetadata instance
* @param other The existing instance to copy.
*/
private Builder(org.apache.hudi.avro.model.HoodieCleanMetadata other) {
super(SCHEMA$, MODEL$);
if (isValidValue(fields()[0], other.startCleanTime)) {
this.startCleanTime = data().deepCopy(fields()[0].schema(), other.startCleanTime);
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.earliestCommitToRetain)) {
this.earliestCommitToRetain = data().deepCopy(fields()[3].schema(), other.earliestCommitToRetain);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.lastCompletedCommitTimestamp)) {
this.lastCompletedCommitTimestamp = data().deepCopy(fields()[4].schema(), other.lastCompletedCommitTimestamp);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.partitionMetadata)) {
this.partitionMetadata = data().deepCopy(fields()[5].schema(), other.partitionMetadata);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.version)) {
this.version = data().deepCopy(fields()[6].schema(), other.version);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.bootstrapPartitionMetadata)) {
this.bootstrapPartitionMetadata = data().deepCopy(fields()[7].schema(), other.bootstrapPartitionMetadata);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.extraMetadata)) {
this.extraMetadata = data().deepCopy(fields()[8].schema(), other.extraMetadata);
fieldSetFlags()[8] = true;
}
}
/**
* Gets the value of the 'startCleanTime' field.
* @return The value.
*/
public java.lang.String getStartCleanTime() {
return startCleanTime;
}
/**
* Sets the value of the 'startCleanTime' field.
* @param value The value of 'startCleanTime'.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder setStartCleanTime(java.lang.String value) {
validate(fields()[0], value);
this.startCleanTime = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'startCleanTime' field has been set.
* @return True if the 'startCleanTime' field has been set, false otherwise.
*/
public boolean hasStartCleanTime() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'startCleanTime' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearStartCleanTime() {
startCleanTime = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'timeTakenInMillis' field.
* @return The value.
*/
public 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.HoodieCleanMetadata.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.HoodieCleanMetadata.Builder clearTimeTakenInMillis() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'totalFilesDeleted' field.
* @return The value.
*/
public int 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.HoodieCleanMetadata.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.HoodieCleanMetadata.Builder clearTotalFilesDeleted() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'earliestCommitToRetain' field.
* @return The value.
*/
public java.lang.String getEarliestCommitToRetain() {
return earliestCommitToRetain;
}
/**
* Sets the value of the 'earliestCommitToRetain' field.
* @param value The value of 'earliestCommitToRetain'.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder setEarliestCommitToRetain(java.lang.String value) {
validate(fields()[3], value);
this.earliestCommitToRetain = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'earliestCommitToRetain' field has been set.
* @return True if the 'earliestCommitToRetain' field has been set, false otherwise.
*/
public boolean hasEarliestCommitToRetain() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'earliestCommitToRetain' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearEarliestCommitToRetain() {
earliestCommitToRetain = null;
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'lastCompletedCommitTimestamp' field.
* @return The value.
*/
public java.lang.String getLastCompletedCommitTimestamp() {
return lastCompletedCommitTimestamp;
}
/**
* Sets the value of the 'lastCompletedCommitTimestamp' field.
* @param value The value of 'lastCompletedCommitTimestamp'.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder setLastCompletedCommitTimestamp(java.lang.String value) {
validate(fields()[4], value);
this.lastCompletedCommitTimestamp = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'lastCompletedCommitTimestamp' field has been set.
* @return True if the 'lastCompletedCommitTimestamp' field has been set, false otherwise.
*/
public boolean hasLastCompletedCommitTimestamp() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'lastCompletedCommitTimestamp' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearLastCompletedCommitTimestamp() {
lastCompletedCommitTimestamp = null;
fieldSetFlags()[4] = 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.HoodieCleanMetadata.Builder setPartitionMetadata(java.util.Map value) {
validate(fields()[5], value);
this.partitionMetadata = value;
fieldSetFlags()[5] = 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()[5];
}
/**
* Clears the value of the 'partitionMetadata' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearPartitionMetadata() {
partitionMetadata = null;
fieldSetFlags()[5] = 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.HoodieCleanMetadata.Builder setVersion(java.lang.Integer value) {
validate(fields()[6], value);
this.version = value;
fieldSetFlags()[6] = 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()[6];
}
/**
* Clears the value of the 'version' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearVersion() {
version = null;
fieldSetFlags()[6] = false;
return this;
}
/**
* Gets the value of the 'bootstrapPartitionMetadata' field.
* @return The value.
*/
public java.util.Map getBootstrapPartitionMetadata() {
return bootstrapPartitionMetadata;
}
/**
* Sets the value of the 'bootstrapPartitionMetadata' field.
* @param value The value of 'bootstrapPartitionMetadata'.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder setBootstrapPartitionMetadata(java.util.Map value) {
validate(fields()[7], value);
this.bootstrapPartitionMetadata = value;
fieldSetFlags()[7] = true;
return this;
}
/**
* Checks whether the 'bootstrapPartitionMetadata' field has been set.
* @return True if the 'bootstrapPartitionMetadata' field has been set, false otherwise.
*/
public boolean hasBootstrapPartitionMetadata() {
return fieldSetFlags()[7];
}
/**
* Clears the value of the 'bootstrapPartitionMetadata' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearBootstrapPartitionMetadata() {
bootstrapPartitionMetadata = null;
fieldSetFlags()[7] = false;
return this;
}
/**
* Gets the value of the 'extraMetadata' field.
* @return The value.
*/
public java.util.Map getExtraMetadata() {
return extraMetadata;
}
/**
* Sets the value of the 'extraMetadata' field.
* @param value The value of 'extraMetadata'.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder setExtraMetadata(java.util.Map value) {
validate(fields()[8], value);
this.extraMetadata = value;
fieldSetFlags()[8] = true;
return this;
}
/**
* Checks whether the 'extraMetadata' field has been set.
* @return True if the 'extraMetadata' field has been set, false otherwise.
*/
public boolean hasExtraMetadata() {
return fieldSetFlags()[8];
}
/**
* Clears the value of the 'extraMetadata' field.
* @return This builder.
*/
public org.apache.hudi.avro.model.HoodieCleanMetadata.Builder clearExtraMetadata() {
extraMetadata = null;
fieldSetFlags()[8] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public HoodieCleanMetadata build() {
try {
HoodieCleanMetadata record = new HoodieCleanMetadata();
record.startCleanTime = fieldSetFlags()[0] ? this.startCleanTime : (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.earliestCommitToRetain = fieldSetFlags()[3] ? this.earliestCommitToRetain : (java.lang.String) defaultValue(fields()[3]);
record.lastCompletedCommitTimestamp = fieldSetFlags()[4] ? this.lastCompletedCommitTimestamp : (java.lang.String) defaultValue(fields()[4]);
record.partitionMetadata = fieldSetFlags()[5] ? this.partitionMetadata : (java.util.Map) defaultValue(fields()[5]);
record.version = fieldSetFlags()[6] ? this.version : (java.lang.Integer) defaultValue(fields()[6]);
record.bootstrapPartitionMetadata = fieldSetFlags()[7] ? this.bootstrapPartitionMetadata : (java.util.Map) defaultValue(fields()[7]);
record.extraMetadata = fieldSetFlags()[8] ? this.extraMetadata : (java.util.Map) defaultValue(fields()[8]);
return record;
} catch (org.apache.avro.AvroMissingFieldException e) {
throw e;
} 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));
}
@Override protected boolean hasCustomCoders() { return true; }
@Override public void customEncode(org.apache.avro.io.Encoder out)
throws java.io.IOException
{
out.writeString(this.startCleanTime);
out.writeLong(this.timeTakenInMillis);
out.writeInt(this.totalFilesDeleted);
out.writeString(this.earliestCommitToRetain);
out.writeString(this.lastCompletedCommitTimestamp);
long size0 = this.partitionMetadata.size();
out.writeMapStart();
out.setItemCount(size0);
long actualSize0 = 0;
for (java.util.Map.Entry e0: this.partitionMetadata.entrySet()) {
actualSize0++;
out.startItem();
out.writeString(e0.getKey());
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v0 = e0.getValue();
v0.customEncode(out);
}
out.writeMapEnd();
if (actualSize0 != size0)
throw new java.util.ConcurrentModificationException("Map-size written was " + size0 + ", but element count was " + actualSize0 + ".");
if (this.version == null) {
out.writeIndex(1);
out.writeNull();
} else {
out.writeIndex(0);
out.writeInt(this.version);
}
if (this.bootstrapPartitionMetadata == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
long size1 = this.bootstrapPartitionMetadata.size();
out.writeMapStart();
out.setItemCount(size1);
long actualSize1 = 0;
for (java.util.Map.Entry e1: this.bootstrapPartitionMetadata.entrySet()) {
actualSize1++;
out.startItem();
out.writeString(e1.getKey());
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v1 = e1.getValue();
v1.customEncode(out);
}
out.writeMapEnd();
if (actualSize1 != size1)
throw new java.util.ConcurrentModificationException("Map-size written was " + size1 + ", but element count was " + actualSize1 + ".");
}
if (this.extraMetadata == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
long size2 = this.extraMetadata.size();
out.writeMapStart();
out.setItemCount(size2);
long actualSize2 = 0;
for (java.util.Map.Entry e2: this.extraMetadata.entrySet()) {
actualSize2++;
out.startItem();
out.writeString(e2.getKey());
java.lang.String v2 = e2.getValue();
out.writeString(v2);
}
out.writeMapEnd();
if (actualSize2 != size2)
throw new java.util.ConcurrentModificationException("Map-size written was " + size2 + ", but element count was " + actualSize2 + ".");
}
}
@Override public void customDecode(org.apache.avro.io.ResolvingDecoder in)
throws java.io.IOException
{
org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff();
if (fieldOrder == null) {
this.startCleanTime = in.readString();
this.timeTakenInMillis = in.readLong();
this.totalFilesDeleted = in.readInt();
this.earliestCommitToRetain = in.readString();
this.lastCompletedCommitTimestamp = in.readString();
long size0 = in.readMapStart();
java.util.Map m0 = this.partitionMetadata; // Need fresh name due to limitation of macro system
if (m0 == null) {
m0 = new java.util.HashMap((int)size0);
this.partitionMetadata = m0;
} else m0.clear();
for ( ; 0 < size0; size0 = in.mapNext()) {
for ( ; size0 != 0; size0--) {
java.lang.String k0 = null;
k0 = in.readString();
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v0 = null;
if (v0 == null) {
v0 = new org.apache.hudi.avro.model.HoodieCleanPartitionMetadata();
}
v0.customDecode(in);
m0.put(k0, v0);
}
}
if (in.readIndex() != 0) {
in.readNull();
this.version = null;
} else {
this.version = in.readInt();
}
if (in.readIndex() != 1) {
in.readNull();
this.bootstrapPartitionMetadata = null;
} else {
long size1 = in.readMapStart();
java.util.Map m1 = this.bootstrapPartitionMetadata; // Need fresh name due to limitation of macro system
if (m1 == null) {
m1 = new java.util.HashMap((int)size1);
this.bootstrapPartitionMetadata = m1;
} else m1.clear();
for ( ; 0 < size1; size1 = in.mapNext()) {
for ( ; size1 != 0; size1--) {
java.lang.String k1 = null;
k1 = in.readString();
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v1 = null;
if (v1 == null) {
v1 = new org.apache.hudi.avro.model.HoodieCleanPartitionMetadata();
}
v1.customDecode(in);
m1.put(k1, v1);
}
}
}
if (in.readIndex() != 1) {
in.readNull();
this.extraMetadata = null;
} else {
long size2 = in.readMapStart();
java.util.Map m2 = this.extraMetadata; // Need fresh name due to limitation of macro system
if (m2 == null) {
m2 = new java.util.HashMap((int)size2);
this.extraMetadata = m2;
} else m2.clear();
for ( ; 0 < size2; size2 = in.mapNext()) {
for ( ; size2 != 0; size2--) {
java.lang.String k2 = null;
k2 = in.readString();
java.lang.String v2 = null;
v2 = in.readString();
m2.put(k2, v2);
}
}
}
} else {
for (int i = 0; i < 9; i++) {
switch (fieldOrder[i].pos()) {
case 0:
this.startCleanTime = in.readString();
break;
case 1:
this.timeTakenInMillis = in.readLong();
break;
case 2:
this.totalFilesDeleted = in.readInt();
break;
case 3:
this.earliestCommitToRetain = in.readString();
break;
case 4:
this.lastCompletedCommitTimestamp = in.readString();
break;
case 5:
long size0 = in.readMapStart();
java.util.Map m0 = this.partitionMetadata; // Need fresh name due to limitation of macro system
if (m0 == null) {
m0 = new java.util.HashMap((int)size0);
this.partitionMetadata = m0;
} else m0.clear();
for ( ; 0 < size0; size0 = in.mapNext()) {
for ( ; size0 != 0; size0--) {
java.lang.String k0 = null;
k0 = in.readString();
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v0 = null;
if (v0 == null) {
v0 = new org.apache.hudi.avro.model.HoodieCleanPartitionMetadata();
}
v0.customDecode(in);
m0.put(k0, v0);
}
}
break;
case 6:
if (in.readIndex() != 0) {
in.readNull();
this.version = null;
} else {
this.version = in.readInt();
}
break;
case 7:
if (in.readIndex() != 1) {
in.readNull();
this.bootstrapPartitionMetadata = null;
} else {
long size1 = in.readMapStart();
java.util.Map m1 = this.bootstrapPartitionMetadata; // Need fresh name due to limitation of macro system
if (m1 == null) {
m1 = new java.util.HashMap((int)size1);
this.bootstrapPartitionMetadata = m1;
} else m1.clear();
for ( ; 0 < size1; size1 = in.mapNext()) {
for ( ; size1 != 0; size1--) {
java.lang.String k1 = null;
k1 = in.readString();
org.apache.hudi.avro.model.HoodieCleanPartitionMetadata v1 = null;
if (v1 == null) {
v1 = new org.apache.hudi.avro.model.HoodieCleanPartitionMetadata();
}
v1.customDecode(in);
m1.put(k1, v1);
}
}
}
break;
case 8:
if (in.readIndex() != 1) {
in.readNull();
this.extraMetadata = null;
} else {
long size2 = in.readMapStart();
java.util.Map m2 = this.extraMetadata; // Need fresh name due to limitation of macro system
if (m2 == null) {
m2 = new java.util.HashMap((int)size2);
this.extraMetadata = m2;
} else m2.clear();
for ( ; 0 < size2; size2 = in.mapNext()) {
for ( ; size2 != 0; size2--) {
java.lang.String k2 = null;
k2 = in.readString();
java.lang.String v2 = null;
v2 = in.readString();
m2.put(k2, v2);
}
}
}
break;
default:
throw new java.io.IOException("Corrupt ResolvingDecoder.");
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy