001/** 002 * Autogenerated by Avro 003 * 004 * DO NOT EDIT DIRECTLY 005 */ 006package org.apache.reef.io.watcher.driver.evaluator; 007@SuppressWarnings("all") 008@org.apache.avro.specific.AvroGenerated 009public class AvroFailedEvaluator 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\":\"AvroFailedEvaluator\",\"namespace\":\"org.apache.reef.io.watcher.driver.evaluator\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"evaluatorException\",\"type\":\"string\"},{\"name\":\"failedContextList\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"AvroFailedContext\",\"namespace\":\"org.apache.reef.io.watcher.driver.context\",\"fields\":[{\"name\":\"base\",\"type\":{\"type\":\"record\",\"name\":\"AvroContextBase\",\"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\"]}]}},{\"name\":\"parentContext\",\"type\":[{\"type\":\"record\",\"name\":\"AvroActiveContext\",\"fields\":[{\"name\":\"base\",\"type\":\"AvroContextBase\"}]},\"null\"]},{\"name\":\"failure\",\"type\":{\"type\":\"record\",\"name\":\"AvroFailure\",\"namespace\":\"org.apache.reef.io.watcher.common\",\"fields\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"description\",\"type\":[\"string\",\"null\"]},{\"name\":\"reason\",\"type\":[\"string\",\"null\"]},{\"name\":\"data\",\"type\":[\"bytes\",\"null\"]},{\"name\":\"asError\",\"type\":\"string\"}]}}]}}},{\"name\":\"failedTask\",\"type\":[{\"type\":\"record\",\"name\":\"AvroFailedTask\",\"namespace\":\"org.apache.reef.io.watcher.driver.task\",\"fields\":[{\"name\":\"failure\",\"type\":\"org.apache.reef.io.watcher.common.AvroFailure\"},{\"name\":\"activeContext\",\"type\":[\"org.apache.reef.io.watcher.driver.context.AvroActiveContext\",\"null\"]}]},\"null\"]}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public java.lang.CharSequence id; 013 @Deprecated public java.lang.CharSequence evaluatorException; 014 @Deprecated public java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> failedContextList; 015 @Deprecated public org.apache.reef.io.watcher.driver.task.AvroFailedTask failedTask; 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 AvroFailedEvaluator() {} 023 024 /** 025 * All-args constructor. 026 */ 027 public AvroFailedEvaluator(java.lang.CharSequence id, java.lang.CharSequence evaluatorException, java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> failedContextList, org.apache.reef.io.watcher.driver.task.AvroFailedTask failedTask) { 028 this.id = id; 029 this.evaluatorException = evaluatorException; 030 this.failedContextList = failedContextList; 031 this.failedTask = failedTask; 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 evaluatorException; 040 case 2: return failedContextList; 041 case 3: return failedTask; 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: evaluatorException = (java.lang.CharSequence)value$; break; 051 case 2: failedContextList = (java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext>)value$; break; 052 case 3: failedTask = (org.apache.reef.io.watcher.driver.task.AvroFailedTask)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 'evaluatorException' field. 074 */ 075 public java.lang.CharSequence getEvaluatorException() { 076 return evaluatorException; 077 } 078 079 /** 080 * Sets the value of the 'evaluatorException' field. 081 * @param value the value to set. 082 */ 083 public void setEvaluatorException(java.lang.CharSequence value) { 084 this.evaluatorException = value; 085 } 086 087 /** 088 * Gets the value of the 'failedContextList' field. 089 */ 090 public java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> getFailedContextList() { 091 return failedContextList; 092 } 093 094 /** 095 * Sets the value of the 'failedContextList' field. 096 * @param value the value to set. 097 */ 098 public void setFailedContextList(java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> value) { 099 this.failedContextList = value; 100 } 101 102 /** 103 * Gets the value of the 'failedTask' field. 104 */ 105 public org.apache.reef.io.watcher.driver.task.AvroFailedTask getFailedTask() { 106 return failedTask; 107 } 108 109 /** 110 * Sets the value of the 'failedTask' field. 111 * @param value the value to set. 112 */ 113 public void setFailedTask(org.apache.reef.io.watcher.driver.task.AvroFailedTask value) { 114 this.failedTask = value; 115 } 116 117 /** Creates a new AvroFailedEvaluator RecordBuilder */ 118 public static org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder newBuilder() { 119 return new org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder(); 120 } 121 122 /** Creates a new AvroFailedEvaluator RecordBuilder by copying an existing Builder */ 123 public static org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder newBuilder(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder other) { 124 return new org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder(other); 125 } 126 127 /** Creates a new AvroFailedEvaluator RecordBuilder by copying an existing AvroFailedEvaluator instance */ 128 public static org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder newBuilder(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator other) { 129 return new org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder(other); 130 } 131 132 /** 133 * RecordBuilder for AvroFailedEvaluator instances. 134 */ 135 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroFailedEvaluator> 136 implements org.apache.avro.data.RecordBuilder<AvroFailedEvaluator> { 137 138 private java.lang.CharSequence id; 139 private java.lang.CharSequence evaluatorException; 140 private java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> failedContextList; 141 private org.apache.reef.io.watcher.driver.task.AvroFailedTask failedTask; 142 143 /** Creates a new Builder */ 144 private Builder() { 145 super(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.SCHEMA$); 146 } 147 148 /** Creates a Builder by copying an existing Builder */ 149 private Builder(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.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.evaluatorException)) { 156 this.evaluatorException = data().deepCopy(fields()[1].schema(), other.evaluatorException); 157 fieldSetFlags()[1] = true; 158 } 159 if (isValidValue(fields()[2], other.failedContextList)) { 160 this.failedContextList = data().deepCopy(fields()[2].schema(), other.failedContextList); 161 fieldSetFlags()[2] = true; 162 } 163 if (isValidValue(fields()[3], other.failedTask)) { 164 this.failedTask = data().deepCopy(fields()[3].schema(), other.failedTask); 165 fieldSetFlags()[3] = true; 166 } 167 } 168 169 /** Creates a Builder by copying an existing AvroFailedEvaluator instance */ 170 private Builder(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator other) { 171 super(org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.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.evaluatorException)) { 177 this.evaluatorException = data().deepCopy(fields()[1].schema(), other.evaluatorException); 178 fieldSetFlags()[1] = true; 179 } 180 if (isValidValue(fields()[2], other.failedContextList)) { 181 this.failedContextList = data().deepCopy(fields()[2].schema(), other.failedContextList); 182 fieldSetFlags()[2] = true; 183 } 184 if (isValidValue(fields()[3], other.failedTask)) { 185 this.failedTask = data().deepCopy(fields()[3].schema(), other.failedTask); 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.evaluator.AvroFailedEvaluator.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.evaluator.AvroFailedEvaluator.Builder clearId() { 210 id = null; 211 fieldSetFlags()[0] = false; 212 return this; 213 } 214 215 /** Gets the value of the 'evaluatorException' field */ 216 public java.lang.CharSequence getEvaluatorException() { 217 return evaluatorException; 218 } 219 220 /** Sets the value of the 'evaluatorException' field */ 221 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder setEvaluatorException(java.lang.CharSequence value) { 222 validate(fields()[1], value); 223 this.evaluatorException = value; 224 fieldSetFlags()[1] = true; 225 return this; 226 } 227 228 /** Checks whether the 'evaluatorException' field has been set */ 229 public boolean hasEvaluatorException() { 230 return fieldSetFlags()[1]; 231 } 232 233 /** Clears the value of the 'evaluatorException' field */ 234 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder clearEvaluatorException() { 235 evaluatorException = null; 236 fieldSetFlags()[1] = false; 237 return this; 238 } 239 240 /** Gets the value of the 'failedContextList' field */ 241 public java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> getFailedContextList() { 242 return failedContextList; 243 } 244 245 /** Sets the value of the 'failedContextList' field */ 246 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder setFailedContextList(java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext> value) { 247 validate(fields()[2], value); 248 this.failedContextList = value; 249 fieldSetFlags()[2] = true; 250 return this; 251 } 252 253 /** Checks whether the 'failedContextList' field has been set */ 254 public boolean hasFailedContextList() { 255 return fieldSetFlags()[2]; 256 } 257 258 /** Clears the value of the 'failedContextList' field */ 259 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder clearFailedContextList() { 260 failedContextList = null; 261 fieldSetFlags()[2] = false; 262 return this; 263 } 264 265 /** Gets the value of the 'failedTask' field */ 266 public org.apache.reef.io.watcher.driver.task.AvroFailedTask getFailedTask() { 267 return failedTask; 268 } 269 270 /** Sets the value of the 'failedTask' field */ 271 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder setFailedTask(org.apache.reef.io.watcher.driver.task.AvroFailedTask value) { 272 validate(fields()[3], value); 273 this.failedTask = value; 274 fieldSetFlags()[3] = true; 275 return this; 276 } 277 278 /** Checks whether the 'failedTask' field has been set */ 279 public boolean hasFailedTask() { 280 return fieldSetFlags()[3]; 281 } 282 283 /** Clears the value of the 'failedTask' field */ 284 public org.apache.reef.io.watcher.driver.evaluator.AvroFailedEvaluator.Builder clearFailedTask() { 285 failedTask = null; 286 fieldSetFlags()[3] = false; 287 return this; 288 } 289 290 @Override 291 public AvroFailedEvaluator build() { 292 try { 293 AvroFailedEvaluator record = new AvroFailedEvaluator(); 294 record.id = fieldSetFlags()[0] ? this.id : (java.lang.CharSequence) defaultValue(fields()[0]); 295 record.evaluatorException = fieldSetFlags()[1] ? this.evaluatorException : (java.lang.CharSequence) defaultValue(fields()[1]); 296 record.failedContextList = fieldSetFlags()[2] ? this.failedContextList : (java.util.List<org.apache.reef.io.watcher.driver.context.AvroFailedContext>) defaultValue(fields()[2]); 297 record.failedTask = fieldSetFlags()[3] ? this.failedTask : (org.apache.reef.io.watcher.driver.task.AvroFailedTask) defaultValue(fields()[3]); 298 return record; 299 } catch (Exception e) { 300 throw new org.apache.avro.AvroRuntimeException(e); 301 } 302 } 303 } 304}