/** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package net.lag.kestrel.thrift; import org.apache.commons.lang3.builder.HashCodeBuilder; 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; public class QueueInfo implements org.apache.thrift.TBase<QueueInfo, QueueInfo._Fields>, java.io.Serializable, Cloneable, Comparable<QueueInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("QueueInfo"); private static final org.apache.thrift.protocol.TField HEAD_ITEM_FIELD_DESC = new org.apache.thrift.protocol.TField("head_item", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField ITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("items", org.apache.thrift.protocol.TType.I64, (short)2); private static final org.apache.thrift.protocol.TField BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("bytes", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField JOURNAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("journal_bytes", org.apache.thrift.protocol.TType.I64, (short)4); private static final org.apache.thrift.protocol.TField AGE_FIELD_DESC = new org.apache.thrift.protocol.TField("age", org.apache.thrift.protocol.TType.I64, (short)5); private static final org.apache.thrift.protocol.TField WAITERS_FIELD_DESC = new org.apache.thrift.protocol.TField("waiters", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.protocol.TField OPEN_TRANSACTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("open_transactions", org.apache.thrift.protocol.TType.I32, (short)7); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new QueueInfoStandardSchemeFactory()); schemes.put(TupleScheme.class, new QueueInfoTupleSchemeFactory()); } private ByteBuffer head_item; // optional private long items; // required private long bytes; // required private long journal_bytes; // required private long age; // required private int waiters; // required private int open_transactions; // 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 { HEAD_ITEM((short)1, "head_item"), ITEMS((short)2, "items"), BYTES((short)3, "bytes"), JOURNAL_BYTES((short)4, "journal_bytes"), AGE((short)5, "age"), WAITERS((short)6, "waiters"), OPEN_TRANSACTIONS((short)7, "open_transactions"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // HEAD_ITEM return HEAD_ITEM; case 2: // ITEMS return ITEMS; case 3: // BYTES return BYTES; case 4: // JOURNAL_BYTES return JOURNAL_BYTES; case 5: // AGE return AGE; case 6: // WAITERS return WAITERS; case 7: // OPEN_TRANSACTIONS return OPEN_TRANSACTIONS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new 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) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __ITEMS_ISSET_ID = 0; private static final int __BYTES_ISSET_ID = 1; private static final int __JOURNAL_BYTES_ISSET_ID = 2; private static final int __AGE_ISSET_ID = 3; private static final int __WAITERS_ISSET_ID = 4; private static final int __OPEN_TRANSACTIONS_ISSET_ID = 5; private byte __isset_bitfield = 0; private _Fields optionals[] = {_Fields.HEAD_ITEM}; 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); tmpMap.put(_Fields.HEAD_ITEM, new org.apache.thrift.meta_data.FieldMetaData("head_item", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.ITEMS, new org.apache.thrift.meta_data.FieldMetaData("items", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.BYTES, new org.apache.thrift.meta_data.FieldMetaData("bytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.JOURNAL_BYTES, new org.apache.thrift.meta_data.FieldMetaData("journal_bytes", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.AGE, new org.apache.thrift.meta_data.FieldMetaData("age", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.WAITERS, new org.apache.thrift.meta_data.FieldMetaData("waiters", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.OPEN_TRANSACTIONS, new org.apache.thrift.meta_data.FieldMetaData("open_transactions", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(QueueInfo.class, metaDataMap); } public QueueInfo() { } public QueueInfo( long items, long bytes, long journal_bytes, long age, int waiters, int open_transactions) { this(); this.items = items; set_items_isSet(true); this.bytes = bytes; set_bytes_isSet(true); this.journal_bytes = journal_bytes; set_journal_bytes_isSet(true); this.age = age; set_age_isSet(true); this.waiters = waiters; set_waiters_isSet(true); this.open_transactions = open_transactions; set_open_transactions_isSet(true); } /** * Performs a deep copy on <i>other</i>. */ public QueueInfo(QueueInfo other) { __isset_bitfield = other.__isset_bitfield; if (other.is_set_head_item()) { this.head_item = org.apache.thrift.TBaseHelper.copyBinary(other.head_item); ; } this.items = other.items; this.bytes = other.bytes; this.journal_bytes = other.journal_bytes; this.age = other.age; this.waiters = other.waiters; this.open_transactions = other.open_transactions; } public QueueInfo deepCopy() { return new QueueInfo(this); } @Override public void clear() { this.head_item = null; set_items_isSet(false); this.items = 0; set_bytes_isSet(false); this.bytes = 0; set_journal_bytes_isSet(false); this.journal_bytes = 0; set_age_isSet(false); this.age = 0; set_waiters_isSet(false); this.waiters = 0; set_open_transactions_isSet(false); this.open_transactions = 0; } public byte[] get_head_item() { set_head_item(org.apache.thrift.TBaseHelper.rightSize(head_item)); return head_item == null ? null : head_item.array(); } public ByteBuffer buffer_for_head_item() { return head_item; } public void set_head_item(byte[] head_item) { set_head_item(head_item == null ? (ByteBuffer)null : ByteBuffer.wrap(head_item)); } public void set_head_item(ByteBuffer head_item) { this.head_item = head_item; } public void unset_head_item() { this.head_item = null; } /** Returns true if field head_item is set (has been assigned a value) and false otherwise */ public boolean is_set_head_item() { return this.head_item != null; } public void set_head_item_isSet(boolean value) { if (!value) { this.head_item = null; } } public long get_items() { return this.items; } public void set_items(long items) { this.items = items; set_items_isSet(true); } public void unset_items() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ITEMS_ISSET_ID); } /** Returns true if field items is set (has been assigned a value) and false otherwise */ public boolean is_set_items() { return EncodingUtils.testBit(__isset_bitfield, __ITEMS_ISSET_ID); } public void set_items_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ITEMS_ISSET_ID, value); } public long get_bytes() { return this.bytes; } public void set_bytes(long bytes) { this.bytes = bytes; set_bytes_isSet(true); } public void unset_bytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BYTES_ISSET_ID); } /** Returns true if field bytes is set (has been assigned a value) and false otherwise */ public boolean is_set_bytes() { return EncodingUtils.testBit(__isset_bitfield, __BYTES_ISSET_ID); } public void set_bytes_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BYTES_ISSET_ID, value); } public long get_journal_bytes() { return this.journal_bytes; } public void set_journal_bytes(long journal_bytes) { this.journal_bytes = journal_bytes; set_journal_bytes_isSet(true); } public void unset_journal_bytes() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JOURNAL_BYTES_ISSET_ID); } /** Returns true if field journal_bytes is set (has been assigned a value) and false otherwise */ public boolean is_set_journal_bytes() { return EncodingUtils.testBit(__isset_bitfield, __JOURNAL_BYTES_ISSET_ID); } public void set_journal_bytes_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JOURNAL_BYTES_ISSET_ID, value); } public long get_age() { return this.age; } public void set_age(long age) { this.age = age; set_age_isSet(true); } public void unset_age() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGE_ISSET_ID); } /** Returns true if field age is set (has been assigned a value) and false otherwise */ public boolean is_set_age() { return EncodingUtils.testBit(__isset_bitfield, __AGE_ISSET_ID); } public void set_age_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGE_ISSET_ID, value); } public int get_waiters() { return this.waiters; } public void set_waiters(int waiters) { this.waiters = waiters; set_waiters_isSet(true); } public void unset_waiters() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WAITERS_ISSET_ID); } /** Returns true if field waiters is set (has been assigned a value) and false otherwise */ public boolean is_set_waiters() { return EncodingUtils.testBit(__isset_bitfield, __WAITERS_ISSET_ID); } public void set_waiters_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WAITERS_ISSET_ID, value); } public int get_open_transactions() { return this.open_transactions; } public void set_open_transactions(int open_transactions) { this.open_transactions = open_transactions; set_open_transactions_isSet(true); } public void unset_open_transactions() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPEN_TRANSACTIONS_ISSET_ID); } /** Returns true if field open_transactions is set (has been assigned a value) and false otherwise */ public boolean is_set_open_transactions() { return EncodingUtils.testBit(__isset_bitfield, __OPEN_TRANSACTIONS_ISSET_ID); } public void set_open_transactions_isSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPEN_TRANSACTIONS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case HEAD_ITEM: if (value == null) { unset_head_item(); } else { set_head_item((ByteBuffer)value); } break; case ITEMS: if (value == null) { unset_items(); } else { set_items((Long)value); } break; case BYTES: if (value == null) { unset_bytes(); } else { set_bytes((Long)value); } break; case JOURNAL_BYTES: if (value == null) { unset_journal_bytes(); } else { set_journal_bytes((Long)value); } break; case AGE: if (value == null) { unset_age(); } else { set_age((Long)value); } break; case WAITERS: if (value == null) { unset_waiters(); } else { set_waiters((Integer)value); } break; case OPEN_TRANSACTIONS: if (value == null) { unset_open_transactions(); } else { set_open_transactions((Integer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case HEAD_ITEM: return get_head_item(); case ITEMS: return Long.valueOf(get_items()); case BYTES: return Long.valueOf(get_bytes()); case JOURNAL_BYTES: return Long.valueOf(get_journal_bytes()); case AGE: return Long.valueOf(get_age()); case WAITERS: return Integer.valueOf(get_waiters()); case OPEN_TRANSACTIONS: return Integer.valueOf(get_open_transactions()); } throw new 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(); } switch (field) { case HEAD_ITEM: return is_set_head_item(); case ITEMS: return is_set_items(); case BYTES: return is_set_bytes(); case JOURNAL_BYTES: return is_set_journal_bytes(); case AGE: return is_set_age(); case WAITERS: return is_set_waiters(); case OPEN_TRANSACTIONS: return is_set_open_transactions(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof QueueInfo) return this.equals((QueueInfo)that); return false; } public boolean equals(QueueInfo that) { if (that == null) return false; boolean this_present_head_item = true && this.is_set_head_item(); boolean that_present_head_item = true && that.is_set_head_item(); if (this_present_head_item || that_present_head_item) { if (!(this_present_head_item && that_present_head_item)) return false; if (!this.head_item.equals(that.head_item)) return false; } boolean this_present_items = true; boolean that_present_items = true; if (this_present_items || that_present_items) { if (!(this_present_items && that_present_items)) return false; if (this.items != that.items) return false; } boolean this_present_bytes = true; boolean that_present_bytes = true; if (this_present_bytes || that_present_bytes) { if (!(this_present_bytes && that_present_bytes)) return false; if (this.bytes != that.bytes) return false; } boolean this_present_journal_bytes = true; boolean that_present_journal_bytes = true; if (this_present_journal_bytes || that_present_journal_bytes) { if (!(this_present_journal_bytes && that_present_journal_bytes)) return false; if (this.journal_bytes != that.journal_bytes) return false; } boolean this_present_age = true; boolean that_present_age = true; if (this_present_age || that_present_age) { if (!(this_present_age && that_present_age)) return false; if (this.age != that.age) return false; } boolean this_present_waiters = true; boolean that_present_waiters = true; if (this_present_waiters || that_present_waiters) { if (!(this_present_waiters && that_present_waiters)) return false; if (this.waiters != that.waiters) return false; } boolean this_present_open_transactions = true; boolean that_present_open_transactions = true; if (this_present_open_transactions || that_present_open_transactions) { if (!(this_present_open_transactions && that_present_open_transactions)) return false; if (this.open_transactions != that.open_transactions) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_head_item = true && (is_set_head_item()); builder.append(present_head_item); if (present_head_item) builder.append(head_item); boolean present_items = true; builder.append(present_items); if (present_items) builder.append(items); boolean present_bytes = true; builder.append(present_bytes); if (present_bytes) builder.append(bytes); boolean present_journal_bytes = true; builder.append(present_journal_bytes); if (present_journal_bytes) builder.append(journal_bytes); boolean present_age = true; builder.append(present_age); if (present_age) builder.append(age); boolean present_waiters = true; builder.append(present_waiters); if (present_waiters) builder.append(waiters); boolean present_open_transactions = true; builder.append(present_open_transactions); if (present_open_transactions) builder.append(open_transactions); return builder.toHashCode(); } @Override public int compareTo(QueueInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(is_set_head_item()).compareTo(other.is_set_head_item()); if (lastComparison != 0) { return lastComparison; } if (is_set_head_item()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.head_item, other.head_item); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_items()).compareTo(other.is_set_items()); if (lastComparison != 0) { return lastComparison; } if (is_set_items()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.items, other.items); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_bytes()).compareTo(other.is_set_bytes()); if (lastComparison != 0) { return lastComparison; } if (is_set_bytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bytes, other.bytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_journal_bytes()).compareTo(other.is_set_journal_bytes()); if (lastComparison != 0) { return lastComparison; } if (is_set_journal_bytes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.journal_bytes, other.journal_bytes); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_age()).compareTo(other.is_set_age()); if (lastComparison != 0) { return lastComparison; } if (is_set_age()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.age, other.age); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_waiters()).compareTo(other.is_set_waiters()); if (lastComparison != 0) { return lastComparison; } if (is_set_waiters()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.waiters, other.waiters); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_open_transactions()).compareTo(other.is_set_open_transactions()); if (lastComparison != 0) { return lastComparison; } if (is_set_open_transactions()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.open_transactions, other.open_transactions); if (lastComparison != 0) { return lastComparison; } } return 0; } 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); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("QueueInfo("); boolean first = true; if (is_set_head_item()) { sb.append("head_item:"); if (this.head_item == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.head_item, sb); } first = false; } if (!first) sb.append(", "); sb.append("items:"); sb.append(this.items); first = false; if (!first) sb.append(", "); sb.append("bytes:"); sb.append(this.bytes); first = false; if (!first) sb.append(", "); sb.append("journal_bytes:"); sb.append(this.journal_bytes); first = false; if (!first) sb.append(", "); sb.append("age:"); sb.append(this.age); first = false; if (!first) sb.append(", "); sb.append("waiters:"); sb.append(this.waiters); first = false; if (!first) sb.append(", "); sb.append("open_transactions:"); sb.append(this.open_transactions); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } 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_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 QueueInfoStandardSchemeFactory implements SchemeFactory { public QueueInfoStandardScheme getScheme() { return new QueueInfoStandardScheme(); } } private static class QueueInfoStandardScheme extends StandardScheme<QueueInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, QueueInfo 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: // HEAD_ITEM if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.head_item = iprot.readBinary(); struct.set_head_item_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // ITEMS if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.items = iprot.readI64(); struct.set_items_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.bytes = iprot.readI64(); struct.set_bytes_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // JOURNAL_BYTES if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.journal_bytes = iprot.readI64(); struct.set_journal_bytes_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // AGE if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.age = iprot.readI64(); struct.set_age_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // WAITERS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.waiters = iprot.readI32(); struct.set_waiters_isSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // OPEN_TRANSACTIONS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.open_transactions = iprot.readI32(); struct.set_open_transactions_isSet(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, QueueInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.head_item != null) { if (struct.is_set_head_item()) { oprot.writeFieldBegin(HEAD_ITEM_FIELD_DESC); oprot.writeBinary(struct.head_item); oprot.writeFieldEnd(); } } oprot.writeFieldBegin(ITEMS_FIELD_DESC); oprot.writeI64(struct.items); oprot.writeFieldEnd(); oprot.writeFieldBegin(BYTES_FIELD_DESC); oprot.writeI64(struct.bytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(JOURNAL_BYTES_FIELD_DESC); oprot.writeI64(struct.journal_bytes); oprot.writeFieldEnd(); oprot.writeFieldBegin(AGE_FIELD_DESC); oprot.writeI64(struct.age); oprot.writeFieldEnd(); oprot.writeFieldBegin(WAITERS_FIELD_DESC); oprot.writeI32(struct.waiters); oprot.writeFieldEnd(); oprot.writeFieldBegin(OPEN_TRANSACTIONS_FIELD_DESC); oprot.writeI32(struct.open_transactions); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class QueueInfoTupleSchemeFactory implements SchemeFactory { public QueueInfoTupleScheme getScheme() { return new QueueInfoTupleScheme(); } } private static class QueueInfoTupleScheme extends TupleScheme<QueueInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, QueueInfo struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.is_set_head_item()) { optionals.set(0); } if (struct.is_set_items()) { optionals.set(1); } if (struct.is_set_bytes()) { optionals.set(2); } if (struct.is_set_journal_bytes()) { optionals.set(3); } if (struct.is_set_age()) { optionals.set(4); } if (struct.is_set_waiters()) { optionals.set(5); } if (struct.is_set_open_transactions()) { optionals.set(6); } oprot.writeBitSet(optionals, 7); if (struct.is_set_head_item()) { oprot.writeBinary(struct.head_item); } if (struct.is_set_items()) { oprot.writeI64(struct.items); } if (struct.is_set_bytes()) { oprot.writeI64(struct.bytes); } if (struct.is_set_journal_bytes()) { oprot.writeI64(struct.journal_bytes); } if (struct.is_set_age()) { oprot.writeI64(struct.age); } if (struct.is_set_waiters()) { oprot.writeI32(struct.waiters); } if (struct.is_set_open_transactions()) { oprot.writeI32(struct.open_transactions); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, QueueInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(7); if (incoming.get(0)) { struct.head_item = iprot.readBinary(); struct.set_head_item_isSet(true); } if (incoming.get(1)) { struct.items = iprot.readI64(); struct.set_items_isSet(true); } if (incoming.get(2)) { struct.bytes = iprot.readI64(); struct.set_bytes_isSet(true); } if (incoming.get(3)) { struct.journal_bytes = iprot.readI64(); struct.set_journal_bytes_isSet(true); } if (incoming.get(4)) { struct.age = iprot.readI64(); struct.set_age_isSet(true); } if (incoming.get(5)) { struct.waiters = iprot.readI32(); struct.set_waiters_isSet(true); } if (incoming.get(6)) { struct.open_transactions = iprot.readI32(); struct.set_open_transactions_isSet(true); } } } }