You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by cu...@apache.org on 2014/09/23 00:07:35 UTC
svn commit: r1626912 [4/4] - in /avro/trunk: ./ lang/java/ lang/java/avro/
lang/java/ipc/src/test/java/org/apache/avro/ipc/ lang/java/mapred/
lang/java/mapred/src/test/java/org/apache/avro/hadoop/util/
lang/java/maven-plugin/ lang/java/maven-plugin/src...
Modified: avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/Test.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/Test.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/Test.java (original)
+++ avro/trunk/lang/java/thrift/src/test/java/org/apache/avro/thrift/test/Test.java Mon Sep 22 22:07:34 2014
@@ -1,10 +1,22 @@
/**
- * Autogenerated by Thrift Compiler (0.7.0)
+ * Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
*/
package org.apache.avro.thrift.test;
+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;
@@ -20,7 +32,7 @@ import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class Test implements org.apache.thrift.TBase<Test, Test._Fields>, java.io.Serializable, Cloneable {
+public class Test implements org.apache.thrift.TBase<Test, Test._Fields>, java.io.Serializable, Cloneable, Comparable<Test> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Test");
private static final org.apache.thrift.protocol.TField BOOL_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("boolField", org.apache.thrift.protocol.TType.BOOL, (short)1);
@@ -39,15 +51,21 @@ public class Test implements org.apache.
private static final org.apache.thrift.protocol.TField STRUCT_FIELD_FIELD_DESC = new org.apache.thrift.protocol.TField("structField", org.apache.thrift.protocol.TType.STRUCT, (short)13);
private static final org.apache.thrift.protocol.TField FOO_OR_BAR_FIELD_DESC = new org.apache.thrift.protocol.TField("fooOrBar", org.apache.thrift.protocol.TType.STRUCT, (short)14);
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TestStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TestTupleSchemeFactory());
+ }
+
private boolean boolField; // required
private byte byteField; // required
private short i16Field; // required
- private short i16OptionalField; // required
- private int i32Field; // required
+ private short i16OptionalField; // optional
+ private int i32Field; // optional
private long i64Field; // required
private double doubleField; // required
private String stringField; // required
- private ByteBuffer binaryField; // required
+ private ByteBuffer binaryField; // optional
private Map<String,Integer> mapField; // required
private List<Integer> listField; // required
private Set<Integer> setField; // required
@@ -167,8 +185,8 @@ public class Test implements org.apache.
private static final int __I32FIELD_ISSET_ID = 4;
private static final int __I64FIELD_ISSET_ID = 5;
private static final int __DOUBLEFIELD_ISSET_ID = 6;
- private BitSet __isset_bit_vector = new BitSet(7);
-
+ private byte __isset_bitfield = 0;
+ private _Fields optionals[] = {_Fields.I16_OPTIONAL_FIELD,_Fields.I32_FIELD,_Fields.BINARY_FIELD};
public static final 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);
@@ -251,8 +269,7 @@ public class Test implements org.apache.
* Performs a deep copy on <i>other</i>.
*/
public Test(Test other) {
- __isset_bit_vector.clear();
- __isset_bit_vector.or(other.__isset_bit_vector);
+ __isset_bitfield = other.__isset_bitfield;
this.boolField = other.boolField;
this.byteField = other.byteField;
this.i16Field = other.i16Field;
@@ -268,32 +285,15 @@ public class Test implements org.apache.
;
}
if (other.isSetMapField()) {
- Map<String,Integer> __this__mapField = new HashMap<String,Integer>();
- for (Map.Entry<String, Integer> other_element : other.mapField.entrySet()) {
-
- String other_element_key = other_element.getKey();
- Integer other_element_value = other_element.getValue();
-
- String __this__mapField_copy_key = other_element_key;
-
- Integer __this__mapField_copy_value = other_element_value;
-
- __this__mapField.put(__this__mapField_copy_key, __this__mapField_copy_value);
- }
+ Map<String,Integer> __this__mapField = new HashMap<String,Integer>(other.mapField);
this.mapField = __this__mapField;
}
if (other.isSetListField()) {
- List<Integer> __this__listField = new ArrayList<Integer>();
- for (Integer other_element : other.listField) {
- __this__listField.add(other_element);
- }
+ List<Integer> __this__listField = new ArrayList<Integer>(other.listField);
this.listField = __this__listField;
}
if (other.isSetSetField()) {
- Set<Integer> __this__setField = new HashSet<Integer>();
- for (Integer other_element : other.setField) {
- __this__setField.add(other_element);
- }
+ Set<Integer> __this__setField = new HashSet<Integer>(other.setField);
this.setField = __this__setField;
}
if (other.isSetEnumField()) {
@@ -347,16 +347,16 @@ public class Test implements org.apache.
}
public void unsetBoolField() {
- __isset_bit_vector.clear(__BOOLFIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BOOLFIELD_ISSET_ID);
}
/** Returns true if field boolField is set (has been assigned a value) and false otherwise */
public boolean isSetBoolField() {
- return __isset_bit_vector.get(__BOOLFIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __BOOLFIELD_ISSET_ID);
}
public void setBoolFieldIsSet(boolean value) {
- __isset_bit_vector.set(__BOOLFIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BOOLFIELD_ISSET_ID, value);
}
public byte getByteField() {
@@ -369,16 +369,16 @@ public class Test implements org.apache.
}
public void unsetByteField() {
- __isset_bit_vector.clear(__BYTEFIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BYTEFIELD_ISSET_ID);
}
/** Returns true if field byteField is set (has been assigned a value) and false otherwise */
public boolean isSetByteField() {
- return __isset_bit_vector.get(__BYTEFIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __BYTEFIELD_ISSET_ID);
}
public void setByteFieldIsSet(boolean value) {
- __isset_bit_vector.set(__BYTEFIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BYTEFIELD_ISSET_ID, value);
}
public short getI16Field() {
@@ -391,16 +391,16 @@ public class Test implements org.apache.
}
public void unsetI16Field() {
- __isset_bit_vector.clear(__I16FIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I16FIELD_ISSET_ID);
}
/** Returns true if field i16Field is set (has been assigned a value) and false otherwise */
public boolean isSetI16Field() {
- return __isset_bit_vector.get(__I16FIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __I16FIELD_ISSET_ID);
}
public void setI16FieldIsSet(boolean value) {
- __isset_bit_vector.set(__I16FIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I16FIELD_ISSET_ID, value);
}
public short getI16OptionalField() {
@@ -413,16 +413,16 @@ public class Test implements org.apache.
}
public void unsetI16OptionalField() {
- __isset_bit_vector.clear(__I16OPTIONALFIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I16OPTIONALFIELD_ISSET_ID);
}
/** Returns true if field i16OptionalField is set (has been assigned a value) and false otherwise */
public boolean isSetI16OptionalField() {
- return __isset_bit_vector.get(__I16OPTIONALFIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __I16OPTIONALFIELD_ISSET_ID);
}
public void setI16OptionalFieldIsSet(boolean value) {
- __isset_bit_vector.set(__I16OPTIONALFIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I16OPTIONALFIELD_ISSET_ID, value);
}
public int getI32Field() {
@@ -435,16 +435,16 @@ public class Test implements org.apache.
}
public void unsetI32Field() {
- __isset_bit_vector.clear(__I32FIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I32FIELD_ISSET_ID);
}
/** Returns true if field i32Field is set (has been assigned a value) and false otherwise */
public boolean isSetI32Field() {
- return __isset_bit_vector.get(__I32FIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __I32FIELD_ISSET_ID);
}
public void setI32FieldIsSet(boolean value) {
- __isset_bit_vector.set(__I32FIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I32FIELD_ISSET_ID, value);
}
public long getI64Field() {
@@ -457,16 +457,16 @@ public class Test implements org.apache.
}
public void unsetI64Field() {
- __isset_bit_vector.clear(__I64FIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __I64FIELD_ISSET_ID);
}
/** Returns true if field i64Field is set (has been assigned a value) and false otherwise */
public boolean isSetI64Field() {
- return __isset_bit_vector.get(__I64FIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __I64FIELD_ISSET_ID);
}
public void setI64FieldIsSet(boolean value) {
- __isset_bit_vector.set(__I64FIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __I64FIELD_ISSET_ID, value);
}
public double getDoubleField() {
@@ -479,16 +479,16 @@ public class Test implements org.apache.
}
public void unsetDoubleField() {
- __isset_bit_vector.clear(__DOUBLEFIELD_ISSET_ID);
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DOUBLEFIELD_ISSET_ID);
}
/** Returns true if field doubleField is set (has been assigned a value) and false otherwise */
public boolean isSetDoubleField() {
- return __isset_bit_vector.get(__DOUBLEFIELD_ISSET_ID);
+ return EncodingUtils.testBit(__isset_bitfield, __DOUBLEFIELD_ISSET_ID);
}
public void setDoubleFieldIsSet(boolean value) {
- __isset_bit_vector.set(__DOUBLEFIELD_ISSET_ID, value);
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOUBLEFIELD_ISSET_ID, value);
}
public String getStringField() {
@@ -1106,160 +1106,160 @@ public class Test implements org.apache.
return 0;
}
+ @Override
public int compareTo(Test other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
- Test typedOther = (Test)other;
- lastComparison = Boolean.valueOf(isSetBoolField()).compareTo(typedOther.isSetBoolField());
+ lastComparison = Boolean.valueOf(isSetBoolField()).compareTo(other.isSetBoolField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBoolField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolField, typedOther.boolField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolField, other.boolField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetByteField()).compareTo(typedOther.isSetByteField());
+ lastComparison = Boolean.valueOf(isSetByteField()).compareTo(other.isSetByteField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetByteField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.byteField, typedOther.byteField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.byteField, other.byteField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetI16Field()).compareTo(typedOther.isSetI16Field());
+ lastComparison = Boolean.valueOf(isSetI16Field()).compareTo(other.isSetI16Field());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetI16Field()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i16Field, typedOther.i16Field);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i16Field, other.i16Field);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetI16OptionalField()).compareTo(typedOther.isSetI16OptionalField());
+ lastComparison = Boolean.valueOf(isSetI16OptionalField()).compareTo(other.isSetI16OptionalField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetI16OptionalField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i16OptionalField, typedOther.i16OptionalField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i16OptionalField, other.i16OptionalField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetI32Field()).compareTo(typedOther.isSetI32Field());
+ lastComparison = Boolean.valueOf(isSetI32Field()).compareTo(other.isSetI32Field());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetI32Field()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i32Field, typedOther.i32Field);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i32Field, other.i32Field);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetI64Field()).compareTo(typedOther.isSetI64Field());
+ lastComparison = Boolean.valueOf(isSetI64Field()).compareTo(other.isSetI64Field());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetI64Field()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i64Field, typedOther.i64Field);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.i64Field, other.i64Field);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetDoubleField()).compareTo(typedOther.isSetDoubleField());
+ lastComparison = Boolean.valueOf(isSetDoubleField()).compareTo(other.isSetDoubleField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetDoubleField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doubleField, typedOther.doubleField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doubleField, other.doubleField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetStringField()).compareTo(typedOther.isSetStringField());
+ lastComparison = Boolean.valueOf(isSetStringField()).compareTo(other.isSetStringField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStringField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringField, typedOther.stringField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringField, other.stringField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetBinaryField()).compareTo(typedOther.isSetBinaryField());
+ lastComparison = Boolean.valueOf(isSetBinaryField()).compareTo(other.isSetBinaryField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBinaryField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryField, typedOther.binaryField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryField, other.binaryField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetMapField()).compareTo(typedOther.isSetMapField());
+ lastComparison = Boolean.valueOf(isSetMapField()).compareTo(other.isSetMapField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMapField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapField, typedOther.mapField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mapField, other.mapField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetListField()).compareTo(typedOther.isSetListField());
+ lastComparison = Boolean.valueOf(isSetListField()).compareTo(other.isSetListField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetListField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listField, typedOther.listField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listField, other.listField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetSetField()).compareTo(typedOther.isSetSetField());
+ lastComparison = Boolean.valueOf(isSetSetField()).compareTo(other.isSetSetField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSetField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.setField, typedOther.setField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.setField, other.setField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetEnumField()).compareTo(typedOther.isSetEnumField());
+ lastComparison = Boolean.valueOf(isSetEnumField()).compareTo(other.isSetEnumField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEnumField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enumField, typedOther.enumField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enumField, other.enumField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetStructField()).compareTo(typedOther.isSetStructField());
+ lastComparison = Boolean.valueOf(isSetStructField()).compareTo(other.isSetStructField());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetStructField()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.structField, typedOther.structField);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.structField, other.structField);
if (lastComparison != 0) {
return lastComparison;
}
}
- lastComparison = Boolean.valueOf(isSetFooOrBar()).compareTo(typedOther.isSetFooOrBar());
+ lastComparison = Boolean.valueOf(isSetFooOrBar()).compareTo(other.isSetFooOrBar());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFooOrBar()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fooOrBar, typedOther.fooOrBar);
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fooOrBar, other.fooOrBar);
if (lastComparison != 0) {
return lastComparison;
}
@@ -1272,265 +1272,11 @@ public class Test implements org.apache.
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField field;
- iprot.readStructBegin();
- while (true)
- {
- field = iprot.readFieldBegin();
- if (field.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (field.id) {
- case 1: // BOOL_FIELD
- if (field.type == org.apache.thrift.protocol.TType.BOOL) {
- this.boolField = iprot.readBool();
- setBoolFieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 2: // BYTE_FIELD
- if (field.type == org.apache.thrift.protocol.TType.BYTE) {
- this.byteField = iprot.readByte();
- setByteFieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 3: // I16_FIELD
- if (field.type == org.apache.thrift.protocol.TType.I16) {
- this.i16Field = iprot.readI16();
- setI16FieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 15: // I16_OPTIONAL_FIELD
- if (field.type == org.apache.thrift.protocol.TType.I16) {
- this.i16OptionalField = iprot.readI16();
- setI16OptionalFieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 4: // I32_FIELD
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.i32Field = iprot.readI32();
- setI32FieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 5: // I64_FIELD
- if (field.type == org.apache.thrift.protocol.TType.I64) {
- this.i64Field = iprot.readI64();
- setI64FieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 6: // DOUBLE_FIELD
- if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
- this.doubleField = iprot.readDouble();
- setDoubleFieldIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 7: // STRING_FIELD
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.stringField = iprot.readString();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 8: // BINARY_FIELD
- if (field.type == org.apache.thrift.protocol.TType.STRING) {
- this.binaryField = iprot.readBinary();
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 9: // MAP_FIELD
- if (field.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
- this.mapField = new HashMap<String,Integer>(2*_map0.size);
- for (int _i1 = 0; _i1 < _map0.size; ++_i1)
- {
- String _key2; // required
- int _val3; // required
- _key2 = iprot.readString();
- _val3 = iprot.readI32();
- this.mapField.put(_key2, _val3);
- }
- iprot.readMapEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 10: // LIST_FIELD
- if (field.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
- this.listField = new ArrayList<Integer>(_list4.size);
- for (int _i5 = 0; _i5 < _list4.size; ++_i5)
- {
- int _elem6; // required
- _elem6 = iprot.readI32();
- this.listField.add(_elem6);
- }
- iprot.readListEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 11: // SET_FIELD
- if (field.type == org.apache.thrift.protocol.TType.SET) {
- {
- org.apache.thrift.protocol.TSet _set7 = iprot.readSetBegin();
- this.setField = new HashSet<Integer>(2*_set7.size);
- for (int _i8 = 0; _i8 < _set7.size; ++_i8)
- {
- int _elem9; // required
- _elem9 = iprot.readI32();
- this.setField.add(_elem9);
- }
- iprot.readSetEnd();
- }
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 12: // ENUM_FIELD
- if (field.type == org.apache.thrift.protocol.TType.I32) {
- this.enumField = E.findByValue(iprot.readI32());
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 13: // STRUCT_FIELD
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.structField = new Nested();
- this.structField.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case 14: // FOO_OR_BAR
- if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
- this.fooOrBar = new FooOrBar();
- this.fooOrBar.read(iprot);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- validate();
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(BOOL_FIELD_FIELD_DESC);
- oprot.writeBool(this.boolField);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(BYTE_FIELD_FIELD_DESC);
- oprot.writeByte(this.byteField);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(I16_FIELD_FIELD_DESC);
- oprot.writeI16(this.i16Field);
- oprot.writeFieldEnd();
- if (isSetI32Field()) {
- oprot.writeFieldBegin(I32_FIELD_FIELD_DESC);
- oprot.writeI32(this.i32Field);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(I64_FIELD_FIELD_DESC);
- oprot.writeI64(this.i64Field);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(DOUBLE_FIELD_FIELD_DESC);
- oprot.writeDouble(this.doubleField);
- oprot.writeFieldEnd();
- if (this.stringField != null) {
- oprot.writeFieldBegin(STRING_FIELD_FIELD_DESC);
- oprot.writeString(this.stringField);
- oprot.writeFieldEnd();
- }
- if (this.binaryField != null) {
- if (isSetBinaryField()) {
- oprot.writeFieldBegin(BINARY_FIELD_FIELD_DESC);
- oprot.writeBinary(this.binaryField);
- oprot.writeFieldEnd();
- }
- }
- if (this.mapField != null) {
- oprot.writeFieldBegin(MAP_FIELD_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, this.mapField.size()));
- for (Map.Entry<String, Integer> _iter10 : this.mapField.entrySet())
- {
- oprot.writeString(_iter10.getKey());
- oprot.writeI32(_iter10.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.listField != null) {
- oprot.writeFieldBegin(LIST_FIELD_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, this.listField.size()));
- for (int _iter11 : this.listField)
- {
- oprot.writeI32(_iter11);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.setField != null) {
- oprot.writeFieldBegin(SET_FIELD_FIELD_DESC);
- {
- oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, this.setField.size()));
- for (int _iter12 : this.setField)
- {
- oprot.writeI32(_iter12);
- }
- oprot.writeSetEnd();
- }
- oprot.writeFieldEnd();
- }
- if (this.enumField != null) {
- oprot.writeFieldBegin(ENUM_FIELD_FIELD_DESC);
- oprot.writeI32(this.enumField.getValue());
- oprot.writeFieldEnd();
- }
- if (this.structField != null) {
- oprot.writeFieldBegin(STRUCT_FIELD_FIELD_DESC);
- this.structField.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.fooOrBar != null) {
- oprot.writeFieldBegin(FOO_OR_BAR_FIELD_DESC);
- this.fooOrBar.write(oprot);
- oprot.writeFieldEnd();
- }
- if (isSetI16OptionalField()) {
- oprot.writeFieldBegin(I16_OPTIONAL_FIELD_FIELD_DESC);
- oprot.writeI16(this.i16OptionalField);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
@@ -1641,6 +1387,10 @@ public class Test implements org.apache.
public void validate() throws org.apache.thrift.TException {
// check for required fields
+ // check for sub-struct validity
+ if (structField != null) {
+ structField.validate();
+ }
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -1654,12 +1404,514 @@ public class Test implements org.apache.
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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_bit_vector = new BitSet(1);
+ __isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
+ private static class TestStandardSchemeFactory implements SchemeFactory {
+ public TestStandardScheme getScheme() {
+ return new TestStandardScheme();
+ }
+ }
+
+ private static class TestStandardScheme extends StandardScheme<Test> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, Test struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // BOOL_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+ struct.boolField = iprot.readBool();
+ struct.setBoolFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // BYTE_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
+ struct.byteField = iprot.readByte();
+ struct.setByteFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // I16_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
+ struct.i16Field = iprot.readI16();
+ struct.setI16FieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 15: // I16_OPTIONAL_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
+ struct.i16OptionalField = iprot.readI16();
+ struct.setI16OptionalFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // I32_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.i32Field = iprot.readI32();
+ struct.setI32FieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // I64_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.i64Field = iprot.readI64();
+ struct.setI64FieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // DOUBLE_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ struct.doubleField = iprot.readDouble();
+ struct.setDoubleFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 7: // STRING_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.stringField = iprot.readString();
+ struct.setStringFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 8: // BINARY_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.binaryField = iprot.readBinary();
+ struct.setBinaryFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 9: // MAP_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
+ struct.mapField = new HashMap<String,Integer>(2*_map0.size);
+ for (int _i1 = 0; _i1 < _map0.size; ++_i1)
+ {
+ String _key2;
+ int _val3;
+ _key2 = iprot.readString();
+ _val3 = iprot.readI32();
+ struct.mapField.put(_key2, _val3);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setMapFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 10: // LIST_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
+ struct.listField = new ArrayList<Integer>(_list4.size);
+ for (int _i5 = 0; _i5 < _list4.size; ++_i5)
+ {
+ int _elem6;
+ _elem6 = iprot.readI32();
+ struct.listField.add(_elem6);
+ }
+ iprot.readListEnd();
+ }
+ struct.setListFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 11: // SET_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
+ {
+ org.apache.thrift.protocol.TSet _set7 = iprot.readSetBegin();
+ struct.setField = new HashSet<Integer>(2*_set7.size);
+ for (int _i8 = 0; _i8 < _set7.size; ++_i8)
+ {
+ int _elem9;
+ _elem9 = iprot.readI32();
+ struct.setField.add(_elem9);
+ }
+ iprot.readSetEnd();
+ }
+ struct.setSetFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 12: // ENUM_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.enumField = E.findByValue(iprot.readI32());
+ struct.setEnumFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 13: // STRUCT_FIELD
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.structField = new Nested();
+ struct.structField.read(iprot);
+ struct.setStructFieldIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 14: // FOO_OR_BAR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.fooOrBar = new FooOrBar();
+ struct.fooOrBar.read(iprot);
+ struct.setFooOrBarIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, Test struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldBegin(BOOL_FIELD_FIELD_DESC);
+ oprot.writeBool(struct.boolField);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(BYTE_FIELD_FIELD_DESC);
+ oprot.writeByte(struct.byteField);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(I16_FIELD_FIELD_DESC);
+ oprot.writeI16(struct.i16Field);
+ oprot.writeFieldEnd();
+ if (struct.isSetI32Field()) {
+ oprot.writeFieldBegin(I32_FIELD_FIELD_DESC);
+ oprot.writeI32(struct.i32Field);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(I64_FIELD_FIELD_DESC);
+ oprot.writeI64(struct.i64Field);
+ oprot.writeFieldEnd();
+ oprot.writeFieldBegin(DOUBLE_FIELD_FIELD_DESC);
+ oprot.writeDouble(struct.doubleField);
+ oprot.writeFieldEnd();
+ if (struct.stringField != null) {
+ oprot.writeFieldBegin(STRING_FIELD_FIELD_DESC);
+ oprot.writeString(struct.stringField);
+ oprot.writeFieldEnd();
+ }
+ if (struct.binaryField != null) {
+ if (struct.isSetBinaryField()) {
+ oprot.writeFieldBegin(BINARY_FIELD_FIELD_DESC);
+ oprot.writeBinary(struct.binaryField);
+ oprot.writeFieldEnd();
+ }
+ }
+ if (struct.mapField != null) {
+ oprot.writeFieldBegin(MAP_FIELD_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.mapField.size()));
+ for (Map.Entry<String, Integer> _iter10 : struct.mapField.entrySet())
+ {
+ oprot.writeString(_iter10.getKey());
+ oprot.writeI32(_iter10.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.listField != null) {
+ oprot.writeFieldBegin(LIST_FIELD_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.listField.size()));
+ for (int _iter11 : struct.listField)
+ {
+ oprot.writeI32(_iter11);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.setField != null) {
+ oprot.writeFieldBegin(SET_FIELD_FIELD_DESC);
+ {
+ oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.setField.size()));
+ for (int _iter12 : struct.setField)
+ {
+ oprot.writeI32(_iter12);
+ }
+ oprot.writeSetEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.enumField != null) {
+ oprot.writeFieldBegin(ENUM_FIELD_FIELD_DESC);
+ oprot.writeI32(struct.enumField.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.structField != null) {
+ oprot.writeFieldBegin(STRUCT_FIELD_FIELD_DESC);
+ struct.structField.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.fooOrBar != null) {
+ oprot.writeFieldBegin(FOO_OR_BAR_FIELD_DESC);
+ struct.fooOrBar.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.isSetI16OptionalField()) {
+ oprot.writeFieldBegin(I16_OPTIONAL_FIELD_FIELD_DESC);
+ oprot.writeI16(struct.i16OptionalField);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TestTupleSchemeFactory implements SchemeFactory {
+ public TestTupleScheme getScheme() {
+ return new TestTupleScheme();
+ }
+ }
+
+ private static class TestTupleScheme extends TupleScheme<Test> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, Test struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetBoolField()) {
+ optionals.set(0);
+ }
+ if (struct.isSetByteField()) {
+ optionals.set(1);
+ }
+ if (struct.isSetI16Field()) {
+ optionals.set(2);
+ }
+ if (struct.isSetI16OptionalField()) {
+ optionals.set(3);
+ }
+ if (struct.isSetI32Field()) {
+ optionals.set(4);
+ }
+ if (struct.isSetI64Field()) {
+ optionals.set(5);
+ }
+ if (struct.isSetDoubleField()) {
+ optionals.set(6);
+ }
+ if (struct.isSetStringField()) {
+ optionals.set(7);
+ }
+ if (struct.isSetBinaryField()) {
+ optionals.set(8);
+ }
+ if (struct.isSetMapField()) {
+ optionals.set(9);
+ }
+ if (struct.isSetListField()) {
+ optionals.set(10);
+ }
+ if (struct.isSetSetField()) {
+ optionals.set(11);
+ }
+ if (struct.isSetEnumField()) {
+ optionals.set(12);
+ }
+ if (struct.isSetStructField()) {
+ optionals.set(13);
+ }
+ if (struct.isSetFooOrBar()) {
+ optionals.set(14);
+ }
+ oprot.writeBitSet(optionals, 15);
+ if (struct.isSetBoolField()) {
+ oprot.writeBool(struct.boolField);
+ }
+ if (struct.isSetByteField()) {
+ oprot.writeByte(struct.byteField);
+ }
+ if (struct.isSetI16Field()) {
+ oprot.writeI16(struct.i16Field);
+ }
+ if (struct.isSetI16OptionalField()) {
+ oprot.writeI16(struct.i16OptionalField);
+ }
+ if (struct.isSetI32Field()) {
+ oprot.writeI32(struct.i32Field);
+ }
+ if (struct.isSetI64Field()) {
+ oprot.writeI64(struct.i64Field);
+ }
+ if (struct.isSetDoubleField()) {
+ oprot.writeDouble(struct.doubleField);
+ }
+ if (struct.isSetStringField()) {
+ oprot.writeString(struct.stringField);
+ }
+ if (struct.isSetBinaryField()) {
+ oprot.writeBinary(struct.binaryField);
+ }
+ if (struct.isSetMapField()) {
+ {
+ oprot.writeI32(struct.mapField.size());
+ for (Map.Entry<String, Integer> _iter13 : struct.mapField.entrySet())
+ {
+ oprot.writeString(_iter13.getKey());
+ oprot.writeI32(_iter13.getValue());
+ }
+ }
+ }
+ if (struct.isSetListField()) {
+ {
+ oprot.writeI32(struct.listField.size());
+ for (int _iter14 : struct.listField)
+ {
+ oprot.writeI32(_iter14);
+ }
+ }
+ }
+ if (struct.isSetSetField()) {
+ {
+ oprot.writeI32(struct.setField.size());
+ for (int _iter15 : struct.setField)
+ {
+ oprot.writeI32(_iter15);
+ }
+ }
+ }
+ if (struct.isSetEnumField()) {
+ oprot.writeI32(struct.enumField.getValue());
+ }
+ if (struct.isSetStructField()) {
+ struct.structField.write(oprot);
+ }
+ if (struct.isSetFooOrBar()) {
+ struct.fooOrBar.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, Test struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(15);
+ if (incoming.get(0)) {
+ struct.boolField = iprot.readBool();
+ struct.setBoolFieldIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.byteField = iprot.readByte();
+ struct.setByteFieldIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.i16Field = iprot.readI16();
+ struct.setI16FieldIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.i16OptionalField = iprot.readI16();
+ struct.setI16OptionalFieldIsSet(true);
+ }
+ if (incoming.get(4)) {
+ struct.i32Field = iprot.readI32();
+ struct.setI32FieldIsSet(true);
+ }
+ if (incoming.get(5)) {
+ struct.i64Field = iprot.readI64();
+ struct.setI64FieldIsSet(true);
+ }
+ if (incoming.get(6)) {
+ struct.doubleField = iprot.readDouble();
+ struct.setDoubleFieldIsSet(true);
+ }
+ if (incoming.get(7)) {
+ struct.stringField = iprot.readString();
+ struct.setStringFieldIsSet(true);
+ }
+ if (incoming.get(8)) {
+ struct.binaryField = iprot.readBinary();
+ struct.setBinaryFieldIsSet(true);
+ }
+ if (incoming.get(9)) {
+ {
+ org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32());
+ struct.mapField = new HashMap<String,Integer>(2*_map16.size);
+ for (int _i17 = 0; _i17 < _map16.size; ++_i17)
+ {
+ String _key18;
+ int _val19;
+ _key18 = iprot.readString();
+ _val19 = iprot.readI32();
+ struct.mapField.put(_key18, _val19);
+ }
+ }
+ struct.setMapFieldIsSet(true);
+ }
+ if (incoming.get(10)) {
+ {
+ org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
+ struct.listField = new ArrayList<Integer>(_list20.size);
+ for (int _i21 = 0; _i21 < _list20.size; ++_i21)
+ {
+ int _elem22;
+ _elem22 = iprot.readI32();
+ struct.listField.add(_elem22);
+ }
+ }
+ struct.setListFieldIsSet(true);
+ }
+ if (incoming.get(11)) {
+ {
+ org.apache.thrift.protocol.TSet _set23 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
+ struct.setField = new HashSet<Integer>(2*_set23.size);
+ for (int _i24 = 0; _i24 < _set23.size; ++_i24)
+ {
+ int _elem25;
+ _elem25 = iprot.readI32();
+ struct.setField.add(_elem25);
+ }
+ }
+ struct.setSetFieldIsSet(true);
+ }
+ if (incoming.get(12)) {
+ struct.enumField = E.findByValue(iprot.readI32());
+ struct.setEnumFieldIsSet(true);
+ }
+ if (incoming.get(13)) {
+ struct.structField = new Nested();
+ struct.structField.read(iprot);
+ struct.setStructFieldIsSet(true);
+ }
+ if (incoming.get(14)) {
+ struct.fooOrBar = new FooOrBar();
+ struct.fooOrBar.read(iprot);
+ struct.setFooOrBarIsSet(true);
+ }
+ }
+ }
+
}
Modified: avro/trunk/lang/java/tools/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/pom.xml?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/pom.xml (original)
+++ avro/trunk/lang/java/tools/pom.xml Mon Sep 22 22:07:34 2014
@@ -59,6 +59,7 @@
<goal>shade</goal>
</goals>
<configuration>
+ <createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/BinaryFragmentToJsonTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/BinaryFragmentToJsonTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/BinaryFragmentToJsonTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/BinaryFragmentToJsonTool.java Mon Sep 22 22:07:34 2014
@@ -50,7 +50,7 @@ public class BinaryFragmentToJsonTool im
OptionSet optionSet = optionParser.parse(args.toArray(new String[0]));
Boolean noPretty = optionSet.has(noPrettyOption);
- List<String> nargs = optionSet.nonOptionArguments();
+ List<String> nargs = (List<String>)optionSet.nonOptionArguments();
String schemaFile = schemaFileOption.value(optionSet);
if (nargs.size() != (schemaFile == null ? 2 : 1)) {
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CatTool.java Mon Sep 22 22:07:34 2014
@@ -72,7 +72,7 @@ public class CatTool implements Tool {
.defaultsTo(new Double(1));
OptionSet opts = optParser.parse(args.toArray(new String[0]));
- List<String> nargs = opts.nonOptionArguments();
+ List<String> nargs = (List<String>)opts.nonOptionArguments();
if (nargs.size() < 2) {
printHelp(out);
return 0;
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CreateRandomFileTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CreateRandomFileTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CreateRandomFileTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/CreateRandomFileTool.java Mon Sep 22 22:07:34 2014
@@ -68,7 +68,7 @@ public class CreateRandomFileTool implem
p.printHelpOn(err);
return 1;
}
- args = opts.nonOptionArguments();
+ args = (List<String>)opts.nonOptionArguments();
String schemastr = inschema.value(opts);
String schemafile = file.value(opts);
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileGetMetaTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileGetMetaTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileGetMetaTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileGetMetaTool.java Mon Sep 22 22:07:34 2014
@@ -54,7 +54,7 @@ public class DataFileGetMetaTool impleme
OptionSet opts = p.parse(args.toArray(new String[0]));
String keyName = keyOption.value(opts);
- List<String> nargs = opts.nonOptionArguments();
+ List<String> nargs = (List<String>)opts.nonOptionArguments();
if (nargs.size() != 1) {
err.println("Expected 1 arg: input_file");
p.printHelpOn(err);
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileReadTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileReadTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileReadTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileReadTool.java Mon Sep 22 22:07:34 2014
@@ -56,7 +56,7 @@ public class DataFileReadTool implements
OptionSet optionSet = optionParser.parse(args.toArray(new String[0]));
Boolean pretty = optionSet.has(prettyOption);
- List<String> nargs = optionSet.nonOptionArguments();
+ List<String> nargs = (List<String>)optionSet.nonOptionArguments();
if (nargs.size() != 1) {
printHelp(err);
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileWriteTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileWriteTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileWriteTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/DataFileWriteTool.java Mon Sep 22 22:07:34 2014
@@ -66,7 +66,7 @@ public class DataFileWriteTool implement
.ofType(String.class);
OptionSet opts = p.parse(args.toArray(new String[0]));
- List<String> nargs = opts.nonOptionArguments();
+ List<String> nargs = (List<String>)opts.nonOptionArguments();
if (nargs.size() != 1) {
err.println("Expected 1 arg: input_file");
p.printHelpOn(err);
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/FromTextTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/FromTextTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/FromTextTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/FromTextTool.java Mon Sep 22 22:07:34 2014
@@ -61,7 +61,7 @@ public class FromTextTool implements Too
OptionSet opts = p.parse(args.toArray(new String[0]));
- List<String> nargs = opts.nonOptionArguments();
+ List<String> nargs = (List<String>)opts.nonOptionArguments();
if (nargs.size() != 2) {
err.println("Expected 2 args: from_file to_file (local filenames," +
" Hadoop URI's, or '-' for stdin/stdout");
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/JsonToBinaryFragmentTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/JsonToBinaryFragmentTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/JsonToBinaryFragmentTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/JsonToBinaryFragmentTool.java Mon Sep 22 22:07:34 2014
@@ -46,7 +46,7 @@ public class JsonToBinaryFragmentTool im
.ofType(String.class);
OptionSet optionSet = optionParser.parse(args.toArray(new String[0]));
- List<String> nargs = optionSet.nonOptionArguments();
+ List<String> nargs = (List<String>)optionSet.nonOptionArguments();
String schemaFile = schemaFileOption.value(optionSet);
if (nargs.size() != (schemaFile == null ? 2 : 1)) {
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RecodecTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RecodecTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RecodecTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RecodecTool.java Mon Sep 22 22:07:34 2014
@@ -46,7 +46,7 @@ public class RecodecTool implements Tool
OptionSpec<Integer> levelOpt = Util.compressionLevelOption(optParser);
OptionSet opts = optParser.parse(args.toArray(new String[0]));
- List<String> nargs = opts.nonOptionArguments();
+ List<String> nargs = (List<String>)opts.nonOptionArguments();
if (nargs.size() > 2) {
err.println("Expected at most an input file and output file.");
optParser.printHelpOn(err);
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcReceiveTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcReceiveTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcReceiveTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcReceiveTool.java Mon Sep 22 22:07:34 2014
@@ -132,7 +132,7 @@ public class RpcReceiveTool implements T
.withRequiredArg()
.ofType(String.class);
OptionSet opts = p.parse(args.toArray(new String[0]));
- args = opts.nonOptionArguments();
+ args = (List<String>)opts.nonOptionArguments();
if (args.size() != 3) {
err.println("Usage: uri protocol_file message_name (-data d | -file f)");
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/RpcSendTool.java Mon Sep 22 22:07:34 2014
@@ -68,7 +68,7 @@ public class RpcSendTool implements Tool
.withRequiredArg()
.ofType(String.class);
OptionSet opts = p.parse(args.toArray(new String[0]));
- args = opts.nonOptionArguments();
+ args = (List<String>)opts.nonOptionArguments();
if (args.size() != 3) {
err.println("Usage: uri protocol_file message_name (-data d | -file f)");
Modified: avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/ToTrevniTool.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/ToTrevniTool.java?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/ToTrevniTool.java (original)
+++ avro/trunk/lang/java/tools/src/main/java/org/apache/avro/tool/ToTrevniTool.java Mon Sep 22 22:07:34 2014
@@ -62,7 +62,7 @@ public class ToTrevniTool implements Too
p.printHelpOn(err);
return 1;
}
- args = opts.nonOptionArguments();
+ args = (List<String>)opts.nonOptionArguments();
DataFileStream<Object> reader =
new DataFileStream(Util.fileOrStdin(args.get(0), stdin),
Modified: avro/trunk/lang/java/trevni/avro/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/trevni/avro/pom.xml?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/trevni/avro/pom.xml (original)
+++ avro/trunk/lang/java/trevni/avro/pom.xml Mon Sep 22 22:07:34 2014
@@ -44,12 +44,6 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
Modified: avro/trunk/lang/java/trevni/core/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/trevni/core/pom.xml?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/trevni/core/pom.xml (original)
+++ avro/trunk/lang/java/trevni/core/pom.xml Mon Sep 22 22:07:34 2014
@@ -33,12 +33,6 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>
<version>${snappy.version}</version>
Modified: avro/trunk/lang/java/trevni/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/trevni/pom.xml?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/lang/java/trevni/pom.xml (original)
+++ avro/trunk/lang/java/trevni/pom.xml Mon Sep 22 22:07:34 2014
@@ -46,6 +46,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
+ <version>${surefire-plugin.version}</version>
<configuration>
<failIfNoTests>false</failIfNoTests>
</configuration>
@@ -80,6 +81,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
+ <version>${jar-plugin.version}</version>
<executions>
<execution>
<goals>
Modified: avro/trunk/pom.xml
URL: http://svn.apache.org/viewvc/avro/trunk/pom.xml?rev=1626912&r1=1626911&r2=1626912&view=diff
==============================================================================
--- avro/trunk/pom.xml (original)
+++ avro/trunk/pom.xml Mon Sep 22 22:07:34 2014
@@ -19,6 +19,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>2.2.1</maven>
+ </prerequisites>
+
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
@@ -47,7 +51,7 @@
<!-- plugin versions -->
<antrun-plugin.version>1.7</antrun-plugin.version>
- <enforcer-plugin.version>1.0.1</enforcer-plugin.version>
+ <enforcer-plugin.version>1.3.1</enforcer-plugin.version>
</properties>
<modules>