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.watcher.driver.context;  
007@SuppressWarnings("all")
008@org.apache.avro.specific.AvroGenerated
009public class AvroContextBase 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\":\"AvroContextBase\",\"namespace\":\"org.apache.reef.io.watcher.driver.context\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"evaluatorId\",\"type\":\"string\"},{\"name\":\"parentId\",\"type\":[\"string\",\"null\"]},{\"name\":\"evaluatorDescriptor\",\"type\":[{\"type\":\"record\",\"name\":\"AvroEvaluatorDescriptor\",\"namespace\":\"org.apache.reef.io.watcher.driver.evaluator\",\"fields\":[{\"name\":\"nodeDescriptor\",\"type\":{\"type\":\"record\",\"name\":\"AvroNodeDescriptor\",\"namespace\":\"org.apache.reef.io.watcher.driver.catalog\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"inetSocketAddress\",\"type\":\"string\"},{\"name\":\"rackDescriptor\",\"type\":{\"type\":\"record\",\"name\":\"AvroRackDescriptor\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"nodes\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroNodeDescriptorInRackDescriptor\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"inetSocketAddress\",\"type\":\"string\"}]}}}]}}]}},{\"name\":\"process\",\"type\":{\"type\":\"record\",\"name\":\"AvroEvaluatorProcess\",\"fields\":[{\"name\":\"commandLines\",\"type\":{\"type\":\"array\",\"items\":[\"string\",\"null\"]}},{\"name\":\"evaluatorType\",\"type\":{\"type\":\"enum\",\"name\":\"AvroEvaluatorType\",\"symbols\":[\"JVM\",\"CLR\",\"UNDECIDED\"]}},{\"name\":\"isOptionSet\",\"type\":\"boolean\"}]}},{\"name\":\"memory\",\"type\":\"int\"},{\"name\":\"numberOfCores\",\"type\":\"int\"}]},\"null\"]}]}");
011  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
012  @Deprecated public java.lang.CharSequence id;
013  @Deprecated public java.lang.CharSequence evaluatorId;
014  @Deprecated public java.lang.CharSequence parentId;
015  @Deprecated public org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor evaluatorDescriptor;
016
017  /**
018   * Default constructor.  Note that this does not initialize fields
019   * to their default values from the schema.  If that is desired then
020   * one should use <code>newBuilder()</code>. 
021   */
022  public AvroContextBase() {}
023
024  /**
025   * All-args constructor.
026   */
027  public AvroContextBase(java.lang.CharSequence id, java.lang.CharSequence evaluatorId, java.lang.CharSequence parentId, org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor evaluatorDescriptor) {
028    this.id = id;
029    this.evaluatorId = evaluatorId;
030    this.parentId = parentId;
031    this.evaluatorDescriptor = evaluatorDescriptor;
032  }
033
034  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
035  // Used by DatumWriter.  Applications should not call. 
036  public java.lang.Object get(int field$) {
037    switch (field$) {
038    case 0: return id;
039    case 1: return evaluatorId;
040    case 2: return parentId;
041    case 3: return evaluatorDescriptor;
042    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
043    }
044  }
045  // Used by DatumReader.  Applications should not call. 
046  @SuppressWarnings(value="unchecked")
047  public void put(int field$, java.lang.Object value$) {
048    switch (field$) {
049    case 0: id = (java.lang.CharSequence)value$; break;
050    case 1: evaluatorId = (java.lang.CharSequence)value$; break;
051    case 2: parentId = (java.lang.CharSequence)value$; break;
052    case 3: evaluatorDescriptor = (org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor)value$; break;
053    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
054    }
055  }
056
057  /**
058   * Gets the value of the 'id' field.
059   */
060  public java.lang.CharSequence getId() {
061    return id;
062  }
063
064  /**
065   * Sets the value of the 'id' field.
066   * @param value the value to set.
067   */
068  public void setId(java.lang.CharSequence value) {
069    this.id = value;
070  }
071
072  /**
073   * Gets the value of the 'evaluatorId' field.
074   */
075  public java.lang.CharSequence getEvaluatorId() {
076    return evaluatorId;
077  }
078
079  /**
080   * Sets the value of the 'evaluatorId' field.
081   * @param value the value to set.
082   */
083  public void setEvaluatorId(java.lang.CharSequence value) {
084    this.evaluatorId = value;
085  }
086
087  /**
088   * Gets the value of the 'parentId' field.
089   */
090  public java.lang.CharSequence getParentId() {
091    return parentId;
092  }
093
094  /**
095   * Sets the value of the 'parentId' field.
096   * @param value the value to set.
097   */
098  public void setParentId(java.lang.CharSequence value) {
099    this.parentId = value;
100  }
101
102  /**
103   * Gets the value of the 'evaluatorDescriptor' field.
104   */
105  public org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor getEvaluatorDescriptor() {
106    return evaluatorDescriptor;
107  }
108
109  /**
110   * Sets the value of the 'evaluatorDescriptor' field.
111   * @param value the value to set.
112   */
113  public void setEvaluatorDescriptor(org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor value) {
114    this.evaluatorDescriptor = value;
115  }
116
117  /** Creates a new AvroContextBase RecordBuilder */
118  public static org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder newBuilder() {
119    return new org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder();
120  }
121  
122  /** Creates a new AvroContextBase RecordBuilder by copying an existing Builder */
123  public static org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder newBuilder(org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder other) {
124    return new org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder(other);
125  }
126  
127  /** Creates a new AvroContextBase RecordBuilder by copying an existing AvroContextBase instance */
128  public static org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder newBuilder(org.apache.reef.io.watcher.driver.context.AvroContextBase other) {
129    return new org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder(other);
130  }
131  
132  /**
133   * RecordBuilder for AvroContextBase instances.
134   */
135  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroContextBase>
136    implements org.apache.avro.data.RecordBuilder<AvroContextBase> {
137
138    private java.lang.CharSequence id;
139    private java.lang.CharSequence evaluatorId;
140    private java.lang.CharSequence parentId;
141    private org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor evaluatorDescriptor;
142
143    /** Creates a new Builder */
144    private Builder() {
145      super(org.apache.reef.io.watcher.driver.context.AvroContextBase.SCHEMA$);
146    }
147    
148    /** Creates a Builder by copying an existing Builder */
149    private Builder(org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder other) {
150      super(other);
151      if (isValidValue(fields()[0], other.id)) {
152        this.id = data().deepCopy(fields()[0].schema(), other.id);
153        fieldSetFlags()[0] = true;
154      }
155      if (isValidValue(fields()[1], other.evaluatorId)) {
156        this.evaluatorId = data().deepCopy(fields()[1].schema(), other.evaluatorId);
157        fieldSetFlags()[1] = true;
158      }
159      if (isValidValue(fields()[2], other.parentId)) {
160        this.parentId = data().deepCopy(fields()[2].schema(), other.parentId);
161        fieldSetFlags()[2] = true;
162      }
163      if (isValidValue(fields()[3], other.evaluatorDescriptor)) {
164        this.evaluatorDescriptor = data().deepCopy(fields()[3].schema(), other.evaluatorDescriptor);
165        fieldSetFlags()[3] = true;
166      }
167    }
168    
169    /** Creates a Builder by copying an existing AvroContextBase instance */
170    private Builder(org.apache.reef.io.watcher.driver.context.AvroContextBase other) {
171            super(org.apache.reef.io.watcher.driver.context.AvroContextBase.SCHEMA$);
172      if (isValidValue(fields()[0], other.id)) {
173        this.id = data().deepCopy(fields()[0].schema(), other.id);
174        fieldSetFlags()[0] = true;
175      }
176      if (isValidValue(fields()[1], other.evaluatorId)) {
177        this.evaluatorId = data().deepCopy(fields()[1].schema(), other.evaluatorId);
178        fieldSetFlags()[1] = true;
179      }
180      if (isValidValue(fields()[2], other.parentId)) {
181        this.parentId = data().deepCopy(fields()[2].schema(), other.parentId);
182        fieldSetFlags()[2] = true;
183      }
184      if (isValidValue(fields()[3], other.evaluatorDescriptor)) {
185        this.evaluatorDescriptor = data().deepCopy(fields()[3].schema(), other.evaluatorDescriptor);
186        fieldSetFlags()[3] = true;
187      }
188    }
189
190    /** Gets the value of the 'id' field */
191    public java.lang.CharSequence getId() {
192      return id;
193    }
194    
195    /** Sets the value of the 'id' field */
196    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder setId(java.lang.CharSequence value) {
197      validate(fields()[0], value);
198      this.id = value;
199      fieldSetFlags()[0] = true;
200      return this; 
201    }
202    
203    /** Checks whether the 'id' field has been set */
204    public boolean hasId() {
205      return fieldSetFlags()[0];
206    }
207    
208    /** Clears the value of the 'id' field */
209    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder clearId() {
210      id = null;
211      fieldSetFlags()[0] = false;
212      return this;
213    }
214
215    /** Gets the value of the 'evaluatorId' field */
216    public java.lang.CharSequence getEvaluatorId() {
217      return evaluatorId;
218    }
219    
220    /** Sets the value of the 'evaluatorId' field */
221    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder setEvaluatorId(java.lang.CharSequence value) {
222      validate(fields()[1], value);
223      this.evaluatorId = value;
224      fieldSetFlags()[1] = true;
225      return this; 
226    }
227    
228    /** Checks whether the 'evaluatorId' field has been set */
229    public boolean hasEvaluatorId() {
230      return fieldSetFlags()[1];
231    }
232    
233    /** Clears the value of the 'evaluatorId' field */
234    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder clearEvaluatorId() {
235      evaluatorId = null;
236      fieldSetFlags()[1] = false;
237      return this;
238    }
239
240    /** Gets the value of the 'parentId' field */
241    public java.lang.CharSequence getParentId() {
242      return parentId;
243    }
244    
245    /** Sets the value of the 'parentId' field */
246    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder setParentId(java.lang.CharSequence value) {
247      validate(fields()[2], value);
248      this.parentId = value;
249      fieldSetFlags()[2] = true;
250      return this; 
251    }
252    
253    /** Checks whether the 'parentId' field has been set */
254    public boolean hasParentId() {
255      return fieldSetFlags()[2];
256    }
257    
258    /** Clears the value of the 'parentId' field */
259    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder clearParentId() {
260      parentId = null;
261      fieldSetFlags()[2] = false;
262      return this;
263    }
264
265    /** Gets the value of the 'evaluatorDescriptor' field */
266    public org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor getEvaluatorDescriptor() {
267      return evaluatorDescriptor;
268    }
269    
270    /** Sets the value of the 'evaluatorDescriptor' field */
271    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder setEvaluatorDescriptor(org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor value) {
272      validate(fields()[3], value);
273      this.evaluatorDescriptor = value;
274      fieldSetFlags()[3] = true;
275      return this; 
276    }
277    
278    /** Checks whether the 'evaluatorDescriptor' field has been set */
279    public boolean hasEvaluatorDescriptor() {
280      return fieldSetFlags()[3];
281    }
282    
283    /** Clears the value of the 'evaluatorDescriptor' field */
284    public org.apache.reef.io.watcher.driver.context.AvroContextBase.Builder clearEvaluatorDescriptor() {
285      evaluatorDescriptor = null;
286      fieldSetFlags()[3] = false;
287      return this;
288    }
289
290    @Override
291    public AvroContextBase build() {
292      try {
293        AvroContextBase record = new AvroContextBase();
294        record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]);
295        record.evaluatorId = fieldSetFlags()[1] ? this.evaluatorId : (java.lang.CharSequence) defaultValue(fields()[1]);
296        record.parentId = fieldSetFlags()[2] ? this.parentId : (java.lang.CharSequence) defaultValue(fields()[2]);
297        record.evaluatorDescriptor = fieldSetFlags()[3] ? this.evaluatorDescriptor : (org.apache.reef.io.watcher.driver.evaluator.AvroEvaluatorDescriptor) defaultValue(fields()[3]);
298        return record;
299      } catch (Exception e) {
300        throw new org.apache.avro.AvroRuntimeException(e);
301      }
302    }
303  }
304}