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