/** * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.leansoft.luxun.api.generated; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-09-24") public class QueueService { public interface Iface { public ProduceResponse produce(ProduceRequest produceRequest) throws org.apache.thrift.TException; public void asyncProduce(ProduceRequest produceRequest) throws org.apache.thrift.TException; public ConsumeResponse consume(ConsumeRequest consumeRequest) throws org.apache.thrift.TException; public FindClosestIndexByTimeResponse findClosestIndexByTime(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest) throws org.apache.thrift.TException; public DeleteTopicResponse deleteTopic(DeleteTopicRequest deleteTopicRequest) throws org.apache.thrift.TException; public GetSizeResponse getSize(GetSizeRequest getSizeRequest) throws org.apache.thrift.TException; } public interface AsyncIface { public void produce(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void asyncProduce(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void consume(ConsumeRequest consumeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void findClosestIndexByTime(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deleteTopic(DeleteTopicRequest deleteTopicRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getSize(GetSizeRequest getSizeRequest, org.apache.thrift.async.AsyncMethodCallback 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 ProduceResponse produce(ProduceRequest produceRequest) throws org.apache.thrift.TException { send_produce(produceRequest); return recv_produce(); } public void send_produce(ProduceRequest produceRequest) throws org.apache.thrift.TException { produce_args args = new produce_args(); args.setProduceRequest(produceRequest); sendBase("produce", args); } public ProduceResponse recv_produce() throws org.apache.thrift.TException { produce_result result = new produce_result(); receiveBase(result, "produce"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "produce failed: unknown result"); } public void asyncProduce(ProduceRequest produceRequest) throws org.apache.thrift.TException { send_asyncProduce(produceRequest); } public void send_asyncProduce(ProduceRequest produceRequest) throws org.apache.thrift.TException { asyncProduce_args args = new asyncProduce_args(); args.setProduceRequest(produceRequest); sendBaseOneway("asyncProduce", args); } public ConsumeResponse consume(ConsumeRequest consumeRequest) throws org.apache.thrift.TException { send_consume(consumeRequest); return recv_consume(); } public void send_consume(ConsumeRequest consumeRequest) throws org.apache.thrift.TException { consume_args args = new consume_args(); args.setConsumeRequest(consumeRequest); sendBase("consume", args); } public ConsumeResponse recv_consume() throws org.apache.thrift.TException { consume_result result = new consume_result(); receiveBase(result, "consume"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "consume failed: unknown result"); } public FindClosestIndexByTimeResponse findClosestIndexByTime(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest) throws org.apache.thrift.TException { send_findClosestIndexByTime(findClosestIndexByTimeRequest); return recv_findClosestIndexByTime(); } public void send_findClosestIndexByTime(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest) throws org.apache.thrift.TException { findClosestIndexByTime_args args = new findClosestIndexByTime_args(); args.setFindClosestIndexByTimeRequest(findClosestIndexByTimeRequest); sendBase("findClosestIndexByTime", args); } public FindClosestIndexByTimeResponse recv_findClosestIndexByTime() throws org.apache.thrift.TException { findClosestIndexByTime_result result = new findClosestIndexByTime_result(); receiveBase(result, "findClosestIndexByTime"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "findClosestIndexByTime failed: unknown result"); } public DeleteTopicResponse deleteTopic(DeleteTopicRequest deleteTopicRequest) throws org.apache.thrift.TException { send_deleteTopic(deleteTopicRequest); return recv_deleteTopic(); } public void send_deleteTopic(DeleteTopicRequest deleteTopicRequest) throws org.apache.thrift.TException { deleteTopic_args args = new deleteTopic_args(); args.setDeleteTopicRequest(deleteTopicRequest); sendBase("deleteTopic", args); } public DeleteTopicResponse recv_deleteTopic() throws org.apache.thrift.TException { deleteTopic_result result = new deleteTopic_result(); receiveBase(result, "deleteTopic"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteTopic failed: unknown result"); } public GetSizeResponse getSize(GetSizeRequest getSizeRequest) throws org.apache.thrift.TException { send_getSize(getSizeRequest); return recv_getSize(); } public void send_getSize(GetSizeRequest getSizeRequest) throws org.apache.thrift.TException { getSize_args args = new getSize_args(); args.setGetSizeRequest(getSizeRequest); sendBase("getSize", args); } public GetSizeResponse recv_getSize() throws org.apache.thrift.TException { getSize_result result = new getSize_result(); receiveBase(result, "getSize"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSize failed: unknown result"); } } 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 produce(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); produce_call method_call = new produce_call(produceRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class produce_call extends org.apache.thrift.async.TAsyncMethodCall { private ProduceRequest produceRequest; public produce_call(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.produceRequest = produceRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("produce", org.apache.thrift.protocol.TMessageType.CALL, 0)); produce_args args = new produce_args(); args.setProduceRequest(produceRequest); args.write(prot); prot.writeMessageEnd(); } public ProduceResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_produce(); } } public void asyncProduce(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); asyncProduce_call method_call = new asyncProduce_call(produceRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class asyncProduce_call extends org.apache.thrift.async.TAsyncMethodCall { private ProduceRequest produceRequest; public asyncProduce_call(ProduceRequest produceRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, true); this.produceRequest = produceRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("asyncProduce", org.apache.thrift.protocol.TMessageType.ONEWAY, 0)); asyncProduce_args args = new asyncProduce_args(); args.setProduceRequest(produceRequest); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); } } public void consume(ConsumeRequest consumeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); consume_call method_call = new consume_call(consumeRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class consume_call extends org.apache.thrift.async.TAsyncMethodCall { private ConsumeRequest consumeRequest; public consume_call(ConsumeRequest consumeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.consumeRequest = consumeRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("consume", org.apache.thrift.protocol.TMessageType.CALL, 0)); consume_args args = new consume_args(); args.setConsumeRequest(consumeRequest); args.write(prot); prot.writeMessageEnd(); } public ConsumeResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_consume(); } } public void findClosestIndexByTime(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); findClosestIndexByTime_call method_call = new findClosestIndexByTime_call(findClosestIndexByTimeRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class findClosestIndexByTime_call extends org.apache.thrift.async.TAsyncMethodCall { private FindClosestIndexByTimeRequest findClosestIndexByTimeRequest; public findClosestIndexByTime_call(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.findClosestIndexByTimeRequest = findClosestIndexByTimeRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("findClosestIndexByTime", org.apache.thrift.protocol.TMessageType.CALL, 0)); findClosestIndexByTime_args args = new findClosestIndexByTime_args(); args.setFindClosestIndexByTimeRequest(findClosestIndexByTimeRequest); args.write(prot); prot.writeMessageEnd(); } public FindClosestIndexByTimeResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_findClosestIndexByTime(); } } public void deleteTopic(DeleteTopicRequest deleteTopicRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); deleteTopic_call method_call = new deleteTopic_call(deleteTopicRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class deleteTopic_call extends org.apache.thrift.async.TAsyncMethodCall { private DeleteTopicRequest deleteTopicRequest; public deleteTopic_call(DeleteTopicRequest deleteTopicRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.deleteTopicRequest = deleteTopicRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteTopic", org.apache.thrift.protocol.TMessageType.CALL, 0)); deleteTopic_args args = new deleteTopic_args(); args.setDeleteTopicRequest(deleteTopicRequest); args.write(prot); prot.writeMessageEnd(); } public DeleteTopicResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_deleteTopic(); } } public void getSize(GetSizeRequest getSizeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getSize_call method_call = new getSize_call(getSizeRequest, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSize_call extends org.apache.thrift.async.TAsyncMethodCall { private GetSizeRequest getSizeRequest; public getSize_call(GetSizeRequest getSizeRequest, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.getSizeRequest = getSizeRequest; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSize", org.apache.thrift.protocol.TMessageType.CALL, 0)); getSize_args args = new getSize_args(); args.setGetSizeRequest(getSizeRequest); args.write(prot); prot.writeMessageEnd(); } public GetSizeResponse getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getSize(); } } } 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("produce", new produce()); processMap.put("asyncProduce", new asyncProduce()); processMap.put("consume", new consume()); processMap.put("findClosestIndexByTime", new findClosestIndexByTime()); processMap.put("deleteTopic", new deleteTopic()); processMap.put("getSize", new getSize()); return processMap; } public static class produce<I extends Iface> extends org.apache.thrift.ProcessFunction<I, produce_args> { public produce() { super("produce"); } public produce_args getEmptyArgsInstance() { return new produce_args(); } protected boolean isOneway() { return false; } public produce_result getResult(I iface, produce_args args) throws org.apache.thrift.TException { produce_result result = new produce_result(); result.success = iface.produce(args.produceRequest); return result; } } public static class asyncProduce<I extends Iface> extends org.apache.thrift.ProcessFunction<I, asyncProduce_args> { public asyncProduce() { super("asyncProduce"); } public asyncProduce_args getEmptyArgsInstance() { return new asyncProduce_args(); } protected boolean isOneway() { return true; } public org.apache.thrift.TBase getResult(I iface, asyncProduce_args args) throws org.apache.thrift.TException { iface.asyncProduce(args.produceRequest); return null; } } public static class consume<I extends Iface> extends org.apache.thrift.ProcessFunction<I, consume_args> { public consume() { super("consume"); } public consume_args getEmptyArgsInstance() { return new consume_args(); } protected boolean isOneway() { return false; } public consume_result getResult(I iface, consume_args args) throws org.apache.thrift.TException { consume_result result = new consume_result(); result.success = iface.consume(args.consumeRequest); return result; } } public static class findClosestIndexByTime<I extends Iface> extends org.apache.thrift.ProcessFunction<I, findClosestIndexByTime_args> { public findClosestIndexByTime() { super("findClosestIndexByTime"); } public findClosestIndexByTime_args getEmptyArgsInstance() { return new findClosestIndexByTime_args(); } protected boolean isOneway() { return false; } public findClosestIndexByTime_result getResult(I iface, findClosestIndexByTime_args args) throws org.apache.thrift.TException { findClosestIndexByTime_result result = new findClosestIndexByTime_result(); result.success = iface.findClosestIndexByTime(args.findClosestIndexByTimeRequest); return result; } } public static class deleteTopic<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteTopic_args> { public deleteTopic() { super("deleteTopic"); } public deleteTopic_args getEmptyArgsInstance() { return new deleteTopic_args(); } protected boolean isOneway() { return false; } public deleteTopic_result getResult(I iface, deleteTopic_args args) throws org.apache.thrift.TException { deleteTopic_result result = new deleteTopic_result(); result.success = iface.deleteTopic(args.deleteTopicRequest); return result; } } public static class getSize<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSize_args> { public getSize() { super("getSize"); } public getSize_args getEmptyArgsInstance() { return new getSize_args(); } protected boolean isOneway() { return false; } public getSize_result getResult(I iface, getSize_args args) throws org.apache.thrift.TException { getSize_result result = new getSize_result(); result.success = iface.getSize(args.getSizeRequest); return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) { processMap.put("produce", new produce()); processMap.put("asyncProduce", new asyncProduce()); processMap.put("consume", new consume()); processMap.put("findClosestIndexByTime", new findClosestIndexByTime()); processMap.put("deleteTopic", new deleteTopic()); processMap.put("getSize", new getSize()); return processMap; } public static class produce<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, produce_args, ProduceResponse> { public produce() { super("produce"); } public produce_args getEmptyArgsInstance() { return new produce_args(); } public AsyncMethodCallback<ProduceResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ProduceResponse>() { public void onComplete(ProduceResponse o) { produce_result result = new produce_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; produce_result result = new produce_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, produce_args args, org.apache.thrift.async.AsyncMethodCallback<ProduceResponse> resultHandler) throws TException { iface.produce(args.produceRequest,resultHandler); } } public static class asyncProduce<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, asyncProduce_args, Void> { public asyncProduce() { super("asyncProduce"); } public asyncProduce_args getEmptyArgsInstance() { return new asyncProduce_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { } public void onError(Exception e) { } }; } protected boolean isOneway() { return true; } public void start(I iface, asyncProduce_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.asyncProduce(args.produceRequest,resultHandler); } } public static class consume<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, consume_args, ConsumeResponse> { public consume() { super("consume"); } public consume_args getEmptyArgsInstance() { return new consume_args(); } public AsyncMethodCallback<ConsumeResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ConsumeResponse>() { public void onComplete(ConsumeResponse o) { consume_result result = new consume_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; consume_result result = new consume_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, consume_args args, org.apache.thrift.async.AsyncMethodCallback<ConsumeResponse> resultHandler) throws TException { iface.consume(args.consumeRequest,resultHandler); } } public static class findClosestIndexByTime<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, findClosestIndexByTime_args, FindClosestIndexByTimeResponse> { public findClosestIndexByTime() { super("findClosestIndexByTime"); } public findClosestIndexByTime_args getEmptyArgsInstance() { return new findClosestIndexByTime_args(); } public AsyncMethodCallback<FindClosestIndexByTimeResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<FindClosestIndexByTimeResponse>() { public void onComplete(FindClosestIndexByTimeResponse o) { findClosestIndexByTime_result result = new findClosestIndexByTime_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; findClosestIndexByTime_result result = new findClosestIndexByTime_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, findClosestIndexByTime_args args, org.apache.thrift.async.AsyncMethodCallback<FindClosestIndexByTimeResponse> resultHandler) throws TException { iface.findClosestIndexByTime(args.findClosestIndexByTimeRequest,resultHandler); } } public static class deleteTopic<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteTopic_args, DeleteTopicResponse> { public deleteTopic() { super("deleteTopic"); } public deleteTopic_args getEmptyArgsInstance() { return new deleteTopic_args(); } public AsyncMethodCallback<DeleteTopicResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<DeleteTopicResponse>() { public void onComplete(DeleteTopicResponse o) { deleteTopic_result result = new deleteTopic_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; deleteTopic_result result = new deleteTopic_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, deleteTopic_args args, org.apache.thrift.async.AsyncMethodCallback<DeleteTopicResponse> resultHandler) throws TException { iface.deleteTopic(args.deleteTopicRequest,resultHandler); } } public static class getSize<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSize_args, GetSizeResponse> { public getSize() { super("getSize"); } public getSize_args getEmptyArgsInstance() { return new getSize_args(); } public AsyncMethodCallback<GetSizeResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<GetSizeResponse>() { public void onComplete(GetSizeResponse o) { getSize_result result = new getSize_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getSize_result result = new getSize_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, getSize_args args, org.apache.thrift.async.AsyncMethodCallback<GetSizeResponse> resultHandler) throws TException { iface.getSize(args.getSizeRequest,resultHandler); } } } public static class produce_args implements org.apache.thrift.TBase<produce_args, produce_args._Fields>, java.io.Serializable, Cloneable, Comparable<produce_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("produce_args"); private static final org.apache.thrift.protocol.TField PRODUCE_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("produceRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new produce_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new produce_argsTupleSchemeFactory()); } private ProduceRequest produceRequest; // 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 { PRODUCE_REQUEST((short)1, "produceRequest"); 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: // PRODUCE_REQUEST return PRODUCE_REQUEST; 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.PRODUCE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("produceRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProduceRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(produce_args.class, metaDataMap); } public produce_args() { } public produce_args( ProduceRequest produceRequest) { this(); this.produceRequest = produceRequest; } /** * Performs a deep copy on <i>other</i>. */ public produce_args(produce_args other) { if (other.isSetProduceRequest()) { this.produceRequest = new ProduceRequest(other.produceRequest); } } public produce_args deepCopy() { return new produce_args(this); } @Override public void clear() { this.produceRequest = null; } public ProduceRequest getProduceRequest() { return this.produceRequest; } public void setProduceRequest(ProduceRequest produceRequest) { this.produceRequest = produceRequest; } public void unsetProduceRequest() { this.produceRequest = null; } /** Returns true if field produceRequest is set (has been assigned a value) and false otherwise */ public boolean isSetProduceRequest() { return this.produceRequest != null; } public void setProduceRequestIsSet(boolean value) { if (!value) { this.produceRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PRODUCE_REQUEST: if (value == null) { unsetProduceRequest(); } else { setProduceRequest((ProduceRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PRODUCE_REQUEST: return getProduceRequest(); } 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 PRODUCE_REQUEST: return isSetProduceRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof produce_args) return this.equals((produce_args)that); return false; } public boolean equals(produce_args that) { if (that == null) return false; boolean this_present_produceRequest = true && this.isSetProduceRequest(); boolean that_present_produceRequest = true && that.isSetProduceRequest(); if (this_present_produceRequest || that_present_produceRequest) { if (!(this_present_produceRequest && that_present_produceRequest)) return false; if (!this.produceRequest.equals(that.produceRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_produceRequest = true && (isSetProduceRequest()); list.add(present_produceRequest); if (present_produceRequest) list.add(produceRequest); return list.hashCode(); } @Override public int compareTo(produce_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetProduceRequest()).compareTo(other.isSetProduceRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetProduceRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.produceRequest, other.produceRequest); 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("produce_args("); boolean first = true; sb.append("produceRequest:"); if (this.produceRequest == null) { sb.append("null"); } else { sb.append(this.produceRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (produceRequest != null) { produceRequest.validate(); } } 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 produce_argsStandardSchemeFactory implements SchemeFactory { public produce_argsStandardScheme getScheme() { return new produce_argsStandardScheme(); } } private static class produce_argsStandardScheme extends StandardScheme<produce_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, produce_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: // PRODUCE_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.produceRequest = new ProduceRequest(); struct.produceRequest.read(iprot); struct.setProduceRequestIsSet(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, produce_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.produceRequest != null) { oprot.writeFieldBegin(PRODUCE_REQUEST_FIELD_DESC); struct.produceRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class produce_argsTupleSchemeFactory implements SchemeFactory { public produce_argsTupleScheme getScheme() { return new produce_argsTupleScheme(); } } private static class produce_argsTupleScheme extends TupleScheme<produce_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, produce_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetProduceRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetProduceRequest()) { struct.produceRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, produce_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.produceRequest = new ProduceRequest(); struct.produceRequest.read(iprot); struct.setProduceRequestIsSet(true); } } } } public static class produce_result implements org.apache.thrift.TBase<produce_result, produce_result._Fields>, java.io.Serializable, Cloneable, Comparable<produce_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("produce_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new produce_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new produce_resultTupleSchemeFactory()); } private ProduceResponse success; // 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"); 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; 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, ProduceResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(produce_result.class, metaDataMap); } public produce_result() { } public produce_result( ProduceResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public produce_result(produce_result other) { if (other.isSetSuccess()) { this.success = new ProduceResponse(other.success); } } public produce_result deepCopy() { return new produce_result(this); } @Override public void clear() { this.success = null; } public ProduceResponse getSuccess() { return this.success; } public void setSuccess(ProduceResponse 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 void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ProduceResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof produce_result) return this.equals((produce_result)that); return false; } public boolean equals(produce_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; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(produce_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); 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("produce_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } 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 produce_resultStandardSchemeFactory implements SchemeFactory { public produce_resultStandardScheme getScheme() { return new produce_resultStandardScheme(); } } private static class produce_resultStandardScheme extends StandardScheme<produce_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, produce_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 ProduceResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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, produce_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(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class produce_resultTupleSchemeFactory implements SchemeFactory { public produce_resultTupleScheme getScheme() { return new produce_resultTupleScheme(); } } private static class produce_resultTupleScheme extends TupleScheme<produce_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, produce_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, produce_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new ProduceResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } } } public static class asyncProduce_args implements org.apache.thrift.TBase<asyncProduce_args, asyncProduce_args._Fields>, java.io.Serializable, Cloneable, Comparable<asyncProduce_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("asyncProduce_args"); private static final org.apache.thrift.protocol.TField PRODUCE_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("produceRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new asyncProduce_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new asyncProduce_argsTupleSchemeFactory()); } private ProduceRequest produceRequest; // 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 { PRODUCE_REQUEST((short)1, "produceRequest"); 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: // PRODUCE_REQUEST return PRODUCE_REQUEST; 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.PRODUCE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("produceRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ProduceRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(asyncProduce_args.class, metaDataMap); } public asyncProduce_args() { } public asyncProduce_args( ProduceRequest produceRequest) { this(); this.produceRequest = produceRequest; } /** * Performs a deep copy on <i>other</i>. */ public asyncProduce_args(asyncProduce_args other) { if (other.isSetProduceRequest()) { this.produceRequest = new ProduceRequest(other.produceRequest); } } public asyncProduce_args deepCopy() { return new asyncProduce_args(this); } @Override public void clear() { this.produceRequest = null; } public ProduceRequest getProduceRequest() { return this.produceRequest; } public void setProduceRequest(ProduceRequest produceRequest) { this.produceRequest = produceRequest; } public void unsetProduceRequest() { this.produceRequest = null; } /** Returns true if field produceRequest is set (has been assigned a value) and false otherwise */ public boolean isSetProduceRequest() { return this.produceRequest != null; } public void setProduceRequestIsSet(boolean value) { if (!value) { this.produceRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case PRODUCE_REQUEST: if (value == null) { unsetProduceRequest(); } else { setProduceRequest((ProduceRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case PRODUCE_REQUEST: return getProduceRequest(); } 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 PRODUCE_REQUEST: return isSetProduceRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof asyncProduce_args) return this.equals((asyncProduce_args)that); return false; } public boolean equals(asyncProduce_args that) { if (that == null) return false; boolean this_present_produceRequest = true && this.isSetProduceRequest(); boolean that_present_produceRequest = true && that.isSetProduceRequest(); if (this_present_produceRequest || that_present_produceRequest) { if (!(this_present_produceRequest && that_present_produceRequest)) return false; if (!this.produceRequest.equals(that.produceRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_produceRequest = true && (isSetProduceRequest()); list.add(present_produceRequest); if (present_produceRequest) list.add(produceRequest); return list.hashCode(); } @Override public int compareTo(asyncProduce_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetProduceRequest()).compareTo(other.isSetProduceRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetProduceRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.produceRequest, other.produceRequest); 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("asyncProduce_args("); boolean first = true; sb.append("produceRequest:"); if (this.produceRequest == null) { sb.append("null"); } else { sb.append(this.produceRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (produceRequest != null) { produceRequest.validate(); } } 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 asyncProduce_argsStandardSchemeFactory implements SchemeFactory { public asyncProduce_argsStandardScheme getScheme() { return new asyncProduce_argsStandardScheme(); } } private static class asyncProduce_argsStandardScheme extends StandardScheme<asyncProduce_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, asyncProduce_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: // PRODUCE_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.produceRequest = new ProduceRequest(); struct.produceRequest.read(iprot); struct.setProduceRequestIsSet(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, asyncProduce_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.produceRequest != null) { oprot.writeFieldBegin(PRODUCE_REQUEST_FIELD_DESC); struct.produceRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class asyncProduce_argsTupleSchemeFactory implements SchemeFactory { public asyncProduce_argsTupleScheme getScheme() { return new asyncProduce_argsTupleScheme(); } } private static class asyncProduce_argsTupleScheme extends TupleScheme<asyncProduce_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, asyncProduce_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetProduceRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetProduceRequest()) { struct.produceRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, asyncProduce_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.produceRequest = new ProduceRequest(); struct.produceRequest.read(iprot); struct.setProduceRequestIsSet(true); } } } } public static class consume_args implements org.apache.thrift.TBase<consume_args, consume_args._Fields>, java.io.Serializable, Cloneable, Comparable<consume_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("consume_args"); private static final org.apache.thrift.protocol.TField CONSUME_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("consumeRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new consume_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new consume_argsTupleSchemeFactory()); } private ConsumeRequest consumeRequest; // 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 { CONSUME_REQUEST((short)1, "consumeRequest"); 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: // CONSUME_REQUEST return CONSUME_REQUEST; 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.CONSUME_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("consumeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ConsumeRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consume_args.class, metaDataMap); } public consume_args() { } public consume_args( ConsumeRequest consumeRequest) { this(); this.consumeRequest = consumeRequest; } /** * Performs a deep copy on <i>other</i>. */ public consume_args(consume_args other) { if (other.isSetConsumeRequest()) { this.consumeRequest = new ConsumeRequest(other.consumeRequest); } } public consume_args deepCopy() { return new consume_args(this); } @Override public void clear() { this.consumeRequest = null; } public ConsumeRequest getConsumeRequest() { return this.consumeRequest; } public void setConsumeRequest(ConsumeRequest consumeRequest) { this.consumeRequest = consumeRequest; } public void unsetConsumeRequest() { this.consumeRequest = null; } /** Returns true if field consumeRequest is set (has been assigned a value) and false otherwise */ public boolean isSetConsumeRequest() { return this.consumeRequest != null; } public void setConsumeRequestIsSet(boolean value) { if (!value) { this.consumeRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case CONSUME_REQUEST: if (value == null) { unsetConsumeRequest(); } else { setConsumeRequest((ConsumeRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case CONSUME_REQUEST: return getConsumeRequest(); } 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 CONSUME_REQUEST: return isSetConsumeRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof consume_args) return this.equals((consume_args)that); return false; } public boolean equals(consume_args that) { if (that == null) return false; boolean this_present_consumeRequest = true && this.isSetConsumeRequest(); boolean that_present_consumeRequest = true && that.isSetConsumeRequest(); if (this_present_consumeRequest || that_present_consumeRequest) { if (!(this_present_consumeRequest && that_present_consumeRequest)) return false; if (!this.consumeRequest.equals(that.consumeRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_consumeRequest = true && (isSetConsumeRequest()); list.add(present_consumeRequest); if (present_consumeRequest) list.add(consumeRequest); return list.hashCode(); } @Override public int compareTo(consume_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetConsumeRequest()).compareTo(other.isSetConsumeRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetConsumeRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consumeRequest, other.consumeRequest); 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("consume_args("); boolean first = true; sb.append("consumeRequest:"); if (this.consumeRequest == null) { sb.append("null"); } else { sb.append(this.consumeRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (consumeRequest != null) { consumeRequest.validate(); } } 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 consume_argsStandardSchemeFactory implements SchemeFactory { public consume_argsStandardScheme getScheme() { return new consume_argsStandardScheme(); } } private static class consume_argsStandardScheme extends StandardScheme<consume_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, consume_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: // CONSUME_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.consumeRequest = new ConsumeRequest(); struct.consumeRequest.read(iprot); struct.setConsumeRequestIsSet(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, consume_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.consumeRequest != null) { oprot.writeFieldBegin(CONSUME_REQUEST_FIELD_DESC); struct.consumeRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class consume_argsTupleSchemeFactory implements SchemeFactory { public consume_argsTupleScheme getScheme() { return new consume_argsTupleScheme(); } } private static class consume_argsTupleScheme extends TupleScheme<consume_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, consume_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetConsumeRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetConsumeRequest()) { struct.consumeRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, consume_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.consumeRequest = new ConsumeRequest(); struct.consumeRequest.read(iprot); struct.setConsumeRequestIsSet(true); } } } } public static class consume_result implements org.apache.thrift.TBase<consume_result, consume_result._Fields>, java.io.Serializable, Cloneable, Comparable<consume_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("consume_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new consume_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new consume_resultTupleSchemeFactory()); } private ConsumeResponse success; // 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"); 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; 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, ConsumeResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(consume_result.class, metaDataMap); } public consume_result() { } public consume_result( ConsumeResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public consume_result(consume_result other) { if (other.isSetSuccess()) { this.success = new ConsumeResponse(other.success); } } public consume_result deepCopy() { return new consume_result(this); } @Override public void clear() { this.success = null; } public ConsumeResponse getSuccess() { return this.success; } public void setSuccess(ConsumeResponse 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 void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ConsumeResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof consume_result) return this.equals((consume_result)that); return false; } public boolean equals(consume_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; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(consume_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); 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("consume_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } 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 consume_resultStandardSchemeFactory implements SchemeFactory { public consume_resultStandardScheme getScheme() { return new consume_resultStandardScheme(); } } private static class consume_resultStandardScheme extends StandardScheme<consume_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, consume_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 ConsumeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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, consume_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(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class consume_resultTupleSchemeFactory implements SchemeFactory { public consume_resultTupleScheme getScheme() { return new consume_resultTupleScheme(); } } private static class consume_resultTupleScheme extends TupleScheme<consume_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, consume_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, consume_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new ConsumeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } } } public static class findClosestIndexByTime_args implements org.apache.thrift.TBase<findClosestIndexByTime_args, findClosestIndexByTime_args._Fields>, java.io.Serializable, Cloneable, Comparable<findClosestIndexByTime_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findClosestIndexByTime_args"); private static final org.apache.thrift.protocol.TField FIND_CLOSEST_INDEX_BY_TIME_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("findClosestIndexByTimeRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new findClosestIndexByTime_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new findClosestIndexByTime_argsTupleSchemeFactory()); } private FindClosestIndexByTimeRequest findClosestIndexByTimeRequest; // 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 { FIND_CLOSEST_INDEX_BY_TIME_REQUEST((short)1, "findClosestIndexByTimeRequest"); 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: // FIND_CLOSEST_INDEX_BY_TIME_REQUEST return FIND_CLOSEST_INDEX_BY_TIME_REQUEST; 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.FIND_CLOSEST_INDEX_BY_TIME_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("findClosestIndexByTimeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FindClosestIndexByTimeRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(findClosestIndexByTime_args.class, metaDataMap); } public findClosestIndexByTime_args() { } public findClosestIndexByTime_args( FindClosestIndexByTimeRequest findClosestIndexByTimeRequest) { this(); this.findClosestIndexByTimeRequest = findClosestIndexByTimeRequest; } /** * Performs a deep copy on <i>other</i>. */ public findClosestIndexByTime_args(findClosestIndexByTime_args other) { if (other.isSetFindClosestIndexByTimeRequest()) { this.findClosestIndexByTimeRequest = new FindClosestIndexByTimeRequest(other.findClosestIndexByTimeRequest); } } public findClosestIndexByTime_args deepCopy() { return new findClosestIndexByTime_args(this); } @Override public void clear() { this.findClosestIndexByTimeRequest = null; } public FindClosestIndexByTimeRequest getFindClosestIndexByTimeRequest() { return this.findClosestIndexByTimeRequest; } public void setFindClosestIndexByTimeRequest(FindClosestIndexByTimeRequest findClosestIndexByTimeRequest) { this.findClosestIndexByTimeRequest = findClosestIndexByTimeRequest; } public void unsetFindClosestIndexByTimeRequest() { this.findClosestIndexByTimeRequest = null; } /** Returns true if field findClosestIndexByTimeRequest is set (has been assigned a value) and false otherwise */ public boolean isSetFindClosestIndexByTimeRequest() { return this.findClosestIndexByTimeRequest != null; } public void setFindClosestIndexByTimeRequestIsSet(boolean value) { if (!value) { this.findClosestIndexByTimeRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case FIND_CLOSEST_INDEX_BY_TIME_REQUEST: if (value == null) { unsetFindClosestIndexByTimeRequest(); } else { setFindClosestIndexByTimeRequest((FindClosestIndexByTimeRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case FIND_CLOSEST_INDEX_BY_TIME_REQUEST: return getFindClosestIndexByTimeRequest(); } 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 FIND_CLOSEST_INDEX_BY_TIME_REQUEST: return isSetFindClosestIndexByTimeRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof findClosestIndexByTime_args) return this.equals((findClosestIndexByTime_args)that); return false; } public boolean equals(findClosestIndexByTime_args that) { if (that == null) return false; boolean this_present_findClosestIndexByTimeRequest = true && this.isSetFindClosestIndexByTimeRequest(); boolean that_present_findClosestIndexByTimeRequest = true && that.isSetFindClosestIndexByTimeRequest(); if (this_present_findClosestIndexByTimeRequest || that_present_findClosestIndexByTimeRequest) { if (!(this_present_findClosestIndexByTimeRequest && that_present_findClosestIndexByTimeRequest)) return false; if (!this.findClosestIndexByTimeRequest.equals(that.findClosestIndexByTimeRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_findClosestIndexByTimeRequest = true && (isSetFindClosestIndexByTimeRequest()); list.add(present_findClosestIndexByTimeRequest); if (present_findClosestIndexByTimeRequest) list.add(findClosestIndexByTimeRequest); return list.hashCode(); } @Override public int compareTo(findClosestIndexByTime_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetFindClosestIndexByTimeRequest()).compareTo(other.isSetFindClosestIndexByTimeRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetFindClosestIndexByTimeRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.findClosestIndexByTimeRequest, other.findClosestIndexByTimeRequest); 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("findClosestIndexByTime_args("); boolean first = true; sb.append("findClosestIndexByTimeRequest:"); if (this.findClosestIndexByTimeRequest == null) { sb.append("null"); } else { sb.append(this.findClosestIndexByTimeRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (findClosestIndexByTimeRequest != null) { findClosestIndexByTimeRequest.validate(); } } 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 findClosestIndexByTime_argsStandardSchemeFactory implements SchemeFactory { public findClosestIndexByTime_argsStandardScheme getScheme() { return new findClosestIndexByTime_argsStandardScheme(); } } private static class findClosestIndexByTime_argsStandardScheme extends StandardScheme<findClosestIndexByTime_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, findClosestIndexByTime_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: // FIND_CLOSEST_INDEX_BY_TIME_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.findClosestIndexByTimeRequest = new FindClosestIndexByTimeRequest(); struct.findClosestIndexByTimeRequest.read(iprot); struct.setFindClosestIndexByTimeRequestIsSet(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, findClosestIndexByTime_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.findClosestIndexByTimeRequest != null) { oprot.writeFieldBegin(FIND_CLOSEST_INDEX_BY_TIME_REQUEST_FIELD_DESC); struct.findClosestIndexByTimeRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class findClosestIndexByTime_argsTupleSchemeFactory implements SchemeFactory { public findClosestIndexByTime_argsTupleScheme getScheme() { return new findClosestIndexByTime_argsTupleScheme(); } } private static class findClosestIndexByTime_argsTupleScheme extends TupleScheme<findClosestIndexByTime_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, findClosestIndexByTime_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetFindClosestIndexByTimeRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetFindClosestIndexByTimeRequest()) { struct.findClosestIndexByTimeRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, findClosestIndexByTime_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.findClosestIndexByTimeRequest = new FindClosestIndexByTimeRequest(); struct.findClosestIndexByTimeRequest.read(iprot); struct.setFindClosestIndexByTimeRequestIsSet(true); } } } } public static class findClosestIndexByTime_result implements org.apache.thrift.TBase<findClosestIndexByTime_result, findClosestIndexByTime_result._Fields>, java.io.Serializable, Cloneable, Comparable<findClosestIndexByTime_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findClosestIndexByTime_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new findClosestIndexByTime_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new findClosestIndexByTime_resultTupleSchemeFactory()); } private FindClosestIndexByTimeResponse success; // 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"); 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; 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, FindClosestIndexByTimeResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(findClosestIndexByTime_result.class, metaDataMap); } public findClosestIndexByTime_result() { } public findClosestIndexByTime_result( FindClosestIndexByTimeResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public findClosestIndexByTime_result(findClosestIndexByTime_result other) { if (other.isSetSuccess()) { this.success = new FindClosestIndexByTimeResponse(other.success); } } public findClosestIndexByTime_result deepCopy() { return new findClosestIndexByTime_result(this); } @Override public void clear() { this.success = null; } public FindClosestIndexByTimeResponse getSuccess() { return this.success; } public void setSuccess(FindClosestIndexByTimeResponse 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 void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((FindClosestIndexByTimeResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof findClosestIndexByTime_result) return this.equals((findClosestIndexByTime_result)that); return false; } public boolean equals(findClosestIndexByTime_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; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(findClosestIndexByTime_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); 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("findClosestIndexByTime_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } 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 findClosestIndexByTime_resultStandardSchemeFactory implements SchemeFactory { public findClosestIndexByTime_resultStandardScheme getScheme() { return new findClosestIndexByTime_resultStandardScheme(); } } private static class findClosestIndexByTime_resultStandardScheme extends StandardScheme<findClosestIndexByTime_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, findClosestIndexByTime_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 FindClosestIndexByTimeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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, findClosestIndexByTime_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(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class findClosestIndexByTime_resultTupleSchemeFactory implements SchemeFactory { public findClosestIndexByTime_resultTupleScheme getScheme() { return new findClosestIndexByTime_resultTupleScheme(); } } private static class findClosestIndexByTime_resultTupleScheme extends TupleScheme<findClosestIndexByTime_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, findClosestIndexByTime_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, findClosestIndexByTime_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new FindClosestIndexByTimeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } } } public static class deleteTopic_args implements org.apache.thrift.TBase<deleteTopic_args, deleteTopic_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteTopic_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteTopic_args"); private static final org.apache.thrift.protocol.TField DELETE_TOPIC_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("deleteTopicRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new deleteTopic_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new deleteTopic_argsTupleSchemeFactory()); } private DeleteTopicRequest deleteTopicRequest; // 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 { DELETE_TOPIC_REQUEST((short)1, "deleteTopicRequest"); 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: // DELETE_TOPIC_REQUEST return DELETE_TOPIC_REQUEST; 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.DELETE_TOPIC_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("deleteTopicRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DeleteTopicRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteTopic_args.class, metaDataMap); } public deleteTopic_args() { } public deleteTopic_args( DeleteTopicRequest deleteTopicRequest) { this(); this.deleteTopicRequest = deleteTopicRequest; } /** * Performs a deep copy on <i>other</i>. */ public deleteTopic_args(deleteTopic_args other) { if (other.isSetDeleteTopicRequest()) { this.deleteTopicRequest = new DeleteTopicRequest(other.deleteTopicRequest); } } public deleteTopic_args deepCopy() { return new deleteTopic_args(this); } @Override public void clear() { this.deleteTopicRequest = null; } public DeleteTopicRequest getDeleteTopicRequest() { return this.deleteTopicRequest; } public void setDeleteTopicRequest(DeleteTopicRequest deleteTopicRequest) { this.deleteTopicRequest = deleteTopicRequest; } public void unsetDeleteTopicRequest() { this.deleteTopicRequest = null; } /** Returns true if field deleteTopicRequest is set (has been assigned a value) and false otherwise */ public boolean isSetDeleteTopicRequest() { return this.deleteTopicRequest != null; } public void setDeleteTopicRequestIsSet(boolean value) { if (!value) { this.deleteTopicRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case DELETE_TOPIC_REQUEST: if (value == null) { unsetDeleteTopicRequest(); } else { setDeleteTopicRequest((DeleteTopicRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case DELETE_TOPIC_REQUEST: return getDeleteTopicRequest(); } 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 DELETE_TOPIC_REQUEST: return isSetDeleteTopicRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof deleteTopic_args) return this.equals((deleteTopic_args)that); return false; } public boolean equals(deleteTopic_args that) { if (that == null) return false; boolean this_present_deleteTopicRequest = true && this.isSetDeleteTopicRequest(); boolean that_present_deleteTopicRequest = true && that.isSetDeleteTopicRequest(); if (this_present_deleteTopicRequest || that_present_deleteTopicRequest) { if (!(this_present_deleteTopicRequest && that_present_deleteTopicRequest)) return false; if (!this.deleteTopicRequest.equals(that.deleteTopicRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_deleteTopicRequest = true && (isSetDeleteTopicRequest()); list.add(present_deleteTopicRequest); if (present_deleteTopicRequest) list.add(deleteTopicRequest); return list.hashCode(); } @Override public int compareTo(deleteTopic_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetDeleteTopicRequest()).compareTo(other.isSetDeleteTopicRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetDeleteTopicRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deleteTopicRequest, other.deleteTopicRequest); 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("deleteTopic_args("); boolean first = true; sb.append("deleteTopicRequest:"); if (this.deleteTopicRequest == null) { sb.append("null"); } else { sb.append(this.deleteTopicRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (deleteTopicRequest != null) { deleteTopicRequest.validate(); } } 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 deleteTopic_argsStandardSchemeFactory implements SchemeFactory { public deleteTopic_argsStandardScheme getScheme() { return new deleteTopic_argsStandardScheme(); } } private static class deleteTopic_argsStandardScheme extends StandardScheme<deleteTopic_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, deleteTopic_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: // DELETE_TOPIC_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.deleteTopicRequest = new DeleteTopicRequest(); struct.deleteTopicRequest.read(iprot); struct.setDeleteTopicRequestIsSet(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, deleteTopic_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.deleteTopicRequest != null) { oprot.writeFieldBegin(DELETE_TOPIC_REQUEST_FIELD_DESC); struct.deleteTopicRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class deleteTopic_argsTupleSchemeFactory implements SchemeFactory { public deleteTopic_argsTupleScheme getScheme() { return new deleteTopic_argsTupleScheme(); } } private static class deleteTopic_argsTupleScheme extends TupleScheme<deleteTopic_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, deleteTopic_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetDeleteTopicRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetDeleteTopicRequest()) { struct.deleteTopicRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, deleteTopic_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.deleteTopicRequest = new DeleteTopicRequest(); struct.deleteTopicRequest.read(iprot); struct.setDeleteTopicRequestIsSet(true); } } } } public static class deleteTopic_result implements org.apache.thrift.TBase<deleteTopic_result, deleteTopic_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteTopic_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteTopic_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new deleteTopic_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new deleteTopic_resultTupleSchemeFactory()); } private DeleteTopicResponse success; // 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"); 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; 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, DeleteTopicResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteTopic_result.class, metaDataMap); } public deleteTopic_result() { } public deleteTopic_result( DeleteTopicResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public deleteTopic_result(deleteTopic_result other) { if (other.isSetSuccess()) { this.success = new DeleteTopicResponse(other.success); } } public deleteTopic_result deepCopy() { return new deleteTopic_result(this); } @Override public void clear() { this.success = null; } public DeleteTopicResponse getSuccess() { return this.success; } public void setSuccess(DeleteTopicResponse 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 void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((DeleteTopicResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof deleteTopic_result) return this.equals((deleteTopic_result)that); return false; } public boolean equals(deleteTopic_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; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(deleteTopic_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); 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("deleteTopic_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } 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 deleteTopic_resultStandardSchemeFactory implements SchemeFactory { public deleteTopic_resultStandardScheme getScheme() { return new deleteTopic_resultStandardScheme(); } } private static class deleteTopic_resultStandardScheme extends StandardScheme<deleteTopic_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, deleteTopic_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 DeleteTopicResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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, deleteTopic_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(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class deleteTopic_resultTupleSchemeFactory implements SchemeFactory { public deleteTopic_resultTupleScheme getScheme() { return new deleteTopic_resultTupleScheme(); } } private static class deleteTopic_resultTupleScheme extends TupleScheme<deleteTopic_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, deleteTopic_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, deleteTopic_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new DeleteTopicResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } } } public static class getSize_args implements org.apache.thrift.TBase<getSize_args, getSize_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSize_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSize_args"); private static final org.apache.thrift.protocol.TField GET_SIZE_REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("getSizeRequest", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getSize_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSize_argsTupleSchemeFactory()); } private GetSizeRequest getSizeRequest; // 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 { GET_SIZE_REQUEST((short)1, "getSizeRequest"); 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: // GET_SIZE_REQUEST return GET_SIZE_REQUEST; 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.GET_SIZE_REQUEST, new org.apache.thrift.meta_data.FieldMetaData("getSizeRequest", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GetSizeRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSize_args.class, metaDataMap); } public getSize_args() { } public getSize_args( GetSizeRequest getSizeRequest) { this(); this.getSizeRequest = getSizeRequest; } /** * Performs a deep copy on <i>other</i>. */ public getSize_args(getSize_args other) { if (other.isSetGetSizeRequest()) { this.getSizeRequest = new GetSizeRequest(other.getSizeRequest); } } public getSize_args deepCopy() { return new getSize_args(this); } @Override public void clear() { this.getSizeRequest = null; } public GetSizeRequest getGetSizeRequest() { return this.getSizeRequest; } public void setGetSizeRequest(GetSizeRequest getSizeRequest) { this.getSizeRequest = getSizeRequest; } public void unsetGetSizeRequest() { this.getSizeRequest = null; } /** Returns true if field getSizeRequest is set (has been assigned a value) and false otherwise */ public boolean isSetGetSizeRequest() { return this.getSizeRequest != null; } public void setGetSizeRequestIsSet(boolean value) { if (!value) { this.getSizeRequest = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case GET_SIZE_REQUEST: if (value == null) { unsetGetSizeRequest(); } else { setGetSizeRequest((GetSizeRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case GET_SIZE_REQUEST: return getGetSizeRequest(); } 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 GET_SIZE_REQUEST: return isSetGetSizeRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSize_args) return this.equals((getSize_args)that); return false; } public boolean equals(getSize_args that) { if (that == null) return false; boolean this_present_getSizeRequest = true && this.isSetGetSizeRequest(); boolean that_present_getSizeRequest = true && that.isSetGetSizeRequest(); if (this_present_getSizeRequest || that_present_getSizeRequest) { if (!(this_present_getSizeRequest && that_present_getSizeRequest)) return false; if (!this.getSizeRequest.equals(that.getSizeRequest)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_getSizeRequest = true && (isSetGetSizeRequest()); list.add(present_getSizeRequest); if (present_getSizeRequest) list.add(getSizeRequest); return list.hashCode(); } @Override public int compareTo(getSize_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetGetSizeRequest()).compareTo(other.isSetGetSizeRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetGetSizeRequest()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getSizeRequest, other.getSizeRequest); 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("getSize_args("); boolean first = true; sb.append("getSizeRequest:"); if (this.getSizeRequest == null) { sb.append("null"); } else { sb.append(this.getSizeRequest); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (getSizeRequest != null) { getSizeRequest.validate(); } } 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 getSize_argsStandardSchemeFactory implements SchemeFactory { public getSize_argsStandardScheme getScheme() { return new getSize_argsStandardScheme(); } } private static class getSize_argsStandardScheme extends StandardScheme<getSize_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSize_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: // GET_SIZE_REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.getSizeRequest = new GetSizeRequest(); struct.getSizeRequest.read(iprot); struct.setGetSizeRequestIsSet(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, getSize_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.getSizeRequest != null) { oprot.writeFieldBegin(GET_SIZE_REQUEST_FIELD_DESC); struct.getSizeRequest.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSize_argsTupleSchemeFactory implements SchemeFactory { public getSize_argsTupleScheme getScheme() { return new getSize_argsTupleScheme(); } } private static class getSize_argsTupleScheme extends TupleScheme<getSize_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSize_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetGetSizeRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetGetSizeRequest()) { struct.getSizeRequest.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSize_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.getSizeRequest = new GetSizeRequest(); struct.getSizeRequest.read(iprot); struct.setGetSizeRequestIsSet(true); } } } } public static class getSize_result implements org.apache.thrift.TBase<getSize_result, getSize_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSize_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSize_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getSize_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSize_resultTupleSchemeFactory()); } private GetSizeResponse success; // 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"); 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; 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, GetSizeResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSize_result.class, metaDataMap); } public getSize_result() { } public getSize_result( GetSizeResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getSize_result(getSize_result other) { if (other.isSetSuccess()) { this.success = new GetSizeResponse(other.success); } } public getSize_result deepCopy() { return new getSize_result(this); } @Override public void clear() { this.success = null; } public GetSizeResponse getSuccess() { return this.success; } public void setSuccess(GetSizeResponse 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 void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((GetSizeResponse)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } 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(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSize_result) return this.equals((getSize_result)that); return false; } public boolean equals(getSize_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; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); return list.hashCode(); } @Override public int compareTo(getSize_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); 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("getSize_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (success != null) { success.validate(); } } 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 getSize_resultStandardSchemeFactory implements SchemeFactory { public getSize_resultStandardScheme getScheme() { return new getSize_resultStandardScheme(); } } private static class getSize_resultStandardScheme extends StandardScheme<getSize_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSize_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 GetSizeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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, getSize_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(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSize_resultTupleSchemeFactory implements SchemeFactory { public getSize_resultTupleScheme getScheme() { return new getSize_resultTupleScheme(); } } private static class getSize_resultTupleScheme extends TupleScheme<getSize_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSize_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { struct.success.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSize_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new GetSizeResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } } } }