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:38 UTC
[10/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/proxy/src/main/java/org/apache/accumulo/proxy/thrift/Key.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/Key.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/Key.java
index 93237c5..d935c9a 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/Key.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/Key.java
@@ -15,42 +15,15 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.accumulo.proxy.thrift;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.Serializable, Cloneable, Comparable<Key> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Key");
@@ -60,16 +33,13 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
private static final org.apache.thrift.protocol.TField COL_VISIBILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("colVisibility", org.apache.thrift.protocol.TType.STRING, (short)4);
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)5);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KeyStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new KeyStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new KeyTupleSchemeFactory();
- public ByteBuffer row; // required
- public ByteBuffer colFamily; // required
- public ByteBuffer colQualifier; // required
- public ByteBuffer colVisibility; // required
+ public java.nio.ByteBuffer row; // required
+ public java.nio.ByteBuffer colFamily; // required
+ public java.nio.ByteBuffer colQualifier; // required
+ public java.nio.ByteBuffer colVisibility; // required
public long timestamp; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -80,10 +50,10 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
COL_VISIBILITY((short)4, "colVisibility"),
TIMESTAMP((short)5, "timestamp");
- 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 Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
*/
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 Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -146,9 +116,9 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
private static final int __TIMESTAMP_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.TIMESTAMP};
- 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.ROW, new org.apache.thrift.meta_data.FieldMetaData("row", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.COL_FAMILY, new org.apache.thrift.meta_data.FieldMetaData("colFamily", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -159,7 +129,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", 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(Key.class, metaDataMap);
}
@@ -169,10 +139,10 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
public Key(
- ByteBuffer row,
- ByteBuffer colFamily,
- ByteBuffer colQualifier,
- ByteBuffer colVisibility)
+ java.nio.ByteBuffer row,
+ java.nio.ByteBuffer colFamily,
+ java.nio.ByteBuffer colQualifier,
+ java.nio.ByteBuffer colVisibility)
{
this();
this.row = org.apache.thrift.TBaseHelper.copyBinary(row);
@@ -220,16 +190,16 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return row == null ? null : row.array();
}
- public ByteBuffer bufferForRow() {
+ public java.nio.ByteBuffer bufferForRow() {
return org.apache.thrift.TBaseHelper.copyBinary(row);
}
public Key setRow(byte[] row) {
- this.row = row == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(row, row.length));
+ this.row = row == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(row.clone());
return this;
}
- public Key setRow(ByteBuffer row) {
+ public Key setRow(java.nio.ByteBuffer row) {
this.row = org.apache.thrift.TBaseHelper.copyBinary(row);
return this;
}
@@ -254,16 +224,16 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return colFamily == null ? null : colFamily.array();
}
- public ByteBuffer bufferForColFamily() {
+ public java.nio.ByteBuffer bufferForColFamily() {
return org.apache.thrift.TBaseHelper.copyBinary(colFamily);
}
public Key setColFamily(byte[] colFamily) {
- this.colFamily = colFamily == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(colFamily, colFamily.length));
+ this.colFamily = colFamily == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(colFamily.clone());
return this;
}
- public Key setColFamily(ByteBuffer colFamily) {
+ public Key setColFamily(java.nio.ByteBuffer colFamily) {
this.colFamily = org.apache.thrift.TBaseHelper.copyBinary(colFamily);
return this;
}
@@ -288,16 +258,16 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return colQualifier == null ? null : colQualifier.array();
}
- public ByteBuffer bufferForColQualifier() {
+ public java.nio.ByteBuffer bufferForColQualifier() {
return org.apache.thrift.TBaseHelper.copyBinary(colQualifier);
}
public Key setColQualifier(byte[] colQualifier) {
- this.colQualifier = colQualifier == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(colQualifier, colQualifier.length));
+ this.colQualifier = colQualifier == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(colQualifier.clone());
return this;
}
- public Key setColQualifier(ByteBuffer colQualifier) {
+ public Key setColQualifier(java.nio.ByteBuffer colQualifier) {
this.colQualifier = org.apache.thrift.TBaseHelper.copyBinary(colQualifier);
return this;
}
@@ -322,16 +292,16 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return colVisibility == null ? null : colVisibility.array();
}
- public ByteBuffer bufferForColVisibility() {
+ public java.nio.ByteBuffer bufferForColVisibility() {
return org.apache.thrift.TBaseHelper.copyBinary(colVisibility);
}
public Key setColVisibility(byte[] colVisibility) {
- this.colVisibility = colVisibility == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(colVisibility, colVisibility.length));
+ this.colVisibility = colVisibility == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(colVisibility.clone());
return this;
}
- public Key setColVisibility(ByteBuffer colVisibility) {
+ public Key setColVisibility(java.nio.ByteBuffer colVisibility) {
this.colVisibility = org.apache.thrift.TBaseHelper.copyBinary(colVisibility);
return this;
}
@@ -362,25 +332,29 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
public void unsetTimestamp() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
}
/** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
public boolean isSetTimestamp() {
- return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID);
}
public void setTimestampIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value);
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case ROW:
if (value == null) {
unsetRow();
} else {
- setRow((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setRow((byte[])value);
+ } else {
+ setRow((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -388,7 +362,11 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
if (value == null) {
unsetColFamily();
} else {
- setColFamily((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setColFamily((byte[])value);
+ } else {
+ setColFamily((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -396,7 +374,11 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
if (value == null) {
unsetColQualifier();
} else {
- setColQualifier((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setColQualifier((byte[])value);
+ } else {
+ setColQualifier((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -404,7 +386,11 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
if (value == null) {
unsetColVisibility();
} else {
- setColVisibility((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setColVisibility((byte[])value);
+ } else {
+ setColVisibility((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -412,14 +398,14 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
if (value == null) {
unsetTimestamp();
} else {
- setTimestamp((Long)value);
+ setTimestamp((java.lang.Long)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ROW:
return getRow();
@@ -437,13 +423,13 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return getTimestamp();
}
- 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) {
@@ -458,11 +444,11 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
case TIMESTAMP:
return isSetTimestamp();
}
- 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 Key)
@@ -473,6 +459,8 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
public boolean equals(Key that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_row = true && this.isSetRow();
boolean that_present_row = true && that.isSetRow();
@@ -524,34 +512,29 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_row = true && (isSetRow());
- list.add(present_row);
- if (present_row)
- list.add(row);
+ hashCode = hashCode * 8191 + ((isSetRow()) ? 131071 : 524287);
+ if (isSetRow())
+ hashCode = hashCode * 8191 + row.hashCode();
- boolean present_colFamily = true && (isSetColFamily());
- list.add(present_colFamily);
- if (present_colFamily)
- list.add(colFamily);
+ hashCode = hashCode * 8191 + ((isSetColFamily()) ? 131071 : 524287);
+ if (isSetColFamily())
+ hashCode = hashCode * 8191 + colFamily.hashCode();
- boolean present_colQualifier = true && (isSetColQualifier());
- list.add(present_colQualifier);
- if (present_colQualifier)
- list.add(colQualifier);
+ hashCode = hashCode * 8191 + ((isSetColQualifier()) ? 131071 : 524287);
+ if (isSetColQualifier())
+ hashCode = hashCode * 8191 + colQualifier.hashCode();
- boolean present_colVisibility = true && (isSetColVisibility());
- list.add(present_colVisibility);
- if (present_colVisibility)
- list.add(colVisibility);
+ hashCode = hashCode * 8191 + ((isSetColVisibility()) ? 131071 : 524287);
+ if (isSetColVisibility())
+ hashCode = hashCode * 8191 + colVisibility.hashCode();
- boolean present_timestamp = true && (isSetTimestamp());
- list.add(present_timestamp);
- if (present_timestamp)
- list.add(timestamp);
+ hashCode = hashCode * 8191 + ((isSetTimestamp()) ? 131071 : 524287);
+ if (isSetTimestamp())
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp);
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -562,7 +545,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetRow()).compareTo(other.isSetRow());
+ lastComparison = java.lang.Boolean.valueOf(isSetRow()).compareTo(other.isSetRow());
if (lastComparison != 0) {
return lastComparison;
}
@@ -572,7 +555,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetColFamily()).compareTo(other.isSetColFamily());
+ lastComparison = java.lang.Boolean.valueOf(isSetColFamily()).compareTo(other.isSetColFamily());
if (lastComparison != 0) {
return lastComparison;
}
@@ -582,7 +565,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetColQualifier()).compareTo(other.isSetColQualifier());
+ lastComparison = java.lang.Boolean.valueOf(isSetColQualifier()).compareTo(other.isSetColQualifier());
if (lastComparison != 0) {
return lastComparison;
}
@@ -592,7 +575,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetColVisibility()).compareTo(other.isSetColVisibility());
+ lastComparison = java.lang.Boolean.valueOf(isSetColVisibility()).compareTo(other.isSetColVisibility());
if (lastComparison != 0) {
return lastComparison;
}
@@ -602,7 +585,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
+ lastComparison = java.lang.Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
if (lastComparison != 0) {
return lastComparison;
}
@@ -620,16 +603,16 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
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("Key(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("Key(");
boolean first = true;
sb.append("row:");
@@ -686,7 +669,7 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
}
- 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;
@@ -696,13 +679,13 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
}
- private static class KeyStandardSchemeFactory implements SchemeFactory {
+ private static class KeyStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyStandardScheme getScheme() {
return new KeyStandardScheme();
}
}
- private static class KeyStandardScheme extends StandardScheme<Key> {
+ private static class KeyStandardScheme extends org.apache.thrift.scheme.StandardScheme<Key> {
public void read(org.apache.thrift.protocol.TProtocol iprot, Key struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -800,18 +783,18 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
- private static class KeyTupleSchemeFactory implements SchemeFactory {
+ private static class KeyTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyTupleScheme getScheme() {
return new KeyTupleScheme();
}
}
- private static class KeyTupleScheme extends TupleScheme<Key> {
+ private static class KeyTupleScheme extends org.apache.thrift.scheme.TupleScheme<Key> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Key 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.isSetRow()) {
optionals.set(0);
}
@@ -847,8 +830,8 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Key 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.row = iprot.readBinary();
struct.setRowIsSet(true);
@@ -872,5 +855,9 @@ public class Key implements org.apache.thrift.TBase<Key, Key._Fields>, java.io.S
}
}
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+ }
+ private static void unusedMethod() {}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyExtent.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyExtent.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyExtent.java
index 09001c6..8df1b9e 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyExtent.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyExtent.java
@@ -15,42 +15,15 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.accumulo.proxy.thrift;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._Fields>, java.io.Serializable, Cloneable, Comparable<KeyExtent> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyExtent");
@@ -58,15 +31,12 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
private static final org.apache.thrift.protocol.TField END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("endRow", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField PREV_END_ROW_FIELD_DESC = new org.apache.thrift.protocol.TField("prevEndRow", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KeyExtentStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyExtentTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new KeyExtentStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new KeyExtentTupleSchemeFactory();
- public String tableId; // required
- public ByteBuffer endRow; // required
- public ByteBuffer prevEndRow; // required
+ public java.lang.String tableId; // required
+ public java.nio.ByteBuffer endRow; // required
+ public java.nio.ByteBuffer prevEndRow; // 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 {
@@ -74,10 +44,10 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
END_ROW((short)2, "endRow"),
PREV_END_ROW((short)3, "prevEndRow");
- 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);
}
}
@@ -104,21 +74,21 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
*/
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;
}
@@ -127,22 +97,22 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
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.END_ROW, new org.apache.thrift.meta_data.FieldMetaData("endRow", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.PREV_END_ROW, new org.apache.thrift.meta_data.FieldMetaData("prevEndRow", org.apache.thrift.TFieldRequirementType.DEFAULT,
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(KeyExtent.class, metaDataMap);
}
@@ -150,9 +120,9 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
public KeyExtent(
- String tableId,
- ByteBuffer endRow,
- ByteBuffer prevEndRow)
+ java.lang.String tableId,
+ java.nio.ByteBuffer endRow,
+ java.nio.ByteBuffer prevEndRow)
{
this();
this.tableId = tableId;
@@ -186,11 +156,11 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
this.prevEndRow = null;
}
- public String getTableId() {
+ public java.lang.String getTableId() {
return this.tableId;
}
- public KeyExtent setTableId(String tableId) {
+ public KeyExtent setTableId(java.lang.String tableId) {
this.tableId = tableId;
return this;
}
@@ -215,16 +185,16 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
return endRow == null ? null : endRow.array();
}
- public ByteBuffer bufferForEndRow() {
+ public java.nio.ByteBuffer bufferForEndRow() {
return org.apache.thrift.TBaseHelper.copyBinary(endRow);
}
public KeyExtent setEndRow(byte[] endRow) {
- this.endRow = endRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(endRow, endRow.length));
+ this.endRow = endRow == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(endRow.clone());
return this;
}
- public KeyExtent setEndRow(ByteBuffer endRow) {
+ public KeyExtent setEndRow(java.nio.ByteBuffer endRow) {
this.endRow = org.apache.thrift.TBaseHelper.copyBinary(endRow);
return this;
}
@@ -249,16 +219,16 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
return prevEndRow == null ? null : prevEndRow.array();
}
- public ByteBuffer bufferForPrevEndRow() {
+ public java.nio.ByteBuffer bufferForPrevEndRow() {
return org.apache.thrift.TBaseHelper.copyBinary(prevEndRow);
}
public KeyExtent setPrevEndRow(byte[] prevEndRow) {
- this.prevEndRow = prevEndRow == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(prevEndRow, prevEndRow.length));
+ this.prevEndRow = prevEndRow == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(prevEndRow.clone());
return this;
}
- public KeyExtent setPrevEndRow(ByteBuffer prevEndRow) {
+ public KeyExtent setPrevEndRow(java.nio.ByteBuffer prevEndRow) {
this.prevEndRow = org.apache.thrift.TBaseHelper.copyBinary(prevEndRow);
return this;
}
@@ -278,13 +248,13 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
}
- 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;
@@ -292,7 +262,11 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
if (value == null) {
unsetEndRow();
} else {
- setEndRow((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setEndRow((byte[])value);
+ } else {
+ setEndRow((java.nio.ByteBuffer)value);
+ }
}
break;
@@ -300,14 +274,18 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
if (value == null) {
unsetPrevEndRow();
} else {
- setPrevEndRow((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setPrevEndRow((byte[])value);
+ } else {
+ setPrevEndRow((java.nio.ByteBuffer)value);
+ }
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case TABLE_ID:
return getTableId();
@@ -319,13 +297,13 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
return getPrevEndRow();
}
- 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) {
@@ -336,11 +314,11 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
case PREV_END_ROW:
return isSetPrevEndRow();
}
- 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 KeyExtent)
@@ -351,6 +329,8 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
public boolean equals(KeyExtent 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();
@@ -384,24 +364,21 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
@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_endRow = true && (isSetEndRow());
- list.add(present_endRow);
- if (present_endRow)
- list.add(endRow);
+ hashCode = hashCode * 8191 + ((isSetEndRow()) ? 131071 : 524287);
+ if (isSetEndRow())
+ hashCode = hashCode * 8191 + endRow.hashCode();
- boolean present_prevEndRow = true && (isSetPrevEndRow());
- list.add(present_prevEndRow);
- if (present_prevEndRow)
- list.add(prevEndRow);
+ hashCode = hashCode * 8191 + ((isSetPrevEndRow()) ? 131071 : 524287);
+ if (isSetPrevEndRow())
+ hashCode = hashCode * 8191 + prevEndRow.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -412,7 +389,7 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId());
+ lastComparison = java.lang.Boolean.valueOf(isSetTableId()).compareTo(other.isSetTableId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -422,7 +399,7 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetEndRow()).compareTo(other.isSetEndRow());
+ lastComparison = java.lang.Boolean.valueOf(isSetEndRow()).compareTo(other.isSetEndRow());
if (lastComparison != 0) {
return lastComparison;
}
@@ -432,7 +409,7 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetPrevEndRow()).compareTo(other.isSetPrevEndRow());
+ lastComparison = java.lang.Boolean.valueOf(isSetPrevEndRow()).compareTo(other.isSetPrevEndRow());
if (lastComparison != 0) {
return lastComparison;
}
@@ -450,16 +427,16 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
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("KeyExtent(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("KeyExtent(");
boolean first = true;
sb.append("tableId:");
@@ -502,7 +479,7 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
}
- 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) {
@@ -510,13 +487,13 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
}
- private static class KeyExtentStandardSchemeFactory implements SchemeFactory {
+ private static class KeyExtentStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyExtentStandardScheme getScheme() {
return new KeyExtentStandardScheme();
}
}
- private static class KeyExtentStandardScheme extends StandardScheme<KeyExtent> {
+ private static class KeyExtentStandardScheme extends org.apache.thrift.scheme.StandardScheme<KeyExtent> {
public void read(org.apache.thrift.protocol.TProtocol iprot, KeyExtent struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -588,18 +565,18 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
- private static class KeyExtentTupleSchemeFactory implements SchemeFactory {
+ private static class KeyExtentTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyExtentTupleScheme getScheme() {
return new KeyExtentTupleScheme();
}
}
- private static class KeyExtentTupleScheme extends TupleScheme<KeyExtent> {
+ private static class KeyExtentTupleScheme extends org.apache.thrift.scheme.TupleScheme<KeyExtent> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, KeyExtent 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);
}
@@ -623,8 +600,8 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, KeyExtent struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.tableId = iprot.readString();
struct.setTableIdIsSet(true);
@@ -640,5 +617,9 @@ public class KeyExtent implements org.apache.thrift.TBase<KeyExtent, KeyExtent._
}
}
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+ }
+ private static void unusedMethod() {}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValue.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValue.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValue.java
index 480236c..0f87c09 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValue.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValue.java
@@ -15,66 +15,36 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.accumulo.proxy.thrift;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fields>, java.io.Serializable, Cloneable, Comparable<KeyValue> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyValue");
private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KeyValueStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyValueTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new KeyValueStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new KeyValueTupleSchemeFactory();
public Key key; // required
- public ByteBuffer value; // required
+ public java.nio.ByteBuffer value; // 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 {
KEY((short)1, "key"),
VALUE((short)2, "value");
- 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 KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._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;
}
@@ -122,20 +92,20 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Key.class)));
tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT,
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(KeyValue.class, metaDataMap);
}
@@ -144,7 +114,7 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
public KeyValue(
Key key,
- ByteBuffer value)
+ java.nio.ByteBuffer value)
{
this();
this.key = key;
@@ -202,16 +172,16 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
return value == null ? null : value.array();
}
- public ByteBuffer bufferForValue() {
+ public java.nio.ByteBuffer bufferForValue() {
return org.apache.thrift.TBaseHelper.copyBinary(value);
}
public KeyValue setValue(byte[] value) {
- this.value = value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(value, value.length));
+ this.value = value == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(value.clone());
return this;
}
- public KeyValue setValue(ByteBuffer value) {
+ public KeyValue setValue(java.nio.ByteBuffer value) {
this.value = org.apache.thrift.TBaseHelper.copyBinary(value);
return this;
}
@@ -231,7 +201,7 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case KEY:
if (value == null) {
@@ -245,14 +215,18 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
if (value == null) {
unsetValue();
} else {
- setValue((ByteBuffer)value);
+ if (value instanceof byte[]) {
+ setValue((byte[])value);
+ } else {
+ setValue((java.nio.ByteBuffer)value);
+ }
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case KEY:
return getKey();
@@ -261,13 +235,13 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
return getValue();
}
- 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) {
@@ -276,11 +250,11 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
case VALUE:
return isSetValue();
}
- 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 KeyValue)
@@ -291,6 +265,8 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
public boolean equals(KeyValue that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_key = true && this.isSetKey();
boolean that_present_key = true && that.isSetKey();
@@ -315,19 +291,17 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_key = true && (isSetKey());
- list.add(present_key);
- if (present_key)
- list.add(key);
+ hashCode = hashCode * 8191 + ((isSetKey()) ? 131071 : 524287);
+ if (isSetKey())
+ hashCode = hashCode * 8191 + key.hashCode();
- boolean present_value = true && (isSetValue());
- list.add(present_value);
- if (present_value)
- list.add(value);
+ hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287);
+ if (isSetValue())
+ hashCode = hashCode * 8191 + value.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -338,7 +312,7 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey());
+ lastComparison = java.lang.Boolean.valueOf(isSetKey()).compareTo(other.isSetKey());
if (lastComparison != 0) {
return lastComparison;
}
@@ -348,7 +322,7 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
+ lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
if (lastComparison != 0) {
return lastComparison;
}
@@ -366,16 +340,16 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._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("KeyValue(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("KeyValue(");
boolean first = true;
sb.append("key:");
@@ -413,7 +387,7 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._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) {
@@ -421,13 +395,13 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
}
}
- private static class KeyValueStandardSchemeFactory implements SchemeFactory {
+ private static class KeyValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyValueStandardScheme getScheme() {
return new KeyValueStandardScheme();
}
}
- private static class KeyValueStandardScheme extends StandardScheme<KeyValue> {
+ private static class KeyValueStandardScheme extends org.apache.thrift.scheme.StandardScheme<KeyValue> {
public void read(org.apache.thrift.protocol.TProtocol iprot, KeyValue struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -487,18 +461,18 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
}
- private static class KeyValueTupleSchemeFactory implements SchemeFactory {
+ private static class KeyValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyValueTupleScheme getScheme() {
return new KeyValueTupleScheme();
}
}
- private static class KeyValueTupleScheme extends TupleScheme<KeyValue> {
+ private static class KeyValueTupleScheme extends org.apache.thrift.scheme.TupleScheme<KeyValue> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, KeyValue 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.isSetKey()) {
optionals.set(0);
}
@@ -516,8 +490,8 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._Fie
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, KeyValue 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.key = new Key();
struct.key.read(iprot);
@@ -530,5 +504,9 @@ public class KeyValue implements org.apache.thrift.TBase<KeyValue, KeyValue._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/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValueAndPeek.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValueAndPeek.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValueAndPeek.java
index 3bb4f13..2d121da 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValueAndPeek.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/KeyValueAndPeek.java
@@ -15,53 +15,23 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.accumulo.proxy.thrift;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek, KeyValueAndPeek._Fields>, java.io.Serializable, Cloneable, Comparable<KeyValueAndPeek> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("KeyValueAndPeek");
private static final org.apache.thrift.protocol.TField KEY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValue", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField HAS_NEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("hasNext", org.apache.thrift.protocol.TType.BOOL, (short)2);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new KeyValueAndPeekStandardSchemeFactory());
- schemes.put(TupleScheme.class, new KeyValueAndPeekTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new KeyValueAndPeekStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new KeyValueAndPeekTupleSchemeFactory();
public KeyValue keyValue; // required
public boolean hasNext; // required
@@ -71,10 +41,10 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
KEY_VALUE((short)1, "keyValue"),
HAS_NEXT((short)2, "hasNext");
- 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 KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
*/
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 KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -130,14 +100,14 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
// isset id assignments
private static final int __HASNEXT_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.KEY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("keyValue", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KeyValue.class)));
tmpMap.put(_Fields.HAS_NEXT, new org.apache.thrift.meta_data.FieldMetaData("hasNext", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(KeyValueAndPeek.class, metaDataMap);
}
@@ -211,19 +181,19 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
public void unsetHasNext() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASNEXT_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASNEXT_ISSET_ID);
}
/** Returns true if field hasNext is set (has been assigned a value) and false otherwise */
public boolean isSetHasNext() {
- return EncodingUtils.testBit(__isset_bitfield, __HASNEXT_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASNEXT_ISSET_ID);
}
public void setHasNextIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASNEXT_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASNEXT_ISSET_ID, value);
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case KEY_VALUE:
if (value == null) {
@@ -237,14 +207,14 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
if (value == null) {
unsetHasNext();
} else {
- setHasNext((Boolean)value);
+ setHasNext((java.lang.Boolean)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case KEY_VALUE:
return getKeyValue();
@@ -253,13 +223,13 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
return isHasNext();
}
- 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) {
@@ -268,11 +238,11 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
case HAS_NEXT:
return isSetHasNext();
}
- 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 KeyValueAndPeek)
@@ -283,6 +253,8 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
public boolean equals(KeyValueAndPeek that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_keyValue = true && this.isSetKeyValue();
boolean that_present_keyValue = true && that.isSetKeyValue();
@@ -307,19 +279,15 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_keyValue = true && (isSetKeyValue());
- list.add(present_keyValue);
- if (present_keyValue)
- list.add(keyValue);
+ hashCode = hashCode * 8191 + ((isSetKeyValue()) ? 131071 : 524287);
+ if (isSetKeyValue())
+ hashCode = hashCode * 8191 + keyValue.hashCode();
- boolean present_hasNext = true;
- list.add(present_hasNext);
- if (present_hasNext)
- list.add(hasNext);
+ hashCode = hashCode * 8191 + ((hasNext) ? 131071 : 524287);
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -330,7 +298,7 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetKeyValue()).compareTo(other.isSetKeyValue());
+ lastComparison = java.lang.Boolean.valueOf(isSetKeyValue()).compareTo(other.isSetKeyValue());
if (lastComparison != 0) {
return lastComparison;
}
@@ -340,7 +308,7 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetHasNext()).compareTo(other.isSetHasNext());
+ lastComparison = java.lang.Boolean.valueOf(isSetHasNext()).compareTo(other.isSetHasNext());
if (lastComparison != 0) {
return lastComparison;
}
@@ -358,16 +326,16 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
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("KeyValueAndPeek(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("KeyValueAndPeek(");
boolean first = true;
sb.append("keyValue:");
@@ -401,7 +369,7 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
}
- 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;
@@ -411,13 +379,13 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
}
- private static class KeyValueAndPeekStandardSchemeFactory implements SchemeFactory {
+ private static class KeyValueAndPeekStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyValueAndPeekStandardScheme getScheme() {
return new KeyValueAndPeekStandardScheme();
}
}
- private static class KeyValueAndPeekStandardScheme extends StandardScheme<KeyValueAndPeek> {
+ private static class KeyValueAndPeekStandardScheme extends org.apache.thrift.scheme.StandardScheme<KeyValueAndPeek> {
public void read(org.apache.thrift.protocol.TProtocol iprot, KeyValueAndPeek struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -475,18 +443,18 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
- private static class KeyValueAndPeekTupleSchemeFactory implements SchemeFactory {
+ private static class KeyValueAndPeekTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public KeyValueAndPeekTupleScheme getScheme() {
return new KeyValueAndPeekTupleScheme();
}
}
- private static class KeyValueAndPeekTupleScheme extends TupleScheme<KeyValueAndPeek> {
+ private static class KeyValueAndPeekTupleScheme extends org.apache.thrift.scheme.TupleScheme<KeyValueAndPeek> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, KeyValueAndPeek 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.isSetKeyValue()) {
optionals.set(0);
}
@@ -504,8 +472,8 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, KeyValueAndPeek 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.keyValue = new KeyValue();
struct.keyValue.read(iprot);
@@ -518,5 +486,9 @@ public class KeyValueAndPeek implements org.apache.thrift.TBase<KeyValueAndPeek,
}
}
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
+ }
+ private static void unusedMethod() {}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/MutationsRejectedException.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/MutationsRejectedException.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/MutationsRejectedException.java
index db5b6c4..c1532ba 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/MutationsRejectedException.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/MutationsRejectedException.java
@@ -15,63 +15,33 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.accumulo.proxy.thrift;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import javax.annotation.Generated;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
-public class MutationsRejectedException extends TException implements org.apache.thrift.TBase<MutationsRejectedException, MutationsRejectedException._Fields>, java.io.Serializable, Cloneable, Comparable<MutationsRejectedException> {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
+public class MutationsRejectedException extends org.apache.thrift.TException implements org.apache.thrift.TBase<MutationsRejectedException, MutationsRejectedException._Fields>, java.io.Serializable, Cloneable, Comparable<MutationsRejectedException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MutationsRejectedException");
private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new MutationsRejectedExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new MutationsRejectedExceptionTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new MutationsRejectedExceptionStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new MutationsRejectedExceptionTupleSchemeFactory();
- public String msg; // required
+ public java.lang.String msg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
MSG((short)1, "msg");
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+ private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@@ -94,21 +64,21 @@ public class MutationsRejectedException extends TException implements org.apache
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
- public static _Fields findByName(String name) {
+ public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
- private final String _fieldName;
+ private final java.lang.String _fieldName;
- _Fields(short thriftId, String fieldName) {
+ _Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
@@ -117,18 +87,18 @@ public class MutationsRejectedException extends TException implements org.apache
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MutationsRejectedException.class, metaDataMap);
}
@@ -136,7 +106,7 @@ public class MutationsRejectedException extends TException implements org.apache
}
public MutationsRejectedException(
- String msg)
+ java.lang.String msg)
{
this();
this.msg = msg;
@@ -160,11 +130,11 @@ public class MutationsRejectedException extends TException implements org.apache
this.msg = null;
}
- public String getMsg() {
+ public java.lang.String getMsg() {
return this.msg;
}
- public MutationsRejectedException setMsg(String msg) {
+ public MutationsRejectedException setMsg(java.lang.String msg) {
this.msg = msg;
return this;
}
@@ -184,43 +154,43 @@ public class MutationsRejectedException extends TException implements org.apache
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case MSG:
if (value == null) {
unsetMsg();
} else {
- setMsg((String)value);
+ setMsg((java.lang.String)value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MSG:
return getMsg();
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
case MSG:
return isSetMsg();
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
@Override
- public boolean equals(Object that) {
+ public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof MutationsRejectedException)
@@ -231,6 +201,8 @@ public class MutationsRejectedException extends TException implements org.apache
public boolean equals(MutationsRejectedException that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_msg = true && this.isSetMsg();
boolean that_present_msg = true && that.isSetMsg();
@@ -246,14 +218,13 @@ public class MutationsRejectedException extends TException implements org.apache
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_msg = true && (isSetMsg());
- list.add(present_msg);
- if (present_msg)
- list.add(msg);
+ hashCode = hashCode * 8191 + ((isSetMsg()) ? 131071 : 524287);
+ if (isSetMsg())
+ hashCode = hashCode * 8191 + msg.hashCode();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -264,7 +235,7 @@ public class MutationsRejectedException extends TException implements org.apache
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg());
+ lastComparison = java.lang.Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg());
if (lastComparison != 0) {
return lastComparison;
}
@@ -282,16 +253,16 @@ public class MutationsRejectedException extends TException implements org.apache
}
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("MutationsRejectedException(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("MutationsRejectedException(");
boolean first = true;
sb.append("msg:");
@@ -318,7 +289,7 @@ public class MutationsRejectedException extends TException implements org.apache
}
}
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
@@ -326,13 +297,13 @@ public class MutationsRejectedException extends TException implements org.apache
}
}
- private static class MutationsRejectedExceptionStandardSchemeFactory implements SchemeFactory {
+ private static class MutationsRejectedExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public MutationsRejectedExceptionStandardScheme getScheme() {
return new MutationsRejectedExceptionStandardScheme();
}
}
- private static class MutationsRejectedExceptionStandardScheme extends StandardScheme<MutationsRejectedException> {
+ private static class MutationsRejectedExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<MutationsRejectedException> {
public void read(org.apache.thrift.protocol.TProtocol iprot, MutationsRejectedException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -378,18 +349,18 @@ public class MutationsRejectedException extends TException implements org.apache
}
- private static class MutationsRejectedExceptionTupleSchemeFactory implements SchemeFactory {
+ private static class MutationsRejectedExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public MutationsRejectedExceptionTupleScheme getScheme() {
return new MutationsRejectedExceptionTupleScheme();
}
}
- private static class MutationsRejectedExceptionTupleScheme extends TupleScheme<MutationsRejectedException> {
+ private static class MutationsRejectedExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<MutationsRejectedException> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MutationsRejectedException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
+ org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetMsg()) {
optionals.set(0);
}
@@ -401,8 +372,8 @@ public class MutationsRejectedException extends TException implements org.apache
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, MutationsRejectedException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
+ org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
+ java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.msg = iprot.readString();
struct.setMsgIsSet(true);
@@ -410,5 +381,9 @@ public class MutationsRejectedException extends TException implements org.apache
}
}
+ 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() {}
}