http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanColumn.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanColumn.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanColumn.java index 3cea424..1eb2b48 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanColumn.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanColumn.java @@ -15,66 +15,36 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.accumulo.proxy.thrift; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColumn._Fields>, java.io.Serializable, Cloneable, Comparable<ScanColumn> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScanColumn"); private static final org.apache.thrift.protocol.TField COL_FAMILY_FIELD_DESC = new org.apache.thrift.protocol.TField("colFamily", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField COL_QUALIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("colQualifier", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ScanColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ScanColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ScanColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ScanColumnTupleSchemeFactory(); - public ByteBuffer colFamily; // required - public ByteBuffer colQualifier; // optional + public java.nio.ByteBuffer colFamily; // required + public java.nio.ByteBuffer colQualifier; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { COL_FAMILY((short)1, "colFamily"), COL_QUALIFIER((short)2, "colQualifier"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -99,21 +69,21 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -122,21 +92,21 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.COL_QUALIFIER}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COL_FAMILY, new org.apache.thrift.meta_data.FieldMetaData("colFamily", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.COL_QUALIFIER, new org.apache.thrift.meta_data.FieldMetaData("colQualifier", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScanColumn.class, metaDataMap); } @@ -144,7 +114,7 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } public ScanColumn( - ByteBuffer colFamily) + java.nio.ByteBuffer colFamily) { this(); this.colFamily = org.apache.thrift.TBaseHelper.copyBinary(colFamily); @@ -177,16 +147,16 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum return colFamily == null ? null : colFamily.array(); } - public ByteBuffer bufferForColFamily() { + public java.nio.ByteBuffer bufferForColFamily() { return org.apache.thrift.TBaseHelper.copyBinary(colFamily); } public ScanColumn setColFamily(byte[] colFamily) { - this.colFamily = colFamily == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(colFamily, colFamily.length)); + this.colFamily = colFamily == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(colFamily.clone()); return this; } - public ScanColumn setColFamily(ByteBuffer colFamily) { + public ScanColumn setColFamily(java.nio.ByteBuffer colFamily) { this.colFamily = org.apache.thrift.TBaseHelper.copyBinary(colFamily); return this; } @@ -211,16 +181,16 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum return colQualifier == null ? null : colQualifier.array(); } - public ByteBuffer bufferForColQualifier() { + public java.nio.ByteBuffer bufferForColQualifier() { return org.apache.thrift.TBaseHelper.copyBinary(colQualifier); } public ScanColumn setColQualifier(byte[] colQualifier) { - this.colQualifier = colQualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(colQualifier, colQualifier.length)); + this.colQualifier = colQualifier == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(colQualifier.clone()); return this; } - public ScanColumn setColQualifier(ByteBuffer colQualifier) { + public ScanColumn setColQualifier(java.nio.ByteBuffer colQualifier) { this.colQualifier = org.apache.thrift.TBaseHelper.copyBinary(colQualifier); return this; } @@ -240,13 +210,17 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case COL_FAMILY: if (value == null) { unsetColFamily(); } else { - setColFamily((ByteBuffer)value); + if (value instanceof byte[]) { + setColFamily((byte[])value); + } else { + setColFamily((java.nio.ByteBuffer)value); + } } break; @@ -254,14 +228,18 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum if (value == null) { unsetColQualifier(); } else { - setColQualifier((ByteBuffer)value); + if (value instanceof byte[]) { + setColQualifier((byte[])value); + } else { + setColQualifier((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COL_FAMILY: return getColFamily(); @@ -270,13 +248,13 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum return getColQualifier(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -285,11 +263,11 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum case COL_QUALIFIER: return isSetColQualifier(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ScanColumn) @@ -300,6 +278,8 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum public boolean equals(ScanColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_colFamily = true && this.isSetColFamily(); boolean that_present_colFamily = true && that.isSetColFamily(); @@ -324,19 +304,17 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_colFamily = true && (isSetColFamily()); - list.add(present_colFamily); - if (present_colFamily) - list.add(colFamily); + hashCode = hashCode * 8191 + ((isSetColFamily()) ? 131071 : 524287); + if (isSetColFamily()) + hashCode = hashCode * 8191 + colFamily.hashCode(); - boolean present_colQualifier = true && (isSetColQualifier()); - list.add(present_colQualifier); - if (present_colQualifier) - list.add(colQualifier); + hashCode = hashCode * 8191 + ((isSetColQualifier()) ? 131071 : 524287); + if (isSetColQualifier()) + hashCode = hashCode * 8191 + colQualifier.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -347,7 +325,7 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetColFamily()).compareTo(other.isSetColFamily()); + lastComparison = java.lang.Boolean.valueOf(isSetColFamily()).compareTo(other.isSetColFamily()); if (lastComparison != 0) { return lastComparison; } @@ -357,7 +335,7 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum return lastComparison; } } - lastComparison = Boolean.valueOf(isSetColQualifier()).compareTo(other.isSetColQualifier()); + lastComparison = java.lang.Boolean.valueOf(isSetColQualifier()).compareTo(other.isSetColQualifier()); if (lastComparison != 0) { return lastComparison; } @@ -375,16 +353,16 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ScanColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ScanColumn("); boolean first = true; sb.append("colFamily:"); @@ -421,7 +399,7 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -429,13 +407,13 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } } - private static class ScanColumnStandardSchemeFactory implements SchemeFactory { + private static class ScanColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanColumnStandardScheme getScheme() { return new ScanColumnStandardScheme(); } } - private static class ScanColumnStandardScheme extends StandardScheme<ScanColumn> { + private static class ScanColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme<ScanColumn> { public void read(org.apache.thrift.protocol.TProtocol iprot, ScanColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -496,18 +474,18 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } - private static class ScanColumnTupleSchemeFactory implements SchemeFactory { + private static class ScanColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanColumnTupleScheme getScheme() { return new ScanColumnTupleScheme(); } } - private static class ScanColumnTupleScheme extends TupleScheme<ScanColumn> { + private static class ScanColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme<ScanColumn> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ScanColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetColFamily()) { optionals.set(0); } @@ -525,8 +503,8 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum @Override public void read(org.apache.thrift.protocol.TProtocol prot, ScanColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.colFamily = iprot.readBinary(); struct.setColFamilyIsSet(true); @@ -538,5 +516,9 @@ public class ScanColumn implements org.apache.thrift.TBase<ScanColumn, ScanColum } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + private static void unusedMethod() {} }
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java index 6675c8e..08224f9 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanOptions.java @@ -15,42 +15,15 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.accumulo.proxy.thrift; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOptions._Fields>, java.io.Serializable, Cloneable, Comparable<ScanOptions> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScanOptions"); @@ -60,16 +33,13 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt private static final org.apache.thrift.protocol.TField ITERATORS_FIELD_DESC = new org.apache.thrift.protocol.TField("iterators", org.apache.thrift.protocol.TType.LIST, (short)4); private static final org.apache.thrift.protocol.TField BUFFER_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("bufferSize", org.apache.thrift.protocol.TType.I32, (short)5); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ScanOptionsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ScanOptionsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ScanOptionsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ScanOptionsTupleSchemeFactory(); - public Set<ByteBuffer> authorizations; // optional + public java.util.Set<java.nio.ByteBuffer> authorizations; // optional public Range range; // optional - public List<ScanColumn> columns; // optional - public List<IteratorSetting> iterators; // optional + public java.util.List<ScanColumn> columns; // optional + public java.util.List<IteratorSetting> iterators; // optional public int bufferSize; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -80,10 +50,10 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt ITERATORS((short)4, "iterators"), BUFFER_SIZE((short)5, "bufferSize"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -114,21 +84,21 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -137,7 +107,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -146,9 +116,9 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt private static final int __BUFFERSIZE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.AUTHORIZATIONS,_Fields.RANGE,_Fields.COLUMNS,_Fields.ITERATORS,_Fields.BUFFER_SIZE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.AUTHORIZATIONS, new org.apache.thrift.meta_data.FieldMetaData("authorizations", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); @@ -162,7 +132,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, IteratorSetting.class)))); tmpMap.put(_Fields.BUFFER_SIZE, new org.apache.thrift.meta_data.FieldMetaData("bufferSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScanOptions.class, metaDataMap); } @@ -175,21 +145,21 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt public ScanOptions(ScanOptions other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetAuthorizations()) { - Set<ByteBuffer> __this__authorizations = new HashSet<ByteBuffer>(other.authorizations); + java.util.Set<java.nio.ByteBuffer> __this__authorizations = new java.util.HashSet<java.nio.ByteBuffer>(other.authorizations); this.authorizations = __this__authorizations; } if (other.isSetRange()) { this.range = new Range(other.range); } if (other.isSetColumns()) { - List<ScanColumn> __this__columns = new ArrayList<ScanColumn>(other.columns.size()); + java.util.List<ScanColumn> __this__columns = new java.util.ArrayList<ScanColumn>(other.columns.size()); for (ScanColumn other_element : other.columns) { __this__columns.add(new ScanColumn(other_element)); } this.columns = __this__columns; } if (other.isSetIterators()) { - List<IteratorSetting> __this__iterators = new ArrayList<IteratorSetting>(other.iterators.size()); + java.util.List<IteratorSetting> __this__iterators = new java.util.ArrayList<IteratorSetting>(other.iterators.size()); for (IteratorSetting other_element : other.iterators) { __this__iterators.add(new IteratorSetting(other_element)); } @@ -216,22 +186,22 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return (this.authorizations == null) ? 0 : this.authorizations.size(); } - public java.util.Iterator<ByteBuffer> getAuthorizationsIterator() { + public java.util.Iterator<java.nio.ByteBuffer> getAuthorizationsIterator() { return (this.authorizations == null) ? null : this.authorizations.iterator(); } - public void addToAuthorizations(ByteBuffer elem) { + public void addToAuthorizations(java.nio.ByteBuffer elem) { if (this.authorizations == null) { - this.authorizations = new HashSet<ByteBuffer>(); + this.authorizations = new java.util.HashSet<java.nio.ByteBuffer>(); } this.authorizations.add(elem); } - public Set<ByteBuffer> getAuthorizations() { + public java.util.Set<java.nio.ByteBuffer> getAuthorizations() { return this.authorizations; } - public ScanOptions setAuthorizations(Set<ByteBuffer> authorizations) { + public ScanOptions setAuthorizations(java.util.Set<java.nio.ByteBuffer> authorizations) { this.authorizations = authorizations; return this; } @@ -285,16 +255,16 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt public void addToColumns(ScanColumn elem) { if (this.columns == null) { - this.columns = new ArrayList<ScanColumn>(); + this.columns = new java.util.ArrayList<ScanColumn>(); } this.columns.add(elem); } - public List<ScanColumn> getColumns() { + public java.util.List<ScanColumn> getColumns() { return this.columns; } - public ScanOptions setColumns(List<ScanColumn> columns) { + public ScanOptions setColumns(java.util.List<ScanColumn> columns) { this.columns = columns; return this; } @@ -324,16 +294,16 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt public void addToIterators(IteratorSetting elem) { if (this.iterators == null) { - this.iterators = new ArrayList<IteratorSetting>(); + this.iterators = new java.util.ArrayList<IteratorSetting>(); } this.iterators.add(elem); } - public List<IteratorSetting> getIterators() { + public java.util.List<IteratorSetting> getIterators() { return this.iterators; } - public ScanOptions setIterators(List<IteratorSetting> iterators) { + public ScanOptions setIterators(java.util.List<IteratorSetting> iterators) { this.iterators = iterators; return this; } @@ -364,25 +334,25 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } public void unsetBufferSize() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID); } /** Returns true if field bufferSize is set (has been assigned a value) and false otherwise */ public boolean isSetBufferSize() { - return EncodingUtils.testBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID); } public void setBufferSizeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BUFFERSIZE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case AUTHORIZATIONS: if (value == null) { unsetAuthorizations(); } else { - setAuthorizations((Set<ByteBuffer>)value); + setAuthorizations((java.util.Set<java.nio.ByteBuffer>)value); } break; @@ -398,7 +368,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (value == null) { unsetColumns(); } else { - setColumns((List<ScanColumn>)value); + setColumns((java.util.List<ScanColumn>)value); } break; @@ -406,7 +376,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (value == null) { unsetIterators(); } else { - setIterators((List<IteratorSetting>)value); + setIterators((java.util.List<IteratorSetting>)value); } break; @@ -414,14 +384,14 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (value == null) { unsetBufferSize(); } else { - setBufferSize((Integer)value); + setBufferSize((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case AUTHORIZATIONS: return getAuthorizations(); @@ -439,13 +409,13 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return getBufferSize(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -460,11 +430,11 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt case BUFFER_SIZE: return isSetBufferSize(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ScanOptions) @@ -475,6 +445,8 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt public boolean equals(ScanOptions that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_authorizations = true && this.isSetAuthorizations(); boolean that_present_authorizations = true && that.isSetAuthorizations(); @@ -526,34 +498,29 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_authorizations = true && (isSetAuthorizations()); - list.add(present_authorizations); - if (present_authorizations) - list.add(authorizations); + hashCode = hashCode * 8191 + ((isSetAuthorizations()) ? 131071 : 524287); + if (isSetAuthorizations()) + hashCode = hashCode * 8191 + authorizations.hashCode(); - boolean present_range = true && (isSetRange()); - list.add(present_range); - if (present_range) - list.add(range); + hashCode = hashCode * 8191 + ((isSetRange()) ? 131071 : 524287); + if (isSetRange()) + hashCode = hashCode * 8191 + range.hashCode(); - boolean present_columns = true && (isSetColumns()); - list.add(present_columns); - if (present_columns) - list.add(columns); + hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); + if (isSetColumns()) + hashCode = hashCode * 8191 + columns.hashCode(); - boolean present_iterators = true && (isSetIterators()); - list.add(present_iterators); - if (present_iterators) - list.add(iterators); + hashCode = hashCode * 8191 + ((isSetIterators()) ? 131071 : 524287); + if (isSetIterators()) + hashCode = hashCode * 8191 + iterators.hashCode(); - boolean present_bufferSize = true && (isSetBufferSize()); - list.add(present_bufferSize); - if (present_bufferSize) - list.add(bufferSize); + hashCode = hashCode * 8191 + ((isSetBufferSize()) ? 131071 : 524287); + if (isSetBufferSize()) + hashCode = hashCode * 8191 + bufferSize; - return list.hashCode(); + return hashCode; } @Override @@ -564,7 +531,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetAuthorizations()).compareTo(other.isSetAuthorizations()); + lastComparison = java.lang.Boolean.valueOf(isSetAuthorizations()).compareTo(other.isSetAuthorizations()); if (lastComparison != 0) { return lastComparison; } @@ -574,7 +541,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRange()).compareTo(other.isSetRange()); + lastComparison = java.lang.Boolean.valueOf(isSetRange()).compareTo(other.isSetRange()); if (lastComparison != 0) { return lastComparison; } @@ -584,7 +551,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return lastComparison; } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } @@ -594,7 +561,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return lastComparison; } } - lastComparison = Boolean.valueOf(isSetIterators()).compareTo(other.isSetIterators()); + lastComparison = java.lang.Boolean.valueOf(isSetIterators()).compareTo(other.isSetIterators()); if (lastComparison != 0) { return lastComparison; } @@ -604,7 +571,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt return lastComparison; } } - lastComparison = Boolean.valueOf(isSetBufferSize()).compareTo(other.isSetBufferSize()); + lastComparison = java.lang.Boolean.valueOf(isSetBufferSize()).compareTo(other.isSetBufferSize()); if (lastComparison != 0) { return lastComparison; } @@ -622,16 +589,16 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ScanOptions("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ScanOptions("); boolean first = true; if (isSetAuthorizations()) { @@ -699,7 +666,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -709,13 +676,13 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } } - private static class ScanOptionsStandardSchemeFactory implements SchemeFactory { + private static class ScanOptionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanOptionsStandardScheme getScheme() { return new ScanOptionsStandardScheme(); } } - private static class ScanOptionsStandardScheme extends StandardScheme<ScanOptions> { + private static class ScanOptionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<ScanOptions> { public void read(org.apache.thrift.protocol.TProtocol iprot, ScanOptions struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -731,8 +698,8 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set26 = iprot.readSetBegin(); - struct.authorizations = new HashSet<ByteBuffer>(2*_set26.size); - ByteBuffer _elem27; + struct.authorizations = new java.util.HashSet<java.nio.ByteBuffer>(2*_set26.size); + java.nio.ByteBuffer _elem27; for (int _i28 = 0; _i28 < _set26.size; ++_i28) { _elem27 = iprot.readBinary(); @@ -758,7 +725,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(); - struct.columns = new ArrayList<ScanColumn>(_list29.size); + struct.columns = new java.util.ArrayList<ScanColumn>(_list29.size); ScanColumn _elem30; for (int _i31 = 0; _i31 < _list29.size; ++_i31) { @@ -777,7 +744,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); - struct.iterators = new ArrayList<IteratorSetting>(_list32.size); + struct.iterators = new java.util.ArrayList<IteratorSetting>(_list32.size); IteratorSetting _elem33; for (int _i34 = 0; _i34 < _list32.size; ++_i34) { @@ -820,7 +787,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt oprot.writeFieldBegin(AUTHORIZATIONS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.authorizations.size())); - for (ByteBuffer _iter35 : struct.authorizations) + for (java.nio.ByteBuffer _iter35 : struct.authorizations) { oprot.writeBinary(_iter35); } @@ -875,18 +842,18 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } - private static class ScanOptionsTupleSchemeFactory implements SchemeFactory { + private static class ScanOptionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanOptionsTupleScheme getScheme() { return new ScanOptionsTupleScheme(); } } - private static class ScanOptionsTupleScheme extends TupleScheme<ScanOptions> { + private static class ScanOptionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<ScanOptions> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ScanOptions struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetAuthorizations()) { optionals.set(0); } @@ -906,7 +873,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (struct.isSetAuthorizations()) { { oprot.writeI32(struct.authorizations.size()); - for (ByteBuffer _iter38 : struct.authorizations) + for (java.nio.ByteBuffer _iter38 : struct.authorizations) { oprot.writeBinary(_iter38); } @@ -940,13 +907,13 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt @Override public void read(org.apache.thrift.protocol.TProtocol prot, ScanOptions struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set41 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.authorizations = new HashSet<ByteBuffer>(2*_set41.size); - ByteBuffer _elem42; + struct.authorizations = new java.util.HashSet<java.nio.ByteBuffer>(2*_set41.size); + java.nio.ByteBuffer _elem42; for (int _i43 = 0; _i43 < _set41.size; ++_i43) { _elem42 = iprot.readBinary(); @@ -963,7 +930,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list44 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList<ScanColumn>(_list44.size); + struct.columns = new java.util.ArrayList<ScanColumn>(_list44.size); ScanColumn _elem45; for (int _i46 = 0; _i46 < _list44.size; ++_i46) { @@ -977,7 +944,7 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list47 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.iterators = new ArrayList<IteratorSetting>(_list47.size); + struct.iterators = new java.util.ArrayList<IteratorSetting>(_list47.size); IteratorSetting _elem48; for (int _i49 = 0; _i49 < _list47.size; ++_i49) { @@ -995,5 +962,9 @@ public class ScanOptions implements org.apache.thrift.TBase<ScanOptions, ScanOpt } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + private static void unusedMethod() {} } http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanResult.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanResult.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanResult.java index 861b0de..f5551cc 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanResult.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanResult.java @@ -15,55 +15,25 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.accumulo.proxy.thrift; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResult._Fields>, java.io.Serializable, Cloneable, Comparable<ScanResult> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScanResult"); private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField MORE_FIELD_DESC = new org.apache.thrift.protocol.TField("more", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ScanResultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ScanResultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ScanResultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ScanResultTupleSchemeFactory(); - public List<KeyValue> results; // required + public java.util.List<KeyValue> results; // required public boolean more; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -71,10 +41,10 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul RESULTS((short)1, "results"), MORE((short)2, "more"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -99,21 +69,21 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -122,7 +92,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -130,15 +100,15 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul // isset id assignments private static final int __MORE_ISSET_ID = 0; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KeyValue.class)))); tmpMap.put(_Fields.MORE, new org.apache.thrift.meta_data.FieldMetaData("more", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScanResult.class, metaDataMap); } @@ -146,7 +116,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } public ScanResult( - List<KeyValue> results, + java.util.List<KeyValue> results, boolean more) { this(); @@ -161,7 +131,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul public ScanResult(ScanResult other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetResults()) { - List<KeyValue> __this__results = new ArrayList<KeyValue>(other.results.size()); + java.util.List<KeyValue> __this__results = new java.util.ArrayList<KeyValue>(other.results.size()); for (KeyValue other_element : other.results) { __this__results.add(new KeyValue(other_element)); } @@ -191,16 +161,16 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul public void addToResults(KeyValue elem) { if (this.results == null) { - this.results = new ArrayList<KeyValue>(); + this.results = new java.util.ArrayList<KeyValue>(); } this.results.add(elem); } - public List<KeyValue> getResults() { + public java.util.List<KeyValue> getResults() { return this.results; } - public ScanResult setResults(List<KeyValue> results) { + public ScanResult setResults(java.util.List<KeyValue> results) { this.results = results; return this; } @@ -231,25 +201,25 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } public void unsetMore() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MORE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MORE_ISSET_ID); } /** Returns true if field more is set (has been assigned a value) and false otherwise */ public boolean isSetMore() { - return EncodingUtils.testBit(__isset_bitfield, __MORE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MORE_ISSET_ID); } public void setMoreIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MORE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MORE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case RESULTS: if (value == null) { unsetResults(); } else { - setResults((List<KeyValue>)value); + setResults((java.util.List<KeyValue>)value); } break; @@ -257,14 +227,14 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul if (value == null) { unsetMore(); } else { - setMore((Boolean)value); + setMore((java.lang.Boolean)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case RESULTS: return getResults(); @@ -273,13 +243,13 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul return isMore(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -288,11 +258,11 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul case MORE: return isSetMore(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ScanResult) @@ -303,6 +273,8 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul public boolean equals(ScanResult that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_results = true && this.isSetResults(); boolean that_present_results = true && that.isSetResults(); @@ -327,19 +299,15 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_results = true && (isSetResults()); - list.add(present_results); - if (present_results) - list.add(results); + hashCode = hashCode * 8191 + ((isSetResults()) ? 131071 : 524287); + if (isSetResults()) + hashCode = hashCode * 8191 + results.hashCode(); - boolean present_more = true; - list.add(present_more); - if (present_more) - list.add(more); + hashCode = hashCode * 8191 + ((more) ? 131071 : 524287); - return list.hashCode(); + return hashCode; } @Override @@ -350,7 +318,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); + lastComparison = java.lang.Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); if (lastComparison != 0) { return lastComparison; } @@ -360,7 +328,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMore()).compareTo(other.isSetMore()); + lastComparison = java.lang.Boolean.valueOf(isSetMore()).compareTo(other.isSetMore()); if (lastComparison != 0) { return lastComparison; } @@ -378,16 +346,16 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ScanResult("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ScanResult("); boolean first = true; sb.append("results:"); @@ -418,7 +386,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -428,13 +396,13 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } } - private static class ScanResultStandardSchemeFactory implements SchemeFactory { + private static class ScanResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanResultStandardScheme getScheme() { return new ScanResultStandardScheme(); } } - private static class ScanResultStandardScheme extends StandardScheme<ScanResult> { + private static class ScanResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<ScanResult> { public void read(org.apache.thrift.protocol.TProtocol iprot, ScanResult struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -450,7 +418,7 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.results = new ArrayList<KeyValue>(_list8.size); + struct.results = new java.util.ArrayList<KeyValue>(_list8.size); KeyValue _elem9; for (int _i10 = 0; _i10 < _list8.size; ++_i10) { @@ -509,18 +477,18 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } - private static class ScanResultTupleSchemeFactory implements SchemeFactory { + private static class ScanResultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ScanResultTupleScheme getScheme() { return new ScanResultTupleScheme(); } } - private static class ScanResultTupleScheme extends TupleScheme<ScanResult> { + private static class ScanResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<ScanResult> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ScanResult struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetResults()) { optionals.set(0); } @@ -544,12 +512,12 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul @Override public void read(org.apache.thrift.protocol.TProtocol prot, ScanResult struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.results = new ArrayList<KeyValue>(_list13.size); + struct.results = new java.util.ArrayList<KeyValue>(_list13.size); KeyValue _elem14; for (int _i15 = 0; _i15 < _list13.size; ++_i15) { @@ -567,5 +535,9 @@ public class ScanResult implements org.apache.thrift.TBase<ScanResult, ScanResul } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + private static void unusedMethod() {} } http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanState.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanState.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanState.java index 8e79212..17d390d 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanState.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanState.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -23,11 +23,8 @@ package org.apache.accumulo.proxy.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum ScanState implements org.apache.thrift.TEnum { +public enum ScanState implements org.apache.thrift.TEnum { IDLE(0), RUNNING(1), QUEUED(2); http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanType.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanType.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanType.java index 14ac9ce..0082b71 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanType.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/ScanType.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -23,11 +23,8 @@ package org.apache.accumulo.proxy.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum ScanType implements org.apache.thrift.TEnum { +public enum ScanType implements org.apache.thrift.TEnum { SINGLE(0), BATCH(1); http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/SystemPermission.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/SystemPermission.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/SystemPermission.java index 6f4b549..2c077f0 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/SystemPermission.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/SystemPermission.java @@ -15,7 +15,7 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -23,11 +23,8 @@ package org.apache.accumulo.proxy.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum SystemPermission implements org.apache.thrift.TEnum { +public enum SystemPermission implements org.apache.thrift.TEnum { GRANT(0), CREATE_TABLE(1), DROP_TABLE(2), http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableExistsException.java ---------------------------------------------------------------------- diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableExistsException.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableExistsException.java index 509f022..3162458 100644 --- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableExistsException.java +++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableExistsException.java @@ -15,63 +15,33 @@ * limitations under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.10.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.accumulo.proxy.thrift; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TableExistsException extends TException implements org.apache.thrift.TBase<TableExistsException, TableExistsException._Fields>, java.io.Serializable, Cloneable, Comparable<TableExistsException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class TableExistsException extends org.apache.thrift.TException implements org.apache.thrift.TBase<TableExistsException, TableExistsException._Fields>, java.io.Serializable, Cloneable, Comparable<TableExistsException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableExistsException"); private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TableExistsExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TableExistsExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TableExistsExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TableExistsExceptionTupleSchemeFactory(); - public String msg; // required + public java.lang.String msg; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MSG((short)1, "msg"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -94,21 +64,21 @@ public class TableExistsException extends TException implements org.apache.thrif */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ - public static _Fields findByName(String name) { + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -117,18 +87,18 @@ public class TableExistsException extends TException implements org.apache.thrif return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TableExistsException.class, metaDataMap); } @@ -136,7 +106,7 @@ public class TableExistsException extends TException implements org.apache.thrif } public TableExistsException( - String msg) + java.lang.String msg) { this(); this.msg = msg; @@ -160,11 +130,11 @@ public class TableExistsException extends TException implements org.apache.thrif this.msg = null; } - public String getMsg() { + public java.lang.String getMsg() { return this.msg; } - public TableExistsException setMsg(String msg) { + public TableExistsException setMsg(java.lang.String msg) { this.msg = msg; return this; } @@ -184,43 +154,43 @@ public class TableExistsException extends TException implements org.apache.thrif } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case MSG: if (value == null) { unsetMsg(); } else { - setMsg((String)value); + setMsg((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case MSG: return getMsg(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case MSG: return isSetMsg(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TableExistsException) @@ -231,6 +201,8 @@ public class TableExistsException extends TException implements org.apache.thrif public boolean equals(TableExistsException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_msg = true && this.isSetMsg(); boolean that_present_msg = true && that.isSetMsg(); @@ -246,14 +218,13 @@ public class TableExistsException extends TException implements org.apache.thrif @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_msg = true && (isSetMsg()); - list.add(present_msg); - if (present_msg) - list.add(msg); + hashCode = hashCode * 8191 + ((isSetMsg()) ? 131071 : 524287); + if (isSetMsg()) + hashCode = hashCode * 8191 + msg.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -264,7 +235,7 @@ public class TableExistsException extends TException implements org.apache.thrif int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg()); + lastComparison = java.lang.Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg()); if (lastComparison != 0) { return lastComparison; } @@ -282,16 +253,16 @@ public class TableExistsException extends TException implements org.apache.thrif } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + scheme(iprot).read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TableExistsException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TableExistsException("); boolean first = true; sb.append("msg:"); @@ -318,7 +289,7 @@ public class TableExistsException extends TException implements org.apache.thrif } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -326,13 +297,13 @@ public class TableExistsException extends TException implements org.apache.thrif } } - private static class TableExistsExceptionStandardSchemeFactory implements SchemeFactory { + private static class TableExistsExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TableExistsExceptionStandardScheme getScheme() { return new TableExistsExceptionStandardScheme(); } } - private static class TableExistsExceptionStandardScheme extends StandardScheme<TableExistsException> { + private static class TableExistsExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<TableExistsException> { public void read(org.apache.thrift.protocol.TProtocol iprot, TableExistsException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -378,18 +349,18 @@ public class TableExistsException extends TException implements org.apache.thrif } - private static class TableExistsExceptionTupleSchemeFactory implements SchemeFactory { + private static class TableExistsExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TableExistsExceptionTupleScheme getScheme() { return new TableExistsExceptionTupleScheme(); } } - private static class TableExistsExceptionTupleScheme extends TupleScheme<TableExistsException> { + private static class TableExistsExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<TableExistsException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TableExistsException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetMsg()) { optionals.set(0); } @@ -401,8 +372,8 @@ public class TableExistsException extends TException implements org.apache.thrif @Override public void read(org.apache.thrift.protocol.TProtocol prot, TableExistsException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.msg = iprot.readString(); struct.setMsgIsSet(true); @@ -410,5 +381,9 @@ public class TableExistsException extends TException implements org.apache.thrif } } + private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + private static void unusedMethod() {} }