http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java index 143393e..2f4735b 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ConfigurationType.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.core.client.impl.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum ConfigurationType implements org.apache.thrift.TEnum { +public enum ConfigurationType implements org.apache.thrift.TEnum { CURRENT(0), SITE(1), DEFAULT(2);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/SecurityErrorCode.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/SecurityErrorCode.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/SecurityErrorCode.java index 8bc1964..28e83c7 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/SecurityErrorCode.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/SecurityErrorCode.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.core.client.impl.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum SecurityErrorCode implements org.apache.thrift.TEnum { +public enum SecurityErrorCode implements org.apache.thrift.TEnum { DEFAULT_SECURITY_ERROR(0), BAD_CREDENTIALS(1), PERMISSION_DENIED(2), http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TDiskUsage.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TDiskUsage.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TDiskUsage.java index 30dc624..7058f3b 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TDiskUsage.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TDiskUsage.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.core.client.impl.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 TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsage._Fields>, java.io.Serializable, Cloneable, Comparable<TDiskUsage> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDiskUsage"); private static final org.apache.thrift.protocol.TField TABLES_FIELD_DESC = new org.apache.thrift.protocol.TField("tables", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDiskUsageStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDiskUsageTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDiskUsageStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDiskUsageTupleSchemeFactory(); - public List<String> tables; // required + public java.util.List<java.lang.String> tables; // required public long usage; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -71,10 +41,10 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag TABLES((short)1, "tables"), USAGE((short)2, "usage"); - 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 TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag */ 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 TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -130,15 +100,15 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag // isset id assignments private static final int __USAGE_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.TABLES, new org.apache.thrift.meta_data.FieldMetaData("tables", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDiskUsage.class, metaDataMap); } @@ -146,7 +116,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } public TDiskUsage( - List<String> tables, + java.util.List<java.lang.String> tables, long usage) { this(); @@ -161,7 +131,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag public TDiskUsage(TDiskUsage other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetTables()) { - List<String> __this__tables = new ArrayList<String>(other.tables); + java.util.List<java.lang.String> __this__tables = new java.util.ArrayList<java.lang.String>(other.tables); this.tables = __this__tables; } this.usage = other.usage; @@ -182,22 +152,22 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag return (this.tables == null) ? 0 : this.tables.size(); } - public java.util.Iterator<String> getTablesIterator() { + public java.util.Iterator<java.lang.String> getTablesIterator() { return (this.tables == null) ? null : this.tables.iterator(); } - public void addToTables(String elem) { + public void addToTables(java.lang.String elem) { if (this.tables == null) { - this.tables = new ArrayList<String>(); + this.tables = new java.util.ArrayList<java.lang.String>(); } this.tables.add(elem); } - public List<String> getTables() { + public java.util.List<java.lang.String> getTables() { return this.tables; } - public TDiskUsage setTables(List<String> tables) { + public TDiskUsage setTables(java.util.List<java.lang.String> tables) { this.tables = tables; return this; } @@ -228,25 +198,25 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } public void unsetUsage() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USAGE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __USAGE_ISSET_ID); } /** Returns true if field usage is set (has been assigned a value) and false otherwise */ public boolean isSetUsage() { - return EncodingUtils.testBit(__isset_bitfield, __USAGE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USAGE_ISSET_ID); } public void setUsageIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USAGE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __USAGE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TABLES: if (value == null) { unsetTables(); } else { - setTables((List<String>)value); + setTables((java.util.List<java.lang.String>)value); } break; @@ -254,14 +224,14 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag if (value == null) { unsetUsage(); } else { - setUsage((Long)value); + setUsage((java.lang.Long)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLES: return getTables(); @@ -270,13 +240,13 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag return getUsage(); } - 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 +255,11 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag case USAGE: return isSetUsage(); } - 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 TDiskUsage) @@ -300,6 +270,8 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag public boolean equals(TDiskUsage that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_tables = true && this.isSetTables(); boolean that_present_tables = true && that.isSetTables(); @@ -324,19 +296,15 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_tables = true && (isSetTables()); - list.add(present_tables); - if (present_tables) - list.add(tables); + hashCode = hashCode * 8191 + ((isSetTables()) ? 131071 : 524287); + if (isSetTables()) + hashCode = hashCode * 8191 + tables.hashCode(); - boolean present_usage = true; - list.add(present_usage); - if (present_usage) - list.add(usage); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(usage); - return list.hashCode(); + return hashCode; } @Override @@ -347,7 +315,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetTables()).compareTo(other.isSetTables()); + lastComparison = java.lang.Boolean.valueOf(isSetTables()).compareTo(other.isSetTables()); if (lastComparison != 0) { return lastComparison; } @@ -357,7 +325,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag return lastComparison; } } - lastComparison = Boolean.valueOf(isSetUsage()).compareTo(other.isSetUsage()); + lastComparison = java.lang.Boolean.valueOf(isSetUsage()).compareTo(other.isSetUsage()); if (lastComparison != 0) { return lastComparison; } @@ -375,16 +343,16 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } 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("TDiskUsage("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TDiskUsage("); boolean first = true; sb.append("tables:"); @@ -415,7 +383,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } } - 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; @@ -425,13 +393,13 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } } - private static class TDiskUsageStandardSchemeFactory implements SchemeFactory { + private static class TDiskUsageStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDiskUsageStandardScheme getScheme() { return new TDiskUsageStandardScheme(); } } - private static class TDiskUsageStandardScheme extends StandardScheme<TDiskUsage> { + private static class TDiskUsageStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDiskUsage> { public void read(org.apache.thrift.protocol.TProtocol iprot, TDiskUsage struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -447,8 +415,8 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.tables = new ArrayList<String>(_list0.size); - String _elem1; + struct.tables = new java.util.ArrayList<java.lang.String>(_list0.size); + java.lang.String _elem1; for (int _i2 = 0; _i2 < _list0.size; ++_i2) { _elem1 = iprot.readString(); @@ -488,7 +456,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag oprot.writeFieldBegin(TABLES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tables.size())); - for (String _iter3 : struct.tables) + for (java.lang.String _iter3 : struct.tables) { oprot.writeString(_iter3); } @@ -505,18 +473,18 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } - private static class TDiskUsageTupleSchemeFactory implements SchemeFactory { + private static class TDiskUsageTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDiskUsageTupleScheme getScheme() { return new TDiskUsageTupleScheme(); } } - private static class TDiskUsageTupleScheme extends TupleScheme<TDiskUsage> { + private static class TDiskUsageTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDiskUsage> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDiskUsage 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.isSetTables()) { optionals.set(0); } @@ -527,7 +495,7 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag if (struct.isSetTables()) { { oprot.writeI32(struct.tables.size()); - for (String _iter4 : struct.tables) + for (java.lang.String _iter4 : struct.tables) { oprot.writeString(_iter4); } @@ -540,13 +508,13 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDiskUsage 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 _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tables = new ArrayList<String>(_list5.size); - String _elem6; + struct.tables = new java.util.ArrayList<java.lang.String>(_list5.size); + java.lang.String _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) { _elem6 = iprot.readString(); @@ -562,5 +530,9 @@ public class TDiskUsage implements org.apache.thrift.TBase<TDiskUsage, TDiskUsag } } + 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/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java index 5b49952..1cbcb8e 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperation.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.core.client.impl.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum TableOperation implements org.apache.thrift.TEnum { +public enum TableOperation implements org.apache.thrift.TEnum { CREATE(0), DELETE(1), RENAME(2), http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java index 52ec63f..5f68327 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/TableOperationExceptionType.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.core.client.impl.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -@SuppressWarnings({"unused"}) public enum TableOperationExceptionType implements org.apache.thrift.TEnum { +public enum TableOperationExceptionType implements org.apache.thrift.TEnum { EXISTS(0), NOTFOUND(1), OFFLINE(2), http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftNotActiveServiceException.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftNotActiveServiceException.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftNotActiveServiceException.java index 0702486..ec9f32e 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftNotActiveServiceException.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftNotActiveServiceException.java @@ -15,61 +15,31 @@ * 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.core.client.impl.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 ThriftNotActiveServiceException extends TException implements org.apache.thrift.TBase<ThriftNotActiveServiceException, ThriftNotActiveServiceException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftNotActiveServiceException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class ThriftNotActiveServiceException extends org.apache.thrift.TException implements org.apache.thrift.TBase<ThriftNotActiveServiceException, ThriftNotActiveServiceException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftNotActiveServiceException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftNotActiveServiceException"); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ThriftNotActiveServiceExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ThriftNotActiveServiceExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ThriftNotActiveServiceExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ThriftNotActiveServiceExceptionTupleSchemeFactory(); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - 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); } } @@ -90,21 +60,21 @@ public class ThriftNotActiveServiceException extends TException implements org.a */ 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; } @@ -113,14 +83,14 @@ public class ThriftNotActiveServiceException extends TException implements org.a return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftNotActiveServiceException.class, metaDataMap); } @@ -141,30 +111,30 @@ public class ThriftNotActiveServiceException extends TException implements org.a public void clear() { } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { } - 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) { } - 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 ThriftNotActiveServiceException) @@ -175,15 +145,17 @@ public class ThriftNotActiveServiceException extends TException implements org.a public boolean equals(ThriftNotActiveServiceException that) { if (that == null) return false; + if (this == that) + return true; return true; } @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - return list.hashCode(); + return hashCode; } @Override @@ -202,16 +174,16 @@ public class ThriftNotActiveServiceException extends TException implements org.a } 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("ThriftNotActiveServiceException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ThriftNotActiveServiceException("); boolean first = true; sb.append(")"); @@ -231,7 +203,7 @@ public class ThriftNotActiveServiceException extends TException implements org.a } } - 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) { @@ -239,13 +211,13 @@ public class ThriftNotActiveServiceException extends TException implements org.a } } - private static class ThriftNotActiveServiceExceptionStandardSchemeFactory implements SchemeFactory { + private static class ThriftNotActiveServiceExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftNotActiveServiceExceptionStandardScheme getScheme() { return new ThriftNotActiveServiceExceptionStandardScheme(); } } - private static class ThriftNotActiveServiceExceptionStandardScheme extends StandardScheme<ThriftNotActiveServiceException> { + private static class ThriftNotActiveServiceExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<ThriftNotActiveServiceException> { public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftNotActiveServiceException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -278,24 +250,28 @@ public class ThriftNotActiveServiceException extends TException implements org.a } - private static class ThriftNotActiveServiceExceptionTupleSchemeFactory implements SchemeFactory { + private static class ThriftNotActiveServiceExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftNotActiveServiceExceptionTupleScheme getScheme() { return new ThriftNotActiveServiceExceptionTupleScheme(); } } - private static class ThriftNotActiveServiceExceptionTupleScheme extends TupleScheme<ThriftNotActiveServiceException> { + private static class ThriftNotActiveServiceExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<ThriftNotActiveServiceException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftNotActiveServiceException struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftNotActiveServiceException struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; } } + 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/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftSecurityException.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftSecurityException.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftSecurityException.java index 52bd98f..e1678d6 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftSecurityException.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftSecurityException.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.core.client.impl.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 ThriftSecurityException extends TException implements org.apache.thrift.TBase<ThriftSecurityException, ThriftSecurityException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftSecurityException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class ThriftSecurityException extends org.apache.thrift.TException implements org.apache.thrift.TBase<ThriftSecurityException, ThriftSecurityException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftSecurityException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftSecurityException"); private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("code", org.apache.thrift.protocol.TType.I32, (short)2); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ThriftSecurityExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ThriftSecurityExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ThriftSecurityExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ThriftSecurityExceptionTupleSchemeFactory(); - public String user; // required + public java.lang.String user; // required /** * * @see SecurityErrorCode @@ -79,10 +49,10 @@ public class ThriftSecurityException extends TException implements org.apache.th */ CODE((short)2, "code"); - 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); } } @@ -107,21 +77,21 @@ public class ThriftSecurityException extends TException implements org.apache.th */ 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; } @@ -130,20 +100,20 @@ public class ThriftSecurityException extends TException implements org.apache.th 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.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.CODE, new org.apache.thrift.meta_data.FieldMetaData("code", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SecurityErrorCode.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftSecurityException.class, metaDataMap); } @@ -151,7 +121,7 @@ public class ThriftSecurityException extends TException implements org.apache.th } public ThriftSecurityException( - String user, + java.lang.String user, SecurityErrorCode code) { this(); @@ -181,11 +151,11 @@ public class ThriftSecurityException extends TException implements org.apache.th this.code = null; } - public String getUser() { + public java.lang.String getUser() { return this.user; } - public ThriftSecurityException setUser(String user) { + public ThriftSecurityException setUser(java.lang.String user) { this.user = user; return this; } @@ -237,13 +207,13 @@ public class ThriftSecurityException extends TException implements org.apache.th } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case USER: if (value == null) { unsetUser(); } else { - setUser((String)value); + setUser((java.lang.String)value); } break; @@ -258,7 +228,7 @@ public class ThriftSecurityException extends TException implements org.apache.th } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case USER: return getUser(); @@ -267,13 +237,13 @@ public class ThriftSecurityException extends TException implements org.apache.th return getCode(); } - 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) { @@ -282,11 +252,11 @@ public class ThriftSecurityException extends TException implements org.apache.th case CODE: return isSetCode(); } - 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 ThriftSecurityException) @@ -297,6 +267,8 @@ public class ThriftSecurityException extends TException implements org.apache.th public boolean equals(ThriftSecurityException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_user = true && this.isSetUser(); boolean that_present_user = true && that.isSetUser(); @@ -321,19 +293,17 @@ public class ThriftSecurityException extends TException implements org.apache.th @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_user = true && (isSetUser()); - list.add(present_user); - if (present_user) - list.add(user); + hashCode = hashCode * 8191 + ((isSetUser()) ? 131071 : 524287); + if (isSetUser()) + hashCode = hashCode * 8191 + user.hashCode(); - boolean present_code = true && (isSetCode()); - list.add(present_code); - if (present_code) - list.add(code.getValue()); + hashCode = hashCode * 8191 + ((isSetCode()) ? 131071 : 524287); + if (isSetCode()) + hashCode = hashCode * 8191 + code.getValue(); - return list.hashCode(); + return hashCode; } @Override @@ -344,7 +314,7 @@ public class ThriftSecurityException extends TException implements org.apache.th int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + lastComparison = java.lang.Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); if (lastComparison != 0) { return lastComparison; } @@ -354,7 +324,7 @@ public class ThriftSecurityException extends TException implements org.apache.th return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCode()).compareTo(other.isSetCode()); + lastComparison = java.lang.Boolean.valueOf(isSetCode()).compareTo(other.isSetCode()); if (lastComparison != 0) { return lastComparison; } @@ -372,16 +342,16 @@ public class ThriftSecurityException extends TException implements org.apache.th } 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("ThriftSecurityException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ThriftSecurityException("); boolean first = true; sb.append("user:"); @@ -416,7 +386,7 @@ public class ThriftSecurityException extends TException implements org.apache.th } } - 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) { @@ -424,13 +394,13 @@ public class ThriftSecurityException extends TException implements org.apache.th } } - private static class ThriftSecurityExceptionStandardSchemeFactory implements SchemeFactory { + private static class ThriftSecurityExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftSecurityExceptionStandardScheme getScheme() { return new ThriftSecurityExceptionStandardScheme(); } } - private static class ThriftSecurityExceptionStandardScheme extends StandardScheme<ThriftSecurityException> { + private static class ThriftSecurityExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<ThriftSecurityException> { public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftSecurityException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -489,18 +459,18 @@ public class ThriftSecurityException extends TException implements org.apache.th } - private static class ThriftSecurityExceptionTupleSchemeFactory implements SchemeFactory { + private static class ThriftSecurityExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftSecurityExceptionTupleScheme getScheme() { return new ThriftSecurityExceptionTupleScheme(); } } - private static class ThriftSecurityExceptionTupleScheme extends TupleScheme<ThriftSecurityException> { + private static class ThriftSecurityExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<ThriftSecurityException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftSecurityException 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.isSetUser()) { optionals.set(0); } @@ -518,8 +488,8 @@ public class ThriftSecurityException extends TException implements org.apache.th @Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftSecurityException 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.user = iprot.readString(); struct.setUserIsSet(true); @@ -531,5 +501,9 @@ public class ThriftSecurityException extends TException implements org.apache.th } } + 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/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java index 55a5d5a..5912b8b 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java +++ b/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ThriftTableOperationException.java @@ -15,43 +15,16 @@ * 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.core.client.impl.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 ThriftTableOperationException extends TException implements org.apache.thrift.TBase<ThriftTableOperationException, ThriftTableOperationException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftTableOperationException> { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)") +public class ThriftTableOperationException extends org.apache.thrift.TException implements org.apache.thrift.TBase<ThriftTableOperationException, ThriftTableOperationException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftTableOperationException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftTableOperationException"); private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableId", org.apache.thrift.protocol.TType.STRING, (short)1); @@ -60,14 +33,11 @@ public class ThriftTableOperationException extends TException implements org.apa private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ThriftTableOperationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ThriftTableOperationExceptionTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ThriftTableOperationExceptionStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ThriftTableOperationExceptionTupleSchemeFactory(); - public String tableId; // required - public String tableName; // required + public java.lang.String tableId; // required + public java.lang.String tableName; // required /** * * @see TableOperation @@ -78,7 +48,7 @@ public class ThriftTableOperationException extends TException implements org.apa * @see TableOperationExceptionType */ public TableOperationExceptionType type; // required - public String description; // required + public java.lang.String description; // 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 { @@ -96,10 +66,10 @@ public class ThriftTableOperationException extends TException implements org.apa TYPE((short)4, "type"), DESCRIPTION((short)5, "description"); - 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); } } @@ -130,21 +100,21 @@ public class ThriftTableOperationException extends TException implements org.apa */ 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; } @@ -153,15 +123,15 @@ public class ThriftTableOperationException extends TException implements org.apa 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.TABLE_ID, new org.apache.thrift.meta_data.FieldMetaData("tableId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -172,7 +142,7 @@ public class ThriftTableOperationException extends TException implements org.apa new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TableOperationExceptionType.class))); tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", 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(ThriftTableOperationException.class, metaDataMap); } @@ -180,11 +150,11 @@ public class ThriftTableOperationException extends TException implements org.apa } public ThriftTableOperationException( - String tableId, - String tableName, + java.lang.String tableId, + java.lang.String tableName, TableOperation op, TableOperationExceptionType type, - String description) + java.lang.String description) { this(); this.tableId = tableId; @@ -228,11 +198,11 @@ public class ThriftTableOperationException extends TException implements org.apa this.description = null; } - public String getTableId() { + public java.lang.String getTableId() { return this.tableId; } - public ThriftTableOperationException setTableId(String tableId) { + public ThriftTableOperationException setTableId(java.lang.String tableId) { this.tableId = tableId; return this; } @@ -252,11 +222,11 @@ public class ThriftTableOperationException extends TException implements org.apa } } - public String getTableName() { + public java.lang.String getTableName() { return this.tableName; } - public ThriftTableOperationException setTableName(String tableName) { + public ThriftTableOperationException setTableName(java.lang.String tableName) { this.tableName = tableName; return this; } @@ -340,11 +310,11 @@ public class ThriftTableOperationException extends TException implements org.apa } } - public String getDescription() { + public java.lang.String getDescription() { return this.description; } - public ThriftTableOperationException setDescription(String description) { + public ThriftTableOperationException setDescription(java.lang.String description) { this.description = description; return this; } @@ -364,13 +334,13 @@ public class ThriftTableOperationException extends TException implements org.apa } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case TABLE_ID: if (value == null) { unsetTableId(); } else { - setTableId((String)value); + setTableId((java.lang.String)value); } break; @@ -378,7 +348,7 @@ public class ThriftTableOperationException extends TException implements org.apa if (value == null) { unsetTableName(); } else { - setTableName((String)value); + setTableName((java.lang.String)value); } break; @@ -402,14 +372,14 @@ public class ThriftTableOperationException extends TException implements org.apa if (value == null) { unsetDescription(); } else { - setDescription((String)value); + setDescription((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return getTableId(); @@ -427,13 +397,13 @@ public class ThriftTableOperationException extends TException implements org.apa return getDescription(); } - 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) { @@ -448,11 +418,11 @@ public class ThriftTableOperationException extends TException implements org.apa case DESCRIPTION: return isSetDescription(); } - 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 ThriftTableOperationException) @@ -463,6 +433,8 @@ public class ThriftTableOperationException extends TException implements org.apa public boolean equals(ThriftTableOperationException that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_tableId = true && this.isSetTableId(); boolean that_present_tableId = true && that.isSetTableId(); @@ -514,34 +486,29 @@ public class ThriftTableOperationException extends TException implements org.apa @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_tableId = true && (isSetTableId()); - list.add(present_tableId); - if (present_tableId) - list.add(tableId); + hashCode = hashCode * 8191 + ((isSetTableId()) ? 131071 : 524287); + if (isSetTableId()) + hashCode = hashCode * 8191 + tableId.hashCode(); - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); - boolean present_op = true && (isSetOp()); - list.add(present_op); - if (present_op) - list.add(op.getValue()); + hashCode = hashCode * 8191 + ((isSetOp()) ? 131071 : 524287); + if (isSetOp()) + hashCode = hashCode * 8191 + op.getValue(); - boolean present_type = true && (isSetType()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); + hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); + if (isSetType()) + hashCode = hashCode * 8191 + type.getValue(); - boolean present_description = true && (isSetDescription()); - list.add(present_description); - if (present_description) - list.add(description); + hashCode = hashCode * 8191 + ((isSetDescription()) ? 131071 : 524287); + if (isSetDescription()) + hashCode = hashCode * 8191 + description.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -552,7 +519,7 @@ public class ThriftTableOperationException extends TException implements org.apa int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId()); + lastComparison = java.lang.Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId()); if (lastComparison != 0) { return lastComparison; } @@ -562,7 +529,7 @@ public class ThriftTableOperationException extends TException implements org.apa return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -572,7 +539,7 @@ public class ThriftTableOperationException extends TException implements org.apa return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOp()).compareTo(other.isSetOp()); + lastComparison = java.lang.Boolean.valueOf(isSetOp()).compareTo(other.isSetOp()); if (lastComparison != 0) { return lastComparison; } @@ -582,7 +549,7 @@ public class ThriftTableOperationException extends TException implements org.apa return lastComparison; } } - lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } @@ -592,7 +559,7 @@ public class ThriftTableOperationException extends TException implements org.apa return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription()); + lastComparison = java.lang.Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription()); if (lastComparison != 0) { return lastComparison; } @@ -610,16 +577,16 @@ public class ThriftTableOperationException extends TException implements org.apa } 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("ThriftTableOperationException("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ThriftTableOperationException("); boolean first = true; sb.append("tableId:"); @@ -678,7 +645,7 @@ public class ThriftTableOperationException extends TException implements org.apa } } - 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) { @@ -686,13 +653,13 @@ public class ThriftTableOperationException extends TException implements org.apa } } - private static class ThriftTableOperationExceptionStandardSchemeFactory implements SchemeFactory { + private static class ThriftTableOperationExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftTableOperationExceptionStandardScheme getScheme() { return new ThriftTableOperationExceptionStandardScheme(); } } - private static class ThriftTableOperationExceptionStandardScheme extends StandardScheme<ThriftTableOperationException> { + private static class ThriftTableOperationExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<ThriftTableOperationException> { public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftTableOperationException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -790,18 +757,18 @@ public class ThriftTableOperationException extends TException implements org.apa } - private static class ThriftTableOperationExceptionTupleSchemeFactory implements SchemeFactory { + private static class ThriftTableOperationExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftTableOperationExceptionTupleScheme getScheme() { return new ThriftTableOperationExceptionTupleScheme(); } } - private static class ThriftTableOperationExceptionTupleScheme extends TupleScheme<ThriftTableOperationException> { + private static class ThriftTableOperationExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<ThriftTableOperationException> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftTableOperationException 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.isSetTableId()) { optionals.set(0); } @@ -837,8 +804,8 @@ public class ThriftTableOperationException extends TException implements org.apa @Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftTableOperationException 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)) { struct.tableId = iprot.readString(); struct.setTableIdIsSet(true); @@ -862,5 +829,9 @@ public class ThriftTableOperationException extends TException implements org.apa } } + 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() {} }