You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2017/02/09 19:29:50 UTC
[22/41] accumulo git commit: ACCUMULO-4551 Add thrift-gen changes
from 0.10.0
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java b/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
index 9b62fa1..5502d13 100644
--- a/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.java
+++ b/core/src/main/java/org/apache/accumulo/core/replication/thrift/WalEdits.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.core.replication.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 WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fields>, java.io.Serializable, Cloneable, Comparable<WalEdits> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WalEdits");
private static final org.apache.thrift.protocol.TField EDITS_FIELD_DESC = new org.apache.thrift.protocol.TField("edits", org.apache.thrift.protocol.TType.LIST, (short)1);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new WalEditsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new WalEditsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new WalEditsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new WalEditsTupleSchemeFactory();
- public List<ByteBuffer> edits; // required
+ public java.util.List<java.nio.ByteBuffer> edits; // 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 {
EDITS((short)1, "edits");
- 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 WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
*/
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,19 +87,19 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
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.EDITS, new org.apache.thrift.meta_data.FieldMetaData("edits", 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 , true))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WalEdits.class, metaDataMap);
}
@@ -137,7 +107,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
public WalEdits(
- List<ByteBuffer> edits)
+ java.util.List<java.nio.ByteBuffer> edits)
{
this();
this.edits = edits;
@@ -148,7 +118,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
*/
public WalEdits(WalEdits other) {
if (other.isSetEdits()) {
- List<ByteBuffer> __this__edits = new ArrayList<ByteBuffer>(other.edits);
+ java.util.List<java.nio.ByteBuffer> __this__edits = new java.util.ArrayList<java.nio.ByteBuffer>(other.edits);
this.edits = __this__edits;
}
}
@@ -166,22 +136,22 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
return (this.edits == null) ? 0 : this.edits.size();
}
- public java.util.Iterator<ByteBuffer> getEditsIterator() {
+ public java.util.Iterator<java.nio.ByteBuffer> getEditsIterator() {
return (this.edits == null) ? null : this.edits.iterator();
}
- public void addToEdits(ByteBuffer elem) {
+ public void addToEdits(java.nio.ByteBuffer elem) {
if (this.edits == null) {
- this.edits = new ArrayList<ByteBuffer>();
+ this.edits = new java.util.ArrayList<java.nio.ByteBuffer>();
}
this.edits.add(elem);
}
- public List<ByteBuffer> getEdits() {
+ public java.util.List<java.nio.ByteBuffer> getEdits() {
return this.edits;
}
- public WalEdits setEdits(List<ByteBuffer> edits) {
+ public WalEdits setEdits(java.util.List<java.nio.ByteBuffer> edits) {
this.edits = edits;
return this;
}
@@ -201,43 +171,43 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case EDITS:
if (value == null) {
unsetEdits();
} else {
- setEdits((List<ByteBuffer>)value);
+ setEdits((java.util.List<java.nio.ByteBuffer>)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case EDITS:
return getEdits();
}
- 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 EDITS:
return isSetEdits();
}
- 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 WalEdits)
@@ -248,6 +218,8 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
public boolean equals(WalEdits that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_edits = true && this.isSetEdits();
boolean that_present_edits = true && that.isSetEdits();
@@ -263,14 +235,13 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_edits = true && (isSetEdits());
- list.add(present_edits);
- if (present_edits)
- list.add(edits);
+ hashCode = hashCode * 8191 + ((isSetEdits()) ? 131071 : 524287);
+ if (isSetEdits())
+ hashCode = hashCode * 8191 + edits.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -281,7 +252,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetEdits()).compareTo(other.isSetEdits());
+ lastComparison = java.lang.Boolean.valueOf(isSetEdits()).compareTo(other.isSetEdits());
if (lastComparison != 0) {
return lastComparison;
}
@@ -299,16 +270,16 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
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("WalEdits(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("WalEdits(");
boolean first = true;
sb.append("edits:");
@@ -335,7 +306,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
}
- 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) {
@@ -343,13 +314,13 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
}
- private static class WalEditsStandardSchemeFactory implements SchemeFactory {
+ private static class WalEditsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public WalEditsStandardScheme getScheme() {
return new WalEditsStandardScheme();
}
}
- private static class WalEditsStandardScheme extends StandardScheme<WalEdits> {
+ private static class WalEditsStandardScheme extends org.apache.thrift.scheme.StandardScheme<WalEdits> {
public void read(org.apache.thrift.protocol.TProtocol iprot, WalEdits struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -365,8 +336,8 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
- struct.edits = new ArrayList<ByteBuffer>(_list0.size);
- ByteBuffer _elem1;
+ struct.edits = new java.util.ArrayList<java.nio.ByteBuffer>(_list0.size);
+ java.nio.ByteBuffer _elem1;
for (int _i2 = 0; _i2 < _list0.size; ++_i2)
{
_elem1 = iprot.readBinary();
@@ -398,7 +369,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
oprot.writeFieldBegin(EDITS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.edits.size()));
- for (ByteBuffer _iter3 : struct.edits)
+ for (java.nio.ByteBuffer _iter3 : struct.edits)
{
oprot.writeBinary(_iter3);
}
@@ -412,18 +383,18 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
- private static class WalEditsTupleSchemeFactory implements SchemeFactory {
+ private static class WalEditsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public WalEditsTupleScheme getScheme() {
return new WalEditsTupleScheme();
}
}
- private static class WalEditsTupleScheme extends TupleScheme<WalEdits> {
+ private static class WalEditsTupleScheme extends org.apache.thrift.scheme.TupleScheme<WalEdits> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, WalEdits 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.isSetEdits()) {
optionals.set(0);
}
@@ -431,7 +402,7 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
if (struct.isSetEdits()) {
{
oprot.writeI32(struct.edits.size());
- for (ByteBuffer _iter4 : struct.edits)
+ for (java.nio.ByteBuffer _iter4 : struct.edits)
{
oprot.writeBinary(_iter4);
}
@@ -441,13 +412,13 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, WalEdits 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)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.edits = new ArrayList<ByteBuffer>(_list5.size);
- ByteBuffer _elem6;
+ struct.edits = new java.util.ArrayList<java.nio.ByteBuffer>(_list5.size);
+ java.nio.ByteBuffer _elem6;
for (int _i7 = 0; _i7 < _list5.size; ++_i7)
{
_elem6 = iprot.readBinary();
@@ -459,5 +430,9 @@ public class WalEdits implements org.apache.thrift.TBase<WalEdits, WalEdits._Fie
}
}
+ 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/security/thrift/TAuthenticationKey.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationKey.java b/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationKey.java
index 574a673..d4d2ef3 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationKey.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationKey.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.core.security.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 TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticationKey, TAuthenticationKey._Fields>, java.io.Serializable, Cloneable, Comparable<TAuthenticationKey> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthenticationKey");
@@ -59,13 +32,10 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
private static final org.apache.thrift.protocol.TField EXPIRATION_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("expirationDate", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField CREATION_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("creationDate", org.apache.thrift.protocol.TType.I64, (short)4);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TAuthenticationKeyStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TAuthenticationKeyTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TAuthenticationKeyStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TAuthenticationKeyTupleSchemeFactory();
- public ByteBuffer secret; // required
+ public java.nio.ByteBuffer secret; // required
public int keyId; // optional
public long expirationDate; // optional
public long creationDate; // optional
@@ -77,10 +47,10 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
EXPIRATION_DATE((short)3, "expirationDate"),
CREATION_DATE((short)4, "creationDate");
- 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);
}
}
@@ -109,21 +79,21 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
*/
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;
}
@@ -132,7 +102,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -143,9 +113,9 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
private static final int __CREATIONDATE_ISSET_ID = 2;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.KEY_ID,_Fields.EXPIRATION_DATE,_Fields.CREATION_DATE};
- 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.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.KEY_ID, new org.apache.thrift.meta_data.FieldMetaData("keyId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
@@ -154,7 +124,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.CREATION_DATE, new org.apache.thrift.meta_data.FieldMetaData("creationDate", org.apache.thrift.TFieldRequirementType.OPTIONAL,
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(TAuthenticationKey.class, metaDataMap);
}
@@ -162,7 +132,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
public TAuthenticationKey(
- ByteBuffer secret)
+ java.nio.ByteBuffer secret)
{
this();
this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret);
@@ -201,16 +171,16 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return secret == null ? null : secret.array();
}
- public ByteBuffer bufferForSecret() {
+ public java.nio.ByteBuffer bufferForSecret() {
return org.apache.thrift.TBaseHelper.copyBinary(secret);
}
public TAuthenticationKey setSecret(byte[] secret) {
- this.secret = secret == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(secret, secret.length));
+ this.secret = secret == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(secret.clone());
return this;
}
- public TAuthenticationKey setSecret(ByteBuffer secret) {
+ public TAuthenticationKey setSecret(java.nio.ByteBuffer secret) {
this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret);
return this;
}
@@ -241,16 +211,16 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
public void unsetKeyId() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYID_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYID_ISSET_ID);
}
/** Returns true if field keyId is set (has been assigned a value) and false otherwise */
public boolean isSetKeyId() {
- return EncodingUtils.testBit(__isset_bitfield, __KEYID_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYID_ISSET_ID);
}
public void setKeyIdIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYID_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYID_ISSET_ID, value);
}
public long getExpirationDate() {
@@ -264,16 +234,16 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
public void unsetExpirationDate() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
}
/** Returns true if field expirationDate is set (has been assigned a value) and false otherwise */
public boolean isSetExpirationDate() {
- return EncodingUtils.testBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
}
public void setExpirationDateIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID, value);
}
public long getCreationDate() {
@@ -287,25 +257,29 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
public void unsetCreationDate() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATIONDATE_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATIONDATE_ISSET_ID);
}
/** Returns true if field creationDate is set (has been assigned a value) and false otherwise */
public boolean isSetCreationDate() {
- return EncodingUtils.testBit(__isset_bitfield, __CREATIONDATE_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATIONDATE_ISSET_ID);
}
public void setCreationDateIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATIONDATE_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATIONDATE_ISSET_ID, value);
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SECRET:
if (value == null) {
unsetSecret();
} else {
- setSecret((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setSecret((byte[])value);
+ } else {
+ setSecret((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -313,7 +287,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
if (value == null) {
unsetKeyId();
} else {
- setKeyId((Integer)value);
+ setKeyId((java.lang.Integer)value);
}
break;
@@ -321,7 +295,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
if (value == null) {
unsetExpirationDate();
} else {
- setExpirationDate((Long)value);
+ setExpirationDate((java.lang.Long)value);
}
break;
@@ -329,14 +303,14 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
if (value == null) {
unsetCreationDate();
} else {
- setCreationDate((Long)value);
+ setCreationDate((java.lang.Long)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SECRET:
return getSecret();
@@ -351,13 +325,13 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return getCreationDate();
}
- 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) {
@@ -370,11 +344,11 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
case CREATION_DATE:
return isSetCreationDate();
}
- 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 TAuthenticationKey)
@@ -385,6 +359,8 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
public boolean equals(TAuthenticationKey that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_secret = true && this.isSetSecret();
boolean that_present_secret = true && that.isSetSecret();
@@ -427,29 +403,25 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_secret = true && (isSetSecret());
- list.add(present_secret);
- if (present_secret)
- list.add(secret);
+ hashCode = hashCode * 8191 + ((isSetSecret()) ? 131071 : 524287);
+ if (isSetSecret())
+ hashCode = hashCode * 8191 + secret.hashCode();
- boolean present_keyId = true && (isSetKeyId());
- list.add(present_keyId);
- if (present_keyId)
- list.add(keyId);
+ hashCode = hashCode * 8191 + ((isSetKeyId()) ? 131071 : 524287);
+ if (isSetKeyId())
+ hashCode = hashCode * 8191 + keyId;
- boolean present_expirationDate = true && (isSetExpirationDate());
- list.add(present_expirationDate);
- if (present_expirationDate)
- list.add(expirationDate);
+ hashCode = hashCode * 8191 + ((isSetExpirationDate()) ? 131071 : 524287);
+ if (isSetExpirationDate())
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(expirationDate);
- boolean present_creationDate = true && (isSetCreationDate());
- list.add(present_creationDate);
- if (present_creationDate)
- list.add(creationDate);
+ hashCode = hashCode * 8191 + ((isSetCreationDate()) ? 131071 : 524287);
+ if (isSetCreationDate())
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(creationDate);
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -460,7 +432,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret());
+ lastComparison = java.lang.Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret());
if (lastComparison != 0) {
return lastComparison;
}
@@ -470,7 +442,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetKeyId()).compareTo(other.isSetKeyId());
+ lastComparison = java.lang.Boolean.valueOf(isSetKeyId()).compareTo(other.isSetKeyId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -480,7 +452,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetExpirationDate()).compareTo(other.isSetExpirationDate());
+ lastComparison = java.lang.Boolean.valueOf(isSetExpirationDate()).compareTo(other.isSetExpirationDate());
if (lastComparison != 0) {
return lastComparison;
}
@@ -490,7 +462,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetCreationDate()).compareTo(other.isSetCreationDate());
+ lastComparison = java.lang.Boolean.valueOf(isSetCreationDate()).compareTo(other.isSetCreationDate());
if (lastComparison != 0) {
return lastComparison;
}
@@ -508,16 +480,16 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
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("TAuthenticationKey(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("TAuthenticationKey(");
boolean first = true;
sb.append("secret:");
@@ -562,7 +534,7 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
}
- 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;
@@ -572,13 +544,13 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
}
- private static class TAuthenticationKeyStandardSchemeFactory implements SchemeFactory {
+ private static class TAuthenticationKeyStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAuthenticationKeyStandardScheme getScheme() {
return new TAuthenticationKeyStandardScheme();
}
}
- private static class TAuthenticationKeyStandardScheme extends StandardScheme<TAuthenticationKey> {
+ private static class TAuthenticationKeyStandardScheme extends org.apache.thrift.scheme.StandardScheme<TAuthenticationKey> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TAuthenticationKey struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -663,18 +635,18 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
- private static class TAuthenticationKeyTupleSchemeFactory implements SchemeFactory {
+ private static class TAuthenticationKeyTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAuthenticationKeyTupleScheme getScheme() {
return new TAuthenticationKeyTupleScheme();
}
}
- private static class TAuthenticationKeyTupleScheme extends TupleScheme<TAuthenticationKey> {
+ private static class TAuthenticationKeyTupleScheme extends org.apache.thrift.scheme.TupleScheme<TAuthenticationKey> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TAuthenticationKey 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.isSetSecret()) {
optionals.set(0);
}
@@ -704,8 +676,8 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TAuthenticationKey struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.secret = iprot.readBinary();
struct.setSecretIsSet(true);
@@ -725,5 +697,9 @@ public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticati
}
}
+ 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/security/thrift/TAuthenticationTokenIdentifier.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationTokenIdentifier.java b/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationTokenIdentifier.java
index cf3f515..872f6b8 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationTokenIdentifier.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/thrift/TAuthenticationTokenIdentifier.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.core.security.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 TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<TAuthenticationTokenIdentifier, TAuthenticationTokenIdentifier._Fields>, java.io.Serializable, Cloneable, Comparable<TAuthenticationTokenIdentifier> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthenticationTokenIdentifier");
@@ -60,17 +33,14 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
private static final org.apache.thrift.protocol.TField EXPIRATION_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("expirationDate", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField INSTANCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("instanceId", 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 TAuthenticationTokenIdentifierStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TAuthenticationTokenIdentifierTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TAuthenticationTokenIdentifierStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TAuthenticationTokenIdentifierTupleSchemeFactory();
- public String principal; // required
+ public java.lang.String principal; // required
public int keyId; // optional
public long issueDate; // optional
public long expirationDate; // optional
- public String instanceId; // optional
+ public java.lang.String instanceId; // 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 {
@@ -80,10 +50,10 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
EXPIRATION_DATE((short)4, "expirationDate"),
INSTANCE_ID((short)5, "instanceId");
- 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 TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
*/
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 TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -148,9 +118,9 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
private static final int __EXPIRATIONDATE_ISSET_ID = 2;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.KEY_ID,_Fields.ISSUE_DATE,_Fields.EXPIRATION_DATE,_Fields.INSTANCE_ID};
- 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.PRINCIPAL, new org.apache.thrift.meta_data.FieldMetaData("principal", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.KEY_ID, new org.apache.thrift.meta_data.FieldMetaData("keyId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
@@ -161,7 +131,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.INSTANCE_ID, new org.apache.thrift.meta_data.FieldMetaData("instanceId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
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(TAuthenticationTokenIdentifier.class, metaDataMap);
}
@@ -169,7 +139,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
public TAuthenticationTokenIdentifier(
- String principal)
+ java.lang.String principal)
{
this();
this.principal = principal;
@@ -207,11 +177,11 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
this.instanceId = null;
}
- public String getPrincipal() {
+ public java.lang.String getPrincipal() {
return this.principal;
}
- public TAuthenticationTokenIdentifier setPrincipal(String principal) {
+ public TAuthenticationTokenIdentifier setPrincipal(java.lang.String principal) {
this.principal = principal;
return this;
}
@@ -242,16 +212,16 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
public void unsetKeyId() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYID_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYID_ISSET_ID);
}
/** Returns true if field keyId is set (has been assigned a value) and false otherwise */
public boolean isSetKeyId() {
- return EncodingUtils.testBit(__isset_bitfield, __KEYID_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYID_ISSET_ID);
}
public void setKeyIdIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYID_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYID_ISSET_ID, value);
}
public long getIssueDate() {
@@ -265,16 +235,16 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
public void unsetIssueDate() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISSUEDATE_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ISSUEDATE_ISSET_ID);
}
/** Returns true if field issueDate is set (has been assigned a value) and false otherwise */
public boolean isSetIssueDate() {
- return EncodingUtils.testBit(__isset_bitfield, __ISSUEDATE_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISSUEDATE_ISSET_ID);
}
public void setIssueDateIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISSUEDATE_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ISSUEDATE_ISSET_ID, value);
}
public long getExpirationDate() {
@@ -288,23 +258,23 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
public void unsetExpirationDate() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
}
/** Returns true if field expirationDate is set (has been assigned a value) and false otherwise */
public boolean isSetExpirationDate() {
- return EncodingUtils.testBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID);
}
public void setExpirationDateIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXPIRATIONDATE_ISSET_ID, value);
}
- public String getInstanceId() {
+ public java.lang.String getInstanceId() {
return this.instanceId;
}
- public TAuthenticationTokenIdentifier setInstanceId(String instanceId) {
+ public TAuthenticationTokenIdentifier setInstanceId(java.lang.String instanceId) {
this.instanceId = instanceId;
return this;
}
@@ -324,13 +294,13 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PRINCIPAL:
if (value == null) {
unsetPrincipal();
} else {
- setPrincipal((String)value);
+ setPrincipal((java.lang.String)value);
}
break;
@@ -338,7 +308,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
if (value == null) {
unsetKeyId();
} else {
- setKeyId((Integer)value);
+ setKeyId((java.lang.Integer)value);
}
break;
@@ -346,7 +316,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
if (value == null) {
unsetIssueDate();
} else {
- setIssueDate((Long)value);
+ setIssueDate((java.lang.Long)value);
}
break;
@@ -354,7 +324,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
if (value == null) {
unsetExpirationDate();
} else {
- setExpirationDate((Long)value);
+ setExpirationDate((java.lang.Long)value);
}
break;
@@ -362,14 +332,14 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
if (value == null) {
unsetInstanceId();
} else {
- setInstanceId((String)value);
+ setInstanceId((java.lang.String)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PRINCIPAL:
return getPrincipal();
@@ -387,13 +357,13 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return getInstanceId();
}
- 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) {
@@ -408,11 +378,11 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
case INSTANCE_ID:
return isSetInstanceId();
}
- 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 TAuthenticationTokenIdentifier)
@@ -423,6 +393,8 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
public boolean equals(TAuthenticationTokenIdentifier that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_principal = true && this.isSetPrincipal();
boolean that_present_principal = true && that.isSetPrincipal();
@@ -474,34 +446,29 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_principal = true && (isSetPrincipal());
- list.add(present_principal);
- if (present_principal)
- list.add(principal);
+ hashCode = hashCode * 8191 + ((isSetPrincipal()) ? 131071 : 524287);
+ if (isSetPrincipal())
+ hashCode = hashCode * 8191 + principal.hashCode();
- boolean present_keyId = true && (isSetKeyId());
- list.add(present_keyId);
- if (present_keyId)
- list.add(keyId);
+ hashCode = hashCode * 8191 + ((isSetKeyId()) ? 131071 : 524287);
+ if (isSetKeyId())
+ hashCode = hashCode * 8191 + keyId;
- boolean present_issueDate = true && (isSetIssueDate());
- list.add(present_issueDate);
- if (present_issueDate)
- list.add(issueDate);
+ hashCode = hashCode * 8191 + ((isSetIssueDate()) ? 131071 : 524287);
+ if (isSetIssueDate())
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(issueDate);
- boolean present_expirationDate = true && (isSetExpirationDate());
- list.add(present_expirationDate);
- if (present_expirationDate)
- list.add(expirationDate);
+ hashCode = hashCode * 8191 + ((isSetExpirationDate()) ? 131071 : 524287);
+ if (isSetExpirationDate())
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(expirationDate);
- boolean present_instanceId = true && (isSetInstanceId());
- list.add(present_instanceId);
- if (present_instanceId)
- list.add(instanceId);
+ hashCode = hashCode * 8191 + ((isSetInstanceId()) ? 131071 : 524287);
+ if (isSetInstanceId())
+ hashCode = hashCode * 8191 + instanceId.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -512,7 +479,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetPrincipal()).compareTo(other.isSetPrincipal());
+ lastComparison = java.lang.Boolean.valueOf(isSetPrincipal()).compareTo(other.isSetPrincipal());
if (lastComparison != 0) {
return lastComparison;
}
@@ -522,7 +489,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetKeyId()).compareTo(other.isSetKeyId());
+ lastComparison = java.lang.Boolean.valueOf(isSetKeyId()).compareTo(other.isSetKeyId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -532,7 +499,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetIssueDate()).compareTo(other.isSetIssueDate());
+ lastComparison = java.lang.Boolean.valueOf(isSetIssueDate()).compareTo(other.isSetIssueDate());
if (lastComparison != 0) {
return lastComparison;
}
@@ -542,7 +509,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetExpirationDate()).compareTo(other.isSetExpirationDate());
+ lastComparison = java.lang.Boolean.valueOf(isSetExpirationDate()).compareTo(other.isSetExpirationDate());
if (lastComparison != 0) {
return lastComparison;
}
@@ -552,7 +519,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetInstanceId()).compareTo(other.isSetInstanceId());
+ lastComparison = java.lang.Boolean.valueOf(isSetInstanceId()).compareTo(other.isSetInstanceId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -570,16 +537,16 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
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("TAuthenticationTokenIdentifier(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("TAuthenticationTokenIdentifier(");
boolean first = true;
sb.append("principal:");
@@ -634,7 +601,7 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
}
- 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;
@@ -644,13 +611,13 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
}
- private static class TAuthenticationTokenIdentifierStandardSchemeFactory implements SchemeFactory {
+ private static class TAuthenticationTokenIdentifierStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAuthenticationTokenIdentifierStandardScheme getScheme() {
return new TAuthenticationTokenIdentifierStandardScheme();
}
}
- private static class TAuthenticationTokenIdentifierStandardScheme extends StandardScheme<TAuthenticationTokenIdentifier> {
+ private static class TAuthenticationTokenIdentifierStandardScheme extends org.apache.thrift.scheme.StandardScheme<TAuthenticationTokenIdentifier> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TAuthenticationTokenIdentifier struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -750,18 +717,18 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
- private static class TAuthenticationTokenIdentifierTupleSchemeFactory implements SchemeFactory {
+ private static class TAuthenticationTokenIdentifierTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TAuthenticationTokenIdentifierTupleScheme getScheme() {
return new TAuthenticationTokenIdentifierTupleScheme();
}
}
- private static class TAuthenticationTokenIdentifierTupleScheme extends TupleScheme<TAuthenticationTokenIdentifier> {
+ private static class TAuthenticationTokenIdentifierTupleScheme extends org.apache.thrift.scheme.TupleScheme<TAuthenticationTokenIdentifier> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TAuthenticationTokenIdentifier 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.isSetPrincipal()) {
optionals.set(0);
}
@@ -797,8 +764,8 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TAuthenticationTokenIdentifier 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.principal = iprot.readString();
struct.setPrincipalIsSet(true);
@@ -822,5 +789,9 @@ public class TAuthenticationTokenIdentifier implements org.apache.thrift.TBase<T
}
}
+ 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/security/thrift/TCredentials.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/security/thrift/TCredentials.java b/core/src/main/java/org/apache/accumulo/core/security/thrift/TCredentials.java
index f9beda9..fd7a5e1 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/thrift/TCredentials.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/thrift/TCredentials.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.core.security.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 TCredentials implements org.apache.thrift.TBase<TCredentials, TCredentials._Fields>, java.io.Serializable, Cloneable, Comparable<TCredentials> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCredentials");
@@ -59,16 +32,13 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final org.apache.thrift.protocol.TField INSTANCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("instanceId", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TCredentialsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TCredentialsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCredentialsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCredentialsTupleSchemeFactory();
- public String principal; // required
- public String tokenClassName; // required
- public ByteBuffer token; // required
- public String instanceId; // required
+ public java.lang.String principal; // required
+ public java.lang.String tokenClassName; // required
+ public java.nio.ByteBuffer token; // required
+ public java.lang.String instanceId; // 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 {
@@ -77,10 +47,10 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
TOKEN((short)3, "token"),
INSTANCE_ID((short)4, "instanceId");
- 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);
}
}
@@ -109,21 +79,21 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
*/
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;
}
@@ -132,15 +102,15 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
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.PRINCIPAL, new org.apache.thrift.meta_data.FieldMetaData("principal", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TOKEN_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("tokenClassName", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -149,7 +119,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.INSTANCE_ID, new org.apache.thrift.meta_data.FieldMetaData("instanceId", 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(TCredentials.class, metaDataMap);
}
@@ -157,10 +127,10 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
public TCredentials(
- String principal,
- String tokenClassName,
- ByteBuffer token,
- String instanceId)
+ java.lang.String principal,
+ java.lang.String tokenClassName,
+ java.nio.ByteBuffer token,
+ java.lang.String instanceId)
{
this();
this.principal = principal;
@@ -199,11 +169,11 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
this.instanceId = null;
}
- public String getPrincipal() {
+ public java.lang.String getPrincipal() {
return this.principal;
}
- public TCredentials setPrincipal(String principal) {
+ public TCredentials setPrincipal(java.lang.String principal) {
this.principal = principal;
return this;
}
@@ -223,11 +193,11 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
- public String getTokenClassName() {
+ public java.lang.String getTokenClassName() {
return this.tokenClassName;
}
- public TCredentials setTokenClassName(String tokenClassName) {
+ public TCredentials setTokenClassName(java.lang.String tokenClassName) {
this.tokenClassName = tokenClassName;
return this;
}
@@ -252,16 +222,16 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
return token == null ? null : token.array();
}
- public ByteBuffer bufferForToken() {
+ public java.nio.ByteBuffer bufferForToken() {
return org.apache.thrift.TBaseHelper.copyBinary(token);
}
public TCredentials setToken(byte[] token) {
- this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
+ this.token = token == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(token.clone());
return this;
}
- public TCredentials setToken(ByteBuffer token) {
+ public TCredentials setToken(java.nio.ByteBuffer token) {
this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
return this;
}
@@ -281,11 +251,11 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
- public String getInstanceId() {
+ public java.lang.String getInstanceId() {
return this.instanceId;
}
- public TCredentials setInstanceId(String instanceId) {
+ public TCredentials setInstanceId(java.lang.String instanceId) {
this.instanceId = instanceId;
return this;
}
@@ -305,13 +275,13 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case PRINCIPAL:
if (value == null) {
unsetPrincipal();
} else {
- setPrincipal((String)value);
+ setPrincipal((java.lang.String)value);
}
break;
@@ -319,7 +289,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
if (value == null) {
unsetTokenClassName();
} else {
- setTokenClassName((String)value);
+ setTokenClassName((java.lang.String)value);
}
break;
@@ -327,7 +297,11 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
if (value == null) {
unsetToken();
} else {
- setToken((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setToken((byte[])value);
+ } else {
+ setToken((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -335,14 +309,14 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
if (value == null) {
unsetInstanceId();
} else {
- setInstanceId((String)value);
+ setInstanceId((java.lang.String)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case PRINCIPAL:
return getPrincipal();
@@ -357,13 +331,13 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
return getInstanceId();
}
- 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) {
@@ -376,11 +350,11 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
case INSTANCE_ID:
return isSetInstanceId();
}
- 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 TCredentials)
@@ -391,6 +365,8 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
public boolean equals(TCredentials that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_principal = true && this.isSetPrincipal();
boolean that_present_principal = true && that.isSetPrincipal();
@@ -433,29 +409,25 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_principal = true && (isSetPrincipal());
- list.add(present_principal);
- if (present_principal)
- list.add(principal);
+ hashCode = hashCode * 8191 + ((isSetPrincipal()) ? 131071 : 524287);
+ if (isSetPrincipal())
+ hashCode = hashCode * 8191 + principal.hashCode();
- boolean present_tokenClassName = true && (isSetTokenClassName());
- list.add(present_tokenClassName);
- if (present_tokenClassName)
- list.add(tokenClassName);
+ hashCode = hashCode * 8191 + ((isSetTokenClassName()) ? 131071 : 524287);
+ if (isSetTokenClassName())
+ hashCode = hashCode * 8191 + tokenClassName.hashCode();
- boolean present_token = true && (isSetToken());
- list.add(present_token);
- if (present_token)
- list.add(token);
+ hashCode = hashCode * 8191 + ((isSetToken()) ? 131071 : 524287);
+ if (isSetToken())
+ hashCode = hashCode * 8191 + token.hashCode();
- boolean present_instanceId = true && (isSetInstanceId());
- list.add(present_instanceId);
- if (present_instanceId)
- list.add(instanceId);
+ hashCode = hashCode * 8191 + ((isSetInstanceId()) ? 131071 : 524287);
+ if (isSetInstanceId())
+ hashCode = hashCode * 8191 + instanceId.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -466,7 +438,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetPrincipal()).compareTo(other.isSetPrincipal());
+ lastComparison = java.lang.Boolean.valueOf(isSetPrincipal()).compareTo(other.isSetPrincipal());
if (lastComparison != 0) {
return lastComparison;
}
@@ -476,7 +448,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetTokenClassName()).compareTo(other.isSetTokenClassName());
+ lastComparison = java.lang.Boolean.valueOf(isSetTokenClassName()).compareTo(other.isSetTokenClassName());
if (lastComparison != 0) {
return lastComparison;
}
@@ -486,7 +458,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
+ lastComparison = java.lang.Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
if (lastComparison != 0) {
return lastComparison;
}
@@ -496,7 +468,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetInstanceId()).compareTo(other.isSetInstanceId());
+ lastComparison = java.lang.Boolean.valueOf(isSetInstanceId()).compareTo(other.isSetInstanceId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -514,16 +486,16 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
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("TCredentials(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("TCredentials(");
boolean first = true;
sb.append("principal:");
@@ -574,7 +546,7 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
- 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) {
@@ -582,13 +554,13 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
- private static class TCredentialsStandardSchemeFactory implements SchemeFactory {
+ private static class TCredentialsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TCredentialsStandardScheme getScheme() {
return new TCredentialsStandardScheme();
}
}
- private static class TCredentialsStandardScheme extends StandardScheme<TCredentials> {
+ private static class TCredentialsStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCredentials> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TCredentials struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -673,18 +645,18 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
- private static class TCredentialsTupleSchemeFactory implements SchemeFactory {
+ private static class TCredentialsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TCredentialsTupleScheme getScheme() {
return new TCredentialsTupleScheme();
}
}
- private static class TCredentialsTupleScheme extends TupleScheme<TCredentials> {
+ private static class TCredentialsTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCredentials> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TCredentials 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.isSetPrincipal()) {
optionals.set(0);
}
@@ -714,8 +686,8 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TCredentials struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.principal = iprot.readString();
struct.setPrincipalIsSet(true);
@@ -735,5 +707,9 @@ public class TCredentials implements org.apache.thrift.TBase<TCredentials, TCred
}
}
+ 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() {}
}