/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package com.cloudera.knittingboar.yarn.avro.generated; @SuppressWarnings("all") public class FileSplit extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"FileSplit\",\"namespace\":\"com.cloudera.knittingboar.yarn.avro.generated\",\"fields\":[{\"name\":\"path\",\"type\":\"string\"},{\"name\":\"offset\",\"type\":\"long\"},{\"name\":\"length\",\"type\":\"long\"}]}"); @Deprecated public java.lang.CharSequence path; @Deprecated public long offset; @Deprecated public long length; public org.apache.avro.Schema getSchema() { return SCHEMA$; } // Used by DatumWriter. Applications should not call. public java.lang.Object get(int field$) { switch (field$) { case 0: return path; case 1: return offset; case 2: return length; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } // Used by DatumReader. Applications should not call. @SuppressWarnings(value="unchecked") public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: path = (java.lang.CharSequence)value$; break; case 1: offset = (java.lang.Long)value$; break; case 2: length = (java.lang.Long)value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'path' field. */ public java.lang.CharSequence getPath() { return path; } /** * Sets the value of the 'path' field. * @param value the value to set. */ public void setPath(java.lang.CharSequence value) { this.path = value; } /** * Gets the value of the 'offset' field. */ public java.lang.Long getOffset() { return offset; } /** * Sets the value of the 'offset' field. * @param value the value to set. */ public void setOffset(java.lang.Long value) { this.offset = value; } /** * Gets the value of the 'length' field. */ public java.lang.Long getLength() { return length; } /** * Sets the value of the 'length' field. * @param value the value to set. */ public void setLength(java.lang.Long value) { this.length = value; } /** Creates a new FileSplit RecordBuilder */ public static com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder newBuilder() { return new com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder(); } /** Creates a new FileSplit RecordBuilder by copying an existing Builder */ public static com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder newBuilder(com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder other) { return new com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder(other); } /** Creates a new FileSplit RecordBuilder by copying an existing FileSplit instance */ public static com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder newBuilder(com.cloudera.knittingboar.yarn.avro.generated.FileSplit other) { return new com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder(other); } /** * RecordBuilder for FileSplit instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<FileSplit> implements org.apache.avro.data.RecordBuilder<FileSplit> { private java.lang.CharSequence path; private long offset; private long length; /** Creates a new Builder */ private Builder() { super(com.cloudera.knittingboar.yarn.avro.generated.FileSplit.SCHEMA$); } /** Creates a Builder by copying an existing Builder */ private Builder(com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder other) { super(other); } /** Creates a Builder by copying an existing FileSplit instance */ private Builder(com.cloudera.knittingboar.yarn.avro.generated.FileSplit other) { super(com.cloudera.knittingboar.yarn.avro.generated.FileSplit.SCHEMA$); if (isValidValue(fields()[0], other.path)) { this.path = (java.lang.CharSequence) data().deepCopy(fields()[0].schema(), other.path); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.offset)) { this.offset = (java.lang.Long) data().deepCopy(fields()[1].schema(), other.offset); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.length)) { this.length = (java.lang.Long) data().deepCopy(fields()[2].schema(), other.length); fieldSetFlags()[2] = true; } } /** Gets the value of the 'path' field */ public java.lang.CharSequence getPath() { return path; } /** Sets the value of the 'path' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder setPath(java.lang.CharSequence value) { validate(fields()[0], value); this.path = value; fieldSetFlags()[0] = true; return this; } /** Checks whether the 'path' field has been set */ public boolean hasPath() { return fieldSetFlags()[0]; } /** Clears the value of the 'path' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder clearPath() { path = null; fieldSetFlags()[0] = false; return this; } /** Gets the value of the 'offset' field */ public java.lang.Long getOffset() { return offset; } /** Sets the value of the 'offset' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder setOffset(long value) { validate(fields()[1], value); this.offset = value; fieldSetFlags()[1] = true; return this; } /** Checks whether the 'offset' field has been set */ public boolean hasOffset() { return fieldSetFlags()[1]; } /** Clears the value of the 'offset' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder clearOffset() { fieldSetFlags()[1] = false; return this; } /** Gets the value of the 'length' field */ public java.lang.Long getLength() { return length; } /** Sets the value of the 'length' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder setLength(long value) { validate(fields()[2], value); this.length = value; fieldSetFlags()[2] = true; return this; } /** Checks whether the 'length' field has been set */ public boolean hasLength() { return fieldSetFlags()[2]; } /** Clears the value of the 'length' field */ public com.cloudera.knittingboar.yarn.avro.generated.FileSplit.Builder clearLength() { fieldSetFlags()[2] = false; return this; } @Override public FileSplit build() { try { FileSplit record = new FileSplit(); record.path = fieldSetFlags()[0] ? this.path : (java.lang.CharSequence) defaultValue(fields()[0]); record.offset = fieldSetFlags()[1] ? this.offset : (java.lang.Long) defaultValue(fields()[1]); record.length = fieldSetFlags()[2] ? this.length : (java.lang.Long) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }