Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.xiaomi.infra.galaxy.sds.thrift.TableService Maven / Gradle / Ivy
/**
* 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 = "2015-4-21")
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;
}
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 static class Client extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.Client implements Iface {
public static class Factory implements libthrift091.TServiceClientFactory {
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 static class AsyncClient extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.AsyncClient implements AsyncIface {
public static class Factory implements libthrift091.async.TAsyncClientFactory {
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 static class Processor extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.Processor implements libthrift091.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected Processor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> 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());
return processMap;
}
public static class get extends libthrift091.ProcessFunction {
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 extends libthrift091.ProcessFunction {
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 extends libthrift091.ProcessFunction {
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 extends libthrift091.ProcessFunction {
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 extends libthrift091.ProcessFunction {
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 extends libthrift091.ProcessFunction {
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 AsyncProcessor extends com.xiaomi.infra.galaxy.sds.thrift.BaseService.AsyncProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected AsyncProcessor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> 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());
return processMap;
}
public static class get extends libthrift091.AsyncProcessFunction {
public get() {
super("get");
}
public get_args getEmptyArgsInstance() {
return new get_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.get(args.request,resultHandler);
}
}
public static class put extends libthrift091.AsyncProcessFunction {
public put() {
super("put");
}
public put_args getEmptyArgsInstance() {
return new put_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.put(args.request,resultHandler);
}
}
public static class increment extends libthrift091.AsyncProcessFunction {
public increment() {
super("increment");
}
public increment_args getEmptyArgsInstance() {
return new increment_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.increment(args.request,resultHandler);
}
}
public static class remove extends libthrift091.AsyncProcessFunction {
public remove() {
super("remove");
}
public remove_args getEmptyArgsInstance() {
return new remove_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.remove(args.request,resultHandler);
}
}
public static class scan extends libthrift091.AsyncProcessFunction {
public scan() {
super("scan");
}
public scan_args getEmptyArgsInstance() {
return new scan_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.scan(args.request,resultHandler);
}
}
public static class batch extends libthrift091.AsyncProcessFunction {
public batch() {
super("batch");
}
public batch_args getEmptyArgsInstance() {
return new batch_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final libthrift091.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
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 resultHandler) throws TException {
iface.batch(args.request,resultHandler);
}
}
}
public static class get_args implements libthrift091.TBase, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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, java.io.Serializable, Cloneable, Comparable {
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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
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 other .
*/
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 list = new ArrayList();
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 {
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 {
@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);
}
}
}
}
}