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 AvroTaskletExecutionRequest 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\":\"AvroTaskletExecutionRequest\",\"namespace\":\"org.apache.reef.vortex.common.avro\",\"fields\":[{\"name\":\"taskletId\",\"type\":\"int\"},{\"name\":\"serializedUserFunction\",\"type\":\"bytes\"},{\"name\":\"serializedInput\",\"type\":\"bytes\"}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public int taskletId; 013 @Deprecated public java.nio.ByteBuffer serializedUserFunction; 014 @Deprecated public java.nio.ByteBuffer serializedInput; 015 016 /** 017 * Default constructor. Note that this does not initialize fields 018 * to their default values from the schema. If that is desired then 019 * one should use <code>newBuilder()</code>. 020 */ 021 public AvroTaskletExecutionRequest() {} 022 023 /** 024 * All-args constructor. 025 */ 026 public AvroTaskletExecutionRequest(java.lang.Integer taskletId, java.nio.ByteBuffer serializedUserFunction, java.nio.ByteBuffer serializedInput) { 027 this.taskletId = taskletId; 028 this.serializedUserFunction = serializedUserFunction; 029 this.serializedInput = serializedInput; 030 } 031 032 public org.apache.avro.Schema getSchema() { return SCHEMA$; } 033 // Used by DatumWriter. Applications should not call. 034 public java.lang.Object get(int field$) { 035 switch (field$) { 036 case 0: return taskletId; 037 case 1: return serializedUserFunction; 038 case 2: return serializedInput; 039 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 040 } 041 } 042 // Used by DatumReader. Applications should not call. 043 @SuppressWarnings(value="unchecked") 044 public void put(int field$, java.lang.Object value$) { 045 switch (field$) { 046 case 0: taskletId = (java.lang.Integer)value$; break; 047 case 1: serializedUserFunction = (java.nio.ByteBuffer)value$; break; 048 case 2: serializedInput = (java.nio.ByteBuffer)value$; break; 049 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 050 } 051 } 052 053 /** 054 * Gets the value of the 'taskletId' field. 055 */ 056 public java.lang.Integer getTaskletId() { 057 return taskletId; 058 } 059 060 /** 061 * Sets the value of the 'taskletId' field. 062 * @param value the value to set. 063 */ 064 public void setTaskletId(java.lang.Integer value) { 065 this.taskletId = value; 066 } 067 068 /** 069 * Gets the value of the 'serializedUserFunction' field. 070 */ 071 public java.nio.ByteBuffer getSerializedUserFunction() { 072 return serializedUserFunction; 073 } 074 075 /** 076 * Sets the value of the 'serializedUserFunction' field. 077 * @param value the value to set. 078 */ 079 public void setSerializedUserFunction(java.nio.ByteBuffer value) { 080 this.serializedUserFunction = value; 081 } 082 083 /** 084 * Gets the value of the 'serializedInput' field. 085 */ 086 public java.nio.ByteBuffer getSerializedInput() { 087 return serializedInput; 088 } 089 090 /** 091 * Sets the value of the 'serializedInput' field. 092 * @param value the value to set. 093 */ 094 public void setSerializedInput(java.nio.ByteBuffer value) { 095 this.serializedInput = value; 096 } 097 098 /** Creates a new AvroTaskletExecutionRequest RecordBuilder */ 099 public static org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder newBuilder() { 100 return new org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder(); 101 } 102 103 /** Creates a new AvroTaskletExecutionRequest RecordBuilder by copying an existing Builder */ 104 public static org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder other) { 105 return new org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder(other); 106 } 107 108 /** Creates a new AvroTaskletExecutionRequest RecordBuilder by copying an existing AvroTaskletExecutionRequest instance */ 109 public static org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder newBuilder(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest other) { 110 return new org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder(other); 111 } 112 113 /** 114 * RecordBuilder for AvroTaskletExecutionRequest instances. 115 */ 116 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroTaskletExecutionRequest> 117 implements org.apache.avro.data.RecordBuilder<AvroTaskletExecutionRequest> { 118 119 private int taskletId; 120 private java.nio.ByteBuffer serializedUserFunction; 121 private java.nio.ByteBuffer serializedInput; 122 123 /** Creates a new Builder */ 124 private Builder() { 125 super(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.SCHEMA$); 126 } 127 128 /** Creates a Builder by copying an existing Builder */ 129 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder other) { 130 super(other); 131 if (isValidValue(fields()[0], other.taskletId)) { 132 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 133 fieldSetFlags()[0] = true; 134 } 135 if (isValidValue(fields()[1], other.serializedUserFunction)) { 136 this.serializedUserFunction = data().deepCopy(fields()[1].schema(), other.serializedUserFunction); 137 fieldSetFlags()[1] = true; 138 } 139 if (isValidValue(fields()[2], other.serializedInput)) { 140 this.serializedInput = data().deepCopy(fields()[2].schema(), other.serializedInput); 141 fieldSetFlags()[2] = true; 142 } 143 } 144 145 /** Creates a Builder by copying an existing AvroTaskletExecutionRequest instance */ 146 private Builder(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest other) { 147 super(org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.SCHEMA$); 148 if (isValidValue(fields()[0], other.taskletId)) { 149 this.taskletId = data().deepCopy(fields()[0].schema(), other.taskletId); 150 fieldSetFlags()[0] = true; 151 } 152 if (isValidValue(fields()[1], other.serializedUserFunction)) { 153 this.serializedUserFunction = data().deepCopy(fields()[1].schema(), other.serializedUserFunction); 154 fieldSetFlags()[1] = true; 155 } 156 if (isValidValue(fields()[2], other.serializedInput)) { 157 this.serializedInput = data().deepCopy(fields()[2].schema(), other.serializedInput); 158 fieldSetFlags()[2] = true; 159 } 160 } 161 162 /** Gets the value of the 'taskletId' field */ 163 public java.lang.Integer getTaskletId() { 164 return taskletId; 165 } 166 167 /** Sets the value of the 'taskletId' field */ 168 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder setTaskletId(int value) { 169 validate(fields()[0], value); 170 this.taskletId = value; 171 fieldSetFlags()[0] = true; 172 return this; 173 } 174 175 /** Checks whether the 'taskletId' field has been set */ 176 public boolean hasTaskletId() { 177 return fieldSetFlags()[0]; 178 } 179 180 /** Clears the value of the 'taskletId' field */ 181 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder clearTaskletId() { 182 fieldSetFlags()[0] = false; 183 return this; 184 } 185 186 /** Gets the value of the 'serializedUserFunction' field */ 187 public java.nio.ByteBuffer getSerializedUserFunction() { 188 return serializedUserFunction; 189 } 190 191 /** Sets the value of the 'serializedUserFunction' field */ 192 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder setSerializedUserFunction(java.nio.ByteBuffer value) { 193 validate(fields()[1], value); 194 this.serializedUserFunction = value; 195 fieldSetFlags()[1] = true; 196 return this; 197 } 198 199 /** Checks whether the 'serializedUserFunction' field has been set */ 200 public boolean hasSerializedUserFunction() { 201 return fieldSetFlags()[1]; 202 } 203 204 /** Clears the value of the 'serializedUserFunction' field */ 205 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder clearSerializedUserFunction() { 206 serializedUserFunction = null; 207 fieldSetFlags()[1] = false; 208 return this; 209 } 210 211 /** Gets the value of the 'serializedInput' field */ 212 public java.nio.ByteBuffer getSerializedInput() { 213 return serializedInput; 214 } 215 216 /** Sets the value of the 'serializedInput' field */ 217 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder setSerializedInput(java.nio.ByteBuffer value) { 218 validate(fields()[2], value); 219 this.serializedInput = value; 220 fieldSetFlags()[2] = true; 221 return this; 222 } 223 224 /** Checks whether the 'serializedInput' field has been set */ 225 public boolean hasSerializedInput() { 226 return fieldSetFlags()[2]; 227 } 228 229 /** Clears the value of the 'serializedInput' field */ 230 public org.apache.reef.vortex.common.avro.AvroTaskletExecutionRequest.Builder clearSerializedInput() { 231 serializedInput = null; 232 fieldSetFlags()[2] = false; 233 return this; 234 } 235 236 @Override 237 public AvroTaskletExecutionRequest build() { 238 try { 239 AvroTaskletExecutionRequest record = new AvroTaskletExecutionRequest(); 240 record.taskletId = fieldSetFlags()[0] ? this.taskletId : (java.lang.Integer) defaultValue(fields()[0]); 241 record.serializedUserFunction = fieldSetFlags()[1] ? this.serializedUserFunction : (java.nio.ByteBuffer) defaultValue(fields()[1]); 242 record.serializedInput = fieldSetFlags()[2] ? this.serializedInput : (java.nio.ByteBuffer) defaultValue(fields()[2]); 243 return record; 244 } catch (Exception e) { 245 throw new org.apache.avro.AvroRuntimeException(e); 246 } 247 } 248 } 249}