This project has retired. For details please refer to its Attic page.
Source code
001/**
002 * Autogenerated by Avro
003 * 
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.io.data.loading.avro;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroEvaluatorRequest extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
010  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroEvaluatorRequest\",\"namespace\":\"org.apache.reef.io.data.loading.avro\",\"fields\":[{\"name\":\"megaBytes\",\"type\":\"int\"},{\"name\":\"number\",\"type\":\"int\"},{\"name\":\"cores\",\"type\":\"int\"},{\"name\":\"nodeNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"}},{\"name\":\"rackNames\",\"type\":{\"type\":\"array\",\"items\":\"string\"}}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public int megaBytes;
013  @Deprecated public int number;
014  @Deprecated public int cores;
015  @Deprecated public java.util.List<java.lang.CharSequence> nodeNames;
016  @Deprecated public java.util.List<java.lang.CharSequence> rackNames;
017
018  /**
019   * Default constructor.  Note that this does not initialize fields
020   * to their default values from the schema.  If that is desired then
021   * one should use <code>newBuilder()</code>. 
022   */
023  public AvroEvaluatorRequest() {}
024
025  /**
026   * All-args constructor.
027   */
028  public AvroEvaluatorRequest(java.lang.Integer megaBytes, java.lang.Integer number, java.lang.Integer cores, java.util.List<java.lang.CharSequence> nodeNames, java.util.List<java.lang.CharSequence> rackNames) {
029    this.megaBytes = megaBytes;
030    this.number = number;
031    this.cores = cores;
032    this.nodeNames = nodeNames;
033    this.rackNames = rackNames;
034  }
035
036  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
037  // Used by DatumWriter.  Applications should not call. 
038  public java.lang.Object get(int field$) {
039    switch (field$) {
040    case 0: return megaBytes;
041    case 1: return number;
042    case 2: return cores;
043    case 3: return nodeNames;
044    case 4: return rackNames;
045    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
046    }
047  }
048  // Used by DatumReader.  Applications should not call. 
049  @SuppressWarnings(value="unchecked")
050  public void put(int field$, java.lang.Object value$) {
051    switch (field$) {
052    case 0: megaBytes = (java.lang.Integer)value$; break;
053    case 1: number = (java.lang.Integer)value$; break;
054    case 2: cores = (java.lang.Integer)value$; break;
055    case 3: nodeNames = (java.util.List<java.lang.CharSequence>)value$; break;
056    case 4: rackNames = (java.util.List<java.lang.CharSequence>)value$; break;
057    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
058    }
059  }
060
061  /**
062   * Gets the value of the 'megaBytes' field.
063   */
064  public java.lang.Integer getMegaBytes() {
065    return megaBytes;
066  }
067
068  /**
069   * Sets the value of the 'megaBytes' field.
070   * @param value the value to set.
071   */
072  public void setMegaBytes(java.lang.Integer value) {
073    this.megaBytes = value;
074  }
075
076  /**
077   * Gets the value of the 'number' field.
078   */
079  public java.lang.Integer getNumber() {
080    return number;
081  }
082
083  /**
084   * Sets the value of the 'number' field.
085   * @param value the value to set.
086   */
087  public void setNumber(java.lang.Integer value) {
088    this.number = value;
089  }
090
091  /**
092   * Gets the value of the 'cores' field.
093   */
094  public java.lang.Integer getCores() {
095    return cores;
096  }
097
098  /**
099   * Sets the value of the 'cores' field.
100   * @param value the value to set.
101   */
102  public void setCores(java.lang.Integer value) {
103    this.cores = value;
104  }
105
106  /**
107   * Gets the value of the 'nodeNames' field.
108   */
109  public java.util.List<java.lang.CharSequence> getNodeNames() {
110    return nodeNames;
111  }
112
113  /**
114   * Sets the value of the 'nodeNames' field.
115   * @param value the value to set.
116   */
117  public void setNodeNames(java.util.List<java.lang.CharSequence> value) {
118    this.nodeNames = value;
119  }
120
121  /**
122   * Gets the value of the 'rackNames' field.
123   */
124  public java.util.List<java.lang.CharSequence> getRackNames() {
125    return rackNames;
126  }
127
128  /**
129   * Sets the value of the 'rackNames' field.
130   * @param value the value to set.
131   */
132  public void setRackNames(java.util.List<java.lang.CharSequence> value) {
133    this.rackNames = value;
134  }
135
136  /** Creates a new AvroEvaluatorRequest RecordBuilder */
137  public static org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder newBuilder() {
138    return new org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder();
139  }
140  
141  /** Creates a new AvroEvaluatorRequest RecordBuilder by copying an existing Builder */
142  public static org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder newBuilder(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder other) {
143    return new org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder(other);
144  }
145  
146  /** Creates a new AvroEvaluatorRequest RecordBuilder by copying an existing AvroEvaluatorRequest instance */
147  public static org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder newBuilder(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest other) {
148    return new org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder(other);
149  }
150  
151  /**
152   * RecordBuilder for AvroEvaluatorRequest instances.
153   */
154  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroEvaluatorRequest>
155    implements org.apache.avro.data.RecordBuilder<AvroEvaluatorRequest> {
156
157    private int megaBytes;
158    private int number;
159    private int cores;
160    private java.util.List<java.lang.CharSequence> nodeNames;
161    private java.util.List<java.lang.CharSequence> rackNames;
162
163    /** Creates a new Builder */
164    private Builder() {
165      super(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.SCHEMA$);
166    }
167    
168    /** Creates a Builder by copying an existing Builder */
169    private Builder(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder other) {
170      super(other);
171      if (isValidValue(fields()[0], other.megaBytes)) {
172        this.megaBytes = data().deepCopy(fields()[0].schema(), other.megaBytes);
173        fieldSetFlags()[0] = true;
174      }
175      if (isValidValue(fields()[1], other.number)) {
176        this.number = data().deepCopy(fields()[1].schema(), other.number);
177        fieldSetFlags()[1] = true;
178      }
179      if (isValidValue(fields()[2], other.cores)) {
180        this.cores = data().deepCopy(fields()[2].schema(), other.cores);
181        fieldSetFlags()[2] = true;
182      }
183      if (isValidValue(fields()[3], other.nodeNames)) {
184        this.nodeNames = data().deepCopy(fields()[3].schema(), other.nodeNames);
185        fieldSetFlags()[3] = true;
186      }
187      if (isValidValue(fields()[4], other.rackNames)) {
188        this.rackNames = data().deepCopy(fields()[4].schema(), other.rackNames);
189        fieldSetFlags()[4] = true;
190      }
191    }
192    
193    /** Creates a Builder by copying an existing AvroEvaluatorRequest instance */
194    private Builder(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest other) {
195            super(org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.SCHEMA$);
196      if (isValidValue(fields()[0], other.megaBytes)) {
197        this.megaBytes = data().deepCopy(fields()[0].schema(), other.megaBytes);
198        fieldSetFlags()[0] = true;
199      }
200      if (isValidValue(fields()[1], other.number)) {
201        this.number = data().deepCopy(fields()[1].schema(), other.number);
202        fieldSetFlags()[1] = true;
203      }
204      if (isValidValue(fields()[2], other.cores)) {
205        this.cores = data().deepCopy(fields()[2].schema(), other.cores);
206        fieldSetFlags()[2] = true;
207      }
208      if (isValidValue(fields()[3], other.nodeNames)) {
209        this.nodeNames = data().deepCopy(fields()[3].schema(), other.nodeNames);
210        fieldSetFlags()[3] = true;
211      }
212      if (isValidValue(fields()[4], other.rackNames)) {
213        this.rackNames = data().deepCopy(fields()[4].schema(), other.rackNames);
214        fieldSetFlags()[4] = true;
215      }
216    }
217
218    /** Gets the value of the 'megaBytes' field */
219    public java.lang.Integer getMegaBytes() {
220      return megaBytes;
221    }
222    
223    /** Sets the value of the 'megaBytes' field */
224    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder setMegaBytes(int value) {
225      validate(fields()[0], value);
226      this.megaBytes = value;
227      fieldSetFlags()[0] = true;
228      return this; 
229    }
230    
231    /** Checks whether the 'megaBytes' field has been set */
232    public boolean hasMegaBytes() {
233      return fieldSetFlags()[0];
234    }
235    
236    /** Clears the value of the 'megaBytes' field */
237    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder clearMegaBytes() {
238      fieldSetFlags()[0] = false;
239      return this;
240    }
241
242    /** Gets the value of the 'number' field */
243    public java.lang.Integer getNumber() {
244      return number;
245    }
246    
247    /** Sets the value of the 'number' field */
248    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder setNumber(int value) {
249      validate(fields()[1], value);
250      this.number = value;
251      fieldSetFlags()[1] = true;
252      return this; 
253    }
254    
255    /** Checks whether the 'number' field has been set */
256    public boolean hasNumber() {
257      return fieldSetFlags()[1];
258    }
259    
260    /** Clears the value of the 'number' field */
261    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder clearNumber() {
262      fieldSetFlags()[1] = false;
263      return this;
264    }
265
266    /** Gets the value of the 'cores' field */
267    public java.lang.Integer getCores() {
268      return cores;
269    }
270    
271    /** Sets the value of the 'cores' field */
272    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder setCores(int value) {
273      validate(fields()[2], value);
274      this.cores = value;
275      fieldSetFlags()[2] = true;
276      return this; 
277    }
278    
279    /** Checks whether the 'cores' field has been set */
280    public boolean hasCores() {
281      return fieldSetFlags()[2];
282    }
283    
284    /** Clears the value of the 'cores' field */
285    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder clearCores() {
286      fieldSetFlags()[2] = false;
287      return this;
288    }
289
290    /** Gets the value of the 'nodeNames' field */
291    public java.util.List<java.lang.CharSequence> getNodeNames() {
292      return nodeNames;
293    }
294    
295    /** Sets the value of the 'nodeNames' field */
296    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder setNodeNames(java.util.List<java.lang.CharSequence> value) {
297      validate(fields()[3], value);
298      this.nodeNames = value;
299      fieldSetFlags()[3] = true;
300      return this; 
301    }
302    
303    /** Checks whether the 'nodeNames' field has been set */
304    public boolean hasNodeNames() {
305      return fieldSetFlags()[3];
306    }
307    
308    /** Clears the value of the 'nodeNames' field */
309    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder clearNodeNames() {
310      nodeNames = null;
311      fieldSetFlags()[3] = false;
312      return this;
313    }
314
315    /** Gets the value of the 'rackNames' field */
316    public java.util.List<java.lang.CharSequence> getRackNames() {
317      return rackNames;
318    }
319    
320    /** Sets the value of the 'rackNames' field */
321    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder setRackNames(java.util.List<java.lang.CharSequence> value) {
322      validate(fields()[4], value);
323      this.rackNames = value;
324      fieldSetFlags()[4] = true;
325      return this; 
326    }
327    
328    /** Checks whether the 'rackNames' field has been set */
329    public boolean hasRackNames() {
330      return fieldSetFlags()[4];
331    }
332    
333    /** Clears the value of the 'rackNames' field */
334    public org.apache.reef.io.data.loading.avro.AvroEvaluatorRequest.Builder clearRackNames() {
335      rackNames = null;
336      fieldSetFlags()[4] = false;
337      return this;
338    }
339
340    @Override
341    public AvroEvaluatorRequest build() {
342      try {
343        AvroEvaluatorRequest record = new AvroEvaluatorRequest();
344        record.megaBytes = fieldSetFlags()[0] ? this.megaBytes : (java.lang.Integer) defaultValue(fields()[0]);
345        record.number = fieldSetFlags()[1] ? this.number : (java.lang.Integer) defaultValue(fields()[1]);
346        record.cores = fieldSetFlags()[2] ? this.cores : (java.lang.Integer) defaultValue(fields()[2]);
347        record.nodeNames = fieldSetFlags()[3] ? this.nodeNames : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[3]);
348        record.rackNames = fieldSetFlags()[4] ? this.rackNames : (java.util.List<java.lang.CharSequence>) defaultValue(fields()[4]);
349        return record;
350      } catch (Exception e) {
351        throw new org.apache.avro.AvroRuntimeException(e);
352      }
353    }
354  }
355}