/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.sds.thrift; import libthrift091.scheme.IScheme; import libthrift091.scheme.SchemeFactory; import libthrift091.scheme.StandardScheme; import libthrift091.scheme.TupleScheme; import libthrift091.protocol.TTupleProtocol; import libthrift091.protocol.TProtocolException; import libthrift091.EncodingUtils; import libthrift091.TException; import libthrift091.async.AsyncMethodCallback; import libthrift091.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.2)", date = "2016-12-30") public class TableService { /** * 结构化存储表数据访问接口 */ public interface Iface extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.Iface { /** * 读操作,需要1个读配额 * * @param request */ public GetResult get(GetRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 写操作,需要1个写配额,另外每个Eager二级索引需要1个额外读配额 * * @param request */ public PutResult put(PutRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 自增操作,需要读写配额各1 * * @param request */ public IncrementResult increment(IncrementRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 删除操作,需要1个写配额,另外每个Eager二级索引需要1个额外读配额 * * @param request */ public RemoveResult remove(RemoveRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 扫描操作,每个扫描过的记录消耗1个读配额(即使不满足过滤条件),每个Lazy二级索引需要1个额外读配额 * * @param request */ public ScanResult scan(ScanRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 批量读写操作,消耗各自对应的读写配额。同一个batch中多个操作修改同一行数据可能导致未定义行为(数据不一致), * 应当避免,另外如果一个batch包含同一行的读和写操作,其执行顺序是不确定的,不推荐使用 * * @param request */ public BatchResult batch(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 批量条件写操作,消耗各自对应的写配额。同一个batch中多个操作修改同一行数据可能导致未定义行为(数据不一致), * 应当避免,另外如果一个batch包含同一行的写操作,其执行顺序是不确定的,不推荐使用 * * @param request */ public BatchResult batchCheckAndMutate(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 用于重建二级索引, 当表中存在与request相同的记录,成功写入 * * @param request */ public PutResult putToRebuildIndex(PutRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; /** * 批量读写操作,消耗各自对应的读写配额。同一个batch中多个操作修改同一行数据可能导致未定义行为(数据不一致), * 应当避免,另外如果一个batch包含同一行的读和写操作,其执行顺序是不确定的 * 如quota不足以一次执行所有的batch,会部分执行,需要检查返回结果对未成功的item进行重试, * 如quota不足以执行1个item,会抛出THROUGHPUT_EXCEED异常 * * @param request */ public BatchResult partialAllowedBatch(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException; } public interface AsyncIface extends com.xiaomi.infra.galaxy.sds.thrift.BaseService .AsyncIface { public void get(GetRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void put(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void increment(IncrementRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void remove(RemoveRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void scan(ScanRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void batch(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void batchCheckAndMutate(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void putToRebuildIndex(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void partialAllowedBatch(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; } public static class Client extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.Client implements Iface { public static class Factory implements libthrift091.TServiceClientFactory<Client> { public Factory() {} public Client getClient(libthrift091.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(libthrift091.protocol.TProtocol prot) { super(prot, prot); } public Client(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) { super(iprot, oprot); } public GetResult get(GetRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_get(request); return recv_get(); } public void send_get(GetRequest request) throws libthrift091.TException { get_args args = new get_args(); args.setRequest(request); sendBase("get", args); } public GetResult recv_get() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { get_result result = new get_result(); receiveBase(result, "get"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "get failed: unknown result"); } public PutResult put(PutRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_put(request); return recv_put(); } public void send_put(PutRequest request) throws libthrift091.TException { put_args args = new put_args(); args.setRequest(request); sendBase("put", args); } public PutResult recv_put() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { put_result result = new put_result(); receiveBase(result, "put"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "put failed: unknown result"); } public IncrementResult increment(IncrementRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_increment(request); return recv_increment(); } public void send_increment(IncrementRequest request) throws libthrift091.TException { increment_args args = new increment_args(); args.setRequest(request); sendBase("increment", args); } public IncrementResult recv_increment() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { increment_result result = new increment_result(); receiveBase(result, "increment"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "increment failed: unknown result"); } public RemoveResult remove(RemoveRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_remove(request); return recv_remove(); } public void send_remove(RemoveRequest request) throws libthrift091.TException { remove_args args = new remove_args(); args.setRequest(request); sendBase("remove", args); } public RemoveResult recv_remove() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { remove_result result = new remove_result(); receiveBase(result, "remove"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "remove failed: unknown result"); } public ScanResult scan(ScanRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_scan(request); return recv_scan(); } public void send_scan(ScanRequest request) throws libthrift091.TException { scan_args args = new scan_args(); args.setRequest(request); sendBase("scan", args); } public ScanResult recv_scan() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { scan_result result = new scan_result(); receiveBase(result, "scan"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "scan failed: unknown result"); } public BatchResult batch(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_batch(request); return recv_batch(); } public void send_batch(BatchRequest request) throws libthrift091.TException { batch_args args = new batch_args(); args.setRequest(request); sendBase("batch", args); } public BatchResult recv_batch() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { batch_result result = new batch_result(); receiveBase(result, "batch"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "batch failed: unknown result"); } public BatchResult batchCheckAndMutate(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_batchCheckAndMutate(request); return recv_batchCheckAndMutate(); } public void send_batchCheckAndMutate(BatchRequest request) throws libthrift091.TException { batchCheckAndMutate_args args = new batchCheckAndMutate_args(); args.setRequest(request); sendBase("batchCheckAndMutate", args); } public BatchResult recv_batchCheckAndMutate() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { batchCheckAndMutate_result result = new batchCheckAndMutate_result(); receiveBase(result, "batchCheckAndMutate"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "batchCheckAndMutate failed: unknown result"); } public PutResult putToRebuildIndex(PutRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_putToRebuildIndex(request); return recv_putToRebuildIndex(); } public void send_putToRebuildIndex(PutRequest request) throws libthrift091.TException { putToRebuildIndex_args args = new putToRebuildIndex_args(); args.setRequest(request); sendBase("putToRebuildIndex", args); } public PutResult recv_putToRebuildIndex() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { putToRebuildIndex_result result = new putToRebuildIndex_result(); receiveBase(result, "putToRebuildIndex"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "putToRebuildIndex failed: unknown result"); } public BatchResult partialAllowedBatch(BatchRequest request) throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { send_partialAllowedBatch(request); return recv_partialAllowedBatch(); } public void send_partialAllowedBatch(BatchRequest request) throws libthrift091.TException { partialAllowedBatch_args args = new partialAllowedBatch_args(); args.setRequest(request); sendBase("partialAllowedBatch", args); } public BatchResult recv_partialAllowedBatch() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { partialAllowedBatch_result result = new partialAllowedBatch_result(); receiveBase(result, "partialAllowedBatch"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "partialAllowedBatch failed: unknown result"); } } public static class AsyncClient extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.AsyncClient implements AsyncIface { public static class Factory implements libthrift091.async.TAsyncClientFactory<AsyncClient> { private libthrift091.async.TAsyncClientManager clientManager; private libthrift091.protocol.TProtocolFactory protocolFactory; public Factory(libthrift091.async.TAsyncClientManager clientManager, libthrift091.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(libthrift091.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.async.TAsyncClientManager clientManager, libthrift091.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void get(GetRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); get_call method_call = new get_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class get_call extends libthrift091.async.TAsyncMethodCall { private GetRequest request; public get_call(GetRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("get", libthrift091.protocol.TMessageType.CALL, 0)); get_args args = new get_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public GetResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_get(); } } public void put(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); put_call method_call = new put_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class put_call extends libthrift091.async.TAsyncMethodCall { private PutRequest request; public put_call(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("put", libthrift091.protocol.TMessageType.CALL, 0)); put_args args = new put_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public PutResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_put(); } } public void increment(IncrementRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); increment_call method_call = new increment_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class increment_call extends libthrift091.async.TAsyncMethodCall { private IncrementRequest request; public increment_call(IncrementRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("increment", libthrift091.protocol.TMessageType.CALL, 0)); increment_args args = new increment_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public IncrementResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_increment(); } } public void remove(RemoveRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); remove_call method_call = new remove_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class remove_call extends libthrift091.async.TAsyncMethodCall { private RemoveRequest request; public remove_call(RemoveRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("remove", libthrift091.protocol.TMessageType.CALL, 0)); remove_args args = new remove_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public RemoveResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_remove(); } } public void scan(ScanRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); scan_call method_call = new scan_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class scan_call extends libthrift091.async.TAsyncMethodCall { private ScanRequest request; public scan_call(ScanRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("scan", libthrift091.protocol.TMessageType.CALL, 0)); scan_args args = new scan_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public ScanResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_scan(); } } public void batch(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); batch_call method_call = new batch_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class batch_call extends libthrift091.async.TAsyncMethodCall { private BatchRequest request; public batch_call(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("batch", libthrift091.protocol.TMessageType.CALL, 0)); batch_args args = new batch_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public BatchResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_batch(); } } public void batchCheckAndMutate(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); batchCheckAndMutate_call method_call = new batchCheckAndMutate_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class batchCheckAndMutate_call extends libthrift091.async.TAsyncMethodCall { private BatchRequest request; public batchCheckAndMutate_call(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("batchCheckAndMutate", libthrift091.protocol.TMessageType.CALL, 0)); batchCheckAndMutate_args args = new batchCheckAndMutate_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public BatchResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_batchCheckAndMutate(); } } public void putToRebuildIndex(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); putToRebuildIndex_call method_call = new putToRebuildIndex_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class putToRebuildIndex_call extends libthrift091.async.TAsyncMethodCall { private PutRequest request; public putToRebuildIndex_call(PutRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("putToRebuildIndex", libthrift091.protocol.TMessageType.CALL, 0)); putToRebuildIndex_args args = new putToRebuildIndex_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public PutResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_putToRebuildIndex(); } } public void partialAllowedBatch(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); partialAllowedBatch_call method_call = new partialAllowedBatch_call(request, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class partialAllowedBatch_call extends libthrift091.async.TAsyncMethodCall { private BatchRequest request; public partialAllowedBatch_call(BatchRequest request, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.request = request; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("partialAllowedBatch", libthrift091.protocol.TMessageType.CALL, 0)); partialAllowedBatch_args args = new partialAllowedBatch_args(); args.setRequest(request); args.write(prot); prot.writeMessageEnd(); } public BatchResult getResult() throws com.xiaomi.infra.galaxy.sds.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_partialAllowedBatch(); } } } public static class Processor<I extends Iface> extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.Processor<I> implements libthrift091.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>>())); } protected Processor(I iface, Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> getProcessMap(Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) { processMap.put("get", new get()); processMap.put("put", new put()); processMap.put("increment", new increment()); processMap.put("remove", new remove()); processMap.put("scan", new scan()); processMap.put("batch", new batch()); processMap.put("batchCheckAndMutate", new batchCheckAndMutate()); processMap.put("putToRebuildIndex", new putToRebuildIndex()); processMap.put("partialAllowedBatch", new partialAllowedBatch()); return processMap; } public static class get<I extends Iface> extends libthrift091.ProcessFunction<I, get_args> { public get() { super("get"); } public get_args getEmptyArgsInstance() { return new get_args(); } protected boolean isOneway() { return false; } public get_result getResult(I iface, get_args args) throws libthrift091.TException { get_result result = new get_result(); try { result.success = iface.get(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class put<I extends Iface> extends libthrift091.ProcessFunction<I, put_args> { public put() { super("put"); } public put_args getEmptyArgsInstance() { return new put_args(); } protected boolean isOneway() { return false; } public put_result getResult(I iface, put_args args) throws libthrift091.TException { put_result result = new put_result(); try { result.success = iface.put(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class increment<I extends Iface> extends libthrift091.ProcessFunction<I, increment_args> { public increment() { super("increment"); } public increment_args getEmptyArgsInstance() { return new increment_args(); } protected boolean isOneway() { return false; } public increment_result getResult(I iface, increment_args args) throws libthrift091.TException { increment_result result = new increment_result(); try { result.success = iface.increment(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class remove<I extends Iface> extends libthrift091.ProcessFunction<I, remove_args> { public remove() { super("remove"); } public remove_args getEmptyArgsInstance() { return new remove_args(); } protected boolean isOneway() { return false; } public remove_result getResult(I iface, remove_args args) throws libthrift091.TException { remove_result result = new remove_result(); try { result.success = iface.remove(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class scan<I extends Iface> extends libthrift091.ProcessFunction<I, scan_args> { public scan() { super("scan"); } public scan_args getEmptyArgsInstance() { return new scan_args(); } protected boolean isOneway() { return false; } public scan_result getResult(I iface, scan_args args) throws libthrift091.TException { scan_result result = new scan_result(); try { result.success = iface.scan(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class batch<I extends Iface> extends libthrift091.ProcessFunction<I, batch_args> { public batch() { super("batch"); } public batch_args getEmptyArgsInstance() { return new batch_args(); } protected boolean isOneway() { return false; } public batch_result getResult(I iface, batch_args args) throws libthrift091.TException { batch_result result = new batch_result(); try { result.success = iface.batch(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class batchCheckAndMutate<I extends Iface> extends libthrift091.ProcessFunction<I, batchCheckAndMutate_args> { public batchCheckAndMutate() { super("batchCheckAndMutate"); } public batchCheckAndMutate_args getEmptyArgsInstance() { return new batchCheckAndMutate_args(); } protected boolean isOneway() { return false; } public batchCheckAndMutate_result getResult(I iface, batchCheckAndMutate_args args) throws libthrift091.TException { batchCheckAndMutate_result result = new batchCheckAndMutate_result(); try { result.success = iface.batchCheckAndMutate(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class putToRebuildIndex<I extends Iface> extends libthrift091.ProcessFunction<I, putToRebuildIndex_args> { public putToRebuildIndex() { super("putToRebuildIndex"); } public putToRebuildIndex_args getEmptyArgsInstance() { return new putToRebuildIndex_args(); } protected boolean isOneway() { return false; } public putToRebuildIndex_result getResult(I iface, putToRebuildIndex_args args) throws libthrift091.TException { putToRebuildIndex_result result = new putToRebuildIndex_result(); try { result.success = iface.putToRebuildIndex(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } public static class partialAllowedBatch<I extends Iface> extends libthrift091.ProcessFunction<I, partialAllowedBatch_args> { public partialAllowedBatch() { super("partialAllowedBatch"); } public partialAllowedBatch_args getEmptyArgsInstance() { return new partialAllowedBatch_args(); } protected boolean isOneway() { return false; } public partialAllowedBatch_result getResult(I iface, partialAllowedBatch_args args) throws libthrift091.TException { partialAllowedBatch_result result = new partialAllowedBatch_result(); try { result.success = iface.partialAllowedBatch(args.request); } catch (com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { result.se = se; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.AsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase,?>> getProcessMap(Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) { processMap.put("get", new get()); processMap.put("put", new put()); processMap.put("increment", new increment()); processMap.put("remove", new remove()); processMap.put("scan", new scan()); processMap.put("batch", new batch()); processMap.put("batchCheckAndMutate", new batchCheckAndMutate()); processMap.put("putToRebuildIndex", new putToRebuildIndex()); processMap.put("partialAllowedBatch", new partialAllowedBatch()); return processMap; } public static class get<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, get_args, GetResult> { public get() { super("get"); } public get_args getEmptyArgsInstance() { return new get_args(); } public AsyncMethodCallback<GetResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<GetResult>() { public void onComplete(GetResult o) { get_result result = new get_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; get_result result = new get_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, get_args args, libthrift091.async.AsyncMethodCallback<GetResult> resultHandler) throws TException { iface.get(args.request,resultHandler); } } public static class put<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, put_args, PutResult> { public put() { super("put"); } public put_args getEmptyArgsInstance() { return new put_args(); } public AsyncMethodCallback<PutResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<PutResult>() { public void onComplete(PutResult o) { put_result result = new put_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; put_result result = new put_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, put_args args, libthrift091.async.AsyncMethodCallback<PutResult> resultHandler) throws TException { iface.put(args.request,resultHandler); } } public static class increment<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, increment_args, IncrementResult> { public increment() { super("increment"); } public increment_args getEmptyArgsInstance() { return new increment_args(); } public AsyncMethodCallback<IncrementResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<IncrementResult>() { public void onComplete(IncrementResult o) { increment_result result = new increment_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; increment_result result = new increment_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, increment_args args, libthrift091.async.AsyncMethodCallback<IncrementResult> resultHandler) throws TException { iface.increment(args.request,resultHandler); } } public static class remove<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, remove_args, RemoveResult> { public remove() { super("remove"); } public remove_args getEmptyArgsInstance() { return new remove_args(); } public AsyncMethodCallback<RemoveResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<RemoveResult>() { public void onComplete(RemoveResult o) { remove_result result = new remove_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; remove_result result = new remove_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, remove_args args, libthrift091.async.AsyncMethodCallback<RemoveResult> resultHandler) throws TException { iface.remove(args.request,resultHandler); } } public static class scan<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, scan_args, ScanResult> { public scan() { super("scan"); } public scan_args getEmptyArgsInstance() { return new scan_args(); } public AsyncMethodCallback<ScanResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<ScanResult>() { public void onComplete(ScanResult o) { scan_result result = new scan_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; scan_result result = new scan_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, scan_args args, libthrift091.async.AsyncMethodCallback<ScanResult> resultHandler) throws TException { iface.scan(args.request,resultHandler); } } public static class batch<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, batch_args, BatchResult> { public batch() { super("batch"); } public batch_args getEmptyArgsInstance() { return new batch_args(); } public AsyncMethodCallback<BatchResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<BatchResult>() { public void onComplete(BatchResult o) { batch_result result = new batch_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; batch_result result = new batch_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, batch_args args, libthrift091.async.AsyncMethodCallback<BatchResult> resultHandler) throws TException { iface.batch(args.request,resultHandler); } } public static class batchCheckAndMutate<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, batchCheckAndMutate_args, BatchResult> { public batchCheckAndMutate() { super("batchCheckAndMutate"); } public batchCheckAndMutate_args getEmptyArgsInstance() { return new batchCheckAndMutate_args(); } public AsyncMethodCallback<BatchResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<BatchResult>() { public void onComplete(BatchResult o) { batchCheckAndMutate_result result = new batchCheckAndMutate_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; batchCheckAndMutate_result result = new batchCheckAndMutate_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, batchCheckAndMutate_args args, libthrift091.async.AsyncMethodCallback<BatchResult> resultHandler) throws TException { iface.batchCheckAndMutate(args.request,resultHandler); } } public static class putToRebuildIndex<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, putToRebuildIndex_args, PutResult> { public putToRebuildIndex() { super("putToRebuildIndex"); } public putToRebuildIndex_args getEmptyArgsInstance() { return new putToRebuildIndex_args(); } public AsyncMethodCallback<PutResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<PutResult>() { public void onComplete(PutResult o) { putToRebuildIndex_result result = new putToRebuildIndex_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; putToRebuildIndex_result result = new putToRebuildIndex_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, putToRebuildIndex_args args, libthrift091.async.AsyncMethodCallback<PutResult> resultHandler) throws TException { iface.putToRebuildIndex(args.request,resultHandler); } } public static class partialAllowedBatch<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, partialAllowedBatch_args, BatchResult> { public partialAllowedBatch() { super("partialAllowedBatch"); } public partialAllowedBatch_args getEmptyArgsInstance() { return new partialAllowedBatch_args(); } public AsyncMethodCallback<BatchResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<BatchResult>() { public void onComplete(BatchResult o) { partialAllowedBatch_result result = new partialAllowedBatch_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.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 = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; partialAllowedBatch_result result = new partialAllowedBatch_result(); if (e instanceof com.xiaomi.infra.galaxy.sds.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.sds.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.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, partialAllowedBatch_args args, libthrift091.async.AsyncMethodCallback<BatchResult> resultHandler) throws TException { iface.partialAllowedBatch(args.request,resultHandler); } } } public static class get_args implements libthrift091.TBase<get_args, get_args._Fields>, java.io.Serializable, Cloneable, Comparable<get_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("get_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 get_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory()); } public GetRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, GetRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap); } public get_args() { } public get_args( GetRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public get_args(get_args other) { if (other.isSetRequest()) { this.request = new GetRequest(other.request); } } public get_args deepCopy() { return new get_args(this); } @Override public void clear() { this.request = null; } public GetRequest getRequest() { return this.request; } public get_args setRequest(GetRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((GetRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_args) return this.equals((get_args)that); return false; } public boolean equals(get_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(get_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class get_argsStandardSchemeFactory implements SchemeFactory { public get_argsStandardScheme getScheme() { return new get_argsStandardScheme(); } } private static class get_argsStandardScheme extends StandardScheme<get_args> { public void read(libthrift091.protocol.TProtocol iprot, get_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new GetRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, get_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class get_argsTupleSchemeFactory implements SchemeFactory { public get_argsTupleScheme getScheme() { return new get_argsTupleScheme(); } } private static class get_argsTupleScheme extends TupleScheme<get_args> { @Override public void write(libthrift091.protocol.TProtocol prot, get_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, get_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new GetRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class get_result implements libthrift091.TBase<get_result, get_result._Fields>, java.io.Serializable, Cloneable, Comparable<get_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("get_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 get_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory()); } public GetResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, GetResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap); } public get_result() { } public get_result( GetResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public get_result(get_result other) { if (other.isSetSuccess()) { this.success = new GetResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public get_result deepCopy() { return new get_result(this); } @Override public void clear() { this.success = null; this.se = null; } public GetResult getSuccess() { return this.success; } public get_result setSuccess(GetResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public get_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((GetResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof get_result) return this.equals((get_result)that); return false; } public boolean equals(get_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(get_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("get_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class get_resultStandardSchemeFactory implements SchemeFactory { public get_resultStandardScheme getScheme() { return new get_resultStandardScheme(); } } private static class get_resultStandardScheme extends StandardScheme<get_result> { public void read(libthrift091.protocol.TProtocol iprot, get_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new GetResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, get_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class get_resultTupleSchemeFactory implements SchemeFactory { public get_resultTupleScheme getScheme() { return new get_resultTupleScheme(); } } private static class get_resultTupleScheme extends TupleScheme<get_result> { @Override public void write(libthrift091.protocol.TProtocol prot, get_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, get_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new GetResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class put_args implements libthrift091.TBase<put_args, put_args._Fields>, java.io.Serializable, Cloneable, Comparable<put_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("put_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 put_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new put_argsTupleSchemeFactory()); } public PutRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, PutRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(put_args.class, metaDataMap); } public put_args() { } public put_args( PutRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public put_args(put_args other) { if (other.isSetRequest()) { this.request = new PutRequest(other.request); } } public put_args deepCopy() { return new put_args(this); } @Override public void clear() { this.request = null; } public PutRequest getRequest() { return this.request; } public put_args setRequest(PutRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((PutRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof put_args) return this.equals((put_args)that); return false; } public boolean equals(put_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(put_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("put_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class put_argsStandardSchemeFactory implements SchemeFactory { public put_argsStandardScheme getScheme() { return new put_argsStandardScheme(); } } private static class put_argsStandardScheme extends StandardScheme<put_args> { public void read(libthrift091.protocol.TProtocol iprot, put_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new PutRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, put_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class put_argsTupleSchemeFactory implements SchemeFactory { public put_argsTupleScheme getScheme() { return new put_argsTupleScheme(); } } private static class put_argsTupleScheme extends TupleScheme<put_args> { @Override public void write(libthrift091.protocol.TProtocol prot, put_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, put_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new PutRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class put_result implements libthrift091.TBase<put_result, put_result._Fields>, java.io.Serializable, Cloneable, Comparable<put_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("put_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 put_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new put_resultTupleSchemeFactory()); } public PutResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, PutResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(put_result.class, metaDataMap); } public put_result() { } public put_result( PutResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public put_result(put_result other) { if (other.isSetSuccess()) { this.success = new PutResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public put_result deepCopy() { return new put_result(this); } @Override public void clear() { this.success = null; this.se = null; } public PutResult getSuccess() { return this.success; } public put_result setSuccess(PutResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public put_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((PutResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof put_result) return this.equals((put_result)that); return false; } public boolean equals(put_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(put_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("put_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class put_resultStandardSchemeFactory implements SchemeFactory { public put_resultStandardScheme getScheme() { return new put_resultStandardScheme(); } } private static class put_resultStandardScheme extends StandardScheme<put_result> { public void read(libthrift091.protocol.TProtocol iprot, put_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new PutResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, put_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class put_resultTupleSchemeFactory implements SchemeFactory { public put_resultTupleScheme getScheme() { return new put_resultTupleScheme(); } } private static class put_resultTupleScheme extends TupleScheme<put_result> { @Override public void write(libthrift091.protocol.TProtocol prot, put_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, put_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new PutResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class increment_args implements libthrift091.TBase<increment_args, increment_args._Fields>, java.io.Serializable, Cloneable, Comparable<increment_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("increment_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 increment_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new increment_argsTupleSchemeFactory()); } public IncrementRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, IncrementRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(increment_args.class, metaDataMap); } public increment_args() { } public increment_args( IncrementRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public increment_args(increment_args other) { if (other.isSetRequest()) { this.request = new IncrementRequest(other.request); } } public increment_args deepCopy() { return new increment_args(this); } @Override public void clear() { this.request = null; } public IncrementRequest getRequest() { return this.request; } public increment_args setRequest(IncrementRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((IncrementRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof increment_args) return this.equals((increment_args)that); return false; } public boolean equals(increment_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(increment_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("increment_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class increment_argsStandardSchemeFactory implements SchemeFactory { public increment_argsStandardScheme getScheme() { return new increment_argsStandardScheme(); } } private static class increment_argsStandardScheme extends StandardScheme<increment_args> { public void read(libthrift091.protocol.TProtocol iprot, increment_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new IncrementRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, increment_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class increment_argsTupleSchemeFactory implements SchemeFactory { public increment_argsTupleScheme getScheme() { return new increment_argsTupleScheme(); } } private static class increment_argsTupleScheme extends TupleScheme<increment_args> { @Override public void write(libthrift091.protocol.TProtocol prot, increment_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, increment_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new IncrementRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class increment_result implements libthrift091.TBase<increment_result, increment_result._Fields>, java.io.Serializable, Cloneable, Comparable<increment_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("increment_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 increment_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new increment_resultTupleSchemeFactory()); } public IncrementResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, IncrementResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(increment_result.class, metaDataMap); } public increment_result() { } public increment_result( IncrementResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public increment_result(increment_result other) { if (other.isSetSuccess()) { this.success = new IncrementResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public increment_result deepCopy() { return new increment_result(this); } @Override public void clear() { this.success = null; this.se = null; } public IncrementResult getSuccess() { return this.success; } public increment_result setSuccess(IncrementResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public increment_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((IncrementResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof increment_result) return this.equals((increment_result)that); return false; } public boolean equals(increment_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(increment_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("increment_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class increment_resultStandardSchemeFactory implements SchemeFactory { public increment_resultStandardScheme getScheme() { return new increment_resultStandardScheme(); } } private static class increment_resultStandardScheme extends StandardScheme<increment_result> { public void read(libthrift091.protocol.TProtocol iprot, increment_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new IncrementResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, increment_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class increment_resultTupleSchemeFactory implements SchemeFactory { public increment_resultTupleScheme getScheme() { return new increment_resultTupleScheme(); } } private static class increment_resultTupleScheme extends TupleScheme<increment_result> { @Override public void write(libthrift091.protocol.TProtocol prot, increment_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, increment_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new IncrementResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class remove_args implements libthrift091.TBase<remove_args, remove_args._Fields>, java.io.Serializable, Cloneable, Comparable<remove_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("remove_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 remove_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new remove_argsTupleSchemeFactory()); } public RemoveRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, RemoveRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(remove_args.class, metaDataMap); } public remove_args() { } public remove_args( RemoveRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public remove_args(remove_args other) { if (other.isSetRequest()) { this.request = new RemoveRequest(other.request); } } public remove_args deepCopy() { return new remove_args(this); } @Override public void clear() { this.request = null; } public RemoveRequest getRequest() { return this.request; } public remove_args setRequest(RemoveRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((RemoveRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_args) return this.equals((remove_args)that); return false; } public boolean equals(remove_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(remove_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class remove_argsStandardSchemeFactory implements SchemeFactory { public remove_argsStandardScheme getScheme() { return new remove_argsStandardScheme(); } } private static class remove_argsStandardScheme extends StandardScheme<remove_args> { public void read(libthrift091.protocol.TProtocol iprot, remove_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new RemoveRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, remove_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class remove_argsTupleSchemeFactory implements SchemeFactory { public remove_argsTupleScheme getScheme() { return new remove_argsTupleScheme(); } } private static class remove_argsTupleScheme extends TupleScheme<remove_args> { @Override public void write(libthrift091.protocol.TProtocol prot, remove_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, remove_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new RemoveRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class remove_result implements libthrift091.TBase<remove_result, remove_result._Fields>, java.io.Serializable, Cloneable, Comparable<remove_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("remove_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 remove_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new remove_resultTupleSchemeFactory()); } public RemoveResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, RemoveResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(remove_result.class, metaDataMap); } public remove_result() { } public remove_result( RemoveResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public remove_result(remove_result other) { if (other.isSetSuccess()) { this.success = new RemoveResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public remove_result deepCopy() { return new remove_result(this); } @Override public void clear() { this.success = null; this.se = null; } public RemoveResult getSuccess() { return this.success; } public remove_result setSuccess(RemoveResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public remove_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((RemoveResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof remove_result) return this.equals((remove_result)that); return false; } public boolean equals(remove_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(remove_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("remove_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class remove_resultStandardSchemeFactory implements SchemeFactory { public remove_resultStandardScheme getScheme() { return new remove_resultStandardScheme(); } } private static class remove_resultStandardScheme extends StandardScheme<remove_result> { public void read(libthrift091.protocol.TProtocol iprot, remove_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new RemoveResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, remove_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class remove_resultTupleSchemeFactory implements SchemeFactory { public remove_resultTupleScheme getScheme() { return new remove_resultTupleScheme(); } } private static class remove_resultTupleScheme extends TupleScheme<remove_result> { @Override public void write(libthrift091.protocol.TProtocol prot, remove_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, remove_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new RemoveResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class scan_args implements libthrift091.TBase<scan_args, scan_args._Fields>, java.io.Serializable, Cloneable, Comparable<scan_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("scan_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 scan_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new scan_argsTupleSchemeFactory()); } public ScanRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, ScanRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(scan_args.class, metaDataMap); } public scan_args() { } public scan_args( ScanRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public scan_args(scan_args other) { if (other.isSetRequest()) { this.request = new ScanRequest(other.request); } } public scan_args deepCopy() { return new scan_args(this); } @Override public void clear() { this.request = null; } public ScanRequest getRequest() { return this.request; } public scan_args setRequest(ScanRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((ScanRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof scan_args) return this.equals((scan_args)that); return false; } public boolean equals(scan_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(scan_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("scan_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class scan_argsStandardSchemeFactory implements SchemeFactory { public scan_argsStandardScheme getScheme() { return new scan_argsStandardScheme(); } } private static class scan_argsStandardScheme extends StandardScheme<scan_args> { public void read(libthrift091.protocol.TProtocol iprot, scan_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new ScanRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, scan_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class scan_argsTupleSchemeFactory implements SchemeFactory { public scan_argsTupleScheme getScheme() { return new scan_argsTupleScheme(); } } private static class scan_argsTupleScheme extends TupleScheme<scan_args> { @Override public void write(libthrift091.protocol.TProtocol prot, scan_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, scan_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new ScanRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class scan_result implements libthrift091.TBase<scan_result, scan_result._Fields>, java.io.Serializable, Cloneable, Comparable<scan_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("scan_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 scan_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new scan_resultTupleSchemeFactory()); } public ScanResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, ScanResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(scan_result.class, metaDataMap); } public scan_result() { } public scan_result( ScanResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public scan_result(scan_result other) { if (other.isSetSuccess()) { this.success = new ScanResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public scan_result deepCopy() { return new scan_result(this); } @Override public void clear() { this.success = null; this.se = null; } public ScanResult getSuccess() { return this.success; } public scan_result setSuccess(ScanResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public scan_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((ScanResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof scan_result) return this.equals((scan_result)that); return false; } public boolean equals(scan_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(scan_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("scan_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class scan_resultStandardSchemeFactory implements SchemeFactory { public scan_resultStandardScheme getScheme() { return new scan_resultStandardScheme(); } } private static class scan_resultStandardScheme extends StandardScheme<scan_result> { public void read(libthrift091.protocol.TProtocol iprot, scan_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new ScanResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, scan_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class scan_resultTupleSchemeFactory implements SchemeFactory { public scan_resultTupleScheme getScheme() { return new scan_resultTupleScheme(); } } private static class scan_resultTupleScheme extends TupleScheme<scan_result> { @Override public void write(libthrift091.protocol.TProtocol prot, scan_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, scan_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new ScanResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class batch_args implements libthrift091.TBase<batch_args, batch_args._Fields>, java.io.Serializable, Cloneable, Comparable<batch_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("batch_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 batch_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new batch_argsTupleSchemeFactory()); } public BatchRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(batch_args.class, metaDataMap); } public batch_args() { } public batch_args( BatchRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public batch_args(batch_args other) { if (other.isSetRequest()) { this.request = new BatchRequest(other.request); } } public batch_args deepCopy() { return new batch_args(this); } @Override public void clear() { this.request = null; } public BatchRequest getRequest() { return this.request; } public batch_args setRequest(BatchRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((BatchRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_args) return this.equals((batch_args)that); return false; } public boolean equals(batch_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(batch_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class batch_argsStandardSchemeFactory implements SchemeFactory { public batch_argsStandardScheme getScheme() { return new batch_argsStandardScheme(); } } private static class batch_argsStandardScheme extends StandardScheme<batch_args> { public void read(libthrift091.protocol.TProtocol iprot, batch_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, batch_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class batch_argsTupleSchemeFactory implements SchemeFactory { public batch_argsTupleScheme getScheme() { return new batch_argsTupleScheme(); } } private static class batch_argsTupleScheme extends TupleScheme<batch_args> { @Override public void write(libthrift091.protocol.TProtocol prot, batch_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, batch_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class batch_result implements libthrift091.TBase<batch_result, batch_result._Fields>, java.io.Serializable, Cloneable, Comparable<batch_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("batch_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 batch_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new batch_resultTupleSchemeFactory()); } public BatchResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(batch_result.class, metaDataMap); } public batch_result() { } public batch_result( BatchResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public batch_result(batch_result other) { if (other.isSetSuccess()) { this.success = new BatchResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public batch_result deepCopy() { return new batch_result(this); } @Override public void clear() { this.success = null; this.se = null; } public BatchResult getSuccess() { return this.success; } public batch_result setSuccess(BatchResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public batch_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((BatchResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batch_result) return this.equals((batch_result)that); return false; } public boolean equals(batch_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(batch_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("batch_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class batch_resultStandardSchemeFactory implements SchemeFactory { public batch_resultStandardScheme getScheme() { return new batch_resultStandardScheme(); } } private static class batch_resultStandardScheme extends StandardScheme<batch_result> { public void read(libthrift091.protocol.TProtocol iprot, batch_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, batch_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class batch_resultTupleSchemeFactory implements SchemeFactory { public batch_resultTupleScheme getScheme() { return new batch_resultTupleScheme(); } } private static class batch_resultTupleScheme extends TupleScheme<batch_result> { @Override public void write(libthrift091.protocol.TProtocol prot, batch_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, batch_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class batchCheckAndMutate_args implements libthrift091.TBase<batchCheckAndMutate_args, batchCheckAndMutate_args._Fields>, java.io.Serializable, Cloneable, Comparable<batchCheckAndMutate_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("batchCheckAndMutate_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 batchCheckAndMutate_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new batchCheckAndMutate_argsTupleSchemeFactory()); } public BatchRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(batchCheckAndMutate_args.class, metaDataMap); } public batchCheckAndMutate_args() { } public batchCheckAndMutate_args( BatchRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public batchCheckAndMutate_args(batchCheckAndMutate_args other) { if (other.isSetRequest()) { this.request = new BatchRequest(other.request); } } public batchCheckAndMutate_args deepCopy() { return new batchCheckAndMutate_args(this); } @Override public void clear() { this.request = null; } public BatchRequest getRequest() { return this.request; } public batchCheckAndMutate_args setRequest(BatchRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((BatchRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batchCheckAndMutate_args) return this.equals((batchCheckAndMutate_args)that); return false; } public boolean equals(batchCheckAndMutate_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(batchCheckAndMutate_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("batchCheckAndMutate_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class batchCheckAndMutate_argsStandardSchemeFactory implements SchemeFactory { public batchCheckAndMutate_argsStandardScheme getScheme() { return new batchCheckAndMutate_argsStandardScheme(); } } private static class batchCheckAndMutate_argsStandardScheme extends StandardScheme<batchCheckAndMutate_args> { public void read(libthrift091.protocol.TProtocol iprot, batchCheckAndMutate_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, batchCheckAndMutate_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class batchCheckAndMutate_argsTupleSchemeFactory implements SchemeFactory { public batchCheckAndMutate_argsTupleScheme getScheme() { return new batchCheckAndMutate_argsTupleScheme(); } } private static class batchCheckAndMutate_argsTupleScheme extends TupleScheme<batchCheckAndMutate_args> { @Override public void write(libthrift091.protocol.TProtocol prot, batchCheckAndMutate_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, batchCheckAndMutate_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class batchCheckAndMutate_result implements libthrift091.TBase<batchCheckAndMutate_result, batchCheckAndMutate_result._Fields>, java.io.Serializable, Cloneable, Comparable<batchCheckAndMutate_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("batchCheckAndMutate_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 batchCheckAndMutate_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new batchCheckAndMutate_resultTupleSchemeFactory()); } public BatchResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(batchCheckAndMutate_result.class, metaDataMap); } public batchCheckAndMutate_result() { } public batchCheckAndMutate_result( BatchResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public batchCheckAndMutate_result(batchCheckAndMutate_result other) { if (other.isSetSuccess()) { this.success = new BatchResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public batchCheckAndMutate_result deepCopy() { return new batchCheckAndMutate_result(this); } @Override public void clear() { this.success = null; this.se = null; } public BatchResult getSuccess() { return this.success; } public batchCheckAndMutate_result setSuccess(BatchResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public batchCheckAndMutate_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((BatchResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof batchCheckAndMutate_result) return this.equals((batchCheckAndMutate_result)that); return false; } public boolean equals(batchCheckAndMutate_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(batchCheckAndMutate_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("batchCheckAndMutate_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class batchCheckAndMutate_resultStandardSchemeFactory implements SchemeFactory { public batchCheckAndMutate_resultStandardScheme getScheme() { return new batchCheckAndMutate_resultStandardScheme(); } } private static class batchCheckAndMutate_resultStandardScheme extends StandardScheme<batchCheckAndMutate_result> { public void read(libthrift091.protocol.TProtocol iprot, batchCheckAndMutate_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, batchCheckAndMutate_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class batchCheckAndMutate_resultTupleSchemeFactory implements SchemeFactory { public batchCheckAndMutate_resultTupleScheme getScheme() { return new batchCheckAndMutate_resultTupleScheme(); } } private static class batchCheckAndMutate_resultTupleScheme extends TupleScheme<batchCheckAndMutate_result> { @Override public void write(libthrift091.protocol.TProtocol prot, batchCheckAndMutate_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, batchCheckAndMutate_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class putToRebuildIndex_args implements libthrift091.TBase<putToRebuildIndex_args, putToRebuildIndex_args._Fields>, java.io.Serializable, Cloneable, Comparable<putToRebuildIndex_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("putToRebuildIndex_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 putToRebuildIndex_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new putToRebuildIndex_argsTupleSchemeFactory()); } public PutRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, PutRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(putToRebuildIndex_args.class, metaDataMap); } public putToRebuildIndex_args() { } public putToRebuildIndex_args( PutRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public putToRebuildIndex_args(putToRebuildIndex_args other) { if (other.isSetRequest()) { this.request = new PutRequest(other.request); } } public putToRebuildIndex_args deepCopy() { return new putToRebuildIndex_args(this); } @Override public void clear() { this.request = null; } public PutRequest getRequest() { return this.request; } public putToRebuildIndex_args setRequest(PutRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((PutRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof putToRebuildIndex_args) return this.equals((putToRebuildIndex_args)that); return false; } public boolean equals(putToRebuildIndex_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(putToRebuildIndex_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("putToRebuildIndex_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class putToRebuildIndex_argsStandardSchemeFactory implements SchemeFactory { public putToRebuildIndex_argsStandardScheme getScheme() { return new putToRebuildIndex_argsStandardScheme(); } } private static class putToRebuildIndex_argsStandardScheme extends StandardScheme<putToRebuildIndex_args> { public void read(libthrift091.protocol.TProtocol iprot, putToRebuildIndex_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new PutRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, putToRebuildIndex_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class putToRebuildIndex_argsTupleSchemeFactory implements SchemeFactory { public putToRebuildIndex_argsTupleScheme getScheme() { return new putToRebuildIndex_argsTupleScheme(); } } private static class putToRebuildIndex_argsTupleScheme extends TupleScheme<putToRebuildIndex_args> { @Override public void write(libthrift091.protocol.TProtocol prot, putToRebuildIndex_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, putToRebuildIndex_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new PutRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class putToRebuildIndex_result implements libthrift091.TBase<putToRebuildIndex_result, putToRebuildIndex_result._Fields>, java.io.Serializable, Cloneable, Comparable<putToRebuildIndex_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("putToRebuildIndex_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 putToRebuildIndex_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new putToRebuildIndex_resultTupleSchemeFactory()); } public PutResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, PutResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(putToRebuildIndex_result.class, metaDataMap); } public putToRebuildIndex_result() { } public putToRebuildIndex_result( PutResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public putToRebuildIndex_result(putToRebuildIndex_result other) { if (other.isSetSuccess()) { this.success = new PutResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public putToRebuildIndex_result deepCopy() { return new putToRebuildIndex_result(this); } @Override public void clear() { this.success = null; this.se = null; } public PutResult getSuccess() { return this.success; } public putToRebuildIndex_result setSuccess(PutResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public putToRebuildIndex_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((PutResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof putToRebuildIndex_result) return this.equals((putToRebuildIndex_result)that); return false; } public boolean equals(putToRebuildIndex_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(putToRebuildIndex_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("putToRebuildIndex_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class putToRebuildIndex_resultStandardSchemeFactory implements SchemeFactory { public putToRebuildIndex_resultStandardScheme getScheme() { return new putToRebuildIndex_resultStandardScheme(); } } private static class putToRebuildIndex_resultStandardScheme extends StandardScheme<putToRebuildIndex_result> { public void read(libthrift091.protocol.TProtocol iprot, putToRebuildIndex_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new PutResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, putToRebuildIndex_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class putToRebuildIndex_resultTupleSchemeFactory implements SchemeFactory { public putToRebuildIndex_resultTupleScheme getScheme() { return new putToRebuildIndex_resultTupleScheme(); } } private static class putToRebuildIndex_resultTupleScheme extends TupleScheme<putToRebuildIndex_result> { @Override public void write(libthrift091.protocol.TProtocol prot, putToRebuildIndex_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, putToRebuildIndex_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new PutResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class partialAllowedBatch_args implements libthrift091.TBase<partialAllowedBatch_args, partialAllowedBatch_args._Fields>, java.io.Serializable, Cloneable, Comparable<partialAllowedBatch_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("partialAllowedBatch_args"); private static final libthrift091.protocol.TField REQUEST_FIELD_DESC = new libthrift091.protocol.TField("request", libthrift091.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 partialAllowedBatch_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new partialAllowedBatch_argsTupleSchemeFactory()); } public BatchRequest request; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { REQUEST((short)1, "request"); 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: // REQUEST return 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.REQUEST, new libthrift091.meta_data.FieldMetaData("request", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchRequest.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(partialAllowedBatch_args.class, metaDataMap); } public partialAllowedBatch_args() { } public partialAllowedBatch_args( BatchRequest request) { this(); this.request = request; } /** * Performs a deep copy on <i>other</i>. */ public partialAllowedBatch_args(partialAllowedBatch_args other) { if (other.isSetRequest()) { this.request = new BatchRequest(other.request); } } public partialAllowedBatch_args deepCopy() { return new partialAllowedBatch_args(this); } @Override public void clear() { this.request = null; } public BatchRequest getRequest() { return this.request; } public partialAllowedBatch_args setRequest(BatchRequest request) { this.request = request; return this; } public void unsetRequest() { this.request = null; } /** Returns true if field request is set (has been assigned a value) and false otherwise */ public boolean isSetRequest() { return this.request != null; } public void setRequestIsSet(boolean value) { if (!value) { this.request = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case REQUEST: if (value == null) { unsetRequest(); } else { setRequest((BatchRequest)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case REQUEST: return getRequest(); } 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 REQUEST: return isSetRequest(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof partialAllowedBatch_args) return this.equals((partialAllowedBatch_args)that); return false; } public boolean equals(partialAllowedBatch_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_request = true && (isSetRequest()); list.add(present_request); if (present_request) list.add(request); return list.hashCode(); } @Override public int compareTo(partialAllowedBatch_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest()); if (lastComparison != 0) { return lastComparison; } if (isSetRequest()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.request, other.request); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("partialAllowedBatch_args("); boolean first = true; sb.append("request:"); if (this.request == null) { sb.append("null"); } else { sb.append(this.request); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (request != null) { request.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class partialAllowedBatch_argsStandardSchemeFactory implements SchemeFactory { public partialAllowedBatch_argsStandardScheme getScheme() { return new partialAllowedBatch_argsStandardScheme(); } } private static class partialAllowedBatch_argsStandardScheme extends StandardScheme<partialAllowedBatch_args> { public void read(libthrift091.protocol.TProtocol iprot, partialAllowedBatch_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, partialAllowedBatch_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.request != null) { oprot.writeFieldBegin(REQUEST_FIELD_DESC); struct.request.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class partialAllowedBatch_argsTupleSchemeFactory implements SchemeFactory { public partialAllowedBatch_argsTupleScheme getScheme() { return new partialAllowedBatch_argsTupleScheme(); } } private static class partialAllowedBatch_argsTupleScheme extends TupleScheme<partialAllowedBatch_args> { @Override public void write(libthrift091.protocol.TProtocol prot, partialAllowedBatch_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRequest()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRequest()) { struct.request.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, partialAllowedBatch_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new BatchRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } } } public static class partialAllowedBatch_result implements libthrift091.TBase<partialAllowedBatch_result, partialAllowedBatch_result._Fields>, java.io.Serializable, Cloneable, Comparable<partialAllowedBatch_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("partialAllowedBatch_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.STRUCT, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.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 partialAllowedBatch_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new partialAllowedBatch_resultTupleSchemeFactory()); } public BatchResult success; // required public com.xiaomi.infra.galaxy.sds.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, BatchResult.class))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(partialAllowedBatch_result.class, metaDataMap); } public partialAllowedBatch_result() { } public partialAllowedBatch_result( BatchResult success, com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public partialAllowedBatch_result(partialAllowedBatch_result other) { if (other.isSetSuccess()) { this.success = new BatchResult(other.success); } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(other.se); } } public partialAllowedBatch_result deepCopy() { return new partialAllowedBatch_result(this); } @Override public void clear() { this.success = null; this.se = null; } public BatchResult getSuccess() { return this.success; } public partialAllowedBatch_result setSuccess(BatchResult success) { this.success = success; return this; } 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 com.xiaomi.infra.galaxy.sds.thrift.ServiceException getSe() { return this.se; } public partialAllowedBatch_result setSe(com.xiaomi.infra.galaxy.sds.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((BatchResult)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.sds.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof partialAllowedBatch_result) return this.equals((partialAllowedBatch_result)that); return false; } public boolean equals(partialAllowedBatch_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) 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); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(partialAllowedBatch_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 = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("partialAllowedBatch_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.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 libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class partialAllowedBatch_resultStandardSchemeFactory implements SchemeFactory { public partialAllowedBatch_resultStandardScheme getScheme() { return new partialAllowedBatch_resultStandardScheme(); } } private static class partialAllowedBatch_resultStandardScheme extends StandardScheme<partialAllowedBatch_result> { public void read(libthrift091.protocol.TProtocol iprot, partialAllowedBatch_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, partialAllowedBatch_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class partialAllowedBatch_resultTupleSchemeFactory implements SchemeFactory { public partialAllowedBatch_resultTupleScheme getScheme() { return new partialAllowedBatch_resultTupleScheme(); } } private static class partialAllowedBatch_resultTupleScheme extends TupleScheme<partialAllowedBatch_result> { @Override public void write(libthrift091.protocol.TProtocol prot, partialAllowedBatch_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { struct.success.write(oprot); } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, partialAllowedBatch_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.success = new BatchResult(); struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.sds.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } }