001/**
002 * Autogenerated by Avro
003 *
004 * DO NOT EDIT DIRECTLY
005 */
006package org.apache.reef.reef.bridge.client.avro;
007
008import org.apache.avro.specific.SpecificData;
009
010@SuppressWarnings("all")
011/** General cross-language submission parameters to the YARN runtime */
012@org.apache.avro.specific.AvroGenerated
013public class AvroYarnJobSubmissionParameters extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
014  private static final long serialVersionUID = -6879126362986534187L;
015  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"AvroYarnJobSubmissionParameters\",\"namespace\":\"org.apache.reef.reef.bridge.client.avro\",\"doc\":\"General cross-language submission parameters to the YARN runtime\",\"fields\":[{\"name\":\"sharedJobSubmissionParameters\",\"type\":{\"type\":\"record\",\"name\":\"AvroJobSubmissionParameters\",\"doc\":\"General cross-language job submission parameters shared by all runtimes\",\"fields\":[{\"name\":\"jobId\",\"type\":\"string\"},{\"name\":\"jobSubmissionFolder\",\"type\":\"string\"}]}},{\"name\":\"dfsJobSubmissionFolder\",\"type\":\"string\",\"default\":\"NULL\"},{\"name\":\"fileSystemUrl\",\"type\":\"string\",\"default\":\"NULL\"},{\"name\":\"jobSubmissionDirectoryPrefix\",\"type\":\"string\"}]}");
016  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
017  @Deprecated public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters sharedJobSubmissionParameters;
018  @Deprecated public java.lang.CharSequence dfsJobSubmissionFolder;
019  @Deprecated public java.lang.CharSequence fileSystemUrl;
020  @Deprecated public java.lang.CharSequence jobSubmissionDirectoryPrefix;
021
022  /**
023   * Default constructor.  Note that this does not initialize fields
024   * to their default values from the schema.  If that is desired then
025   * one should use <code>newBuilder()</code>.
026   */
027  public AvroYarnJobSubmissionParameters() {}
028
029  /**
030   * All-args constructor.
031   * @param sharedJobSubmissionParameters The new value for sharedJobSubmissionParameters
032   * @param dfsJobSubmissionFolder The new value for dfsJobSubmissionFolder
033   * @param fileSystemUrl The new value for fileSystemUrl
034   * @param jobSubmissionDirectoryPrefix The new value for jobSubmissionDirectoryPrefix
035   */
036  public AvroYarnJobSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters sharedJobSubmissionParameters, java.lang.CharSequence dfsJobSubmissionFolder, java.lang.CharSequence fileSystemUrl, java.lang.CharSequence jobSubmissionDirectoryPrefix) {
037    this.sharedJobSubmissionParameters = sharedJobSubmissionParameters;
038    this.dfsJobSubmissionFolder = dfsJobSubmissionFolder;
039    this.fileSystemUrl = fileSystemUrl;
040    this.jobSubmissionDirectoryPrefix = jobSubmissionDirectoryPrefix;
041  }
042
043  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
044  // Used by DatumWriter.  Applications should not call.
045  public java.lang.Object get(int field$) {
046    switch (field$) {
047    case 0: return sharedJobSubmissionParameters;
048    case 1: return dfsJobSubmissionFolder;
049    case 2: return fileSystemUrl;
050    case 3: return jobSubmissionDirectoryPrefix;
051    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
052    }
053  }
054
055  // Used by DatumReader.  Applications should not call.
056  @SuppressWarnings(value="unchecked")
057  public void put(int field$, java.lang.Object value$) {
058    switch (field$) {
059    case 0: sharedJobSubmissionParameters = (org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters)value$; break;
060    case 1: dfsJobSubmissionFolder = (java.lang.CharSequence)value$; break;
061    case 2: fileSystemUrl = (java.lang.CharSequence)value$; break;
062    case 3: jobSubmissionDirectoryPrefix = (java.lang.CharSequence)value$; break;
063    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
064    }
065  }
066
067  /**
068   * Gets the value of the 'sharedJobSubmissionParameters' field.
069   * @return The value of the 'sharedJobSubmissionParameters' field.
070   */
071  public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters getSharedJobSubmissionParameters() {
072    return sharedJobSubmissionParameters;
073  }
074
075  /**
076   * Sets the value of the 'sharedJobSubmissionParameters' field.
077   * @param value the value to set.
078   */
079  public void setSharedJobSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters value) {
080    this.sharedJobSubmissionParameters = value;
081  }
082
083  /**
084   * Gets the value of the 'dfsJobSubmissionFolder' field.
085   * @return The value of the 'dfsJobSubmissionFolder' field.
086   */
087  public java.lang.CharSequence getDfsJobSubmissionFolder() {
088    return dfsJobSubmissionFolder;
089  }
090
091  /**
092   * Sets the value of the 'dfsJobSubmissionFolder' field.
093   * @param value the value to set.
094   */
095  public void setDfsJobSubmissionFolder(java.lang.CharSequence value) {
096    this.dfsJobSubmissionFolder = value;
097  }
098
099  /**
100   * Gets the value of the 'fileSystemUrl' field.
101   * @return The value of the 'fileSystemUrl' field.
102   */
103  public java.lang.CharSequence getFileSystemUrl() {
104    return fileSystemUrl;
105  }
106
107  /**
108   * Sets the value of the 'fileSystemUrl' field.
109   * @param value the value to set.
110   */
111  public void setFileSystemUrl(java.lang.CharSequence value) {
112    this.fileSystemUrl = value;
113  }
114
115  /**
116   * Gets the value of the 'jobSubmissionDirectoryPrefix' field.
117   * @return The value of the 'jobSubmissionDirectoryPrefix' field.
118   */
119  public java.lang.CharSequence getJobSubmissionDirectoryPrefix() {
120    return jobSubmissionDirectoryPrefix;
121  }
122
123  /**
124   * Sets the value of the 'jobSubmissionDirectoryPrefix' field.
125   * @param value the value to set.
126   */
127  public void setJobSubmissionDirectoryPrefix(java.lang.CharSequence value) {
128    this.jobSubmissionDirectoryPrefix = value;
129  }
130
131  /**
132   * Creates a new AvroYarnJobSubmissionParameters RecordBuilder.
133   * @return A new AvroYarnJobSubmissionParameters RecordBuilder
134   */
135  public static org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder newBuilder() {
136    return new org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder();
137  }
138
139  /**
140   * Creates a new AvroYarnJobSubmissionParameters RecordBuilder by copying an existing Builder.
141   * @param other The existing builder to copy.
142   * @return A new AvroYarnJobSubmissionParameters RecordBuilder
143   */
144  public static org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder other) {
145    return new org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder(other);
146  }
147
148  /**
149   * Creates a new AvroYarnJobSubmissionParameters RecordBuilder by copying an existing AvroYarnJobSubmissionParameters instance.
150   * @param other The existing instance to copy.
151   * @return A new AvroYarnJobSubmissionParameters RecordBuilder
152   */
153  public static org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder newBuilder(org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters other) {
154    return new org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder(other);
155  }
156
157  /**
158   * RecordBuilder for AvroYarnJobSubmissionParameters instances.
159   */
160  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroYarnJobSubmissionParameters>
161    implements org.apache.avro.data.RecordBuilder<AvroYarnJobSubmissionParameters> {
162
163    private org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters sharedJobSubmissionParameters;
164    private org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder sharedJobSubmissionParametersBuilder;
165    private java.lang.CharSequence dfsJobSubmissionFolder;
166    private java.lang.CharSequence fileSystemUrl;
167    private java.lang.CharSequence jobSubmissionDirectoryPrefix;
168
169    /** Creates a new Builder */
170    private Builder() {
171      super(SCHEMA$);
172    }
173
174    /**
175     * Creates a Builder by copying an existing Builder.
176     * @param other The existing Builder to copy.
177     */
178    private Builder(org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder other) {
179      super(other);
180      if (isValidValue(fields()[0], other.sharedJobSubmissionParameters)) {
181        this.sharedJobSubmissionParameters = data().deepCopy(fields()[0].schema(), other.sharedJobSubmissionParameters);
182        fieldSetFlags()[0] = true;
183      }
184      if (other.hasSharedJobSubmissionParametersBuilder()) {
185        this.sharedJobSubmissionParametersBuilder = org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.newBuilder(other.getSharedJobSubmissionParametersBuilder());
186      }
187      if (isValidValue(fields()[1], other.dfsJobSubmissionFolder)) {
188        this.dfsJobSubmissionFolder = data().deepCopy(fields()[1].schema(), other.dfsJobSubmissionFolder);
189        fieldSetFlags()[1] = true;
190      }
191      if (isValidValue(fields()[2], other.fileSystemUrl)) {
192        this.fileSystemUrl = data().deepCopy(fields()[2].schema(), other.fileSystemUrl);
193        fieldSetFlags()[2] = true;
194      }
195      if (isValidValue(fields()[3], other.jobSubmissionDirectoryPrefix)) {
196        this.jobSubmissionDirectoryPrefix = data().deepCopy(fields()[3].schema(), other.jobSubmissionDirectoryPrefix);
197        fieldSetFlags()[3] = true;
198      }
199    }
200
201    /**
202     * Creates a Builder by copying an existing AvroYarnJobSubmissionParameters instance
203     * @param other The existing instance to copy.
204     */
205    private Builder(org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters other) {
206            super(SCHEMA$);
207      if (isValidValue(fields()[0], other.sharedJobSubmissionParameters)) {
208        this.sharedJobSubmissionParameters = data().deepCopy(fields()[0].schema(), other.sharedJobSubmissionParameters);
209        fieldSetFlags()[0] = true;
210      }
211      this.sharedJobSubmissionParametersBuilder = null;
212      if (isValidValue(fields()[1], other.dfsJobSubmissionFolder)) {
213        this.dfsJobSubmissionFolder = data().deepCopy(fields()[1].schema(), other.dfsJobSubmissionFolder);
214        fieldSetFlags()[1] = true;
215      }
216      if (isValidValue(fields()[2], other.fileSystemUrl)) {
217        this.fileSystemUrl = data().deepCopy(fields()[2].schema(), other.fileSystemUrl);
218        fieldSetFlags()[2] = true;
219      }
220      if (isValidValue(fields()[3], other.jobSubmissionDirectoryPrefix)) {
221        this.jobSubmissionDirectoryPrefix = data().deepCopy(fields()[3].schema(), other.jobSubmissionDirectoryPrefix);
222        fieldSetFlags()[3] = true;
223      }
224    }
225
226    /**
227      * Gets the value of the 'sharedJobSubmissionParameters' field.
228      * @return The value.
229      */
230    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters getSharedJobSubmissionParameters() {
231      return sharedJobSubmissionParameters;
232    }
233
234    /**
235      * Sets the value of the 'sharedJobSubmissionParameters' field.
236      * @param value The value of 'sharedJobSubmissionParameters'.
237      * @return This builder.
238      */
239    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder setSharedJobSubmissionParameters(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters value) {
240      validate(fields()[0], value);
241      this.sharedJobSubmissionParametersBuilder = null;
242      this.sharedJobSubmissionParameters = value;
243      fieldSetFlags()[0] = true;
244      return this;
245    }
246
247    /**
248      * Checks whether the 'sharedJobSubmissionParameters' field has been set.
249      * @return True if the 'sharedJobSubmissionParameters' field has been set, false otherwise.
250      */
251    public boolean hasSharedJobSubmissionParameters() {
252      return fieldSetFlags()[0];
253    }
254
255    /**
256     * Gets the Builder instance for the 'sharedJobSubmissionParameters' field and creates one if it doesn't exist yet.
257     * @return This builder.
258     */
259    public org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder getSharedJobSubmissionParametersBuilder() {
260      if (sharedJobSubmissionParametersBuilder == null) {
261        if (hasSharedJobSubmissionParameters()) {
262          setSharedJobSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.newBuilder(sharedJobSubmissionParameters));
263        } else {
264          setSharedJobSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.newBuilder());
265        }
266      }
267      return sharedJobSubmissionParametersBuilder;
268    }
269
270    /**
271     * Sets the Builder instance for the 'sharedJobSubmissionParameters' field
272     * @param value The builder instance that must be set.
273     * @return This builder.
274     */
275    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder setSharedJobSubmissionParametersBuilder(org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters.Builder value) {
276      clearSharedJobSubmissionParameters();
277      sharedJobSubmissionParametersBuilder = value;
278      return this;
279    }
280
281    /**
282     * Checks whether the 'sharedJobSubmissionParameters' field has an active Builder instance
283     * @return True if the 'sharedJobSubmissionParameters' field has an active Builder instance
284     */
285    public boolean hasSharedJobSubmissionParametersBuilder() {
286      return sharedJobSubmissionParametersBuilder != null;
287    }
288
289    /**
290      * Clears the value of the 'sharedJobSubmissionParameters' field.
291      * @return This builder.
292      */
293    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder clearSharedJobSubmissionParameters() {
294      sharedJobSubmissionParameters = null;
295      sharedJobSubmissionParametersBuilder = null;
296      fieldSetFlags()[0] = false;
297      return this;
298    }
299
300    /**
301      * Gets the value of the 'dfsJobSubmissionFolder' field.
302      * @return The value.
303      */
304    public java.lang.CharSequence getDfsJobSubmissionFolder() {
305      return dfsJobSubmissionFolder;
306    }
307
308    /**
309      * Sets the value of the 'dfsJobSubmissionFolder' field.
310      * @param value The value of 'dfsJobSubmissionFolder'.
311      * @return This builder.
312      */
313    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder setDfsJobSubmissionFolder(java.lang.CharSequence value) {
314      validate(fields()[1], value);
315      this.dfsJobSubmissionFolder = value;
316      fieldSetFlags()[1] = true;
317      return this;
318    }
319
320    /**
321      * Checks whether the 'dfsJobSubmissionFolder' field has been set.
322      * @return True if the 'dfsJobSubmissionFolder' field has been set, false otherwise.
323      */
324    public boolean hasDfsJobSubmissionFolder() {
325      return fieldSetFlags()[1];
326    }
327
328
329    /**
330      * Clears the value of the 'dfsJobSubmissionFolder' field.
331      * @return This builder.
332      */
333    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder clearDfsJobSubmissionFolder() {
334      dfsJobSubmissionFolder = null;
335      fieldSetFlags()[1] = false;
336      return this;
337    }
338
339    /**
340      * Gets the value of the 'fileSystemUrl' field.
341      * @return The value.
342      */
343    public java.lang.CharSequence getFileSystemUrl() {
344      return fileSystemUrl;
345    }
346
347    /**
348      * Sets the value of the 'fileSystemUrl' field.
349      * @param value The value of 'fileSystemUrl'.
350      * @return This builder.
351      */
352    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder setFileSystemUrl(java.lang.CharSequence value) {
353      validate(fields()[2], value);
354      this.fileSystemUrl = value;
355      fieldSetFlags()[2] = true;
356      return this;
357    }
358
359    /**
360      * Checks whether the 'fileSystemUrl' field has been set.
361      * @return True if the 'fileSystemUrl' field has been set, false otherwise.
362      */
363    public boolean hasFileSystemUrl() {
364      return fieldSetFlags()[2];
365    }
366
367
368    /**
369      * Clears the value of the 'fileSystemUrl' field.
370      * @return This builder.
371      */
372    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder clearFileSystemUrl() {
373      fileSystemUrl = null;
374      fieldSetFlags()[2] = false;
375      return this;
376    }
377
378    /**
379      * Gets the value of the 'jobSubmissionDirectoryPrefix' field.
380      * @return The value.
381      */
382    public java.lang.CharSequence getJobSubmissionDirectoryPrefix() {
383      return jobSubmissionDirectoryPrefix;
384    }
385
386    /**
387      * Sets the value of the 'jobSubmissionDirectoryPrefix' field.
388      * @param value The value of 'jobSubmissionDirectoryPrefix'.
389      * @return This builder.
390      */
391    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder setJobSubmissionDirectoryPrefix(java.lang.CharSequence value) {
392      validate(fields()[3], value);
393      this.jobSubmissionDirectoryPrefix = value;
394      fieldSetFlags()[3] = true;
395      return this;
396    }
397
398    /**
399      * Checks whether the 'jobSubmissionDirectoryPrefix' field has been set.
400      * @return True if the 'jobSubmissionDirectoryPrefix' field has been set, false otherwise.
401      */
402    public boolean hasJobSubmissionDirectoryPrefix() {
403      return fieldSetFlags()[3];
404    }
405
406
407    /**
408      * Clears the value of the 'jobSubmissionDirectoryPrefix' field.
409      * @return This builder.
410      */
411    public org.apache.reef.reef.bridge.client.avro.AvroYarnJobSubmissionParameters.Builder clearJobSubmissionDirectoryPrefix() {
412      jobSubmissionDirectoryPrefix = null;
413      fieldSetFlags()[3] = false;
414      return this;
415    }
416
417    @Override
418    public AvroYarnJobSubmissionParameters build() {
419      try {
420        AvroYarnJobSubmissionParameters record = new AvroYarnJobSubmissionParameters();
421        if (sharedJobSubmissionParametersBuilder != null) {
422          record.sharedJobSubmissionParameters = this.sharedJobSubmissionParametersBuilder.build();
423        } else {
424          record.sharedJobSubmissionParameters = fieldSetFlags()[0] ? this.sharedJobSubmissionParameters : (org.apache.reef.reef.bridge.client.avro.AvroJobSubmissionParameters) defaultValue(fields()[0]);
425        }
426        record.dfsJobSubmissionFolder = fieldSetFlags()[1] ? this.dfsJobSubmissionFolder : (java.lang.CharSequence) defaultValue(fields()[1]);
427        record.fileSystemUrl = fieldSetFlags()[2] ? this.fileSystemUrl : (java.lang.CharSequence) defaultValue(fields()[2]);
428        record.jobSubmissionDirectoryPrefix = fieldSetFlags()[3] ? this.jobSubmissionDirectoryPrefix : (java.lang.CharSequence) defaultValue(fields()[3]);
429        return record;
430      } catch (Exception e) {
431        throw new org.apache.avro.AvroRuntimeException(e);
432      }
433    }
434  }
435
436  private static final org.apache.avro.io.DatumWriter
437    WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
438
439  @Override public void writeExternal(java.io.ObjectOutput out)
440    throws java.io.IOException {
441    WRITER$.write(this, SpecificData.getEncoder(out));
442  }
443
444  private static final org.apache.avro.io.DatumReader
445    READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
446
447  @Override public void readExternal(java.io.ObjectInput in)
448    throws java.io.IOException {
449    READER$.read(this, SpecificData.getDecoder(in));
450  }
451
452}