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

org.apache.hadoop.mapreduce.jobhistory.JhCounters Maven / Gradle / Ivy

There is a newer version: 3.2.0-9
Show newest version
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package org.apache.hadoop.mapreduce.jobhistory;  
@SuppressWarnings("all")
@io.prestosql.hadoop.$internal.org.apache.avro.specific.AvroGenerated
public class JhCounters extends io.prestosql.hadoop.$internal.org.apache.avro.specific.SpecificRecordBase implements io.prestosql.hadoop.$internal.org.apache.avro.specific.SpecificRecord {
  public static final io.prestosql.hadoop.$internal.org.apache.avro.Schema SCHEMA$ = new io.prestosql.hadoop.$internal.org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"JhCounters\",\"namespace\":\"org.apache.hadoop.mapreduce.jobhistory\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"groups\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"JhCounterGroup\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"displayName\",\"type\":\"string\"},{\"name\":\"counts\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"JhCounter\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"displayName\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"long\"}]}}}]}}}]}");
  public static io.prestosql.hadoop.$internal.org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  @Deprecated public java.lang.CharSequence name;
  @Deprecated public java.util.List groups;

  /**
   * Default constructor.
   */
  public JhCounters() {}

  /**
   * All-args constructor.
   */
  public JhCounters(java.lang.CharSequence name, java.util.List groups) {
    this.name = name;
    this.groups = groups;
  }

  public io.prestosql.hadoop.$internal.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 name;
    case 1: return groups;
    default: throw new io.prestosql.hadoop.$internal.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: name = (java.lang.CharSequence)value$; break;
    case 1: groups = (java.util.List)value$; break;
    default: throw new io.prestosql.hadoop.$internal.org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'name' field.
   */
  public java.lang.CharSequence getName() {
    return name;
  }

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

  /**
   * Gets the value of the 'groups' field.
   */
  public java.util.List getGroups() {
    return groups;
  }

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

  /** Creates a new JhCounters RecordBuilder */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder() {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder();
  }
  
  /** Creates a new JhCounters RecordBuilder by copying an existing Builder */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder(org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder other) {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder(other);
  }
  
  /** Creates a new JhCounters RecordBuilder by copying an existing JhCounters instance */
  public static org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder newBuilder(org.apache.hadoop.mapreduce.jobhistory.JhCounters other) {
    return new org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder(other);
  }
  
  /**
   * RecordBuilder for JhCounters instances.
   */
  public static class Builder extends io.prestosql.hadoop.$internal.org.apache.avro.specific.SpecificRecordBuilderBase
    implements io.prestosql.hadoop.$internal.org.apache.avro.data.RecordBuilder {

    private java.lang.CharSequence name;
    private java.util.List groups;

    /** Creates a new Builder */
    private Builder() {
      super(org.apache.hadoop.mapreduce.jobhistory.JhCounters.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder other) {
      super(other);
    }
    
    /** Creates a Builder by copying an existing JhCounters instance */
    private Builder(org.apache.hadoop.mapreduce.jobhistory.JhCounters other) {
            super(org.apache.hadoop.mapreduce.jobhistory.JhCounters.SCHEMA$);
      if (isValidValue(fields()[0], other.name)) {
        this.name = data().deepCopy(fields()[0].schema(), other.name);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.groups)) {
        this.groups = data().deepCopy(fields()[1].schema(), other.groups);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'name' field */
    public java.lang.CharSequence getName() {
      return name;
    }
    
    /** Sets the value of the 'name' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder setName(java.lang.CharSequence value) {
      validate(fields()[0], value);
      this.name = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'name' field has been set */
    public boolean hasName() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'name' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder clearName() {
      name = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'groups' field */
    public java.util.List getGroups() {
      return groups;
    }
    
    /** Sets the value of the 'groups' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder setGroups(java.util.List value) {
      validate(fields()[1], value);
      this.groups = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'groups' field has been set */
    public boolean hasGroups() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'groups' field */
    public org.apache.hadoop.mapreduce.jobhistory.JhCounters.Builder clearGroups() {
      groups = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public JhCounters build() {
      try {
        JhCounters record = new JhCounters();
        record.name = fieldSetFlags()[0] ? this.name : (java.lang.CharSequence) defaultValue(fields()[0]);
        record.groups = fieldSetFlags()[1] ? this.groups : (java.util.List) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new io.prestosql.hadoop.$internal.org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy