Update Thrift to 0.11.0 to match Accumulo (#1056)
- Commit Generated Code
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 7406acf..e1201d3 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -72,7 +72,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
- <version>0.9.1</version>
+ <version>0.11.0</version>
<optional>true</optional>
</dependency>
<dependency>
diff --git a/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java b/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
index df1aa62..3ae06af 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/thrift/OracleService.java
@@ -1,37 +1,19 @@
/**
- * Autogenerated by Thrift Compiler (0.9.1)
+ * Autogenerated by Thrift Compiler (0.11.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *
- * @generated
+ * @generated
*/
package org.apache.fluo.core.thrift;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.protocol.TTupleProtocol;
-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.server.AbstractNonblockingServer.AsyncFrameBuffer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings({"rawtypes", "unused", "serial", "unchecked"})
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)",
+ date = "2018-10-30")
public class OracleService {
public interface Iface {
- public Stamps getTimestamps(String id, int num) throws org.apache.thrift.TException;
+ public Stamps getTimestamps(java.lang.String id, int num) throws org.apache.thrift.TException;
public boolean isLeader() throws org.apache.thrift.TException;
@@ -39,11 +21,12 @@
public interface AsyncIface {
- public void getTimestamps(String id, int num,
- org.apache.thrift.async.AsyncMethodCallback resultHandler)
+ public void getTimestamps(java.lang.String id, int num,
+ org.apache.thrift.async.AsyncMethodCallback<Stamps> resultHandler)
throws org.apache.thrift.TException;
- public void isLeader(org.apache.thrift.async.AsyncMethodCallback resultHandler)
+ public void isLeader(
+ org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler)
throws org.apache.thrift.TException;
}
@@ -71,12 +54,13 @@
super(iprot, oprot);
}
- public Stamps getTimestamps(String id, int num) throws org.apache.thrift.TException {
+ public Stamps getTimestamps(java.lang.String id, int num) throws org.apache.thrift.TException {
send_getTimestamps(id, num);
return recv_getTimestamps();
}
- public void send_getTimestamps(String id, int num) throws org.apache.thrift.TException {
+ public void send_getTimestamps(java.lang.String id, int num)
+ throws org.apache.thrift.TException {
getTimestamps_args args = new getTimestamps_args();
args.setId(id);
args.setNum(num);
@@ -141,8 +125,8 @@
super(protocolFactory, clientManager, transport);
}
- public void getTimestamps(String id, int num,
- org.apache.thrift.async.AsyncMethodCallback resultHandler)
+ public void getTimestamps(java.lang.String id, int num,
+ org.apache.thrift.async.AsyncMethodCallback<Stamps> resultHandler)
throws org.apache.thrift.TException {
checkReady();
getTimestamps_call method_call =
@@ -151,12 +135,13 @@
___manager.call(method_call);
}
- public static class getTimestamps_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String id;
+ public static class getTimestamps_call
+ extends org.apache.thrift.async.TAsyncMethodCall<Stamps> {
+ private java.lang.String id;
private int num;
- public getTimestamps_call(String id, int num,
- org.apache.thrift.async.AsyncMethodCallback resultHandler,
+ public getTimestamps_call(java.lang.String id, int num,
+ org.apache.thrift.async.AsyncMethodCallback<Stamps> resultHandler,
org.apache.thrift.async.TAsyncClient client,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.transport.TNonblockingTransport transport)
@@ -179,7 +164,7 @@
public Stamps getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
+ throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport =
new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
@@ -189,7 +174,8 @@
}
}
- public void isLeader(org.apache.thrift.async.AsyncMethodCallback resultHandler)
+ public void isLeader(
+ org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler)
throws org.apache.thrift.TException {
checkReady();
isLeader_call method_call =
@@ -198,8 +184,10 @@
___manager.call(method_call);
}
- public static class isLeader_call extends org.apache.thrift.async.TAsyncMethodCall {
- public isLeader_call(org.apache.thrift.async.AsyncMethodCallback resultHandler,
+ public static class isLeader_call
+ extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
+ public isLeader_call(
+ org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler,
org.apache.thrift.async.TAsyncClient client,
org.apache.thrift.protocol.TProtocolFactory protocolFactory,
org.apache.thrift.transport.TNonblockingTransport transport)
@@ -216,9 +204,9 @@
prot.writeMessageEnd();
}
- public boolean getResult() throws org.apache.thrift.TException {
+ public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
+ throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport =
new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
@@ -232,20 +220,21 @@
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I>
implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+ private static final org.slf4j.Logger _LOGGER =
+ org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(
- new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+ new java.util.HashMap<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface,
- Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
- private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(
- Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ private static <I extends Iface> java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(
+ java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("getTimestamps", new getTimestamps());
processMap.put("isLeader", new isLeader());
return processMap;
@@ -265,6 +254,11 @@
return false;
}
+ @Override
+ protected boolean handleRuntimeExceptions() {
+ return false;
+ }
+
public getTimestamps_result getResult(I iface, getTimestamps_args args)
throws org.apache.thrift.TException {
getTimestamps_result result = new getTimestamps_result();
@@ -287,6 +281,11 @@
return false;
}
+ @Override
+ protected boolean handleRuntimeExceptions() {
+ return false;
+ }
+
public isLeader_result getResult(I iface, isLeader_args args)
throws org.apache.thrift.TException {
isLeader_result result = new isLeader_result();
@@ -300,20 +299,21 @@
public static class AsyncProcessor<I extends AsyncIface>
extends org.apache.thrift.TBaseAsyncProcessor<I> {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+ private static final org.slf4j.Logger _LOGGER =
+ org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(
- new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+ new java.util.HashMap<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface,
- Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
- private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> getProcessMap(
- Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ private static <I extends AsyncIface> java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> getProcessMap(
+ java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("getTimestamps", new getTimestamps());
processMap.put("isLeader", new isLeader());
return processMap;
@@ -329,38 +329,49 @@
return new getTimestamps_args();
}
- public AsyncMethodCallback<Stamps> getResultHandler(final AsyncFrameBuffer fb,
+ public org.apache.thrift.async.AsyncMethodCallback<Stamps> getResultHandler(
+ final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb,
final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Stamps>() {
+ return new org.apache.thrift.async.AsyncMethodCallback<Stamps>() {
public void onComplete(Stamps o) {
getTimestamps_result result = new getTimestamps_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
+ } catch (org.apache.thrift.transport.TTransportException e) {
+ _LOGGER.error("TTransportException writing to internal frame buffer", e);
+ fb.close();
+ } catch (java.lang.Exception e) {
+ _LOGGER.error("Exception writing to internal frame buffer", e);
+ onError(e);
}
- fb.close();
}
- public void onError(Exception e) {
+ public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
+ org.apache.thrift.TSerializable msg;
getTimestamps_result result = new getTimestamps_result();
- {
+ if (e instanceof org.apache.thrift.transport.TTransportException) {
+ _LOGGER.error("TTransportException inside handler", e);
+ fb.close();
+ return;
+ } else if (e instanceof org.apache.thrift.TApplicationException) {
+ _LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase) new org.apache.thrift.TApplicationException(
+ msg = (org.apache.thrift.TApplicationException) e;
+ } else {
+ _LOGGER.error("Exception inside handler", e);
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = new org.apache.thrift.TApplicationException(
org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb, msg, msgType, seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
+ } catch (java.lang.Exception ex) {
+ _LOGGER.error("Exception writing to internal frame buffer", ex);
+ fb.close();
}
- fb.close();
}
};
}
@@ -370,13 +381,14 @@
}
public void start(I iface, getTimestamps_args args,
- org.apache.thrift.async.AsyncMethodCallback<Stamps> resultHandler) throws TException {
+ org.apache.thrift.async.AsyncMethodCallback<Stamps> resultHandler)
+ throws org.apache.thrift.TException {
iface.getTimestamps(args.id, args.num, resultHandler);
}
}
public static class isLeader<I extends AsyncIface>
- extends org.apache.thrift.AsyncProcessFunction<I, isLeader_args, Boolean> {
+ extends org.apache.thrift.AsyncProcessFunction<I, isLeader_args, java.lang.Boolean> {
public isLeader() {
super("isLeader");
}
@@ -385,39 +397,50 @@
return new isLeader_args();
}
- public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb,
+ public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(
+ final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb,
final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback<Boolean>() {
- public void onComplete(Boolean o) {
+ return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
+ public void onComplete(java.lang.Boolean o) {
isLeader_result result = new isLeader_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY, seqid);
- return;
- } catch (Exception e) {
- LOGGER.error("Exception writing to internal frame buffer", e);
+ } catch (org.apache.thrift.transport.TTransportException e) {
+ _LOGGER.error("TTransportException writing to internal frame buffer", e);
+ fb.close();
+ } catch (java.lang.Exception e) {
+ _LOGGER.error("Exception writing to internal frame buffer", e);
+ onError(e);
}
- fb.close();
}
- public void onError(Exception e) {
+ public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
- org.apache.thrift.TBase msg;
+ org.apache.thrift.TSerializable msg;
isLeader_result result = new isLeader_result();
- {
+ if (e instanceof org.apache.thrift.transport.TTransportException) {
+ _LOGGER.error("TTransportException inside handler", e);
+ fb.close();
+ return;
+ } else if (e instanceof org.apache.thrift.TApplicationException) {
+ _LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase) new org.apache.thrift.TApplicationException(
+ msg = (org.apache.thrift.TApplicationException) e;
+ } else {
+ _LOGGER.error("Exception inside handler", e);
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = new org.apache.thrift.TApplicationException(
org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb, msg, msgType, seqid);
- return;
- } catch (Exception ex) {
- LOGGER.error("Exception writing to internal frame buffer", ex);
+ } catch (java.lang.Exception ex) {
+ _LOGGER.error("Exception writing to internal frame buffer", ex);
+ fb.close();
}
- fb.close();
}
};
}
@@ -427,7 +450,8 @@
}
public void start(I iface, isLeader_args args,
- org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler)
+ throws org.apache.thrift.TException {
iface.isLeader(resultHandler);
}
}
@@ -447,14 +471,12 @@
new org.apache.thrift.protocol.TField("num", org.apache.thrift.protocol.TType.I32,
(short) 2);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
- new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getTimestamps_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getTimestamps_argsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
+ new getTimestamps_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
+ new getTimestamps_argsTupleSchemeFactory();
- public String id; // required
+ public java.lang.String id; // required
public int num; // required
/**
@@ -464,10 +486,11 @@
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ID((short) 1, "id"), NUM((short) 2, "num");
- 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);
}
}
@@ -492,21 +515,21 @@
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
- throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ 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;
}
@@ -515,7 +538,7 @@
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -523,10 +546,10 @@
// isset id assignments
private static final int __NUM_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.ID,
new org.apache.thrift.meta_data.FieldMetaData("id",
org.apache.thrift.TFieldRequirementType.DEFAULT,
@@ -537,14 +560,14 @@
org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.I32)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTimestamps_args.class,
metaDataMap);
}
public getTimestamps_args() {}
- public getTimestamps_args(String id, int num) {
+ public getTimestamps_args(java.lang.String id, int num) {
this();
this.id = id;
this.num = num;
@@ -573,11 +596,11 @@
this.num = 0;
}
- public String getId() {
+ public java.lang.String getId() {
return this.id;
}
- public getTimestamps_args setId(String id) {
+ public getTimestamps_args setId(java.lang.String id) {
this.id = id;
return this;
}
@@ -608,25 +631,26 @@
}
public void unsetNum() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_ISSET_ID);
+ __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_ISSET_ID);
}
/** Returns true if field num is set (has been assigned a value) and false otherwise */
public boolean isSetNum() {
- return EncodingUtils.testBit(__isset_bitfield, __NUM_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_ISSET_ID);
}
public void setNumIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_ISSET_ID, value);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_ISSET_ID, value);
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
- setId((String) value);
+ setId((java.lang.String) value);
}
break;
@@ -634,23 +658,23 @@
if (value == null) {
unsetNum();
} else {
- setNum((Integer) value);
+ setNum((java.lang.Integer) value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
case NUM:
- return Integer.valueOf(getNum());
+ return getNum();
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
/**
@@ -659,7 +683,7 @@
*/
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
@@ -668,11 +692,11 @@
case NUM:
return isSetNum();
}
- 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 getTimestamps_args)
@@ -683,6 +707,8 @@
public boolean equals(getTimestamps_args that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
@@ -707,7 +733,15 @@
@Override
public int hashCode() {
- return 0;
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
+ if (isSetId())
+ hashCode = hashCode * 8191 + id.hashCode();
+
+ hashCode = hashCode * 8191 + num;
+
+ return hashCode;
}
@Override
@@ -718,7 +752,7 @@
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+ lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
@@ -728,7 +762,7 @@
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetNum()).compareTo(other.isSetNum());
+ lastComparison = java.lang.Boolean.valueOf(isSetNum()).compareTo(other.isSetNum());
if (lastComparison != 0) {
return lastComparison;
}
@@ -747,17 +781,17 @@
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("getTimestamps_args(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("getTimestamps_args(");
boolean first = true;
sb.append("id:");
@@ -791,7 +825,7 @@
}
private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
+ 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.
@@ -803,14 +837,15 @@
}
}
- private static class getTimestamps_argsStandardSchemeFactory implements SchemeFactory {
+ private static class getTimestamps_argsStandardSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public getTimestamps_argsStandardScheme getScheme() {
return new getTimestamps_argsStandardScheme();
}
}
private static class getTimestamps_argsStandardScheme
- extends StandardScheme<getTimestamps_args> {
+ extends org.apache.thrift.scheme.StandardScheme<getTimestamps_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getTimestamps_args struct)
throws org.apache.thrift.TException {
@@ -869,19 +904,22 @@
}
- private static class getTimestamps_argsTupleSchemeFactory implements SchemeFactory {
+ private static class getTimestamps_argsTupleSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public getTimestamps_argsTupleScheme getScheme() {
return new getTimestamps_argsTupleScheme();
}
}
- private static class getTimestamps_argsTupleScheme extends TupleScheme<getTimestamps_args> {
+ private static class getTimestamps_argsTupleScheme
+ extends org.apache.thrift.scheme.TupleScheme<getTimestamps_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getTimestamps_args 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.isSetId()) {
optionals.set(0);
}
@@ -900,8 +938,9 @@
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getTimestamps_args 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.id = iprot.readString();
struct.setIdIsSet(true);
@@ -913,6 +952,12 @@
}
}
+ 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();
+ }
}
public static class getTimestamps_result
@@ -925,12 +970,10 @@
new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT,
(short) 0);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
- new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getTimestamps_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getTimestamps_resultTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
+ new getTimestamps_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
+ new getTimestamps_resultTupleSchemeFactory();
public Stamps success; // required
@@ -941,10 +984,11 @@
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short) 0, "success");
- 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);
}
}
@@ -967,21 +1011,21 @@
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
- throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ 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;
}
@@ -990,22 +1034,22 @@
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.SUCCESS,
new org.apache.thrift.meta_data.FieldMetaData("success",
org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(
org.apache.thrift.protocol.TType.STRUCT, Stamps.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTimestamps_result.class,
metaDataMap);
}
@@ -1059,7 +1103,7 @@
}
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
@@ -1072,13 +1116,13 @@
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
/**
@@ -1087,18 +1131,18 @@
*/
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
- 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 getTimestamps_result)
@@ -1109,6 +1153,8 @@
public boolean equals(getTimestamps_result that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
@@ -1124,7 +1170,13 @@
@Override
public int hashCode() {
- return 0;
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
+ if (isSetSuccess())
+ hashCode = hashCode * 8191 + success.hashCode();
+
+ return hashCode;
}
@Override
@@ -1135,7 +1187,7 @@
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
@@ -1154,17 +1206,17 @@
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("getTimestamps_result(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("getTimestamps_result(");
boolean first = true;
sb.append("success:");
@@ -1196,7 +1248,7 @@
}
private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
+ throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(
new org.apache.thrift.transport.TIOStreamTransport(in)));
@@ -1205,14 +1257,15 @@
}
}
- private static class getTimestamps_resultStandardSchemeFactory implements SchemeFactory {
+ private static class getTimestamps_resultStandardSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public getTimestamps_resultStandardScheme getScheme() {
return new getTimestamps_resultStandardScheme();
}
}
private static class getTimestamps_resultStandardScheme
- extends StandardScheme<getTimestamps_result> {
+ extends org.apache.thrift.scheme.StandardScheme<getTimestamps_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getTimestamps_result struct)
throws org.apache.thrift.TException {
@@ -1261,19 +1314,22 @@
}
- private static class getTimestamps_resultTupleSchemeFactory implements SchemeFactory {
+ private static class getTimestamps_resultTupleSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public getTimestamps_resultTupleScheme getScheme() {
return new getTimestamps_resultTupleScheme();
}
}
- private static class getTimestamps_resultTupleScheme extends TupleScheme<getTimestamps_result> {
+ private static class getTimestamps_resultTupleScheme
+ extends org.apache.thrift.scheme.TupleScheme<getTimestamps_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getTimestamps_result 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.isSetSuccess()) {
optionals.set(0);
}
@@ -1286,8 +1342,9 @@
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getTimestamps_result 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.success = new Stamps();
struct.success.read(iprot);
@@ -1296,6 +1353,12 @@
}
}
+ 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();
+ }
}
public static class isLeader_args
@@ -1305,12 +1368,10 @@
new org.apache.thrift.protocol.TStruct("isLeader_args");
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
- new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new isLeader_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new isLeader_argsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
+ new isLeader_argsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
+ new isLeader_argsTupleSchemeFactory();
/**
@@ -1320,10 +1381,11 @@
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+ private static final java.util.Map<java.lang.String, _Fields> byName =
+ new java.util.HashMap<java.lang.String, _Fields>();
static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
@@ -1344,21 +1406,21 @@
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
- throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ 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;
}
@@ -1367,16 +1429,16 @@
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
- new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
+ new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isLeader_args.class,
metaDataMap);
}
@@ -1395,15 +1457,15 @@
@Override
public void clear() {}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
/**
@@ -1412,16 +1474,16 @@
*/
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
@Override
- public boolean equals(Object that) {
+ public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof isLeader_args)
@@ -1432,13 +1494,17 @@
public boolean equals(isLeader_args that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
return true;
}
@Override
public int hashCode() {
- return 0;
+ int hashCode = 1;
+
+ return hashCode;
}
@Override
@@ -1458,17 +1524,17 @@
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("isLeader_args(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("isLeader_args(");
boolean first = true;
sb.append(")");
@@ -1490,7 +1556,7 @@
}
private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
+ throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(
new org.apache.thrift.transport.TIOStreamTransport(in)));
@@ -1499,13 +1565,15 @@
}
}
- private static class isLeader_argsStandardSchemeFactory implements SchemeFactory {
+ private static class isLeader_argsStandardSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public isLeader_argsStandardScheme getScheme() {
return new isLeader_argsStandardScheme();
}
}
- private static class isLeader_argsStandardScheme extends StandardScheme<isLeader_args> {
+ private static class isLeader_argsStandardScheme
+ extends org.apache.thrift.scheme.StandardScheme<isLeader_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isLeader_args struct)
throws org.apache.thrift.TException {
@@ -1540,27 +1608,37 @@
}
- private static class isLeader_argsTupleSchemeFactory implements SchemeFactory {
+ private static class isLeader_argsTupleSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public isLeader_argsTupleScheme getScheme() {
return new isLeader_argsTupleScheme();
}
}
- private static class isLeader_argsTupleScheme extends TupleScheme<isLeader_args> {
+ private static class isLeader_argsTupleScheme
+ extends org.apache.thrift.scheme.TupleScheme<isLeader_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isLeader_args struct)
throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
+ org.apache.thrift.protocol.TTupleProtocol oprot =
+ (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isLeader_args struct)
throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
+ org.apache.thrift.protocol.TTupleProtocol iprot =
+ (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
+ private static <S extends org.apache.thrift.scheme.IScheme> S scheme(
+ org.apache.thrift.protocol.TProtocol proto) {
+ return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme())
+ ? STANDARD_SCHEME_FACTORY
+ : TUPLE_SCHEME_FACTORY).getScheme();
+ }
}
public static class isLeader_result
@@ -1573,12 +1651,10 @@
new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL,
(short) 0);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
- new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new isLeader_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new isLeader_resultTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
+ new isLeader_resultStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
+ new isLeader_resultTupleSchemeFactory();
public boolean success; // required
@@ -1589,10 +1665,11 @@
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short) 0, "success");
- 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);
}
}
@@ -1615,21 +1692,21 @@
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
- throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ 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;
}
@@ -1638,7 +1715,7 @@
return _thriftId;
}
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -1646,16 +1723,16 @@
// isset id assignments
private static final int __SUCCESS_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.SUCCESS,
new org.apache.thrift.meta_data.FieldMetaData("success",
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(isLeader_result.class,
metaDataMap);
}
@@ -1697,38 +1774,40 @@
}
public void unsetSuccess() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
- return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
- setSuccess((Boolean) value);
+ setSuccess((java.lang.Boolean) value);
}
break;
}
}
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
- return Boolean.valueOf(isSuccess());
+ return isSuccess();
}
- throw new IllegalStateException();
+ throw new java.lang.IllegalStateException();
}
/**
@@ -1737,18 +1816,18 @@
*/
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
- 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 isLeader_result)
@@ -1759,6 +1838,8 @@
public boolean equals(isLeader_result that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_success = true;
boolean that_present_success = true;
@@ -1774,7 +1855,11 @@
@Override
public int hashCode() {
- return 0;
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
+
+ return hashCode;
}
@Override
@@ -1785,7 +1870,7 @@
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
@@ -1804,17 +1889,17 @@
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("isLeader_result(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("isLeader_result(");
boolean first = true;
sb.append("success:");
@@ -1839,7 +1924,7 @@
}
private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
+ 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.
@@ -1851,13 +1936,15 @@
}
}
- private static class isLeader_resultStandardSchemeFactory implements SchemeFactory {
+ private static class isLeader_resultStandardSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public isLeader_resultStandardScheme getScheme() {
return new isLeader_resultStandardScheme();
}
}
- private static class isLeader_resultStandardScheme extends StandardScheme<isLeader_result> {
+ private static class isLeader_resultStandardScheme
+ extends org.apache.thrift.scheme.StandardScheme<isLeader_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, isLeader_result struct)
throws org.apache.thrift.TException {
@@ -1905,19 +1992,22 @@
}
- private static class isLeader_resultTupleSchemeFactory implements SchemeFactory {
+ private static class isLeader_resultTupleSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public isLeader_resultTupleScheme getScheme() {
return new isLeader_resultTupleScheme();
}
}
- private static class isLeader_resultTupleScheme extends TupleScheme<isLeader_result> {
+ private static class isLeader_resultTupleScheme
+ extends org.apache.thrift.scheme.TupleScheme<isLeader_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, isLeader_result 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.isSetSuccess()) {
optionals.set(0);
}
@@ -1930,8 +2020,9 @@
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, isLeader_result 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.success = iprot.readBool();
struct.setSuccessIsSet(true);
@@ -1939,6 +2030,12 @@
}
}
+ 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();
+ }
}
}
diff --git a/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java b/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
index c63c8e6..7df4dd7 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/thrift/Stamps.java
@@ -1,27 +1,14 @@
/**
- * Autogenerated by Thrift Compiler (0.9.1)
+ * Autogenerated by Thrift Compiler (0.11.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *
- * @generated
+ * @generated
*/
package org.apache.fluo.core.thrift;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-import org.apache.thrift.scheme.TupleScheme;
-
-@SuppressWarnings({"rawtypes", "unused", "serial", "unchecked"})
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
+@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)",
+ date = "2018-10-30")
public class Stamps implements org.apache.thrift.TBase<Stamps, Stamps._Fields>,
java.io.Serializable, Cloneable, Comparable<Stamps> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC =
@@ -34,12 +21,10 @@
new org.apache.thrift.protocol.TField("gcStamp", org.apache.thrift.protocol.TType.I64,
(short) 2);
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
- new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new StampsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new StampsTupleSchemeFactory());
- }
+ private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
+ new StampsStandardSchemeFactory();
+ private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
+ new StampsTupleSchemeFactory();
public long txStampsStart; // required
public long gcStamp; // required
@@ -51,10 +36,11 @@
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TX_STAMPS_START((short) 1, "txStampsStart"), GC_STAMP((short) 2, "gcStamp");
- 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);
}
}
@@ -79,32 +65,30 @@
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
- throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ 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;
}
- @Override
public short getThriftFieldId() {
return _thriftId;
}
- @Override
- public String getFieldName() {
+ public java.lang.String getFieldName() {
return _fieldName;
}
}
@@ -113,17 +97,17 @@
private static final int __TXSTAMPSSTART_ISSET_ID = 0;
private static final int __GCSTAMP_ISSET_ID = 1;
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.TX_STAMPS_START, new org.apache.thrift.meta_data.FieldMetaData(
"txStampsStart", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.GC_STAMP, new org.apache.thrift.meta_data.FieldMetaData("gcStamp",
org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
+ metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Stamps.class, metaDataMap);
}
@@ -146,7 +130,6 @@
this.gcStamp = other.gcStamp;
}
- @Override
public Stamps deepCopy() {
return new Stamps(this);
}
@@ -170,16 +153,18 @@
}
public void unsetTxStampsStart() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID);
}
/** Returns true if field txStampsStart is set (has been assigned a value) and false otherwise */
public boolean isSetTxStampsStart() {
- return EncodingUtils.testBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID);
}
public void setTxStampsStartIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID, value);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TXSTAMPSSTART_ISSET_ID, value);
}
public long getGcStamp() {
@@ -193,26 +178,27 @@
}
public void unsetGcStamp() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GCSTAMP_ISSET_ID);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GCSTAMP_ISSET_ID);
}
/** Returns true if field gcStamp is set (has been assigned a value) and false otherwise */
public boolean isSetGcStamp() {
- return EncodingUtils.testBit(__isset_bitfield, __GCSTAMP_ISSET_ID);
+ return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GCSTAMP_ISSET_ID);
}
public void setGcStampIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GCSTAMP_ISSET_ID, value);
+ __isset_bitfield =
+ org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GCSTAMP_ISSET_ID, value);
}
- @Override
- public void setFieldValue(_Fields field, Object value) {
+ public void setFieldValue(_Fields field, java.lang.Object value) {
switch (field) {
case TX_STAMPS_START:
if (value == null) {
unsetTxStampsStart();
} else {
- setTxStampsStart((Long) value);
+ setTxStampsStart((java.lang.Long) value);
}
break;
@@ -220,34 +206,32 @@
if (value == null) {
unsetGcStamp();
} else {
- setGcStamp((Long) value);
+ setGcStamp((java.lang.Long) value);
}
break;
}
}
- @Override
- public Object getFieldValue(_Fields field) {
+ public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case TX_STAMPS_START:
- return Long.valueOf(getTxStampsStart());
+ return getTxStampsStart();
case GC_STAMP:
- return Long.valueOf(getGcStamp());
+ return getGcStamp();
}
- 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
*/
- @Override
public boolean isSet(_Fields field) {
if (field == null) {
- throw new IllegalArgumentException();
+ throw new java.lang.IllegalArgumentException();
}
switch (field) {
@@ -256,11 +240,11 @@
case GC_STAMP:
return isSetGcStamp();
}
- 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 Stamps)
@@ -271,6 +255,8 @@
public boolean equals(Stamps that) {
if (that == null)
return false;
+ if (this == that)
+ return true;
boolean this_present_txStampsStart = true;
boolean that_present_txStampsStart = true;
@@ -295,7 +281,13 @@
@Override
public int hashCode() {
- return 0;
+ int hashCode = 1;
+
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(txStampsStart);
+
+ hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(gcStamp);
+
+ return hashCode;
}
@Override
@@ -306,7 +298,8 @@
int lastComparison = 0;
- lastComparison = Boolean.valueOf(isSetTxStampsStart()).compareTo(other.isSetTxStampsStart());
+ lastComparison =
+ java.lang.Boolean.valueOf(isSetTxStampsStart()).compareTo(other.isSetTxStampsStart());
if (lastComparison != 0) {
return lastComparison;
}
@@ -317,7 +310,7 @@
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetGcStamp()).compareTo(other.isSetGcStamp());
+ lastComparison = java.lang.Boolean.valueOf(isSetGcStamp()).compareTo(other.isSetGcStamp());
if (lastComparison != 0) {
return lastComparison;
}
@@ -330,25 +323,22 @@
return 0;
}
- @Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
- @Override
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);
}
- @Override
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("Stamps(");
+ public java.lang.String toString() {
+ java.lang.StringBuilder sb = new java.lang.StringBuilder("Stamps(");
boolean first = true;
sb.append("txStampsStart:");
@@ -378,7 +368,7 @@
}
private void readObject(java.io.ObjectInputStream in)
- throws java.io.IOException, ClassNotFoundException {
+ 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.
@@ -390,16 +380,16 @@
}
}
- private static class StampsStandardSchemeFactory implements SchemeFactory {
- @Override
+ private static class StampsStandardSchemeFactory
+ implements org.apache.thrift.scheme.SchemeFactory {
public StampsStandardScheme getScheme() {
return new StampsStandardScheme();
}
}
- private static class StampsStandardScheme extends StandardScheme<Stamps> {
+ private static class StampsStandardScheme
+ extends org.apache.thrift.scheme.StandardScheme<Stamps> {
- @Override
public void read(org.apache.thrift.protocol.TProtocol iprot, Stamps struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
@@ -437,7 +427,6 @@
struct.validate();
}
- @Override
public void write(org.apache.thrift.protocol.TProtocol oprot, Stamps struct)
throws org.apache.thrift.TException {
struct.validate();
@@ -455,20 +444,20 @@
}
- private static class StampsTupleSchemeFactory implements SchemeFactory {
- @Override
+ private static class StampsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public StampsTupleScheme getScheme() {
return new StampsTupleScheme();
}
}
- private static class StampsTupleScheme extends TupleScheme<Stamps> {
+ private static class StampsTupleScheme extends org.apache.thrift.scheme.TupleScheme<Stamps> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Stamps 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.isSetTxStampsStart()) {
optionals.set(0);
}
@@ -487,8 +476,9 @@
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Stamps 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.txStampsStart = iprot.readI64();
struct.setTxStampsStartIsSet(true);
@@ -500,4 +490,10 @@
}
}
+ 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();
+ }
}