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:35 UTC
[07/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/TableNotFoundException.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableNotFoundException.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableNotFoundException.java
index d889faf..1bc9529 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableNotFoundException.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TableNotFoundException.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 TableNotFoundException extends TException implements org.apache.thrift.TBase<TableNotFoundException, TableNotFoundException._Fields>, java.io.Serializable, Cloneable, Comparable<TableNotFoundException> {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
+public class TableNotFoundException extends org.apache.thrift.TException implements org.apache.thrift.TBase<TableNotFoundException, TableNotFoundException._Fields>, java.io.Serializable, Cloneable, Comparable<TableNotFoundException> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableNotFoundException");
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 TableNotFoundExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TableNotFoundExceptionTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TableNotFoundExceptionStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TableNotFoundExceptionTupleSchemeFactory();
- 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 TableNotFoundException extends TException implements org.apache.thr
*/
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 TableNotFoundException extends TException implements org.apache.thr
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(TableNotFoundException.class, metaDataMap);
}
@@ -136,7 +106,7 @@ public class TableNotFoundException extends TException implements org.apache.thr
}
public TableNotFoundException(
- String msg)
+ java.lang.String msg)
{
this();
this.msg = msg;
@@ -160,11 +130,11 @@ public class TableNotFoundException extends TException implements org.apache.thr
this.msg = null;
}
- public String getMsg() {
+ public java.lang.String getMsg() {
return this.msg;
}
- public TableNotFoundException setMsg(String msg) {
+ public TableNotFoundException setMsg(java.lang.String msg) {
this.msg = msg;
return this;
}
@@ -184,43 +154,43 @@ public class TableNotFoundException extends TException implements org.apache.thr
}
}
- 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 TableNotFoundException)
@@ -231,6 +201,8 @@ public class TableNotFoundException extends TException implements org.apache.thr
public boolean equals(TableNotFoundException 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 TableNotFoundException extends TException implements org.apache.thr
@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 TableNotFoundException extends TException implements org.apache.thr
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 TableNotFoundException extends TException implements org.apache.thr
}
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("TableNotFoundException(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("TableNotFoundException(");
boolean first = true;
sb.append("msg:");
@@ -318,7 +289,7 @@ public class TableNotFoundException extends TException implements org.apache.thr
}
}
- 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 TableNotFoundException extends TException implements org.apache.thr
}
}
- private static class TableNotFoundExceptionStandardSchemeFactory implements SchemeFactory {
+ private static class TableNotFoundExceptionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TableNotFoundExceptionStandardScheme getScheme() {
return new TableNotFoundExceptionStandardScheme();
}
}
- private static class TableNotFoundExceptionStandardScheme extends StandardScheme<TableNotFoundException> {
+ private static class TableNotFoundExceptionStandardScheme extends org.apache.thrift.scheme.StandardScheme<TableNotFoundException> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TableNotFoundException struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -378,18 +349,18 @@ public class TableNotFoundException extends TException implements org.apache.thr
}
- private static class TableNotFoundExceptionTupleSchemeFactory implements SchemeFactory {
+ private static class TableNotFoundExceptionTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public TableNotFoundExceptionTupleScheme getScheme() {
return new TableNotFoundExceptionTupleScheme();
}
}
- private static class TableNotFoundExceptionTupleScheme extends TupleScheme<TableNotFoundException> {
+ private static class TableNotFoundExceptionTupleScheme extends org.apache.thrift.scheme.TupleScheme<TableNotFoundException> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TableNotFoundException 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 TableNotFoundException extends TException implements org.apache.thr
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TableNotFoundException 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 TableNotFoundException extends TException implements org.apache.thr
}
}
+ 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/TablePermission.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TablePermission.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TablePermission.java
index 1beac63..c969452 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TablePermission.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TablePermission.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -23,11 +23,8 @@
package org.apache.accumulo.proxy.thrift;
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-@SuppressWarnings({"unused"}) public enum TablePermission implements org.apache.thrift.TEnum {
+public enum TablePermission implements org.apache.thrift.TEnum {
READ(2),
WRITE(3),
BULK_IMPORT(4),
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TimeType.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TimeType.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TimeType.java
index 26565a2..26ebb62 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TimeType.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/TimeType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/**
- * Autogenerated by Thrift Compiler (0.9.3)
+ * Autogenerated by Thrift Compiler (0.10.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
@@ -23,11 +23,8 @@
package org.apache.accumulo.proxy.thrift;
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-@SuppressWarnings({"unused"}) public enum TimeType implements org.apache.thrift.TEnum {
+public enum TimeType implements org.apache.thrift.TEnum {
LOGICAL(0),
MILLIS(1);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/62bbce43/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownScanner.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownScanner.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownScanner.java
index 3630f94..82ea224 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownScanner.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownScanner.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 UnknownScanner extends TException implements org.apache.thrift.TBase<UnknownScanner, UnknownScanner._Fields>, java.io.Serializable, Cloneable, Comparable<UnknownScanner> {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
+public class UnknownScanner extends org.apache.thrift.TException implements org.apache.thrift.TBase<UnknownScanner, UnknownScanner._Fields>, java.io.Serializable, Cloneable, Comparable<UnknownScanner> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnknownScanner");
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 UnknownScannerStandardSchemeFactory());
- schemes.put(TupleScheme.class, new UnknownScannerTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownScannerStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownScannerTupleSchemeFactory();
- 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 UnknownScanner extends TException implements org.apache.thrift.TBas
*/
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 UnknownScanner extends TException implements org.apache.thrift.TBas
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(UnknownScanner.class, metaDataMap);
}
@@ -136,7 +106,7 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
}
public UnknownScanner(
- String msg)
+ java.lang.String msg)
{
this();
this.msg = msg;
@@ -160,11 +130,11 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
this.msg = null;
}
- public String getMsg() {
+ public java.lang.String getMsg() {
return this.msg;
}
- public UnknownScanner setMsg(String msg) {
+ public UnknownScanner setMsg(java.lang.String msg) {
this.msg = msg;
return this;
}
@@ -184,43 +154,43 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
}
}
- 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 UnknownScanner)
@@ -231,6 +201,8 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
public boolean equals(UnknownScanner 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 UnknownScanner extends TException implements org.apache.thrift.TBas
@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 UnknownScanner extends TException implements org.apache.thrift.TBas
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 UnknownScanner extends TException implements org.apache.thrift.TBas
}
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("UnknownScanner(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("UnknownScanner(");
boolean first = true;
sb.append("msg:");
@@ -318,7 +289,7 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
}
}
- 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 UnknownScanner extends TException implements org.apache.thrift.TBas
}
}
- private static class UnknownScannerStandardSchemeFactory implements SchemeFactory {
+ private static class UnknownScannerStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnknownScannerStandardScheme getScheme() {
return new UnknownScannerStandardScheme();
}
}
- private static class UnknownScannerStandardScheme extends StandardScheme<UnknownScanner> {
+ private static class UnknownScannerStandardScheme extends org.apache.thrift.scheme.StandardScheme<UnknownScanner> {
public void read(org.apache.thrift.protocol.TProtocol iprot, UnknownScanner struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -378,18 +349,18 @@ public class UnknownScanner extends TException implements org.apache.thrift.TBas
}
- private static class UnknownScannerTupleSchemeFactory implements SchemeFactory {
+ private static class UnknownScannerTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnknownScannerTupleScheme getScheme() {
return new UnknownScannerTupleScheme();
}
}
- private static class UnknownScannerTupleScheme extends TupleScheme<UnknownScanner> {
+ private static class UnknownScannerTupleScheme extends org.apache.thrift.scheme.TupleScheme<UnknownScanner> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UnknownScanner 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 UnknownScanner extends TException implements org.apache.thrift.TBas
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UnknownScanner 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 UnknownScanner extends TException implements org.apache.thrift.TBas
}
}
+ 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/UnknownWriter.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java
index cd82742..8a7969c 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/UnknownWriter.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 UnknownWriter extends TException implements org.apache.thrift.TBase<UnknownWriter, UnknownWriter._Fields>, java.io.Serializable, Cloneable, Comparable<UnknownWriter> {
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
+public class UnknownWriter extends org.apache.thrift.TException implements org.apache.thrift.TBase<UnknownWriter, UnknownWriter._Fields>, java.io.Serializable, Cloneable, Comparable<UnknownWriter> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnknownWriter");
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 UnknownWriterStandardSchemeFactory());
- schemes.put(TupleScheme.class, new UnknownWriterTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UnknownWriterStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UnknownWriterTupleSchemeFactory();
- 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 UnknownWriter extends TException implements org.apache.thrift.TBase
*/
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 UnknownWriter extends TException implements org.apache.thrift.TBase
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(UnknownWriter.class, metaDataMap);
}
@@ -136,7 +106,7 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
}
public UnknownWriter(
- String msg)
+ java.lang.String msg)
{
this();
this.msg = msg;
@@ -160,11 +130,11 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
this.msg = null;
}
- public String getMsg() {
+ public java.lang.String getMsg() {
return this.msg;
}
- public UnknownWriter setMsg(String msg) {
+ public UnknownWriter setMsg(java.lang.String msg) {
this.msg = msg;
return this;
}
@@ -184,43 +154,43 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
}
}
- 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 UnknownWriter)
@@ -231,6 +201,8 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
public boolean equals(UnknownWriter 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 UnknownWriter extends TException implements org.apache.thrift.TBase
@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 UnknownWriter extends TException implements org.apache.thrift.TBase
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 UnknownWriter extends TException implements org.apache.thrift.TBase
}
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("UnknownWriter(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("UnknownWriter(");
boolean first = true;
sb.append("msg:");
@@ -318,7 +289,7 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
}
}
- 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 UnknownWriter extends TException implements org.apache.thrift.TBase
}
}
- private static class UnknownWriterStandardSchemeFactory implements SchemeFactory {
+ private static class UnknownWriterStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnknownWriterStandardScheme getScheme() {
return new UnknownWriterStandardScheme();
}
}
- private static class UnknownWriterStandardScheme extends StandardScheme<UnknownWriter> {
+ private static class UnknownWriterStandardScheme extends org.apache.thrift.scheme.StandardScheme<UnknownWriter> {
public void read(org.apache.thrift.protocol.TProtocol iprot, UnknownWriter struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -378,18 +349,18 @@ public class UnknownWriter extends TException implements org.apache.thrift.TBase
}
- private static class UnknownWriterTupleSchemeFactory implements SchemeFactory {
+ private static class UnknownWriterTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public UnknownWriterTupleScheme getScheme() {
return new UnknownWriterTupleScheme();
}
}
- private static class UnknownWriterTupleScheme extends TupleScheme<UnknownWriter> {
+ private static class UnknownWriterTupleScheme extends org.apache.thrift.scheme.TupleScheme<UnknownWriter> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, UnknownWriter 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 UnknownWriter extends TException implements org.apache.thrift.TBase
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, UnknownWriter 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 UnknownWriter extends TException implements org.apache.thrift.TBase
}
}
+ 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/WriterOptions.java
----------------------------------------------------------------------
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/WriterOptions.java b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/WriterOptions.java
index 02d4548..25b48a8 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/thrift/WriterOptions.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/thrift/WriterOptions.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 WriterOptions implements org.apache.thrift.TBase<WriterOptions, WriterOptions._Fields>, java.io.Serializable, Cloneable, Comparable<WriterOptions> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WriterOptions");
@@ -60,11 +33,8 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
private static final org.apache.thrift.protocol.TField THREADS_FIELD_DESC = new org.apache.thrift.protocol.TField("threads", org.apache.thrift.protocol.TType.I32, (short)4);
private static final org.apache.thrift.protocol.TField DURABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("durability", org.apache.thrift.protocol.TType.I32, (short)5);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new WriterOptionsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new WriterOptionsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new WriterOptionsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new WriterOptionsTupleSchemeFactory();
public long maxMemory; // required
public long latencyMs; // required
@@ -88,10 +58,10 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
*/
DURABILITY((short)5, "durability");
- 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);
}
}
@@ -122,21 +92,21 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
*/
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;
}
@@ -145,7 +115,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -157,9 +127,9 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
private static final int __THREADS_ISSET_ID = 3;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.DURABILITY};
- 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.MAX_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("maxMemory", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("latencyMs", org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -170,7 +140,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.DURABILITY, new org.apache.thrift.meta_data.FieldMetaData("durability", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Durability.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WriterOptions.class, metaDataMap);
}
@@ -236,16 +206,16 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
public void unsetMaxMemory() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXMEMORY_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXMEMORY_ISSET_ID);
}
/** Returns true if field maxMemory is set (has been assigned a value) and false otherwise */
public boolean isSetMaxMemory() {
- return EncodingUtils.testBit(__isset_bitfield, __MAXMEMORY_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXMEMORY_ISSET_ID);
}
public void setMaxMemoryIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXMEMORY_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXMEMORY_ISSET_ID, value);
}
public long getLatencyMs() {
@@ -259,16 +229,16 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
public void unsetLatencyMs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LATENCYMS_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LATENCYMS_ISSET_ID);
}
/** Returns true if field latencyMs is set (has been assigned a value) and false otherwise */
public boolean isSetLatencyMs() {
- return EncodingUtils.testBit(__isset_bitfield, __LATENCYMS_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LATENCYMS_ISSET_ID);
}
public void setLatencyMsIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LATENCYMS_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LATENCYMS_ISSET_ID, value);
}
public long getTimeoutMs() {
@@ -282,16 +252,16 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
public void unsetTimeoutMs() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID);
}
/** Returns true if field timeoutMs is set (has been assigned a value) and false otherwise */
public boolean isSetTimeoutMs() {
- return EncodingUtils.testBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID);
}
public void setTimeoutMsIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMEOUTMS_ISSET_ID, value);
}
public int getThreads() {
@@ -305,16 +275,16 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
public void unsetThreads() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __THREADS_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __THREADS_ISSET_ID);
}
/** Returns true if field threads is set (has been assigned a value) and false otherwise */
public boolean isSetThreads() {
- return EncodingUtils.testBit(__isset_bitfield, __THREADS_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __THREADS_ISSET_ID);
}
public void setThreadsIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __THREADS_ISSET_ID, value);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __THREADS_ISSET_ID, value);
}
/**
@@ -349,13 +319,13 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case MAX_MEMORY:
if (value == null) {
unsetMaxMemory();
} else {
- setMaxMemory((Long)value);
+ setMaxMemory((java.lang.Long)value);
}
break;
@@ -363,7 +333,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
if (value == null) {
unsetLatencyMs();
} else {
- setLatencyMs((Long)value);
+ setLatencyMs((java.lang.Long)value);
}
break;
@@ -371,7 +341,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
if (value == null) {
unsetTimeoutMs();
} else {
- setTimeoutMs((Long)value);
+ setTimeoutMs((java.lang.Long)value);
}
break;
@@ -379,7 +349,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
if (value == null) {
unsetThreads();
} else {
- setThreads((Integer)value);
+ setThreads((java.lang.Integer)value);
}
break;
@@ -394,7 +364,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case MAX_MEMORY:
return getMaxMemory();
@@ -412,13 +382,13 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return getDurability();
}
- 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) {
@@ -433,11 +403,11 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
case DURABILITY:
return isSetDurability();
}
- 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 WriterOptions)
@@ -448,6 +418,8 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
public boolean equals(WriterOptions that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_maxMemory = true;
boolean that_present_maxMemory = true;
@@ -499,34 +471,21 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
@Override
public int hashCode() {
- List<Object> list = new ArrayList<Object>();
+ int hashCode = 1;
- boolean present_maxMemory = true;
- list.add(present_maxMemory);
- if (present_maxMemory)
- list.add(maxMemory);
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxMemory);
- boolean present_latencyMs = true;
- list.add(present_latencyMs);
- if (present_latencyMs)
- list.add(latencyMs);
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(latencyMs);
- boolean present_timeoutMs = true;
- list.add(present_timeoutMs);
- if (present_timeoutMs)
- list.add(timeoutMs);
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timeoutMs);
- boolean present_threads = true;
- list.add(present_threads);
- if (present_threads)
- list.add(threads);
+ hashCode = hashCode * 8191 + threads;
- boolean present_durability = true && (isSetDurability());
- list.add(present_durability);
- if (present_durability)
- list.add(durability.getValue());
+ hashCode = hashCode * 8191 + ((isSetDurability()) ? 131071 : 524287);
+ if (isSetDurability())
+ hashCode = hashCode * 8191 + durability.getValue();
- return list.hashCode();
+ return hashCode;
}
@Override
@@ -537,7 +496,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetMaxMemory()).compareTo(other.isSetMaxMemory());
+ lastComparison = java.lang.Boolean.valueOf(isSetMaxMemory()).compareTo(other.isSetMaxMemory());
if (lastComparison != 0) {
return lastComparison;
}
@@ -547,7 +506,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetLatencyMs()).compareTo(other.isSetLatencyMs());
+ lastComparison = java.lang.Boolean.valueOf(isSetLatencyMs()).compareTo(other.isSetLatencyMs());
if (lastComparison != 0) {
return lastComparison;
}
@@ -557,7 +516,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetTimeoutMs()).compareTo(other.isSetTimeoutMs());
+ lastComparison = java.lang.Boolean.valueOf(isSetTimeoutMs()).compareTo(other.isSetTimeoutMs());
if (lastComparison != 0) {
return lastComparison;
}
@@ -567,7 +526,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetThreads()).compareTo(other.isSetThreads());
+ lastComparison = java.lang.Boolean.valueOf(isSetThreads()).compareTo(other.isSetThreads());
if (lastComparison != 0) {
return lastComparison;
}
@@ -577,7 +536,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetDurability()).compareTo(other.isSetDurability());
+ lastComparison = java.lang.Boolean.valueOf(isSetDurability()).compareTo(other.isSetDurability());
if (lastComparison != 0) {
return lastComparison;
}
@@ -595,16 +554,16 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
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("WriterOptions(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("WriterOptions(");
boolean first = true;
sb.append("maxMemory:");
@@ -649,7 +608,7 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
}
- 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;
@@ -659,13 +618,13 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
}
- private static class WriterOptionsStandardSchemeFactory implements SchemeFactory {
+ private static class WriterOptionsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public WriterOptionsStandardScheme getScheme() {
return new WriterOptionsStandardScheme();
}
}
- private static class WriterOptionsStandardScheme extends StandardScheme<WriterOptions> {
+ private static class WriterOptionsStandardScheme extends org.apache.thrift.scheme.StandardScheme<WriterOptions> {
public void read(org.apache.thrift.protocol.TProtocol iprot, WriterOptions struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -757,18 +716,18 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
- private static class WriterOptionsTupleSchemeFactory implements SchemeFactory {
+ private static class WriterOptionsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public WriterOptionsTupleScheme getScheme() {
return new WriterOptionsTupleScheme();
}
}
- private static class WriterOptionsTupleScheme extends TupleScheme<WriterOptions> {
+ private static class WriterOptionsTupleScheme extends org.apache.thrift.scheme.TupleScheme<WriterOptions> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, WriterOptions 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.isSetMaxMemory()) {
optionals.set(0);
}
@@ -804,8 +763,8 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, WriterOptions 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.maxMemory = iprot.readI64();
struct.setMaxMemoryIsSet(true);
@@ -829,5 +788,9 @@ public class WriterOptions implements org.apache.thrift.TBase<WriterOptions, Wri
}
}
+ 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() {}
}