This is an automated email from the ASF dual-hosted git repository. mpercy pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/flume.git
commit 867c0a2f62711abcb91c85c2c1c1dbcbbc1025b4 Author: Michael Percy <[email protected]> AuthorDate: Sat Nov 23 20:54:32 2019 -0800 JDK 11: upgrade to Thrift 0.13 Thrift 0.13 is the first version of Thrift to support JDK 11, according to the Thrift changelog. This patch updates the Thrift dependency to 0.13 and regenerates the generated code in the legacy thrift source, enabling us to build on JDK 11. --- .../flume-thrift-source/pom.xml | 2 +- .../flume/handlers/thrift/EventStatus.java | 8 +- .../cloudera/flume/handlers/thrift/Priority.java | 8 +- .../flume/handlers/thrift/ThriftFlumeEvent.java | 242 ++++++------- .../handlers/thrift/ThriftFlumeEventServer.java | 382 +++++++++++---------- pom.xml | 2 +- 6 files changed, 317 insertions(+), 327 deletions(-) diff --git a/flume-ng-legacy-sources/flume-thrift-source/pom.xml b/flume-ng-legacy-sources/flume-thrift-source/pom.xml index 1e3129b..74922f6 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/pom.xml +++ b/flume-ng-legacy-sources/flume-thrift-source/pom.xml @@ -68,7 +68,7 @@ limitations under the License. fi for THRIFT_FILE in `ls $THRIFT_DIR/*.thrift 2> /dev/null` do - thrift --gen java:hashcode -o $JAVA_DIR $THRIFT_FILE + thrift --gen java -o $JAVA_DIR $THRIFT_FILE done SRC_DIR=$JAVA_DIR/gen-java/com/cloudera/flume/handlers/thrift DEST_DIR=src/main/java/com/cloudera/flume/handlers/thrift diff --git a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/EventStatus.java b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/EventStatus.java index fa05210..6c4b599 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/EventStatus.java +++ b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/EventStatus.java @@ -17,7 +17,7 @@ * under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.13.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -25,10 +25,7 @@ package com.cloudera.flume.handlers.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - [email protected](value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2019-11-23") public enum EventStatus implements org.apache.thrift.TEnum { ACK(0), COMMITED(1), @@ -51,6 +48,7 @@ public enum EventStatus implements org.apache.thrift.TEnum { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static EventStatus findByValue(int value) { switch (value) { case 0: diff --git a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/Priority.java b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/Priority.java index 46d4a5b..0949eea 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/Priority.java +++ b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/Priority.java @@ -17,7 +17,7 @@ * under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.13.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -25,10 +25,7 @@ package com.cloudera.flume.handlers.thrift; -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - [email protected](value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2019-11-23") public enum Priority implements org.apache.thrift.TEnum { FATAL(0), ERROR(1), @@ -54,6 +51,7 @@ public enum Priority implements org.apache.thrift.TEnum { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static Priority findByValue(int value) { switch (value) { case 0: diff --git a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEvent.java b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEvent.java index 1649abd..812cb57 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEvent.java +++ b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEvent.java @@ -17,42 +17,15 @@ * under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.13.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.cloudera.flume.handlers.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"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-09-01") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2019-11-23") public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEvent, ThriftFlumeEvent._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftFlumeEvent> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftFlumeEvent"); @@ -63,22 +36,19 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("fields", org.apache.thrift.protocol.TType.MAP, (short)6); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ThriftFlumeEventStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ThriftFlumeEventTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ThriftFlumeEventStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ThriftFlumeEventTupleSchemeFactory(); public long timestamp; // required /** * * @see Priority */ - public Priority priority; // required - public ByteBuffer body; // required + public @org.apache.thrift.annotation.Nullable Priority priority; // required + public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer body; // required public long nanos; // required - public String host; // required - public Map<String,ByteBuffer> fields; // required + public @org.apache.thrift.annotation.Nullable java.lang.String host; // required + public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.nio.ByteBuffer> fields; // 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 { @@ -93,10 +63,10 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven HOST((short)5, "host"), FIELDS((short)6, "fields"); - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -104,6 +74,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TIMESTAMP @@ -129,21 +100,22 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven */ 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) { + @org.apache.thrift.annotation.Nullable + 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; } @@ -152,7 +124,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -161,9 +133,9 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven private static final int __TIMESTAMP_ISSET_ID = 0; private static final int __NANOS_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.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "Timestamp"))); tmpMap.put(_Fields.PRIORITY, new org.apache.thrift.meta_data.FieldMetaData("priority", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -178,7 +150,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ThriftFlumeEvent.class, metaDataMap); } @@ -188,10 +160,10 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven public ThriftFlumeEvent( long timestamp, Priority priority, - ByteBuffer body, + java.nio.ByteBuffer body, long nanos, - String host, - Map<String,ByteBuffer> fields) + java.lang.String host, + java.util.Map<java.lang.String,java.nio.ByteBuffer> fields) { this(); this.timestamp = timestamp; @@ -221,7 +193,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven this.host = other.host; } if (other.isSetFields()) { - Map<String,ByteBuffer> __this__fields = new HashMap<String,ByteBuffer>(other.fields); + java.util.Map<java.lang.String,java.nio.ByteBuffer> __this__fields = new java.util.HashMap<java.lang.String,java.nio.ByteBuffer>(other.fields); this.fields = __this__fields; } } @@ -253,22 +225,23 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } public void unsetTimestamp() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } /** Returns true if field timestamp is set (has been assigned a value) and false otherwise */ public boolean isSetTimestamp() { - return EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TIMESTAMP_ISSET_ID); } public void setTimestampIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TIMESTAMP_ISSET_ID, value); } /** * * @see Priority */ + @org.apache.thrift.annotation.Nullable public Priority getPriority() { return this.priority; } @@ -277,7 +250,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven * * @see Priority */ - public ThriftFlumeEvent setPriority(Priority priority) { + public ThriftFlumeEvent setPriority(@org.apache.thrift.annotation.Nullable Priority priority) { this.priority = priority; return this; } @@ -302,16 +275,16 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return body == null ? null : body.array(); } - public ByteBuffer bufferForBody() { + public java.nio.ByteBuffer bufferForBody() { return org.apache.thrift.TBaseHelper.copyBinary(body); } public ThriftFlumeEvent setBody(byte[] body) { - this.body = body == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(body, body.length)); + this.body = body == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(body.clone()); return this; } - public ThriftFlumeEvent setBody(ByteBuffer body) { + public ThriftFlumeEvent setBody(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer body) { this.body = org.apache.thrift.TBaseHelper.copyBinary(body); return this; } @@ -342,23 +315,24 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } public void unsetNanos() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NANOS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NANOS_ISSET_ID); } /** Returns true if field nanos is set (has been assigned a value) and false otherwise */ public boolean isSetNanos() { - return EncodingUtils.testBit(__isset_bitfield, __NANOS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NANOS_ISSET_ID); } public void setNanosIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NANOS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NANOS_ISSET_ID, value); } - public String getHost() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getHost() { return this.host; } - public ThriftFlumeEvent setHost(String host) { + public ThriftFlumeEvent setHost(@org.apache.thrift.annotation.Nullable java.lang.String host) { this.host = host; return this; } @@ -382,18 +356,19 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return (this.fields == null) ? 0 : this.fields.size(); } - public void putToFields(String key, ByteBuffer val) { + public void putToFields(java.lang.String key, java.nio.ByteBuffer val) { if (this.fields == null) { - this.fields = new HashMap<String,ByteBuffer>(); + this.fields = new java.util.HashMap<java.lang.String,java.nio.ByteBuffer>(); } this.fields.put(key, val); } - public Map<String,ByteBuffer> getFields() { + @org.apache.thrift.annotation.Nullable + public java.util.Map<java.lang.String,java.nio.ByteBuffer> getFields() { return this.fields; } - public ThriftFlumeEvent setFields(Map<String,ByteBuffer> fields) { + public ThriftFlumeEvent setFields(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.nio.ByteBuffer> fields) { this.fields = fields; return this; } @@ -413,13 +388,13 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TIMESTAMP: if (value == null) { unsetTimestamp(); } else { - setTimestamp((Long)value); + setTimestamp((java.lang.Long)value); } break; @@ -435,7 +410,11 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (value == null) { unsetBody(); } else { - setBody((ByteBuffer)value); + if (value instanceof byte[]) { + setBody((byte[])value); + } else { + setBody((java.nio.ByteBuffer)value); + } } break; @@ -443,7 +422,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (value == null) { unsetNanos(); } else { - setNanos((Long)value); + setNanos((java.lang.Long)value); } break; @@ -451,7 +430,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (value == null) { unsetHost(); } else { - setHost((String)value); + setHost((java.lang.String)value); } break; @@ -459,14 +438,15 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (value == null) { unsetFields(); } else { - setFields((Map<String,ByteBuffer>)value); + setFields((java.util.Map<java.lang.String,java.nio.ByteBuffer>)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TIMESTAMP: return getTimestamp(); @@ -487,13 +467,13 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return getFields(); } - 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) { @@ -510,11 +490,11 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven case FIELDS: return isSetFields(); } - 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 ThriftFlumeEvent) @@ -525,6 +505,8 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven public boolean equals(ThriftFlumeEvent that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_timestamp = true; boolean that_present_timestamp = true; @@ -585,39 +567,29 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_timestamp = true; - list.add(present_timestamp); - if (present_timestamp) - list.add(timestamp); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(timestamp); - boolean present_priority = true && (isSetPriority()); - list.add(present_priority); - if (present_priority) - list.add(priority.getValue()); + hashCode = hashCode * 8191 + ((isSetPriority()) ? 131071 : 524287); + if (isSetPriority()) + hashCode = hashCode * 8191 + priority.getValue(); - boolean present_body = true && (isSetBody()); - list.add(present_body); - if (present_body) - list.add(body); + hashCode = hashCode * 8191 + ((isSetBody()) ? 131071 : 524287); + if (isSetBody()) + hashCode = hashCode * 8191 + body.hashCode(); - boolean present_nanos = true; - list.add(present_nanos); - if (present_nanos) - list.add(nanos); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(nanos); - boolean present_host = true && (isSetHost()); - list.add(present_host); - if (present_host) - list.add(host); + hashCode = hashCode * 8191 + ((isSetHost()) ? 131071 : 524287); + if (isSetHost()) + hashCode = hashCode * 8191 + host.hashCode(); - boolean present_fields = true && (isSetFields()); - list.add(present_fields); - if (present_fields) - list.add(fields); + hashCode = hashCode * 8191 + ((isSetFields()) ? 131071 : 524287); + if (isSetFields()) + hashCode = hashCode * 8191 + fields.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -628,7 +600,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); + lastComparison = java.lang.Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp()); if (lastComparison != 0) { return lastComparison; } @@ -638,7 +610,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPriority()).compareTo(other.isSetPriority()); + lastComparison = java.lang.Boolean.valueOf(isSetPriority()).compareTo(other.isSetPriority()); if (lastComparison != 0) { return lastComparison; } @@ -648,7 +620,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return lastComparison; } } - lastComparison = Boolean.valueOf(isSetBody()).compareTo(other.isSetBody()); + lastComparison = java.lang.Boolean.valueOf(isSetBody()).compareTo(other.isSetBody()); if (lastComparison != 0) { return lastComparison; } @@ -658,7 +630,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNanos()).compareTo(other.isSetNanos()); + lastComparison = java.lang.Boolean.valueOf(isSetNanos()).compareTo(other.isSetNanos()); if (lastComparison != 0) { return lastComparison; } @@ -668,7 +640,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return lastComparison; } } - lastComparison = Boolean.valueOf(isSetHost()).compareTo(other.isSetHost()); + lastComparison = java.lang.Boolean.valueOf(isSetHost()).compareTo(other.isSetHost()); if (lastComparison != 0) { return lastComparison; } @@ -678,7 +650,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return lastComparison; } } - lastComparison = Boolean.valueOf(isSetFields()).compareTo(other.isSetFields()); + lastComparison = java.lang.Boolean.valueOf(isSetFields()).compareTo(other.isSetFields()); if (lastComparison != 0) { return lastComparison; } @@ -691,21 +663,22 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven return 0; } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } 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("ThriftFlumeEvent("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ThriftFlumeEvent("); boolean first = true; sb.append("timestamp:"); @@ -764,7 +737,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } } - 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; @@ -774,13 +747,13 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } } - private static class ThriftFlumeEventStandardSchemeFactory implements SchemeFactory { + private static class ThriftFlumeEventStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftFlumeEventStandardScheme getScheme() { return new ThriftFlumeEventStandardScheme(); } } - private static class ThriftFlumeEventStandardScheme extends StandardScheme<ThriftFlumeEvent> { + private static class ThriftFlumeEventStandardScheme extends org.apache.thrift.scheme.StandardScheme<ThriftFlumeEvent> { public void read(org.apache.thrift.protocol.TProtocol iprot, ThriftFlumeEvent struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -836,9 +809,9 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.fields = new HashMap<String,ByteBuffer>(2*_map0.size); - String _key1; - ByteBuffer _val2; + struct.fields = new java.util.HashMap<java.lang.String,java.nio.ByteBuffer>(2*_map0.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key1; + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val2; for (int _i3 = 0; _i3 < _map0.size; ++_i3) { _key1 = iprot.readString(); @@ -892,7 +865,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven oprot.writeFieldBegin(FIELDS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.fields.size())); - for (Map.Entry<String, ByteBuffer> _iter4 : struct.fields.entrySet()) + for (java.util.Map.Entry<java.lang.String, java.nio.ByteBuffer> _iter4 : struct.fields.entrySet()) { oprot.writeString(_iter4.getKey()); oprot.writeBinary(_iter4.getValue()); @@ -907,18 +880,18 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } - private static class ThriftFlumeEventTupleSchemeFactory implements SchemeFactory { + private static class ThriftFlumeEventTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ThriftFlumeEventTupleScheme getScheme() { return new ThriftFlumeEventTupleScheme(); } } - private static class ThriftFlumeEventTupleScheme extends TupleScheme<ThriftFlumeEvent> { + private static class ThriftFlumeEventTupleScheme extends org.apache.thrift.scheme.TupleScheme<ThriftFlumeEvent> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftFlumeEvent 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.isSetTimestamp()) { optionals.set(0); } @@ -956,7 +929,7 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (struct.isSetFields()) { { oprot.writeI32(struct.fields.size()); - for (Map.Entry<String, ByteBuffer> _iter5 : struct.fields.entrySet()) + for (java.util.Map.Entry<java.lang.String, java.nio.ByteBuffer> _iter5 : struct.fields.entrySet()) { oprot.writeString(_iter5.getKey()); oprot.writeBinary(_iter5.getValue()); @@ -967,8 +940,8 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven @Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftFlumeEvent struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(6); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.timestamp = iprot.readI64(); struct.setTimestampIsSet(true); @@ -992,9 +965,9 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven if (incoming.get(5)) { { org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.fields = new HashMap<String,ByteBuffer>(2*_map6.size); - String _key7; - ByteBuffer _val8; + struct.fields = new java.util.HashMap<java.lang.String,java.nio.ByteBuffer>(2*_map6.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7; + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val8; for (int _i9 = 0; _i9 < _map6.size; ++_i9) { _key7 = iprot.readString(); @@ -1007,5 +980,8 @@ public class ThriftFlumeEvent implements org.apache.thrift.TBase<ThriftFlumeEven } } + 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/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEventServer.java b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEventServer.java index dbc2417..a7026a9 100644 --- a/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEventServer.java +++ b/flume-ng-legacy-sources/flume-thrift-source/src/main/java/com/cloudera/flume/handlers/thrift/ThriftFlumeEventServer.java @@ -17,42 +17,15 @@ * under the License. */ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.13.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.cloudera.flume.handlers.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"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-09-01") +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) [email protected](value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2019-11-23") public class ThriftFlumeEventServer { public interface Iface { @@ -65,9 +38,9 @@ public class ThriftFlumeEventServer { public interface AsyncIface { - public void append(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void append(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; - public void close(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void close(org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException; } @@ -140,16 +113,16 @@ public class ThriftFlumeEventServer { super(protocolFactory, clientManager, transport); } - public void append(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void append(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { checkReady(); append_call method_call = new append_call(evt, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class append_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class append_call extends org.apache.thrift.async.TAsyncMethodCall<Void> { private ThriftFlumeEvent evt; - public append_call(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public append_call(ThriftFlumeEvent evt, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, true); this.evt = evt; } @@ -162,24 +135,25 @@ public class ThriftFlumeEventServer { prot.writeMessageEnd(); } - public void getResult() throws org.apache.thrift.TException { + public Void 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()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return null; } } - public void close(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void close(org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { checkReady(); close_call method_call = new close_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class close_call extends org.apache.thrift.async.TAsyncMethodCall { - public close_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public static class close_call extends org.apache.thrift.async.TAsyncMethodCall<Void> { + public close_call(org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } @@ -190,29 +164,29 @@ public class ThriftFlumeEventServer { prot.writeMessageEnd(); } - public void getResult() throws org.apache.thrift.TException { + public Void 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()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - (new Client(prot)).recv_close(); + return null; } } } 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>>())); + super(iface, getProcessMap(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) { + protected Processor(I iface, 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("append", new append()); processMap.put("close", new close()); return processMap; @@ -231,6 +205,11 @@ public class ThriftFlumeEventServer { return true; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public org.apache.thrift.TBase getResult(I iface, append_args args) throws org.apache.thrift.TException { iface.append(args.evt); return null; @@ -250,6 +229,11 @@ public class ThriftFlumeEventServer { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public close_result getResult(I iface, close_args args) throws org.apache.thrift.TException { close_result result = new close_result(); iface.close(); @@ -260,16 +244,16 @@ public class ThriftFlumeEventServer { } 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, ?>>())); + super(iface, getProcessMap(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) { + protected AsyncProcessor(I iface, 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("append", new append()); processMap.put("close", new close()); return processMap; @@ -284,12 +268,18 @@ public class ThriftFlumeEventServer { return new append_args(); } - public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback<Void> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<Void>() { + return new org.apache.thrift.async.AsyncMethodCallback<Void>() { public void onComplete(Void o) { } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + } else { + _LOGGER.error("Exception inside oneway handler", e); + } } }; } @@ -298,7 +288,7 @@ public class ThriftFlumeEventServer { return true; } - public void start(I iface, append_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { + public void start(I iface, append_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { iface.append(args.evt,resultHandler); } } @@ -312,34 +302,44 @@ public class ThriftFlumeEventServer { return new close_args(); } - public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback<Void> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<Void>() { + return new org.apache.thrift.async.AsyncMethodCallback<Void>() { public void onComplete(Void o) { close_result result = new close_result(); 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); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } 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; close_result result = new close_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.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + 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(); } }; } @@ -348,7 +348,7 @@ public class ThriftFlumeEventServer { return false; } - public void start(I iface, close_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { + public void start(I iface, close_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException { iface.close(resultHandler); } } @@ -360,22 +360,19 @@ public class ThriftFlumeEventServer { private static final org.apache.thrift.protocol.TField EVT_FIELD_DESC = new org.apache.thrift.protocol.TField("evt", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new append_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new append_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new append_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new append_argsTupleSchemeFactory(); - public ThriftFlumeEvent evt; // required + public @org.apache.thrift.annotation.Nullable ThriftFlumeEvent evt; // 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 { EVT((short)1, "evt"); - 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); } } @@ -383,6 +380,7 @@ public class ThriftFlumeEventServer { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // EVT @@ -398,21 +396,22 @@ public class ThriftFlumeEventServer { */ 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) { + @org.apache.thrift.annotation.Nullable + 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; } @@ -421,18 +420,18 @@ public class ThriftFlumeEventServer { 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.EVT, new org.apache.thrift.meta_data.FieldMetaData("evt", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ThriftFlumeEvent.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(append_args.class, metaDataMap); } @@ -464,11 +463,12 @@ public class ThriftFlumeEventServer { this.evt = null; } + @org.apache.thrift.annotation.Nullable public ThriftFlumeEvent getEvt() { return this.evt; } - public append_args setEvt(ThriftFlumeEvent evt) { + public append_args setEvt(@org.apache.thrift.annotation.Nullable ThriftFlumeEvent evt) { this.evt = evt; return this; } @@ -488,7 +488,7 @@ public class ThriftFlumeEventServer { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case EVT: if (value == null) { @@ -501,30 +501,31 @@ public class ThriftFlumeEventServer { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case EVT: return getEvt(); } - 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 EVT: return isSetEvt(); } - 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 append_args) @@ -535,6 +536,8 @@ public class ThriftFlumeEventServer { public boolean equals(append_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_evt = true && this.isSetEvt(); boolean that_present_evt = true && that.isSetEvt(); @@ -550,14 +553,13 @@ public class ThriftFlumeEventServer { @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - boolean present_evt = true && (isSetEvt()); - list.add(present_evt); - if (present_evt) - list.add(evt); + hashCode = hashCode * 8191 + ((isSetEvt()) ? 131071 : 524287); + if (isSetEvt()) + hashCode = hashCode * 8191 + evt.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -568,7 +570,7 @@ public class ThriftFlumeEventServer { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetEvt()).compareTo(other.isSetEvt()); + lastComparison = java.lang.Boolean.valueOf(isSetEvt()).compareTo(other.isSetEvt()); if (lastComparison != 0) { return lastComparison; } @@ -581,21 +583,22 @@ public class ThriftFlumeEventServer { return 0; } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } 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("append_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("append_args("); boolean first = true; sb.append("evt:"); @@ -625,7 +628,7 @@ public class ThriftFlumeEventServer { } } - 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) { @@ -633,13 +636,13 @@ public class ThriftFlumeEventServer { } } - private static class append_argsStandardSchemeFactory implements SchemeFactory { + private static class append_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public append_argsStandardScheme getScheme() { return new append_argsStandardScheme(); } } - private static class append_argsStandardScheme extends StandardScheme<append_args> { + private static class append_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<append_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, append_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -686,18 +689,18 @@ public class ThriftFlumeEventServer { } - private static class append_argsTupleSchemeFactory implements SchemeFactory { + private static class append_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public append_argsTupleScheme getScheme() { return new append_argsTupleScheme(); } } - private static class append_argsTupleScheme extends TupleScheme<append_args> { + private static class append_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<append_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, append_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.isSetEvt()) { optionals.set(0); } @@ -709,8 +712,8 @@ public class ThriftFlumeEventServer { @Override public void read(org.apache.thrift.protocol.TProtocol prot, append_args 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.evt = new ThriftFlumeEvent(); struct.evt.read(iprot); @@ -719,27 +722,27 @@ public class ThriftFlumeEventServer { } } + 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 close_args implements org.apache.thrift.TBase<close_args, close_args._Fields>, java.io.Serializable, Cloneable, Comparable<close_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("close_args"); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new close_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new close_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new close_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new close_argsTupleSchemeFactory(); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -747,6 +750,7 @@ public class ThriftFlumeEventServer { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: @@ -760,21 +764,22 @@ public class ThriftFlumeEventServer { */ 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) { + @org.apache.thrift.annotation.Nullable + 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; } @@ -783,14 +788,14 @@ public class ThriftFlumeEventServer { 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(close_args.class, metaDataMap); } @@ -811,30 +816,31 @@ public class ThriftFlumeEventServer { public void clear() { } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof close_args) @@ -845,15 +851,17 @@ public class ThriftFlumeEventServer { public boolean equals(close_args that) { if (that == null) return false; + if (this == that) + return true; return true; } @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - return list.hashCode(); + return hashCode; } @Override @@ -867,21 +875,22 @@ public class ThriftFlumeEventServer { return 0; } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } 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("close_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("close_args("); boolean first = true; sb.append(")"); @@ -901,7 +910,7 @@ public class ThriftFlumeEventServer { } } - 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) { @@ -909,13 +918,13 @@ public class ThriftFlumeEventServer { } } - private static class close_argsStandardSchemeFactory implements SchemeFactory { + private static class close_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public close_argsStandardScheme getScheme() { return new close_argsStandardScheme(); } } - private static class close_argsStandardScheme extends StandardScheme<close_args> { + private static class close_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<close_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, close_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -948,46 +957,46 @@ public class ThriftFlumeEventServer { } - private static class close_argsTupleSchemeFactory implements SchemeFactory { + private static class close_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public close_argsTupleScheme getScheme() { return new close_argsTupleScheme(); } } - private static class close_argsTupleScheme extends TupleScheme<close_args> { + private static class close_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<close_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, close_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, close_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 close_result implements org.apache.thrift.TBase<close_result, close_result._Fields>, java.io.Serializable, Cloneable, Comparable<close_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("close_result"); - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new close_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new close_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new close_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new close_resultTupleSchemeFactory(); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -995,6 +1004,7 @@ public class ThriftFlumeEventServer { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: @@ -1008,21 +1018,22 @@ public class ThriftFlumeEventServer { */ 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) { + @org.apache.thrift.annotation.Nullable + 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; } @@ -1031,14 +1042,14 @@ public class ThriftFlumeEventServer { 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(close_result.class, metaDataMap); } @@ -1059,30 +1070,31 @@ public class ThriftFlumeEventServer { public void clear() { } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { - throw new IllegalArgumentException(); + throw new java.lang.IllegalArgumentException(); } switch (field) { } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof close_result) @@ -1093,15 +1105,17 @@ public class ThriftFlumeEventServer { public boolean equals(close_result that) { if (that == null) return false; + if (this == that) + return true; return true; } @Override public int hashCode() { - List<Object> list = new ArrayList<Object>(); + int hashCode = 1; - return list.hashCode(); + return hashCode; } @Override @@ -1115,21 +1129,22 @@ public class ThriftFlumeEventServer { return 0; } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } 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("close_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("close_result("); boolean first = true; sb.append(")"); @@ -1149,7 +1164,7 @@ public class ThriftFlumeEventServer { } } - 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) { @@ -1157,13 +1172,13 @@ public class ThriftFlumeEventServer { } } - private static class close_resultStandardSchemeFactory implements SchemeFactory { + private static class close_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public close_resultStandardScheme getScheme() { return new close_resultStandardScheme(); } } - private static class close_resultStandardScheme extends StandardScheme<close_result> { + private static class close_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<close_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, close_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -1196,25 +1211,28 @@ public class ThriftFlumeEventServer { } - private static class close_resultTupleSchemeFactory implements SchemeFactory { + private static class close_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public close_resultTupleScheme getScheme() { return new close_resultTupleScheme(); } } - private static class close_resultTupleScheme extends TupleScheme<close_result> { + private static class close_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<close_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, close_result 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, close_result 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(); + } } } diff --git a/pom.xml b/pom.xml index ce71aa9..5ef4584 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ limitations under the License. <solr-global.version>4.3.0</solr-global.version> <slf4j.version>1.7.25</slf4j.version> <system-rules.version>1.17.0</system-rules.version> - <thrift.version>0.9.3</thrift.version> + <thrift.version>0.13.0</thrift.version> <twitter4j.version>3.0.3</twitter4j.version> <xalan.version>2.7.2</xalan.version> <xerces.version>2.9.1</xerces.version>
