001/** 002 * Autogenerated by Avro 003 * 004 * DO NOT EDIT DIRECTLY 005 */ 006package org.apache.reef.vortex.common.avro; 007@SuppressWarnings("all") 008@org.apache.avro.specific.AvroGenerated 009public class AvroTaskletFailureReport 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\":\"AvroTaskletFailureReport\",\"namespace\":\"org.apache.reef.vortex.common.avro\",\"fields\":[{\"name\":\"taskletId\",\"type\":\"int\"},{\"name\":\"serializedException\",\"type\":\"bytes\"}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public int taskletId; 013 @Deprecated public java.nio.ByteBuffer serializedException; 014 015 /** 016 * Default constructor. Note that this does not initialize fields 017 * to their default values from the schema. If that is desired then 018 * one should use <code>newBuilder()</code>. 019 */ 020 public AvroTaskletFailureReport() {} 021 022 /** 023 * All-args constructor. 024 */ 025 public AvroTaskletFailureReport(java.lang.Integer taskletId, java.nio.ByteBuffer serializedException) { 026 this.taskletId = taskletId; 027 this.serializedException = serializedException; 028 } 029 030 public org.apache.avro.Schema getSchema() { return SCHEMA$; } 031 // Used by DatumWriter. Applications should not call. 032 public java.lang.Object get(int field$) { 033 switch (field$) { 034 case 0: return taskletId; 035 case 1: return serializedException; 036 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 037 } 038 } 039 // Used by DatumReader. Applications should not call. 040 @SuppressWarnings(value="unchecked") 041 public void put(int field$, java.lang.Object value$) { 042 switch (field$) { 043 case 0: taskletId = (java.lang.Integer)value$; break; 044 case 1: serializedException = (java.nio.ByteBuffer)value$; break; 045 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 046 } 047 } 048 049 /** 050 * Gets the value of the 'taskletId' field. 051 */ 052 public java.lang.Integer getTaskletId() { 053 return taskletId; 054 } 055 056 /** 057 * Sets the value of the 'taskletId' field. 058 * @param value the value to set. 059 */ 060 public void setTaskletId(java.lang.Integer value) { 061 this.taskletId = value; 062 } 063 064 /** 065 * Gets the value of the 'serializedException' field. 066 */ 067 public java.nio.ByteBuffer getSerializedException() { 068 return serializedException; 069 } 070 071 /** 072 * Sets the value of the 'serializedException' field. 073 * @param value the value to set. 074 */ 075 public void setSerializedException(java.nio.ByteBuffer value) { 076 this.serializedException = value; 077 } 078 079 /** Creates a new AvroTaskletFailureReport RecordBuilder */ 080 public static org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder newBuilder() { 081 return new org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder(); 082 } 083 084 /** Creates a new AvroTaskletFailureReport RecordBuilder by copying an existing Builder */ 085 public static org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder other) { 086 return new org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder(other); 087 } 088 089 /** Creates a new AvroTaskletFailureReport RecordBuilder by copying an existing AvroTaskletFailureReport instance */ 090 public static org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport other) { 091 return new org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder(other); 092 } 093 094 /** 095 * RecordBuilder for AvroTaskletFailureReport instances. 096 */ 097 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroTaskletFailureReport> 098 implements org.apache.avro.data.RecordBuilder<AvroTaskletFailureReport> { 099 100 private int taskletId; 101 private java.nio.ByteBuffer serializedException; 102 103 /** Creates a new Builder */ 104 private Builder() { 105 super(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.SCHEMA$); 106 } 107 108 /** Creates a Builder by copying an existing Builder */ 109 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder other) { 110 super(other); 111 if (isValidValue(fields()[0], other.taskletId)) { 112 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 113 fieldSetFlags()[0] = true; 114 } 115 if (isValidValue(fields()[1], other.serializedException)) { 116 this.serializedException = data().deepCopy(fields()[1].schema(), other.serializedException); 117 fieldSetFlags()[1] = true; 118 } 119 } 120 121 /** Creates a Builder by copying an existing AvroTaskletFailureReport instance */ 122 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport other) { 123 super(org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.SCHEMA$); 124 if (isValidValue(fields()[0], other.taskletId)) { 125 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 126 fieldSetFlags()[0] = true; 127 } 128 if (isValidValue(fields()[1], other.serializedException)) { 129 this.serializedException = data().deepCopy(fields()[1].schema(), other.serializedException); 130 fieldSetFlags()[1] = true; 131 } 132 } 133 134 /** Gets the value of the 'taskletId' field */ 135 public java.lang.Integer getTaskletId() { 136 return taskletId; 137 } 138 139 /** Sets the value of the 'taskletId' field */ 140 public org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder setTaskletId(int value) { 141 validate(fields()[0], value); 142 this.taskletId = value; 143 fieldSetFlags()[0] = true; 144 return this; 145 } 146 147 /** Checks whether the 'taskletId' field has been set */ 148 public boolean hasTaskletId() { 149 return fieldSetFlags()[0]; 150 } 151 152 /** Clears the value of the 'taskletId' field */ 153 public org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder clearTaskletId() { 154 fieldSetFlags()[0] = false; 155 return this; 156 } 157 158 /** Gets the value of the 'serializedException' field */ 159 public java.nio.ByteBuffer getSerializedException() { 160 return serializedException; 161 } 162 163 /** Sets the value of the 'serializedException' field */ 164 public org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder setSerializedException(java.nio.ByteBuffer value) { 165 validate(fields()[1], value); 166 this.serializedException = value; 167 fieldSetFlags()[1] = true; 168 return this; 169 } 170 171 /** Checks whether the 'serializedException' field has been set */ 172 public boolean hasSerializedException() { 173 return fieldSetFlags()[1]; 174 } 175 176 /** Clears the value of the 'serializedException' field */ 177 public org.apache.reef.vortex.common.avro.AvroTaskletFailureReport.Builder clearSerializedException() { 178 serializedException = null; 179 fieldSetFlags()[1] = false; 180 return this; 181 } 182 183 @Override 184 public AvroTaskletFailureReport build() { 185 try { 186 AvroTaskletFailureReport record = new AvroTaskletFailureReport(); 187 record.taskletId = fieldSetFlags()[0] ? this.taskletId : (java.lang.Integer) defaultValue(fields()[0]); 188 record.serializedException = fieldSetFlags()[1] ? this.serializedException : (java.nio.ByteBuffer) defaultValue(fields()[1]); 189 return record; 190 } catch (Exception e) { 191 throw new org.apache.avro.AvroRuntimeException(e); 192 } 193 } 194 } 195}