/** * Autogenerated by Thrift Compiler (0.8.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.rubiconproject.oss.kv.gen; import org.apache.commons.lang.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 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 KeyValueService { public interface Iface { public boolean exists(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException; public GetResult getValue(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException; public Map<String,GetResult> getBulk(List<String> keys) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException; public void setValue(String key, ByteBuffer data) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException; public void deleteValue(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException; } public interface AsyncIface { public void exists(String key, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.exists_call> resultHandler) throws org.apache.thrift.TException; public void getValue(String key, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getValue_call> resultHandler) throws org.apache.thrift.TException; public void getBulk(List<String> keys, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getBulk_call> resultHandler) throws org.apache.thrift.TException; public void setValue(String key, ByteBuffer data, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.setValue_call> resultHandler) throws org.apache.thrift.TException; public void deleteValue(String key, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteValue_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 boolean exists(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { send_exists(key); return recv_exists(); } public void send_exists(String key) throws org.apache.thrift.TException { exists_args args = new exists_args(); args.setKey(key); sendBase("exists", args); } public boolean recv_exists() throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { exists_result result = new exists_result(); receiveBase(result, "exists"); if (result.isSetSuccess()) { return result.success; } if (result.ioException != null) { throw result.ioException; } if (result.keyValueStoreException != null) { throw result.keyValueStoreException; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exists failed: unknown result"); } public GetResult getValue(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { send_getValue(key); return recv_getValue(); } public void send_getValue(String key) throws org.apache.thrift.TException { getValue_args args = new getValue_args(); args.setKey(key); sendBase("getValue", args); } public GetResult recv_getValue() throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { getValue_result result = new getValue_result(); receiveBase(result, "getValue"); if (result.isSetSuccess()) { return result.success; } if (result.ioException != null) { throw result.ioException; } if (result.keyValueStoreException != null) { throw result.keyValueStoreException; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getValue failed: unknown result"); } public Map<String,GetResult> getBulk(List<String> keys) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { send_getBulk(keys); return recv_getBulk(); } public void send_getBulk(List<String> keys) throws org.apache.thrift.TException { getBulk_args args = new getBulk_args(); args.setKeys(keys); sendBase("getBulk", args); } public Map<String,GetResult> recv_getBulk() throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { getBulk_result result = new getBulk_result(); receiveBase(result, "getBulk"); if (result.isSetSuccess()) { return result.success; } if (result.ioException != null) { throw result.ioException; } if (result.keyValueStoreException != null) { throw result.keyValueStoreException; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBulk failed: unknown result"); } public void setValue(String key, ByteBuffer data) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { send_setValue(key, data); recv_setValue(); } public void send_setValue(String key, ByteBuffer data) throws org.apache.thrift.TException { setValue_args args = new setValue_args(); args.setKey(key); args.setData(data); sendBase("setValue", args); } public void recv_setValue() throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { setValue_result result = new setValue_result(); receiveBase(result, "setValue"); if (result.ioException != null) { throw result.ioException; } if (result.keyValueStoreException != null) { throw result.keyValueStoreException; } return; } public void deleteValue(String key) throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { send_deleteValue(key); recv_deleteValue(); } public void send_deleteValue(String key) throws org.apache.thrift.TException { deleteValue_args args = new deleteValue_args(); args.setKey(key); sendBase("deleteValue", args); } public void recv_deleteValue() throws KeyValueStoreIOException, KeyValueStoreException, org.apache.thrift.TException { deleteValue_result result = new deleteValue_result(); receiveBase(result, "deleteValue"); if (result.ioException != null) { throw result.ioException; } if (result.keyValueStoreException != null) { throw result.keyValueStoreException; } return; } } 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 exists(String key, org.apache.thrift.async.AsyncMethodCallback<exists_call> resultHandler) throws org.apache.thrift.TException { checkReady(); exists_call method_call = new exists_call(key, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class exists_call extends org.apache.thrift.async.TAsyncMethodCall { private String key; public exists_call(String key, org.apache.thrift.async.AsyncMethodCallback<exists_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, false); this.key = key; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("exists", org.apache.thrift.protocol.TMessageType.CALL, 0)); exists_args args = new exists_args(); args.setKey(key); args.write(prot); prot.writeMessageEnd(); } public boolean getResult() throws KeyValueStoreIOException, KeyValueStoreException, 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); return (new Client(prot)).recv_exists(); } } public void getValue(String key, org.apache.thrift.async.AsyncMethodCallback<getValue_call> resultHandler) throws org.apache.thrift.TException { checkReady(); getValue_call method_call = new getValue_call(key, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getValue_call extends org.apache.thrift.async.TAsyncMethodCall { private String key; public getValue_call(String key, org.apache.thrift.async.AsyncMethodCallback<getValue_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, false); this.key = key; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getValue", org.apache.thrift.protocol.TMessageType.CALL, 0)); getValue_args args = new getValue_args(); args.setKey(key); args.write(prot); prot.writeMessageEnd(); } public GetResult getResult() throws KeyValueStoreIOException, KeyValueStoreException, 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); return (new Client(prot)).recv_getValue(); } } public void getBulk(List<String> keys, org.apache.thrift.async.AsyncMethodCallback<getBulk_call> resultHandler) throws org.apache.thrift.TException { checkReady(); getBulk_call method_call = new getBulk_call(keys, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getBulk_call extends org.apache.thrift.async.TAsyncMethodCall { private List<String> keys; public getBulk_call(List<String> keys, org.apache.thrift.async.AsyncMethodCallback<getBulk_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, false); this.keys = keys; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getBulk", org.apache.thrift.protocol.TMessageType.CALL, 0)); getBulk_args args = new getBulk_args(); args.setKeys(keys); args.write(prot); prot.writeMessageEnd(); } public Map<String,GetResult> getResult() throws KeyValueStoreIOException, KeyValueStoreException, 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); return (new Client(prot)).recv_getBulk(); } } public void setValue(String key, ByteBuffer data, org.apache.thrift.async.AsyncMethodCallback<setValue_call> resultHandler) throws org.apache.thrift.TException { checkReady(); setValue_call method_call = new setValue_call(key, data, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class setValue_call extends org.apache.thrift.async.TAsyncMethodCall { private String key; private ByteBuffer data; public setValue_call(String key, ByteBuffer data, org.apache.thrift.async.AsyncMethodCallback<setValue_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, false); this.key = key; this.data = data; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setValue", org.apache.thrift.protocol.TMessageType.CALL, 0)); setValue_args args = new setValue_args(); args.setKey(key); args.setData(data); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws KeyValueStoreIOException, KeyValueStoreException, 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); (new Client(prot)).recv_setValue(); } } public void deleteValue(String key, org.apache.thrift.async.AsyncMethodCallback<deleteValue_call> resultHandler) throws org.apache.thrift.TException { checkReady(); deleteValue_call method_call = new deleteValue_call(key, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class deleteValue_call extends org.apache.thrift.async.TAsyncMethodCall { private String key; public deleteValue_call(String key, org.apache.thrift.async.AsyncMethodCallback<deleteValue_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, false); this.key = key; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteValue", org.apache.thrift.protocol.TMessageType.CALL, 0)); deleteValue_args args = new deleteValue_args(); args.setKey(key); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws KeyValueStoreIOException, KeyValueStoreException, 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); (new Client(prot)).recv_deleteValue(); } } } 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("exists", new exists()); processMap.put("getValue", new getValue()); processMap.put("getBulk", new getBulk()); processMap.put("setValue", new setValue()); processMap.put("deleteValue", new deleteValue()); return processMap; } private static class exists<I extends Iface> extends org.apache.thrift.ProcessFunction<I, exists_args> { public exists() { super("exists"); } protected exists_args getEmptyArgsInstance() { return new exists_args(); } protected exists_result getResult(I iface, exists_args args) throws org.apache.thrift.TException { exists_result result = new exists_result(); try { result.success = iface.exists(args.key); result.setSuccessIsSet(true); } catch (KeyValueStoreIOException ioException) { result.ioException = ioException; } catch (KeyValueStoreException keyValueStoreException) { result.keyValueStoreException = keyValueStoreException; } return result; } } private static class getValue<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getValue_args> { public getValue() { super("getValue"); } protected getValue_args getEmptyArgsInstance() { return new getValue_args(); } protected getValue_result getResult(I iface, getValue_args args) throws org.apache.thrift.TException { getValue_result result = new getValue_result(); try { result.success = iface.getValue(args.key); } catch (KeyValueStoreIOException ioException) { result.ioException = ioException; } catch (KeyValueStoreException keyValueStoreException) { result.keyValueStoreException = keyValueStoreException; } return result; } } private static class getBulk<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getBulk_args> { public getBulk() { super("getBulk"); } protected getBulk_args getEmptyArgsInstance() { return new getBulk_args(); } protected getBulk_result getResult(I iface, getBulk_args args) throws org.apache.thrift.TException { getBulk_result result = new getBulk_result(); try { result.success = iface.getBulk(args.keys); } catch (KeyValueStoreIOException ioException) { result.ioException = ioException; } catch (KeyValueStoreException keyValueStoreException) { result.keyValueStoreException = keyValueStoreException; } return result; } } private static class setValue<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setValue_args> { public setValue() { super("setValue"); } protected setValue_args getEmptyArgsInstance() { return new setValue_args(); } protected setValue_result getResult(I iface, setValue_args args) throws org.apache.thrift.TException { setValue_result result = new setValue_result(); try { iface.setValue(args.key, args.data); } catch (KeyValueStoreIOException ioException) { result.ioException = ioException; } catch (KeyValueStoreException keyValueStoreException) { result.keyValueStoreException = keyValueStoreException; } return result; } } private static class deleteValue<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteValue_args> { public deleteValue() { super("deleteValue"); } protected deleteValue_args getEmptyArgsInstance() { return new deleteValue_args(); } protected deleteValue_result getResult(I iface, deleteValue_args args) throws org.apache.thrift.TException { deleteValue_result result = new deleteValue_result(); try { iface.deleteValue(args.key); } catch (KeyValueStoreIOException ioException) { result.ioException = ioException; } catch (KeyValueStoreException keyValueStoreException) { result.keyValueStoreException = keyValueStoreException; } return result; } } } public static class exists_args implements org.apache.thrift.TBase<exists_args, exists_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_args"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", 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 exists_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new exists_argsTupleSchemeFactory()); } private String key; // 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"); 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; 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_args.class, metaDataMap); } public exists_args() { } public exists_args( String key) { this(); this.key = key; } /** * Performs a deep copy on <i>other</i>. */ public exists_args(exists_args other) { if (other.isSetKey()) { this.key = other.key; } } public exists_args deepCopy() { return new exists_args(this); } @Override public void clear() { this.key = null; } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } 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 void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof exists_args) return this.equals((exists_args)that); return false; } public boolean equals(exists_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; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_key = true && (isSetKey()); builder.append(present_key); if (present_key) builder.append(key); return builder.toHashCode(); } public int compareTo(exists_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; exists_args typedOther = (exists_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; } } 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("exists_args("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 exists_argsStandardSchemeFactory implements SchemeFactory { public exists_argsStandardScheme getScheme() { return new exists_argsStandardScheme(); } } private static class exists_argsStandardScheme extends StandardScheme<exists_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, exists_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.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(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, exists_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class exists_argsTupleSchemeFactory implements SchemeFactory { public exists_argsTupleScheme getScheme() { return new exists_argsTupleScheme(); } } private static class exists_argsTupleScheme extends TupleScheme<exists_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetKey()) { oprot.writeString(struct.key); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, exists_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } } } } public static class exists_result implements org.apache.thrift.TBase<exists_result, exists_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("exists_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField IO_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("ioException", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField KEY_VALUE_STORE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValueStoreException", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new exists_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new exists_resultTupleSchemeFactory()); } private boolean success; // required private KeyValueStoreIOException ioException; // required private KeyValueStoreException keyValueStoreException; // 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 { SUCCESS((short)0, "success"), IO_EXCEPTION((short)1, "ioException"), KEY_VALUE_STORE_EXCEPTION((short)2, "keyValueStoreException"); 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 0: // SUCCESS return SUCCESS; case 1: // IO_EXCEPTION return IO_EXCEPTION; case 2: // KEY_VALUE_STORE_EXCEPTION return KEY_VALUE_STORE_EXCEPTION; 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 __SUCCESS_ISSET_ID = 0; private BitSet __isset_bit_vector = new BitSet(1); 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.IO_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("ioException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.KEY_VALUE_STORE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("keyValueStoreException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(exists_result.class, metaDataMap); } public exists_result() { } public exists_result( boolean success, KeyValueStoreIOException ioException, KeyValueStoreException keyValueStoreException) { this(); this.success = success; setSuccessIsSet(true); this.ioException = ioException; this.keyValueStoreException = keyValueStoreException; } /** * Performs a deep copy on <i>other</i>. */ public exists_result(exists_result other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.success = other.success; if (other.isSetIoException()) { this.ioException = new KeyValueStoreIOException(other.ioException); } if (other.isSetKeyValueStoreException()) { this.keyValueStoreException = new KeyValueStoreException(other.keyValueStoreException); } } public exists_result deepCopy() { return new exists_result(this); } @Override public void clear() { setSuccessIsSet(false); this.success = false; this.ioException = null; this.keyValueStoreException = null; } public boolean isSuccess() { return this.success; } public void setSuccess(boolean success) { this.success = success; setSuccessIsSet(true); } public void unsetSuccess() { __isset_bit_vector.clear(__SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return __isset_bit_vector.get(__SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); } public KeyValueStoreIOException getIoException() { return this.ioException; } public void setIoException(KeyValueStoreIOException ioException) { this.ioException = ioException; } public void unsetIoException() { this.ioException = null; } /** Returns true if field ioException is set (has been assigned a value) and false otherwise */ public boolean isSetIoException() { return this.ioException != null; } public void setIoExceptionIsSet(boolean value) { if (!value) { this.ioException = null; } } public KeyValueStoreException getKeyValueStoreException() { return this.keyValueStoreException; } public void setKeyValueStoreException(KeyValueStoreException keyValueStoreException) { this.keyValueStoreException = keyValueStoreException; } public void unsetKeyValueStoreException() { this.keyValueStoreException = null; } /** Returns true if field keyValueStoreException is set (has been assigned a value) and false otherwise */ public boolean isSetKeyValueStoreException() { return this.keyValueStoreException != null; } public void setKeyValueStoreExceptionIsSet(boolean value) { if (!value) { this.keyValueStoreException = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Boolean)value); } break; case IO_EXCEPTION: if (value == null) { unsetIoException(); } else { setIoException((KeyValueStoreIOException)value); } break; case KEY_VALUE_STORE_EXCEPTION: if (value == null) { unsetKeyValueStoreException(); } else { setKeyValueStoreException((KeyValueStoreException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return Boolean.valueOf(isSuccess()); case IO_EXCEPTION: return getIoException(); case KEY_VALUE_STORE_EXCEPTION: return getKeyValueStoreException(); } 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 SUCCESS: return isSetSuccess(); case IO_EXCEPTION: return isSetIoException(); case KEY_VALUE_STORE_EXCEPTION: return isSetKeyValueStoreException(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof exists_result) return this.equals((exists_result)that); return false; } public boolean equals(exists_result that) { if (that == null) return false; boolean this_present_success = true; boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (this.success != that.success) return false; } boolean this_present_ioException = true && this.isSetIoException(); boolean that_present_ioException = true && that.isSetIoException(); if (this_present_ioException || that_present_ioException) { if (!(this_present_ioException && that_present_ioException)) return false; if (!this.ioException.equals(that.ioException)) return false; } boolean this_present_keyValueStoreException = true && this.isSetKeyValueStoreException(); boolean that_present_keyValueStoreException = true && that.isSetKeyValueStoreException(); if (this_present_keyValueStoreException || that_present_keyValueStoreException) { if (!(this_present_keyValueStoreException && that_present_keyValueStoreException)) return false; if (!this.keyValueStoreException.equals(that.keyValueStoreException)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_success = true; builder.append(present_success); if (present_success) builder.append(success); boolean present_ioException = true && (isSetIoException()); builder.append(present_ioException); if (present_ioException) builder.append(ioException); boolean present_keyValueStoreException = true && (isSetKeyValueStoreException()); builder.append(present_keyValueStoreException); if (present_keyValueStoreException) builder.append(keyValueStoreException); return builder.toHashCode(); } public int compareTo(exists_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; exists_result typedOther = (exists_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoException()).compareTo(typedOther.isSetIoException()); if (lastComparison != 0) { return lastComparison; } if (isSetIoException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioException, typedOther.ioException); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKeyValueStoreException()).compareTo(typedOther.isSetKeyValueStoreException()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyValueStoreException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyValueStoreException, typedOther.keyValueStoreException); 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("exists_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ioException:"); if (this.ioException == null) { sb.append("null"); } else { sb.append(this.ioException); } first = false; if (!first) sb.append(", "); sb.append("keyValueStoreException:"); if (this.keyValueStoreException == null) { sb.append("null"); } else { sb.append(this.keyValueStoreException); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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_bit_vector = new BitSet(1); 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 exists_resultStandardSchemeFactory implements SchemeFactory { public exists_resultStandardScheme getScheme() { return new exists_resultStandardScheme(); } } private static class exists_resultStandardScheme extends StandardScheme<exists_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, exists_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // IO_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY_VALUE_STORE_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(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, exists_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeBool(struct.success); oprot.writeFieldEnd(); if (struct.ioException != null) { oprot.writeFieldBegin(IO_EXCEPTION_FIELD_DESC); struct.ioException.write(oprot); oprot.writeFieldEnd(); } if (struct.keyValueStoreException != null) { oprot.writeFieldBegin(KEY_VALUE_STORE_EXCEPTION_FIELD_DESC); struct.keyValueStoreException.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class exists_resultTupleSchemeFactory implements SchemeFactory { public exists_resultTupleScheme getScheme() { return new exists_resultTupleScheme(); } } private static class exists_resultTupleScheme extends TupleScheme<exists_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetIoException()) { optionals.set(1); } if (struct.isSetKeyValueStoreException()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { oprot.writeBool(struct.success); } if (struct.isSetIoException()) { struct.ioException.write(oprot); } if (struct.isSetKeyValueStoreException()) { struct.keyValueStoreException.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, exists_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } if (incoming.get(2)) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(true); } } } } public static class getValue_args implements org.apache.thrift.TBase<getValue_args, getValue_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getValue_args"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", 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 getValue_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getValue_argsTupleSchemeFactory()); } private String key; // 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"); 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; 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getValue_args.class, metaDataMap); } public getValue_args() { } public getValue_args( String key) { this(); this.key = key; } /** * Performs a deep copy on <i>other</i>. */ public getValue_args(getValue_args other) { if (other.isSetKey()) { this.key = other.key; } } public getValue_args deepCopy() { return new getValue_args(this); } @Override public void clear() { this.key = null; } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } 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 void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getValue_args) return this.equals((getValue_args)that); return false; } public boolean equals(getValue_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; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_key = true && (isSetKey()); builder.append(present_key); if (present_key) builder.append(key); return builder.toHashCode(); } public int compareTo(getValue_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; getValue_args typedOther = (getValue_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; } } 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("getValue_args("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 getValue_argsStandardSchemeFactory implements SchemeFactory { public getValue_argsStandardScheme getScheme() { return new getValue_argsStandardScheme(); } } private static class getValue_argsStandardScheme extends StandardScheme<getValue_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getValue_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.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(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, getValue_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getValue_argsTupleSchemeFactory implements SchemeFactory { public getValue_argsTupleScheme getScheme() { return new getValue_argsTupleScheme(); } } private static class getValue_argsTupleScheme extends TupleScheme<getValue_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getValue_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetKey()) { oprot.writeString(struct.key); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getValue_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } } } } public static class getValue_result implements org.apache.thrift.TBase<getValue_result, getValue_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getValue_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField IO_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("ioException", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField KEY_VALUE_STORE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValueStoreException", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getValue_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getValue_resultTupleSchemeFactory()); } private GetResult success; // required private KeyValueStoreIOException ioException; // required private KeyValueStoreException keyValueStoreException; // 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 { SUCCESS((short)0, "success"), IO_EXCEPTION((short)1, "ioException"), KEY_VALUE_STORE_EXCEPTION((short)2, "keyValueStoreException"); 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 0: // SUCCESS return SUCCESS; case 1: // IO_EXCEPTION return IO_EXCEPTION; case 2: // KEY_VALUE_STORE_EXCEPTION return KEY_VALUE_STORE_EXCEPTION; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GetResult.class))); tmpMap.put(_Fields.IO_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("ioException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.KEY_VALUE_STORE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("keyValueStoreException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getValue_result.class, metaDataMap); } public getValue_result() { } public getValue_result( GetResult success, KeyValueStoreIOException ioException, KeyValueStoreException keyValueStoreException) { this(); this.success = success; this.ioException = ioException; this.keyValueStoreException = keyValueStoreException; } /** * Performs a deep copy on <i>other</i>. */ public getValue_result(getValue_result other) { if (other.isSetSuccess()) { this.success = new GetResult(other.success); } if (other.isSetIoException()) { this.ioException = new KeyValueStoreIOException(other.ioException); } if (other.isSetKeyValueStoreException()) { this.keyValueStoreException = new KeyValueStoreException(other.keyValueStoreException); } } public getValue_result deepCopy() { return new getValue_result(this); } @Override public void clear() { this.success = null; this.ioException = null; this.keyValueStoreException = null; } public GetResult getSuccess() { return this.success; } public void setSuccess(GetResult success) { this.success = success; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public KeyValueStoreIOException getIoException() { return this.ioException; } public void setIoException(KeyValueStoreIOException ioException) { this.ioException = ioException; } public void unsetIoException() { this.ioException = null; } /** Returns true if field ioException is set (has been assigned a value) and false otherwise */ public boolean isSetIoException() { return this.ioException != null; } public void setIoExceptionIsSet(boolean value) { if (!value) { this.ioException = null; } } public KeyValueStoreException getKeyValueStoreException() { return this.keyValueStoreException; } public void setKeyValueStoreException(KeyValueStoreException keyValueStoreException) { this.keyValueStoreException = keyValueStoreException; } public void unsetKeyValueStoreException() { this.keyValueStoreException = null; } /** Returns true if field keyValueStoreException is set (has been assigned a value) and false otherwise */ public boolean isSetKeyValueStoreException() { return this.keyValueStoreException != null; } public void setKeyValueStoreExceptionIsSet(boolean value) { if (!value) { this.keyValueStoreException = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((GetResult)value); } break; case IO_EXCEPTION: if (value == null) { unsetIoException(); } else { setIoException((KeyValueStoreIOException)value); } break; case KEY_VALUE_STORE_EXCEPTION: if (value == null) { unsetKeyValueStoreException(); } else { setKeyValueStoreException((KeyValueStoreException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case IO_EXCEPTION: return getIoException(); case KEY_VALUE_STORE_EXCEPTION: return getKeyValueStoreException(); } 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 SUCCESS: return isSetSuccess(); case IO_EXCEPTION: return isSetIoException(); case KEY_VALUE_STORE_EXCEPTION: return isSetKeyValueStoreException(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getValue_result) return this.equals((getValue_result)that); return false; } public boolean equals(getValue_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ioException = true && this.isSetIoException(); boolean that_present_ioException = true && that.isSetIoException(); if (this_present_ioException || that_present_ioException) { if (!(this_present_ioException && that_present_ioException)) return false; if (!this.ioException.equals(that.ioException)) return false; } boolean this_present_keyValueStoreException = true && this.isSetKeyValueStoreException(); boolean that_present_keyValueStoreException = true && that.isSetKeyValueStoreException(); if (this_present_keyValueStoreException || that_present_keyValueStoreException) { if (!(this_present_keyValueStoreException && that_present_keyValueStoreException)) return false; if (!this.keyValueStoreException.equals(that.keyValueStoreException)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_success = true && (isSetSuccess()); builder.append(present_success); if (present_success) builder.append(success); boolean present_ioException = true && (isSetIoException()); builder.append(present_ioException); if (present_ioException) builder.append(ioException); boolean present_keyValueStoreException = true && (isSetKeyValueStoreException()); builder.append(present_keyValueStoreException); if (present_keyValueStoreException) builder.append(keyValueStoreException); return builder.toHashCode(); } public int compareTo(getValue_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; getValue_result typedOther = (getValue_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoException()).compareTo(typedOther.isSetIoException()); if (lastComparison != 0) { return lastComparison; } if (isSetIoException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioException, typedOther.ioException); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKeyValueStoreException()).compareTo(typedOther.isSetKeyValueStoreException()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyValueStoreException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyValueStoreException, typedOther.keyValueStoreException); 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("getValue_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ioException:"); if (this.ioException == null) { sb.append("null"); } else { sb.append(this.ioException); } first = false; if (!first) sb.append(", "); sb.append("keyValueStoreException:"); if (this.keyValueStoreException == null) { sb.append("null"); } else { sb.append(this.keyValueStoreException); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 getValue_resultStandardSchemeFactory implements SchemeFactory { public getValue_resultStandardScheme getScheme() { return new getValue_resultStandardScheme(); } } private static class getValue_resultStandardScheme extends StandardScheme<getValue_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getValue_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new GetResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // IO_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY_VALUE_STORE_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(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, getValue_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.ioException != null) { oprot.writeFieldBegin(IO_EXCEPTION_FIELD_DESC); struct.ioException.write(oprot); oprot.writeFieldEnd(); } if (struct.keyValueStoreException != null) { oprot.writeFieldBegin(KEY_VALUE_STORE_EXCEPTION_FIELD_DESC); struct.keyValueStoreException.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getValue_resultTupleSchemeFactory implements SchemeFactory { public getValue_resultTupleScheme getScheme() { return new getValue_resultTupleScheme(); } } private static class getValue_resultTupleScheme extends TupleScheme<getValue_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getValue_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetIoException()) { optionals.set(1); } if (struct.isSetKeyValueStoreException()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetIoException()) { struct.ioException.write(oprot); } if (struct.isSetKeyValueStoreException()) { struct.keyValueStoreException.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getValue_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.success = new GetResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } if (incoming.get(2)) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(true); } } } } public static class getBulk_args implements org.apache.thrift.TBase<getBulk_args, getBulk_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBulk_args"); private static final org.apache.thrift.protocol.TField KEYS_FIELD_DESC = new org.apache.thrift.protocol.TField("keys", org.apache.thrift.protocol.TType.LIST, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getBulk_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getBulk_argsTupleSchemeFactory()); } private List<String> keys; // 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 { KEYS((short)1, "keys"); 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: // KEYS return KEYS; 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.KEYS, new org.apache.thrift.meta_data.FieldMetaData("keys", 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)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBulk_args.class, metaDataMap); } public getBulk_args() { } public getBulk_args( List<String> keys) { this(); this.keys = keys; } /** * Performs a deep copy on <i>other</i>. */ public getBulk_args(getBulk_args other) { if (other.isSetKeys()) { List<String> __this__keys = new ArrayList<String>(); for (String other_element : other.keys) { __this__keys.add(other_element); } this.keys = __this__keys; } } public getBulk_args deepCopy() { return new getBulk_args(this); } @Override public void clear() { this.keys = null; } public int getKeysSize() { return (this.keys == null) ? 0 : this.keys.size(); } public java.util.Iterator<String> getKeysIterator() { return (this.keys == null) ? null : this.keys.iterator(); } public void addToKeys(String elem) { if (this.keys == null) { this.keys = new ArrayList<String>(); } this.keys.add(elem); } public List<String> getKeys() { return this.keys; } public void setKeys(List<String> keys) { this.keys = keys; } public void unsetKeys() { this.keys = null; } /** Returns true if field keys is set (has been assigned a value) and false otherwise */ public boolean isSetKeys() { return this.keys != null; } public void setKeysIsSet(boolean value) { if (!value) { this.keys = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case KEYS: if (value == null) { unsetKeys(); } else { setKeys((List<String>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEYS: return getKeys(); } 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 KEYS: return isSetKeys(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getBulk_args) return this.equals((getBulk_args)that); return false; } public boolean equals(getBulk_args that) { if (that == null) return false; boolean this_present_keys = true && this.isSetKeys(); boolean that_present_keys = true && that.isSetKeys(); if (this_present_keys || that_present_keys) { if (!(this_present_keys && that_present_keys)) return false; if (!this.keys.equals(that.keys)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_keys = true && (isSetKeys()); builder.append(present_keys); if (present_keys) builder.append(keys); return builder.toHashCode(); } public int compareTo(getBulk_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; getBulk_args typedOther = (getBulk_args)other; lastComparison = Boolean.valueOf(isSetKeys()).compareTo(typedOther.isSetKeys()); if (lastComparison != 0) { return lastComparison; } if (isSetKeys()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keys, typedOther.keys); 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("getBulk_args("); boolean first = true; sb.append("keys:"); if (this.keys == null) { sb.append("null"); } else { sb.append(this.keys); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 getBulk_argsStandardSchemeFactory implements SchemeFactory { public getBulk_argsStandardScheme getScheme() { return new getBulk_argsStandardScheme(); } } private static class getBulk_argsStandardScheme extends StandardScheme<getBulk_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getBulk_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: // KEYS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.keys = new ArrayList<String>(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { String _elem2; // required _elem2 = iprot.readString(); struct.keys.add(_elem2); } iprot.readListEnd(); } struct.setKeysIsSet(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, getBulk_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.keys != null) { oprot.writeFieldBegin(KEYS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size())); for (String _iter3 : struct.keys) { oprot.writeString(_iter3); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getBulk_argsTupleSchemeFactory implements SchemeFactory { public getBulk_argsTupleScheme getScheme() { return new getBulk_argsTupleScheme(); } } private static class getBulk_argsTupleScheme extends TupleScheme<getBulk_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getBulk_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKeys()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetKeys()) { { oprot.writeI32(struct.keys.size()); for (String _iter4 : struct.keys) { oprot.writeString(_iter4); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getBulk_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.keys = new ArrayList<String>(_list5.size); for (int _i6 = 0; _i6 < _list5.size; ++_i6) { String _elem7; // required _elem7 = iprot.readString(); struct.keys.add(_elem7); } } struct.setKeysIsSet(true); } } } } public static class getBulk_result implements org.apache.thrift.TBase<getBulk_result, getBulk_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBulk_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); private static final org.apache.thrift.protocol.TField IO_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("ioException", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField KEY_VALUE_STORE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValueStoreException", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getBulk_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getBulk_resultTupleSchemeFactory()); } private Map<String,GetResult> success; // required private KeyValueStoreIOException ioException; // required private KeyValueStoreException keyValueStoreException; // 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 { SUCCESS((short)0, "success"), IO_EXCEPTION((short)1, "ioException"), KEY_VALUE_STORE_EXCEPTION((short)2, "keyValueStoreException"); 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 0: // SUCCESS return SUCCESS; case 1: // IO_EXCEPTION return IO_EXCEPTION; case 2: // KEY_VALUE_STORE_EXCEPTION return KEY_VALUE_STORE_EXCEPTION; 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GetResult.class)))); tmpMap.put(_Fields.IO_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("ioException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.KEY_VALUE_STORE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("keyValueStoreException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBulk_result.class, metaDataMap); } public getBulk_result() { } public getBulk_result( Map<String,GetResult> success, KeyValueStoreIOException ioException, KeyValueStoreException keyValueStoreException) { this(); this.success = success; this.ioException = ioException; this.keyValueStoreException = keyValueStoreException; } /** * Performs a deep copy on <i>other</i>. */ public getBulk_result(getBulk_result other) { if (other.isSetSuccess()) { Map<String,GetResult> __this__success = new HashMap<String,GetResult>(); for (Map.Entry<String, GetResult> other_element : other.success.entrySet()) { String other_element_key = other_element.getKey(); GetResult other_element_value = other_element.getValue(); String __this__success_copy_key = other_element_key; GetResult __this__success_copy_value = new GetResult(other_element_value); __this__success.put(__this__success_copy_key, __this__success_copy_value); } this.success = __this__success; } if (other.isSetIoException()) { this.ioException = new KeyValueStoreIOException(other.ioException); } if (other.isSetKeyValueStoreException()) { this.keyValueStoreException = new KeyValueStoreException(other.keyValueStoreException); } } public getBulk_result deepCopy() { return new getBulk_result(this); } @Override public void clear() { this.success = null; this.ioException = null; this.keyValueStoreException = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public void putToSuccess(String key, GetResult val) { if (this.success == null) { this.success = new HashMap<String,GetResult>(); } this.success.put(key, val); } public Map<String,GetResult> getSuccess() { return this.success; } public void setSuccess(Map<String,GetResult> success) { this.success = success; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public KeyValueStoreIOException getIoException() { return this.ioException; } public void setIoException(KeyValueStoreIOException ioException) { this.ioException = ioException; } public void unsetIoException() { this.ioException = null; } /** Returns true if field ioException is set (has been assigned a value) and false otherwise */ public boolean isSetIoException() { return this.ioException != null; } public void setIoExceptionIsSet(boolean value) { if (!value) { this.ioException = null; } } public KeyValueStoreException getKeyValueStoreException() { return this.keyValueStoreException; } public void setKeyValueStoreException(KeyValueStoreException keyValueStoreException) { this.keyValueStoreException = keyValueStoreException; } public void unsetKeyValueStoreException() { this.keyValueStoreException = null; } /** Returns true if field keyValueStoreException is set (has been assigned a value) and false otherwise */ public boolean isSetKeyValueStoreException() { return this.keyValueStoreException != null; } public void setKeyValueStoreExceptionIsSet(boolean value) { if (!value) { this.keyValueStoreException = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((Map<String,GetResult>)value); } break; case IO_EXCEPTION: if (value == null) { unsetIoException(); } else { setIoException((KeyValueStoreIOException)value); } break; case KEY_VALUE_STORE_EXCEPTION: if (value == null) { unsetKeyValueStoreException(); } else { setKeyValueStoreException((KeyValueStoreException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case IO_EXCEPTION: return getIoException(); case KEY_VALUE_STORE_EXCEPTION: return getKeyValueStoreException(); } 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 SUCCESS: return isSetSuccess(); case IO_EXCEPTION: return isSetIoException(); case KEY_VALUE_STORE_EXCEPTION: return isSetKeyValueStoreException(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getBulk_result) return this.equals((getBulk_result)that); return false; } public boolean equals(getBulk_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ioException = true && this.isSetIoException(); boolean that_present_ioException = true && that.isSetIoException(); if (this_present_ioException || that_present_ioException) { if (!(this_present_ioException && that_present_ioException)) return false; if (!this.ioException.equals(that.ioException)) return false; } boolean this_present_keyValueStoreException = true && this.isSetKeyValueStoreException(); boolean that_present_keyValueStoreException = true && that.isSetKeyValueStoreException(); if (this_present_keyValueStoreException || that_present_keyValueStoreException) { if (!(this_present_keyValueStoreException && that_present_keyValueStoreException)) return false; if (!this.keyValueStoreException.equals(that.keyValueStoreException)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_success = true && (isSetSuccess()); builder.append(present_success); if (present_success) builder.append(success); boolean present_ioException = true && (isSetIoException()); builder.append(present_ioException); if (present_ioException) builder.append(ioException); boolean present_keyValueStoreException = true && (isSetKeyValueStoreException()); builder.append(present_keyValueStoreException); if (present_keyValueStoreException) builder.append(keyValueStoreException); return builder.toHashCode(); } public int compareTo(getBulk_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; getBulk_result typedOther = (getBulk_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetIoException()).compareTo(typedOther.isSetIoException()); if (lastComparison != 0) { return lastComparison; } if (isSetIoException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioException, typedOther.ioException); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKeyValueStoreException()).compareTo(typedOther.isSetKeyValueStoreException()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyValueStoreException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyValueStoreException, typedOther.keyValueStoreException); 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("getBulk_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ioException:"); if (this.ioException == null) { sb.append("null"); } else { sb.append(this.ioException); } first = false; if (!first) sb.append(", "); sb.append("keyValueStoreException:"); if (this.keyValueStoreException == null) { sb.append("null"); } else { sb.append(this.keyValueStoreException); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 getBulk_resultStandardSchemeFactory implements SchemeFactory { public getBulk_resultStandardScheme getScheme() { return new getBulk_resultStandardScheme(); } } private static class getBulk_resultStandardScheme extends StandardScheme<getBulk_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getBulk_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin(); struct.success = new HashMap<String,GetResult>(2*_map8.size); for (int _i9 = 0; _i9 < _map8.size; ++_i9) { String _key10; // required GetResult _val11; // optional _key10 = iprot.readString(); _val11 = new GetResult(); _val11.read(iprot); struct.success.put(_key10, _val11); } iprot.readMapEnd(); } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // IO_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY_VALUE_STORE_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(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, getBulk_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (Map.Entry<String, GetResult> _iter12 : struct.success.entrySet()) { oprot.writeString(_iter12.getKey()); _iter12.getValue().write(oprot); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (struct.ioException != null) { oprot.writeFieldBegin(IO_EXCEPTION_FIELD_DESC); struct.ioException.write(oprot); oprot.writeFieldEnd(); } if (struct.keyValueStoreException != null) { oprot.writeFieldBegin(KEY_VALUE_STORE_EXCEPTION_FIELD_DESC); struct.keyValueStoreException.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getBulk_resultTupleSchemeFactory implements SchemeFactory { public getBulk_resultTupleScheme getScheme() { return new getBulk_resultTupleScheme(); } } private static class getBulk_resultTupleScheme extends TupleScheme<getBulk_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getBulk_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetIoException()) { optionals.set(1); } if (struct.isSetKeyValueStoreException()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (Map.Entry<String, GetResult> _iter13 : struct.success.entrySet()) { oprot.writeString(_iter13.getKey()); _iter13.getValue().write(oprot); } } } if (struct.isSetIoException()) { struct.ioException.write(oprot); } if (struct.isSetKeyValueStoreException()) { struct.keyValueStoreException.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getBulk_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new HashMap<String,GetResult>(2*_map14.size); for (int _i15 = 0; _i15 < _map14.size; ++_i15) { String _key16; // required GetResult _val17; // optional _key16 = iprot.readString(); _val17 = new GetResult(); _val17.read(iprot); struct.success.put(_key16, _val17); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } if (incoming.get(2)) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(true); } } } } public static class setValue_args implements org.apache.thrift.TBase<setValue_args, setValue_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setValue_args"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new setValue_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new setValue_argsTupleSchemeFactory()); } private String key; // required private ByteBuffer data; // 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"), DATA((short)2, "data"); 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: // DATA return DATA; 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", 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(setValue_args.class, metaDataMap); } public setValue_args() { } public setValue_args( String key, ByteBuffer data) { this(); this.key = key; this.data = data; } /** * Performs a deep copy on <i>other</i>. */ public setValue_args(setValue_args other) { if (other.isSetKey()) { this.key = other.key; } if (other.isSetData()) { this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data); ; } } public setValue_args deepCopy() { return new setValue_args(this); } @Override public void clear() { this.key = null; this.data = null; } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } 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 byte[] getData() { setData(org.apache.thrift.TBaseHelper.rightSize(data)); return data == null ? null : data.array(); } public ByteBuffer bufferForData() { return data; } public void setData(byte[] data) { setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data)); } public void setData(ByteBuffer data) { this.data = data; } public void unsetData() { this.data = null; } /** Returns true if field data is set (has been assigned a value) and false otherwise */ public boolean isSetData() { return this.data != null; } public void setDataIsSet(boolean value) { if (!value) { this.data = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case DATA: if (value == null) { unsetData(); } else { setData((ByteBuffer)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case DATA: return getData(); } 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 DATA: return isSetData(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof setValue_args) return this.equals((setValue_args)that); return false; } public boolean equals(setValue_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_data = true && this.isSetData(); boolean that_present_data = true && that.isSetData(); if (this_present_data || that_present_data) { if (!(this_present_data && that_present_data)) return false; if (!this.data.equals(that.data)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_key = true && (isSetKey()); builder.append(present_key); if (present_key) builder.append(key); boolean present_data = true && (isSetData()); builder.append(present_data); if (present_data) builder.append(data); return builder.toHashCode(); } public int compareTo(setValue_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; setValue_args typedOther = (setValue_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(isSetData()).compareTo(typedOther.isSetData()); if (lastComparison != 0) { return lastComparison; } if (isSetData()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data); 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("setValue_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("data:"); if (this.data == null) { sb.append("null"); } else { org.apache.thrift.TBaseHelper.toString(this.data, sb); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 setValue_argsStandardSchemeFactory implements SchemeFactory { public setValue_argsStandardScheme getScheme() { return new setValue_argsStandardScheme(); } } private static class setValue_argsStandardScheme extends StandardScheme<setValue_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, setValue_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.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // DATA if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.data = iprot.readBinary(); struct.setDataIsSet(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, setValue_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.data != null) { oprot.writeFieldBegin(DATA_FIELD_DESC); oprot.writeBinary(struct.data); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class setValue_argsTupleSchemeFactory implements SchemeFactory { public setValue_argsTupleScheme getScheme() { return new setValue_argsTupleScheme(); } } private static class setValue_argsTupleScheme extends TupleScheme<setValue_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, setValue_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } if (struct.isSetData()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetKey()) { oprot.writeString(struct.key); } if (struct.isSetData()) { oprot.writeBinary(struct.data); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, setValue_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } if (incoming.get(1)) { struct.data = iprot.readBinary(); struct.setDataIsSet(true); } } } } public static class setValue_result implements org.apache.thrift.TBase<setValue_result, setValue_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setValue_result"); private static final org.apache.thrift.protocol.TField IO_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("ioException", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField KEY_VALUE_STORE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValueStoreException", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new setValue_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new setValue_resultTupleSchemeFactory()); } private KeyValueStoreIOException ioException; // required private KeyValueStoreException keyValueStoreException; // 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 { IO_EXCEPTION((short)1, "ioException"), KEY_VALUE_STORE_EXCEPTION((short)2, "keyValueStoreException"); 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: // IO_EXCEPTION return IO_EXCEPTION; case 2: // KEY_VALUE_STORE_EXCEPTION return KEY_VALUE_STORE_EXCEPTION; 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.IO_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("ioException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.KEY_VALUE_STORE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("keyValueStoreException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setValue_result.class, metaDataMap); } public setValue_result() { } public setValue_result( KeyValueStoreIOException ioException, KeyValueStoreException keyValueStoreException) { this(); this.ioException = ioException; this.keyValueStoreException = keyValueStoreException; } /** * Performs a deep copy on <i>other</i>. */ public setValue_result(setValue_result other) { if (other.isSetIoException()) { this.ioException = new KeyValueStoreIOException(other.ioException); } if (other.isSetKeyValueStoreException()) { this.keyValueStoreException = new KeyValueStoreException(other.keyValueStoreException); } } public setValue_result deepCopy() { return new setValue_result(this); } @Override public void clear() { this.ioException = null; this.keyValueStoreException = null; } public KeyValueStoreIOException getIoException() { return this.ioException; } public void setIoException(KeyValueStoreIOException ioException) { this.ioException = ioException; } public void unsetIoException() { this.ioException = null; } /** Returns true if field ioException is set (has been assigned a value) and false otherwise */ public boolean isSetIoException() { return this.ioException != null; } public void setIoExceptionIsSet(boolean value) { if (!value) { this.ioException = null; } } public KeyValueStoreException getKeyValueStoreException() { return this.keyValueStoreException; } public void setKeyValueStoreException(KeyValueStoreException keyValueStoreException) { this.keyValueStoreException = keyValueStoreException; } public void unsetKeyValueStoreException() { this.keyValueStoreException = null; } /** Returns true if field keyValueStoreException is set (has been assigned a value) and false otherwise */ public boolean isSetKeyValueStoreException() { return this.keyValueStoreException != null; } public void setKeyValueStoreExceptionIsSet(boolean value) { if (!value) { this.keyValueStoreException = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case IO_EXCEPTION: if (value == null) { unsetIoException(); } else { setIoException((KeyValueStoreIOException)value); } break; case KEY_VALUE_STORE_EXCEPTION: if (value == null) { unsetKeyValueStoreException(); } else { setKeyValueStoreException((KeyValueStoreException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case IO_EXCEPTION: return getIoException(); case KEY_VALUE_STORE_EXCEPTION: return getKeyValueStoreException(); } 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 IO_EXCEPTION: return isSetIoException(); case KEY_VALUE_STORE_EXCEPTION: return isSetKeyValueStoreException(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof setValue_result) return this.equals((setValue_result)that); return false; } public boolean equals(setValue_result that) { if (that == null) return false; boolean this_present_ioException = true && this.isSetIoException(); boolean that_present_ioException = true && that.isSetIoException(); if (this_present_ioException || that_present_ioException) { if (!(this_present_ioException && that_present_ioException)) return false; if (!this.ioException.equals(that.ioException)) return false; } boolean this_present_keyValueStoreException = true && this.isSetKeyValueStoreException(); boolean that_present_keyValueStoreException = true && that.isSetKeyValueStoreException(); if (this_present_keyValueStoreException || that_present_keyValueStoreException) { if (!(this_present_keyValueStoreException && that_present_keyValueStoreException)) return false; if (!this.keyValueStoreException.equals(that.keyValueStoreException)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_ioException = true && (isSetIoException()); builder.append(present_ioException); if (present_ioException) builder.append(ioException); boolean present_keyValueStoreException = true && (isSetKeyValueStoreException()); builder.append(present_keyValueStoreException); if (present_keyValueStoreException) builder.append(keyValueStoreException); return builder.toHashCode(); } public int compareTo(setValue_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; setValue_result typedOther = (setValue_result)other; lastComparison = Boolean.valueOf(isSetIoException()).compareTo(typedOther.isSetIoException()); if (lastComparison != 0) { return lastComparison; } if (isSetIoException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioException, typedOther.ioException); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKeyValueStoreException()).compareTo(typedOther.isSetKeyValueStoreException()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyValueStoreException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyValueStoreException, typedOther.keyValueStoreException); 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("setValue_result("); boolean first = true; sb.append("ioException:"); if (this.ioException == null) { sb.append("null"); } else { sb.append(this.ioException); } first = false; if (!first) sb.append(", "); sb.append("keyValueStoreException:"); if (this.keyValueStoreException == null) { sb.append("null"); } else { sb.append(this.keyValueStoreException); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 setValue_resultStandardSchemeFactory implements SchemeFactory { public setValue_resultStandardScheme getScheme() { return new setValue_resultStandardScheme(); } } private static class setValue_resultStandardScheme extends StandardScheme<setValue_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, setValue_result 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: // IO_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY_VALUE_STORE_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(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, setValue_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ioException != null) { oprot.writeFieldBegin(IO_EXCEPTION_FIELD_DESC); struct.ioException.write(oprot); oprot.writeFieldEnd(); } if (struct.keyValueStoreException != null) { oprot.writeFieldBegin(KEY_VALUE_STORE_EXCEPTION_FIELD_DESC); struct.keyValueStoreException.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class setValue_resultTupleSchemeFactory implements SchemeFactory { public setValue_resultTupleScheme getScheme() { return new setValue_resultTupleScheme(); } } private static class setValue_resultTupleScheme extends TupleScheme<setValue_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, setValue_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetIoException()) { optionals.set(0); } if (struct.isSetKeyValueStoreException()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetIoException()) { struct.ioException.write(oprot); } if (struct.isSetKeyValueStoreException()) { struct.keyValueStoreException.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, setValue_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } if (incoming.get(1)) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(true); } } } } public static class deleteValue_args implements org.apache.thrift.TBase<deleteValue_args, deleteValue_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteValue_args"); private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", 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 deleteValue_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new deleteValue_argsTupleSchemeFactory()); } private String key; // 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"); 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; 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteValue_args.class, metaDataMap); } public deleteValue_args() { } public deleteValue_args( String key) { this(); this.key = key; } /** * Performs a deep copy on <i>other</i>. */ public deleteValue_args(deleteValue_args other) { if (other.isSetKey()) { this.key = other.key; } } public deleteValue_args deepCopy() { return new deleteValue_args(this); } @Override public void clear() { this.key = null; } public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } 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 void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof deleteValue_args) return this.equals((deleteValue_args)that); return false; } public boolean equals(deleteValue_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; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_key = true && (isSetKey()); builder.append(present_key); if (present_key) builder.append(key); return builder.toHashCode(); } public int compareTo(deleteValue_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; deleteValue_args typedOther = (deleteValue_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; } } 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("deleteValue_args("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 deleteValue_argsStandardSchemeFactory implements SchemeFactory { public deleteValue_argsStandardScheme getScheme() { return new deleteValue_argsStandardScheme(); } } private static class deleteValue_argsStandardScheme extends StandardScheme<deleteValue_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, deleteValue_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.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(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, deleteValue_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class deleteValue_argsTupleSchemeFactory implements SchemeFactory { public deleteValue_argsTupleScheme getScheme() { return new deleteValue_argsTupleScheme(); } } private static class deleteValue_argsTupleScheme extends TupleScheme<deleteValue_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, deleteValue_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetKey()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetKey()) { oprot.writeString(struct.key); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, deleteValue_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } } } } public static class deleteValue_result implements org.apache.thrift.TBase<deleteValue_result, deleteValue_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteValue_result"); private static final org.apache.thrift.protocol.TField IO_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("ioException", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField KEY_VALUE_STORE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("keyValueStoreException", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new deleteValue_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new deleteValue_resultTupleSchemeFactory()); } private KeyValueStoreIOException ioException; // required private KeyValueStoreException keyValueStoreException; // 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 { IO_EXCEPTION((short)1, "ioException"), KEY_VALUE_STORE_EXCEPTION((short)2, "keyValueStoreException"); 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: // IO_EXCEPTION return IO_EXCEPTION; case 2: // KEY_VALUE_STORE_EXCEPTION return KEY_VALUE_STORE_EXCEPTION; 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.IO_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("ioException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.KEY_VALUE_STORE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("keyValueStoreException", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteValue_result.class, metaDataMap); } public deleteValue_result() { } public deleteValue_result( KeyValueStoreIOException ioException, KeyValueStoreException keyValueStoreException) { this(); this.ioException = ioException; this.keyValueStoreException = keyValueStoreException; } /** * Performs a deep copy on <i>other</i>. */ public deleteValue_result(deleteValue_result other) { if (other.isSetIoException()) { this.ioException = new KeyValueStoreIOException(other.ioException); } if (other.isSetKeyValueStoreException()) { this.keyValueStoreException = new KeyValueStoreException(other.keyValueStoreException); } } public deleteValue_result deepCopy() { return new deleteValue_result(this); } @Override public void clear() { this.ioException = null; this.keyValueStoreException = null; } public KeyValueStoreIOException getIoException() { return this.ioException; } public void setIoException(KeyValueStoreIOException ioException) { this.ioException = ioException; } public void unsetIoException() { this.ioException = null; } /** Returns true if field ioException is set (has been assigned a value) and false otherwise */ public boolean isSetIoException() { return this.ioException != null; } public void setIoExceptionIsSet(boolean value) { if (!value) { this.ioException = null; } } public KeyValueStoreException getKeyValueStoreException() { return this.keyValueStoreException; } public void setKeyValueStoreException(KeyValueStoreException keyValueStoreException) { this.keyValueStoreException = keyValueStoreException; } public void unsetKeyValueStoreException() { this.keyValueStoreException = null; } /** Returns true if field keyValueStoreException is set (has been assigned a value) and false otherwise */ public boolean isSetKeyValueStoreException() { return this.keyValueStoreException != null; } public void setKeyValueStoreExceptionIsSet(boolean value) { if (!value) { this.keyValueStoreException = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case IO_EXCEPTION: if (value == null) { unsetIoException(); } else { setIoException((KeyValueStoreIOException)value); } break; case KEY_VALUE_STORE_EXCEPTION: if (value == null) { unsetKeyValueStoreException(); } else { setKeyValueStoreException((KeyValueStoreException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case IO_EXCEPTION: return getIoException(); case KEY_VALUE_STORE_EXCEPTION: return getKeyValueStoreException(); } 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 IO_EXCEPTION: return isSetIoException(); case KEY_VALUE_STORE_EXCEPTION: return isSetKeyValueStoreException(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof deleteValue_result) return this.equals((deleteValue_result)that); return false; } public boolean equals(deleteValue_result that) { if (that == null) return false; boolean this_present_ioException = true && this.isSetIoException(); boolean that_present_ioException = true && that.isSetIoException(); if (this_present_ioException || that_present_ioException) { if (!(this_present_ioException && that_present_ioException)) return false; if (!this.ioException.equals(that.ioException)) return false; } boolean this_present_keyValueStoreException = true && this.isSetKeyValueStoreException(); boolean that_present_keyValueStoreException = true && that.isSetKeyValueStoreException(); if (this_present_keyValueStoreException || that_present_keyValueStoreException) { if (!(this_present_keyValueStoreException && that_present_keyValueStoreException)) return false; if (!this.keyValueStoreException.equals(that.keyValueStoreException)) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_ioException = true && (isSetIoException()); builder.append(present_ioException); if (present_ioException) builder.append(ioException); boolean present_keyValueStoreException = true && (isSetKeyValueStoreException()); builder.append(present_keyValueStoreException); if (present_keyValueStoreException) builder.append(keyValueStoreException); return builder.toHashCode(); } public int compareTo(deleteValue_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; deleteValue_result typedOther = (deleteValue_result)other; lastComparison = Boolean.valueOf(isSetIoException()).compareTo(typedOther.isSetIoException()); if (lastComparison != 0) { return lastComparison; } if (isSetIoException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ioException, typedOther.ioException); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKeyValueStoreException()).compareTo(typedOther.isSetKeyValueStoreException()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyValueStoreException()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyValueStoreException, typedOther.keyValueStoreException); 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("deleteValue_result("); boolean first = true; sb.append("ioException:"); if (this.ioException == null) { sb.append("null"); } else { sb.append(this.ioException); } first = false; if (!first) sb.append(", "); sb.append("keyValueStoreException:"); if (this.keyValueStoreException == null) { sb.append("null"); } else { sb.append(this.keyValueStoreException); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 deleteValue_resultStandardSchemeFactory implements SchemeFactory { public deleteValue_resultStandardScheme getScheme() { return new deleteValue_resultStandardScheme(); } } private static class deleteValue_resultStandardScheme extends StandardScheme<deleteValue_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, deleteValue_result 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: // IO_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // KEY_VALUE_STORE_EXCEPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(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, deleteValue_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ioException != null) { oprot.writeFieldBegin(IO_EXCEPTION_FIELD_DESC); struct.ioException.write(oprot); oprot.writeFieldEnd(); } if (struct.keyValueStoreException != null) { oprot.writeFieldBegin(KEY_VALUE_STORE_EXCEPTION_FIELD_DESC); struct.keyValueStoreException.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class deleteValue_resultTupleSchemeFactory implements SchemeFactory { public deleteValue_resultTupleScheme getScheme() { return new deleteValue_resultTupleScheme(); } } private static class deleteValue_resultTupleScheme extends TupleScheme<deleteValue_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, deleteValue_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetIoException()) { optionals.set(0); } if (struct.isSetKeyValueStoreException()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetIoException()) { struct.ioException.write(oprot); } if (struct.isSetKeyValueStoreException()) { struct.keyValueStoreException.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, deleteValue_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.ioException = new KeyValueStoreIOException(); struct.ioException.read(iprot); struct.setIoExceptionIsSet(true); } if (incoming.get(1)) { struct.keyValueStoreException = new KeyValueStoreException(); struct.keyValueStoreException.read(iprot); struct.setKeyValueStoreExceptionIsSet(true); } } } } }