001/** 002 * Autogenerated by Avro 003 * 004 * DO NOT EDIT DIRECTLY 005 */ 006package org.apache.reef.io.watcher.driver.context; 007@SuppressWarnings("all") 008@org.apache.avro.specific.AvroGenerated 009public class AvroActiveContext 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\":\"AvroActiveContext\",\"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\"]}]}}]}"); 011 public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } 012 @Deprecated public org.apache.reef.io.watcher.driver.context.AvroContextBase base; 013 014 /** 015 * Default constructor. Note that this does not initialize fields 016 * to their default values from the schema. If that is desired then 017 * one should use <code>newBuilder()</code>. 018 */ 019 public AvroActiveContext() {} 020 021 /** 022 * All-args constructor. 023 */ 024 public AvroActiveContext(org.apache.reef.io.watcher.driver.context.AvroContextBase base) { 025 this.base = base; 026 } 027 028 public org.apache.avro.Schema getSchema() { return SCHEMA$; } 029 // Used by DatumWriter. Applications should not call. 030 public java.lang.Object get(int field$) { 031 switch (field$) { 032 case 0: return base; 033 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 034 } 035 } 036 // Used by DatumReader. Applications should not call. 037 @SuppressWarnings(value="unchecked") 038 public void put(int field$, java.lang.Object value$) { 039 switch (field$) { 040 case 0: base = (org.apache.reef.io.watcher.driver.context.AvroContextBase)value$; break; 041 default: throw new org.apache.avro.AvroRuntimeException("Bad index"); 042 } 043 } 044 045 /** 046 * Gets the value of the 'base' field. 047 */ 048 public org.apache.reef.io.watcher.driver.context.AvroContextBase getBase() { 049 return base; 050 } 051 052 /** 053 * Sets the value of the 'base' field. 054 * @param value the value to set. 055 */ 056 public void setBase(org.apache.reef.io.watcher.driver.context.AvroContextBase value) { 057 this.base = value; 058 } 059 060 /** Creates a new AvroActiveContext RecordBuilder */ 061 public static org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder newBuilder() { 062 return new org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder(); 063 } 064 065 /** Creates a new AvroActiveContext RecordBuilder by copying an existing Builder */ 066 public static org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder newBuilder(org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder other) { 067 return new org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder(other); 068 } 069 070 /** Creates a new AvroActiveContext RecordBuilder by copying an existing AvroActiveContext instance */ 071 public static org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder newBuilder(org.apache.reef.io.watcher.driver.context.AvroActiveContext other) { 072 return new org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder(other); 073 } 074 075 /** 076 * RecordBuilder for AvroActiveContext instances. 077 */ 078 public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<AvroActiveContext> 079 implements org.apache.avro.data.RecordBuilder<AvroActiveContext> { 080 081 private org.apache.reef.io.watcher.driver.context.AvroContextBase base; 082 083 /** Creates a new Builder */ 084 private Builder() { 085 super(org.apache.reef.io.watcher.driver.context.AvroActiveContext.SCHEMA$); 086 } 087 088 /** Creates a Builder by copying an existing Builder */ 089 private Builder(org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder other) { 090 super(other); 091 if (isValidValue(fields()[0], other.base)) { 092 this.base = data().deepCopy(fields()[0].schema(), other.base); 093 fieldSetFlags()[0] = true; 094 } 095 } 096 097 /** Creates a Builder by copying an existing AvroActiveContext instance */ 098 private Builder(org.apache.reef.io.watcher.driver.context.AvroActiveContext other) { 099 super(org.apache.reef.io.watcher.driver.context.AvroActiveContext.SCHEMA$); 100 if (isValidValue(fields()[0], other.base)) { 101 this.base = data().deepCopy(fields()[0].schema(), other.base); 102 fieldSetFlags()[0] = true; 103 } 104 } 105 106 /** Gets the value of the 'base' field */ 107 public org.apache.reef.io.watcher.driver.context.AvroContextBase getBase() { 108 return base; 109 } 110 111 /** Sets the value of the 'base' field */ 112 public org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder setBase(org.apache.reef.io.watcher.driver.context.AvroContextBase value) { 113 validate(fields()[0], value); 114 this.base = value; 115 fieldSetFlags()[0] = true; 116 return this; 117 } 118 119 /** Checks whether the 'base' field has been set */ 120 public boolean hasBase() { 121 return fieldSetFlags()[0]; 122 } 123 124 /** Clears the value of the 'base' field */ 125 public org.apache.reef.io.watcher.driver.context.AvroActiveContext.Builder clearBase() { 126 base = null; 127 fieldSetFlags()[0] = false; 128 return this; 129 } 130 131 @Override 132 public AvroActiveContext build() { 133 try { 134 AvroActiveContext record = new AvroActiveContext(); 135 record.base = fieldSetFlags()[0] ? this.base : (org.apache.reef.io.watcher.driver.context.AvroContextBase) defaultValue(fields()[0]); 136 return record; 137 } catch (Exception e) { 138 throw new org.apache.avro.AvroRuntimeException(e); 139 } 140 } 141 } 142}