/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package edu.berkeley.thebes.hat.common.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 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 AntiEntropyService { public interface Iface { public void put(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value) throws org.apache.thrift.TException; public void ackTransactionPending(ByteBuffer transactionIds) throws org.apache.thrift.TException; } public interface AsyncIface { public void put(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.put_call> resultHandler) throws org.apache.thrift.TException; public void ackTransactionPending(ByteBuffer transactionIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.ackTransactionPending_call> resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public void put(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value) throws org.apache.thrift.TException { send_put(key, value); } public void send_put(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value) throws org.apache.thrift.TException { put_args args = new put_args(); args.setKey(key); args.setValue(value); sendBase("put", args); } public void ackTransactionPending(ByteBuffer transactionIds) throws org.apache.thrift.TException { send_ackTransactionPending(transactionIds); } public void send_ackTransactionPending(ByteBuffer transactionIds) throws org.apache.thrift.TException { ackTransactionPending_args args = new ackTransactionPending_args(); args.setTransactionIds(transactionIds); sendBase("ackTransactionPending", args); } } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void put(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value, org.apache.thrift.async.AsyncMethodCallback<put_call> resultHandler) throws org.apache.thrift.TException { checkReady(); put_call method_call = new put_call(key, value, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class put_call extends org.apache.thrift.async.TAsyncMethodCall { private List<String> key; private List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value; public put_call(List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value, org.apache.thrift.async.AsyncMethodCallback<put_call> 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.key = key; this.value = value; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("put", org.apache.thrift.protocol.TMessageType.CALL, 0)); put_args args = new put_args(); args.setKey(key); args.setValue(value); args.write(prot); prot.writeMessageEnd(); } 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!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); } } public void ackTransactionPending(ByteBuffer transactionIds, org.apache.thrift.async.AsyncMethodCallback<ackTransactionPending_call> resultHandler) throws org.apache.thrift.TException { checkReady(); ackTransactionPending_call method_call = new ackTransactionPending_call(transactionIds, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class ackTransactionPending_call extends org.apache.thrift.async.TAsyncMethodCall { private ByteBuffer transactionIds; public ackTransactionPending_call(ByteBuffer transactionIds, org.apache.thrift.async.AsyncMethodCallback<ackTransactionPending_call> 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.transactionIds = transactionIds; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ackTransactionPending", org.apache.thrift.protocol.TMessageType.CALL, 0)); ackTransactionPending_args args = new ackTransactionPending_args(); args.setTransactionIds(transactionIds); args.write(prot); prot.writeMessageEnd(); } 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!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); } } } 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()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<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) { 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) { processMap.put("put", new put()); processMap.put("ackTransactionPending", new ackTransactionPending()); return processMap; } public static class put<I extends Iface> extends org.apache.thrift.ProcessFunction<I, put_args> { public put() { super("put"); } public put_args getEmptyArgsInstance() { return new put_args(); } protected boolean isOneway() { return true; } public org.apache.thrift.TBase getResult(I iface, put_args args) throws org.apache.thrift.TException { iface.put(args.key, args.value); return null; } } public static class ackTransactionPending<I extends Iface> extends org.apache.thrift.ProcessFunction<I, ackTransactionPending_args> { public ackTransactionPending() { super("ackTransactionPending"); } public ackTransactionPending_args getEmptyArgsInstance() { return new ackTransactionPending_args(); } protected boolean isOneway() { return true; } public org.apache.thrift.TBase getResult(I iface, ackTransactionPending_args args) throws org.apache.thrift.TException { iface.ackTransactionPending(args.transactionIds); return null; } } } public static class put_args implements org.apache.thrift.TBase<put_args, put_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("put_args"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.LIST, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new put_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new put_argsTupleSchemeFactory()); } public List<String> key; // required public List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value; // 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 { KEY((short)1, "key"), VALUE((short)2, "value"); 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: // KEY return KEY; case 2: // VALUE return VALUE; 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 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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, edu.berkeley.thebes.common.thrift.ThriftDataItem.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(put_args.class, metaDataMap); } public put_args() { } public put_args( List<String> key, List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value) { this(); this.key = key; this.value = value; } /** * Performs a deep copy on <i>other</i>. */ public put_args(put_args other) { if (other.isSetKey()) { List<String> __this__key = new ArrayList<String>(); for (String other_element : other.key) { __this__key.add(other_element); } this.key = __this__key; } if (other.isSetValue()) { List<edu.berkeley.thebes.common.thrift.ThriftDataItem> __this__value = new ArrayList<edu.berkeley.thebes.common.thrift.ThriftDataItem>(); for (edu.berkeley.thebes.common.thrift.ThriftDataItem other_element : other.value) { __this__value.add(new edu.berkeley.thebes.common.thrift.ThriftDataItem(other_element)); } this.value = __this__value; } } public put_args deepCopy() { return new put_args(this); } @Override public void clear() { this.key = null; this.value = null; } public int getKeySize() { return (this.key == null) ? 0 : this.key.size(); } public java.util.Iterator<String> getKeyIterator() { return (this.key == null) ? null : this.key.iterator(); } public void addToKey(String elem) { if (this.key == null) { this.key = new ArrayList<String>(); } this.key.add(elem); } public List<String> getKey() { return this.key; } public put_args setKey(List<String> key) { this.key = key; return this; } public void unsetKey() { this.key = null; } /** Returns true if field key is set (has been assigned a value) and false otherwise */ public boolean isSetKey() { return this.key != null; } public void setKeyIsSet(boolean value) { if (!value) { this.key = null; } } public int getValueSize() { return (this.value == null) ? 0 : this.value.size(); } public java.util.Iterator<edu.berkeley.thebes.common.thrift.ThriftDataItem> getValueIterator() { return (this.value == null) ? null : this.value.iterator(); } public void addToValue(edu.berkeley.thebes.common.thrift.ThriftDataItem elem) { if (this.value == null) { this.value = new ArrayList<edu.berkeley.thebes.common.thrift.ThriftDataItem>(); } this.value.add(elem); } public List<edu.berkeley.thebes.common.thrift.ThriftDataItem> getValue() { return this.value; } public put_args setValue(List<edu.berkeley.thebes.common.thrift.ThriftDataItem> value) { this.value = value; return this; } public void unsetValue() { this.value = null; } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { return this.value != null; } public void setValueIsSet(boolean value) { if (!value) { this.value = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((List<String>)value); } break; case VALUE: if (value == null) { unsetValue(); } else { setValue((List<edu.berkeley.thebes.common.thrift.ThriftDataItem>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case VALUE: return getValue(); } 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 KEY: return isSetKey(); case VALUE: return isSetValue(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof put_args) return this.equals((put_args)that); return false; } public boolean equals(put_args that) { if (that == null) return false; boolean this_present_key = true && this.isSetKey(); boolean that_present_key = true && that.isSetKey(); if (this_present_key || that_present_key) { if (!(this_present_key && that_present_key)) return false; if (!this.key.equals(that.key)) return false; } boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; if (!this.value.equals(that.value)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(put_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; put_args typedOther = (put_args)other; lastComparison = Boolean.valueOf(isSetKey()).compareTo(typedOther.isSetKey()); if (lastComparison != 0) { return lastComparison; } if (isSetKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, typedOther.key); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); if (lastComparison != 0) { return lastComparison; } if (isSetValue()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); 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("put_args("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (!first) sb.append(", "); sb.append("value:"); if (this.value == null) { sb.append("null"); } else { sb.append(this.value); } 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 { 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 put_argsStandardSchemeFactory implements SchemeFactory { public put_argsStandardScheme getScheme() { return new put_argsStandardScheme(); } } private static class put_argsStandardScheme extends StandardScheme<put_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, put_args 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: // KEY if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.key = new ArrayList<String>(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { String _elem2; // required _elem2 = iprot.readString(); struct.key.add(_elem2); } iprot.readListEnd(); } struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // VALUE if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); struct.value = new ArrayList<edu.berkeley.thebes.common.thrift.ThriftDataItem>(_list3.size); for (int _i4 = 0; _i4 < _list3.size; ++_i4) { edu.berkeley.thebes.common.thrift.ThriftDataItem _elem5; // required _elem5 = new edu.berkeley.thebes.common.thrift.ThriftDataItem(); _elem5.read(iprot); struct.value.add(_elem5); } iprot.readListEnd(); } struct.setValueIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, put_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.key.size())); for (String _iter6 : struct.key) { oprot.writeString(_iter6); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.value != null) { oprot.writeFieldBegin(VALUE_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.value.size())); for (edu.berkeley.thebes.common.thrift.ThriftDataItem _iter7 : struct.value) { _iter7.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class put_argsTupleSchemeFactory implements SchemeFactory { public put_argsTupleScheme getScheme() { return new put_argsTupleScheme(); } } private static class put_argsTupleScheme extends TupleScheme<put_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } if (struct.isSetValue()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetKey()) { { oprot.writeI32(struct.key.size()); for (String _iter8 : struct.key) { oprot.writeString(_iter8); } } } if (struct.isSetValue()) { { oprot.writeI32(struct.value.size()); for (edu.berkeley.thebes.common.thrift.ThriftDataItem _iter9 : struct.value) { _iter9.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, put_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.key = new ArrayList<String>(_list10.size); for (int _i11 = 0; _i11 < _list10.size; ++_i11) { String _elem12; // required _elem12 = iprot.readString(); struct.key.add(_elem12); } } struct.setKeyIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.value = new ArrayList<edu.berkeley.thebes.common.thrift.ThriftDataItem>(_list13.size); for (int _i14 = 0; _i14 < _list13.size; ++_i14) { edu.berkeley.thebes.common.thrift.ThriftDataItem _elem15; // required _elem15 = new edu.berkeley.thebes.common.thrift.ThriftDataItem(); _elem15.read(iprot); struct.value.add(_elem15); } } struct.setValueIsSet(true); } } } } public static class ackTransactionPending_args implements org.apache.thrift.TBase<ackTransactionPending_args, ackTransactionPending_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ackTransactionPending_args"); private static final org.apache.thrift.protocol.TField TRANSACTION_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionIds", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new ackTransactionPending_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new ackTransactionPending_argsTupleSchemeFactory()); } public ByteBuffer transactionIds; // 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 { TRANSACTION_IDS((short)1, "transactionIds"); 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: // TRANSACTION_IDS return TRANSACTION_IDS; 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 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.TRANSACTION_IDS, new org.apache.thrift.meta_data.FieldMetaData("transactionIds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ackTransactionPending_args.class, metaDataMap); } public ackTransactionPending_args() { } public ackTransactionPending_args( ByteBuffer transactionIds) { this(); this.transactionIds = transactionIds; } /** * Performs a deep copy on <i>other</i>. */ public ackTransactionPending_args(ackTransactionPending_args other) { if (other.isSetTransactionIds()) { this.transactionIds = org.apache.thrift.TBaseHelper.copyBinary(other.transactionIds); ; } } public ackTransactionPending_args deepCopy() { return new ackTransactionPending_args(this); } @Override public void clear() { this.transactionIds = null; } public byte[] getTransactionIds() { setTransactionIds(org.apache.thrift.TBaseHelper.rightSize(transactionIds)); return transactionIds == null ? null : transactionIds.array(); } public ByteBuffer bufferForTransactionIds() { return transactionIds; } public ackTransactionPending_args setTransactionIds(byte[] transactionIds) { setTransactionIds(transactionIds == null ? (ByteBuffer)null : ByteBuffer.wrap(transactionIds)); return this; } public ackTransactionPending_args setTransactionIds(ByteBuffer transactionIds) { this.transactionIds = transactionIds; return this; } public void unsetTransactionIds() { this.transactionIds = null; } /** Returns true if field transactionIds is set (has been assigned a value) and false otherwise */ public boolean isSetTransactionIds() { return this.transactionIds != null; } public void setTransactionIdsIsSet(boolean value) { if (!value) { this.transactionIds = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case TRANSACTION_IDS: if (value == null) { unsetTransactionIds(); } else { setTransactionIds((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case TRANSACTION_IDS: return getTransactionIds(); } 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 TRANSACTION_IDS: return isSetTransactionIds(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ackTransactionPending_args) return this.equals((ackTransactionPending_args)that); return false; } public boolean equals(ackTransactionPending_args that) { if (that == null) return false; boolean this_present_transactionIds = true && this.isSetTransactionIds(); boolean that_present_transactionIds = true && that.isSetTransactionIds(); if (this_present_transactionIds || that_present_transactionIds) { if (!(this_present_transactionIds && that_present_transactionIds)) return false; if (!this.transactionIds.equals(that.transactionIds)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(ackTransactionPending_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; ackTransactionPending_args typedOther = (ackTransactionPending_args)other; lastComparison = Boolean.valueOf(isSetTransactionIds()).compareTo(typedOther.isSetTransactionIds()); if (lastComparison != 0) { return lastComparison; } if (isSetTransactionIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionIds, typedOther.transactionIds); 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("ackTransactionPending_args("); boolean first = true; sb.append("transactionIds:"); if (this.transactionIds == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.transactionIds, sb); } 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 { 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 ackTransactionPending_argsStandardSchemeFactory implements SchemeFactory { public ackTransactionPending_argsStandardScheme getScheme() { return new ackTransactionPending_argsStandardScheme(); } } private static class ackTransactionPending_argsStandardScheme extends StandardScheme<ackTransactionPending_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, ackTransactionPending_args 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: // TRANSACTION_IDS if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.transactionIds = iprot.readBinary(); struct.setTransactionIdsIsSet(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(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, ackTransactionPending_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.transactionIds != null) { oprot.writeFieldBegin(TRANSACTION_IDS_FIELD_DESC); oprot.writeBinary(struct.transactionIds); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class ackTransactionPending_argsTupleSchemeFactory implements SchemeFactory { public ackTransactionPending_argsTupleScheme getScheme() { return new ackTransactionPending_argsTupleScheme(); } } private static class ackTransactionPending_argsTupleScheme extends TupleScheme<ackTransactionPending_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ackTransactionPending_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetTransactionIds()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetTransactionIds()) { oprot.writeBinary(struct.transactionIds); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ackTransactionPending_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.transactionIds = iprot.readBinary(); struct.setTransactionIdsIsSet(true); } } } } }