All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.snappydata.thrift.SnappyDataService Maven / Gradle / Ivy

/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package io.snappydata.thrift;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-10")
public class SnappyDataService {

  public interface Iface {

    public HostAddress getPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws SnappyException, org.apache.thrift.TException;

    public List getAllServersWithPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws SnappyException, org.apache.thrift.TException;

    public ConnectionProperties openConnection(OpenConnectionArgs arguments) throws SnappyException, org.apache.thrift.TException;

    public StatementResult execute(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public UpdateResult executeUpdate(long connId, List sqls, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public RowSet executeQuery(long connId, String sql, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public PrepareResult prepareStatement(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public StatementResult executePrepared(long stmtId, Row params, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public UpdateResult executePreparedUpdate(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public RowSet executePreparedQuery(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public UpdateResult executePreparedBatch(long stmtId, List paramsBatch, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public StatementResult prepareAndExecute(long connId, String sql, List paramsBatch, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public byte beginTransaction(long connId, byte isolationLevel, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void setTransactionAttributes(long connId, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public Map getTransactionAttributes(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void commitTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void rollbackTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public RowSet getNextResultSet(long cursorId, byte otherResultSetBehaviour, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public BlobChunk getBlobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public ClobChunk getClobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public long sendBlobChunk(BlobChunk chunk, long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public long sendClobChunk(ClobChunk chunk, long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void freeLob(long connId, long lobId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public RowSet scrollCursor(long cursorId, int offset, boolean offsetIsAbsolute, boolean fetchReverse, int fetchSize, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void executeCursorUpdate(long cursorId, List operations, List changedRows, List> changedColumnsList, List changedRowIndexes, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void startXATransaction(long connId, TransactionXid xid, int timeoutInSeconds, int flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public int prepareXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void commitXATransaction(long connId, TransactionXid xid, boolean onePhase, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void rollbackXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void forgetXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void endXATransaction(long connId, TransactionXid xid, int flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public List recoverXATransaction(long connId, int flag, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public ServiceMetaData getServiceMetaData(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public RowSet getSchemaMetaData(ServiceMetaDataCall schemaCall, ServiceMetaDataArgs metadataArgs) throws SnappyException, org.apache.thrift.TException;

    public RowSet getIndexInfo(ServiceMetaDataArgs metadataArgs, boolean unique, boolean approximate) throws SnappyException, org.apache.thrift.TException;

    public RowSet getUDTs(ServiceMetaDataArgs metadataArgs, List types) throws SnappyException, org.apache.thrift.TException;

    public RowSet getBestRowIdentifier(ServiceMetaDataArgs metadataArgs, int scope, boolean nullable) throws SnappyException, org.apache.thrift.TException;

    public List fetchActiveConnections(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public Map fetchActiveStatements(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void cancelStatement(long stmtId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void cancelCurrentStatement(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void closeResultSet(long cursorId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void closeStatement(long stmtId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException;

    public void closeConnection(long connId, boolean closeSocket, ByteBuffer token) throws org.apache.thrift.TException;

    public void bulkClose(List entities) throws org.apache.thrift.TException;

  }

  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public HostAddress getPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws SnappyException, org.apache.thrift.TException
    {
      send_getPreferredServer(serverTypes, serverGroups, failedServers);
      return recv_getPreferredServer();
    }

    public void send_getPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws org.apache.thrift.TException
    {
      getPreferredServer_args args = new getPreferredServer_args();
      args.setServerTypes(serverTypes);
      args.setServerGroups(serverGroups);
      args.setFailedServers(failedServers);
      sendBase("getPreferredServer", args);
    }

    public HostAddress recv_getPreferredServer() throws SnappyException, org.apache.thrift.TException
    {
      getPreferredServer_result result = new getPreferredServer_result();
      receiveBase(result, "getPreferredServer");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPreferredServer failed: unknown result");
    }

    public List getAllServersWithPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws SnappyException, org.apache.thrift.TException
    {
      send_getAllServersWithPreferredServer(serverTypes, serverGroups, failedServers);
      return recv_getAllServersWithPreferredServer();
    }

    public void send_getAllServersWithPreferredServer(Set serverTypes, Set serverGroups, Set failedServers) throws org.apache.thrift.TException
    {
      getAllServersWithPreferredServer_args args = new getAllServersWithPreferredServer_args();
      args.setServerTypes(serverTypes);
      args.setServerGroups(serverGroups);
      args.setFailedServers(failedServers);
      sendBase("getAllServersWithPreferredServer", args);
    }

    public List recv_getAllServersWithPreferredServer() throws SnappyException, org.apache.thrift.TException
    {
      getAllServersWithPreferredServer_result result = new getAllServersWithPreferredServer_result();
      receiveBase(result, "getAllServersWithPreferredServer");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllServersWithPreferredServer failed: unknown result");
    }

    public ConnectionProperties openConnection(OpenConnectionArgs arguments) throws SnappyException, org.apache.thrift.TException
    {
      send_openConnection(arguments);
      return recv_openConnection();
    }

    public void send_openConnection(OpenConnectionArgs arguments) throws org.apache.thrift.TException
    {
      openConnection_args args = new openConnection_args();
      args.setArguments(arguments);
      sendBase("openConnection", args);
    }

    public ConnectionProperties recv_openConnection() throws SnappyException, org.apache.thrift.TException
    {
      openConnection_result result = new openConnection_result();
      receiveBase(result, "openConnection");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "openConnection failed: unknown result");
    }

    public StatementResult execute(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_execute(connId, sql, outputParams, attrs, token);
      return recv_execute();
    }

    public void send_execute(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      execute_args args = new execute_args();
      args.setConnId(connId);
      args.setSql(sql);
      args.setOutputParams(outputParams);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("execute", args);
    }

    public StatementResult recv_execute() throws SnappyException, org.apache.thrift.TException
    {
      execute_result result = new execute_result();
      receiveBase(result, "execute");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "execute failed: unknown result");
    }

    public UpdateResult executeUpdate(long connId, List sqls, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executeUpdate(connId, sqls, attrs, token);
      return recv_executeUpdate();
    }

    public void send_executeUpdate(long connId, List sqls, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executeUpdate_args args = new executeUpdate_args();
      args.setConnId(connId);
      args.setSqls(sqls);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executeUpdate", args);
    }

    public UpdateResult recv_executeUpdate() throws SnappyException, org.apache.thrift.TException
    {
      executeUpdate_result result = new executeUpdate_result();
      receiveBase(result, "executeUpdate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executeUpdate failed: unknown result");
    }

    public RowSet executeQuery(long connId, String sql, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executeQuery(connId, sql, attrs, token);
      return recv_executeQuery();
    }

    public void send_executeQuery(long connId, String sql, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executeQuery_args args = new executeQuery_args();
      args.setConnId(connId);
      args.setSql(sql);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executeQuery", args);
    }

    public RowSet recv_executeQuery() throws SnappyException, org.apache.thrift.TException
    {
      executeQuery_result result = new executeQuery_result();
      receiveBase(result, "executeQuery");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executeQuery failed: unknown result");
    }

    public PrepareResult prepareStatement(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_prepareStatement(connId, sql, outputParams, attrs, token);
      return recv_prepareStatement();
    }

    public void send_prepareStatement(long connId, String sql, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      prepareStatement_args args = new prepareStatement_args();
      args.setConnId(connId);
      args.setSql(sql);
      args.setOutputParams(outputParams);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("prepareStatement", args);
    }

    public PrepareResult recv_prepareStatement() throws SnappyException, org.apache.thrift.TException
    {
      prepareStatement_result result = new prepareStatement_result();
      receiveBase(result, "prepareStatement");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "prepareStatement failed: unknown result");
    }

    public StatementResult executePrepared(long stmtId, Row params, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executePrepared(stmtId, params, outputParams, attrs, token);
      return recv_executePrepared();
    }

    public void send_executePrepared(long stmtId, Row params, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executePrepared_args args = new executePrepared_args();
      args.setStmtId(stmtId);
      args.setParams(params);
      args.setOutputParams(outputParams);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executePrepared", args);
    }

    public StatementResult recv_executePrepared() throws SnappyException, org.apache.thrift.TException
    {
      executePrepared_result result = new executePrepared_result();
      receiveBase(result, "executePrepared");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executePrepared failed: unknown result");
    }

    public UpdateResult executePreparedUpdate(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executePreparedUpdate(stmtId, params, attrs, token);
      return recv_executePreparedUpdate();
    }

    public void send_executePreparedUpdate(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executePreparedUpdate_args args = new executePreparedUpdate_args();
      args.setStmtId(stmtId);
      args.setParams(params);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executePreparedUpdate", args);
    }

    public UpdateResult recv_executePreparedUpdate() throws SnappyException, org.apache.thrift.TException
    {
      executePreparedUpdate_result result = new executePreparedUpdate_result();
      receiveBase(result, "executePreparedUpdate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executePreparedUpdate failed: unknown result");
    }

    public RowSet executePreparedQuery(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executePreparedQuery(stmtId, params, attrs, token);
      return recv_executePreparedQuery();
    }

    public void send_executePreparedQuery(long stmtId, Row params, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executePreparedQuery_args args = new executePreparedQuery_args();
      args.setStmtId(stmtId);
      args.setParams(params);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executePreparedQuery", args);
    }

    public RowSet recv_executePreparedQuery() throws SnappyException, org.apache.thrift.TException
    {
      executePreparedQuery_result result = new executePreparedQuery_result();
      receiveBase(result, "executePreparedQuery");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executePreparedQuery failed: unknown result");
    }

    public UpdateResult executePreparedBatch(long stmtId, List paramsBatch, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executePreparedBatch(stmtId, paramsBatch, attrs, token);
      return recv_executePreparedBatch();
    }

    public void send_executePreparedBatch(long stmtId, List paramsBatch, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      executePreparedBatch_args args = new executePreparedBatch_args();
      args.setStmtId(stmtId);
      args.setParamsBatch(paramsBatch);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("executePreparedBatch", args);
    }

    public UpdateResult recv_executePreparedBatch() throws SnappyException, org.apache.thrift.TException
    {
      executePreparedBatch_result result = new executePreparedBatch_result();
      receiveBase(result, "executePreparedBatch");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executePreparedBatch failed: unknown result");
    }

    public StatementResult prepareAndExecute(long connId, String sql, List paramsBatch, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_prepareAndExecute(connId, sql, paramsBatch, outputParams, attrs, token);
      return recv_prepareAndExecute();
    }

    public void send_prepareAndExecute(long connId, String sql, List paramsBatch, Map outputParams, StatementAttrs attrs, ByteBuffer token) throws org.apache.thrift.TException
    {
      prepareAndExecute_args args = new prepareAndExecute_args();
      args.setConnId(connId);
      args.setSql(sql);
      args.setParamsBatch(paramsBatch);
      args.setOutputParams(outputParams);
      args.setAttrs(attrs);
      args.setToken(token);
      sendBase("prepareAndExecute", args);
    }

    public StatementResult recv_prepareAndExecute() throws SnappyException, org.apache.thrift.TException
    {
      prepareAndExecute_result result = new prepareAndExecute_result();
      receiveBase(result, "prepareAndExecute");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "prepareAndExecute failed: unknown result");
    }

    public byte beginTransaction(long connId, byte isolationLevel, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_beginTransaction(connId, isolationLevel, flags, token);
      return recv_beginTransaction();
    }

    public void send_beginTransaction(long connId, byte isolationLevel, Map flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      beginTransaction_args args = new beginTransaction_args();
      args.setConnId(connId);
      args.setIsolationLevel(isolationLevel);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("beginTransaction", args);
    }

    public byte recv_beginTransaction() throws SnappyException, org.apache.thrift.TException
    {
      beginTransaction_result result = new beginTransaction_result();
      receiveBase(result, "beginTransaction");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "beginTransaction failed: unknown result");
    }

    public void setTransactionAttributes(long connId, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_setTransactionAttributes(connId, flags, token);
      recv_setTransactionAttributes();
    }

    public void send_setTransactionAttributes(long connId, Map flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      setTransactionAttributes_args args = new setTransactionAttributes_args();
      args.setConnId(connId);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("setTransactionAttributes", args);
    }

    public void recv_setTransactionAttributes() throws SnappyException, org.apache.thrift.TException
    {
      setTransactionAttributes_result result = new setTransactionAttributes_result();
      receiveBase(result, "setTransactionAttributes");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public Map getTransactionAttributes(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_getTransactionAttributes(connId, token);
      return recv_getTransactionAttributes();
    }

    public void send_getTransactionAttributes(long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      getTransactionAttributes_args args = new getTransactionAttributes_args();
      args.setConnId(connId);
      args.setToken(token);
      sendBase("getTransactionAttributes", args);
    }

    public Map recv_getTransactionAttributes() throws SnappyException, org.apache.thrift.TException
    {
      getTransactionAttributes_result result = new getTransactionAttributes_result();
      receiveBase(result, "getTransactionAttributes");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getTransactionAttributes failed: unknown result");
    }

    public void commitTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_commitTransaction(connId, startNewTransaction, flags, token);
      recv_commitTransaction();
    }

    public void send_commitTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      commitTransaction_args args = new commitTransaction_args();
      args.setConnId(connId);
      args.setStartNewTransaction(startNewTransaction);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("commitTransaction", args);
    }

    public void recv_commitTransaction() throws SnappyException, org.apache.thrift.TException
    {
      commitTransaction_result result = new commitTransaction_result();
      receiveBase(result, "commitTransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void rollbackTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_rollbackTransaction(connId, startNewTransaction, flags, token);
      recv_rollbackTransaction();
    }

    public void send_rollbackTransaction(long connId, boolean startNewTransaction, Map flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      rollbackTransaction_args args = new rollbackTransaction_args();
      args.setConnId(connId);
      args.setStartNewTransaction(startNewTransaction);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("rollbackTransaction", args);
    }

    public void recv_rollbackTransaction() throws SnappyException, org.apache.thrift.TException
    {
      rollbackTransaction_result result = new rollbackTransaction_result();
      receiveBase(result, "rollbackTransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public RowSet getNextResultSet(long cursorId, byte otherResultSetBehaviour, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_getNextResultSet(cursorId, otherResultSetBehaviour, token);
      return recv_getNextResultSet();
    }

    public void send_getNextResultSet(long cursorId, byte otherResultSetBehaviour, ByteBuffer token) throws org.apache.thrift.TException
    {
      getNextResultSet_args args = new getNextResultSet_args();
      args.setCursorId(cursorId);
      args.setOtherResultSetBehaviour(otherResultSetBehaviour);
      args.setToken(token);
      sendBase("getNextResultSet", args);
    }

    public RowSet recv_getNextResultSet() throws SnappyException, org.apache.thrift.TException
    {
      getNextResultSet_result result = new getNextResultSet_result();
      receiveBase(result, "getNextResultSet");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNextResultSet failed: unknown result");
    }

    public BlobChunk getBlobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_getBlobChunk(connId, lobId, offset, size, freeLobAtEnd, token);
      return recv_getBlobChunk();
    }

    public void send_getBlobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws org.apache.thrift.TException
    {
      getBlobChunk_args args = new getBlobChunk_args();
      args.setConnId(connId);
      args.setLobId(lobId);
      args.setOffset(offset);
      args.setSize(size);
      args.setFreeLobAtEnd(freeLobAtEnd);
      args.setToken(token);
      sendBase("getBlobChunk", args);
    }

    public BlobChunk recv_getBlobChunk() throws SnappyException, org.apache.thrift.TException
    {
      getBlobChunk_result result = new getBlobChunk_result();
      receiveBase(result, "getBlobChunk");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBlobChunk failed: unknown result");
    }

    public ClobChunk getClobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_getClobChunk(connId, lobId, offset, size, freeLobAtEnd, token);
      return recv_getClobChunk();
    }

    public void send_getClobChunk(long connId, long lobId, long offset, int size, boolean freeLobAtEnd, ByteBuffer token) throws org.apache.thrift.TException
    {
      getClobChunk_args args = new getClobChunk_args();
      args.setConnId(connId);
      args.setLobId(lobId);
      args.setOffset(offset);
      args.setSize(size);
      args.setFreeLobAtEnd(freeLobAtEnd);
      args.setToken(token);
      sendBase("getClobChunk", args);
    }

    public ClobChunk recv_getClobChunk() throws SnappyException, org.apache.thrift.TException
    {
      getClobChunk_result result = new getClobChunk_result();
      receiveBase(result, "getClobChunk");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClobChunk failed: unknown result");
    }

    public long sendBlobChunk(BlobChunk chunk, long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_sendBlobChunk(chunk, connId, token);
      return recv_sendBlobChunk();
    }

    public void send_sendBlobChunk(BlobChunk chunk, long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      sendBlobChunk_args args = new sendBlobChunk_args();
      args.setChunk(chunk);
      args.setConnId(connId);
      args.setToken(token);
      sendBase("sendBlobChunk", args);
    }

    public long recv_sendBlobChunk() throws SnappyException, org.apache.thrift.TException
    {
      sendBlobChunk_result result = new sendBlobChunk_result();
      receiveBase(result, "sendBlobChunk");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sendBlobChunk failed: unknown result");
    }

    public long sendClobChunk(ClobChunk chunk, long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_sendClobChunk(chunk, connId, token);
      return recv_sendClobChunk();
    }

    public void send_sendClobChunk(ClobChunk chunk, long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      sendClobChunk_args args = new sendClobChunk_args();
      args.setChunk(chunk);
      args.setConnId(connId);
      args.setToken(token);
      sendBase("sendClobChunk", args);
    }

    public long recv_sendClobChunk() throws SnappyException, org.apache.thrift.TException
    {
      sendClobChunk_result result = new sendClobChunk_result();
      receiveBase(result, "sendClobChunk");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sendClobChunk failed: unknown result");
    }

    public void freeLob(long connId, long lobId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_freeLob(connId, lobId, token);
      recv_freeLob();
    }

    public void send_freeLob(long connId, long lobId, ByteBuffer token) throws org.apache.thrift.TException
    {
      freeLob_args args = new freeLob_args();
      args.setConnId(connId);
      args.setLobId(lobId);
      args.setToken(token);
      sendBase("freeLob", args);
    }

    public void recv_freeLob() throws SnappyException, org.apache.thrift.TException
    {
      freeLob_result result = new freeLob_result();
      receiveBase(result, "freeLob");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public RowSet scrollCursor(long cursorId, int offset, boolean offsetIsAbsolute, boolean fetchReverse, int fetchSize, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_scrollCursor(cursorId, offset, offsetIsAbsolute, fetchReverse, fetchSize, token);
      return recv_scrollCursor();
    }

    public void send_scrollCursor(long cursorId, int offset, boolean offsetIsAbsolute, boolean fetchReverse, int fetchSize, ByteBuffer token) throws org.apache.thrift.TException
    {
      scrollCursor_args args = new scrollCursor_args();
      args.setCursorId(cursorId);
      args.setOffset(offset);
      args.setOffsetIsAbsolute(offsetIsAbsolute);
      args.setFetchReverse(fetchReverse);
      args.setFetchSize(fetchSize);
      args.setToken(token);
      sendBase("scrollCursor", args);
    }

    public RowSet recv_scrollCursor() throws SnappyException, org.apache.thrift.TException
    {
      scrollCursor_result result = new scrollCursor_result();
      receiveBase(result, "scrollCursor");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "scrollCursor failed: unknown result");
    }

    public void executeCursorUpdate(long cursorId, List operations, List changedRows, List> changedColumnsList, List changedRowIndexes, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_executeCursorUpdate(cursorId, operations, changedRows, changedColumnsList, changedRowIndexes, token);
      recv_executeCursorUpdate();
    }

    public void send_executeCursorUpdate(long cursorId, List operations, List changedRows, List> changedColumnsList, List changedRowIndexes, ByteBuffer token) throws org.apache.thrift.TException
    {
      executeCursorUpdate_args args = new executeCursorUpdate_args();
      args.setCursorId(cursorId);
      args.setOperations(operations);
      args.setChangedRows(changedRows);
      args.setChangedColumnsList(changedColumnsList);
      args.setChangedRowIndexes(changedRowIndexes);
      args.setToken(token);
      sendBase("executeCursorUpdate", args);
    }

    public void recv_executeCursorUpdate() throws SnappyException, org.apache.thrift.TException
    {
      executeCursorUpdate_result result = new executeCursorUpdate_result();
      receiveBase(result, "executeCursorUpdate");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void startXATransaction(long connId, TransactionXid xid, int timeoutInSeconds, int flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_startXATransaction(connId, xid, timeoutInSeconds, flags, token);
      recv_startXATransaction();
    }

    public void send_startXATransaction(long connId, TransactionXid xid, int timeoutInSeconds, int flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      startXATransaction_args args = new startXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setTimeoutInSeconds(timeoutInSeconds);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("startXATransaction", args);
    }

    public void recv_startXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      startXATransaction_result result = new startXATransaction_result();
      receiveBase(result, "startXATransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public int prepareXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_prepareXATransaction(connId, xid, token);
      return recv_prepareXATransaction();
    }

    public void send_prepareXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws org.apache.thrift.TException
    {
      prepareXATransaction_args args = new prepareXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setToken(token);
      sendBase("prepareXATransaction", args);
    }

    public int recv_prepareXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      prepareXATransaction_result result = new prepareXATransaction_result();
      receiveBase(result, "prepareXATransaction");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "prepareXATransaction failed: unknown result");
    }

    public void commitXATransaction(long connId, TransactionXid xid, boolean onePhase, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_commitXATransaction(connId, xid, onePhase, token);
      recv_commitXATransaction();
    }

    public void send_commitXATransaction(long connId, TransactionXid xid, boolean onePhase, ByteBuffer token) throws org.apache.thrift.TException
    {
      commitXATransaction_args args = new commitXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setOnePhase(onePhase);
      args.setToken(token);
      sendBase("commitXATransaction", args);
    }

    public void recv_commitXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      commitXATransaction_result result = new commitXATransaction_result();
      receiveBase(result, "commitXATransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void rollbackXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_rollbackXATransaction(connId, xid, token);
      recv_rollbackXATransaction();
    }

    public void send_rollbackXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws org.apache.thrift.TException
    {
      rollbackXATransaction_args args = new rollbackXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setToken(token);
      sendBase("rollbackXATransaction", args);
    }

    public void recv_rollbackXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      rollbackXATransaction_result result = new rollbackXATransaction_result();
      receiveBase(result, "rollbackXATransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void forgetXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_forgetXATransaction(connId, xid, token);
      recv_forgetXATransaction();
    }

    public void send_forgetXATransaction(long connId, TransactionXid xid, ByteBuffer token) throws org.apache.thrift.TException
    {
      forgetXATransaction_args args = new forgetXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setToken(token);
      sendBase("forgetXATransaction", args);
    }

    public void recv_forgetXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      forgetXATransaction_result result = new forgetXATransaction_result();
      receiveBase(result, "forgetXATransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void endXATransaction(long connId, TransactionXid xid, int flags, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_endXATransaction(connId, xid, flags, token);
      recv_endXATransaction();
    }

    public void send_endXATransaction(long connId, TransactionXid xid, int flags, ByteBuffer token) throws org.apache.thrift.TException
    {
      endXATransaction_args args = new endXATransaction_args();
      args.setConnId(connId);
      args.setXid(xid);
      args.setFlags(flags);
      args.setToken(token);
      sendBase("endXATransaction", args);
    }

    public void recv_endXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      endXATransaction_result result = new endXATransaction_result();
      receiveBase(result, "endXATransaction");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public List recoverXATransaction(long connId, int flag, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_recoverXATransaction(connId, flag, token);
      return recv_recoverXATransaction();
    }

    public void send_recoverXATransaction(long connId, int flag, ByteBuffer token) throws org.apache.thrift.TException
    {
      recoverXATransaction_args args = new recoverXATransaction_args();
      args.setConnId(connId);
      args.setFlag(flag);
      args.setToken(token);
      sendBase("recoverXATransaction", args);
    }

    public List recv_recoverXATransaction() throws SnappyException, org.apache.thrift.TException
    {
      recoverXATransaction_result result = new recoverXATransaction_result();
      receiveBase(result, "recoverXATransaction");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "recoverXATransaction failed: unknown result");
    }

    public ServiceMetaData getServiceMetaData(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_getServiceMetaData(connId, token);
      return recv_getServiceMetaData();
    }

    public void send_getServiceMetaData(long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      getServiceMetaData_args args = new getServiceMetaData_args();
      args.setConnId(connId);
      args.setToken(token);
      sendBase("getServiceMetaData", args);
    }

    public ServiceMetaData recv_getServiceMetaData() throws SnappyException, org.apache.thrift.TException
    {
      getServiceMetaData_result result = new getServiceMetaData_result();
      receiveBase(result, "getServiceMetaData");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getServiceMetaData failed: unknown result");
    }

    public RowSet getSchemaMetaData(ServiceMetaDataCall schemaCall, ServiceMetaDataArgs metadataArgs) throws SnappyException, org.apache.thrift.TException
    {
      send_getSchemaMetaData(schemaCall, metadataArgs);
      return recv_getSchemaMetaData();
    }

    public void send_getSchemaMetaData(ServiceMetaDataCall schemaCall, ServiceMetaDataArgs metadataArgs) throws org.apache.thrift.TException
    {
      getSchemaMetaData_args args = new getSchemaMetaData_args();
      args.setSchemaCall(schemaCall);
      args.setMetadataArgs(metadataArgs);
      sendBase("getSchemaMetaData", args);
    }

    public RowSet recv_getSchemaMetaData() throws SnappyException, org.apache.thrift.TException
    {
      getSchemaMetaData_result result = new getSchemaMetaData_result();
      receiveBase(result, "getSchemaMetaData");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSchemaMetaData failed: unknown result");
    }

    public RowSet getIndexInfo(ServiceMetaDataArgs metadataArgs, boolean unique, boolean approximate) throws SnappyException, org.apache.thrift.TException
    {
      send_getIndexInfo(metadataArgs, unique, approximate);
      return recv_getIndexInfo();
    }

    public void send_getIndexInfo(ServiceMetaDataArgs metadataArgs, boolean unique, boolean approximate) throws org.apache.thrift.TException
    {
      getIndexInfo_args args = new getIndexInfo_args();
      args.setMetadataArgs(metadataArgs);
      args.setUnique(unique);
      args.setApproximate(approximate);
      sendBase("getIndexInfo", args);
    }

    public RowSet recv_getIndexInfo() throws SnappyException, org.apache.thrift.TException
    {
      getIndexInfo_result result = new getIndexInfo_result();
      receiveBase(result, "getIndexInfo");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getIndexInfo failed: unknown result");
    }

    public RowSet getUDTs(ServiceMetaDataArgs metadataArgs, List types) throws SnappyException, org.apache.thrift.TException
    {
      send_getUDTs(metadataArgs, types);
      return recv_getUDTs();
    }

    public void send_getUDTs(ServiceMetaDataArgs metadataArgs, List types) throws org.apache.thrift.TException
    {
      getUDTs_args args = new getUDTs_args();
      args.setMetadataArgs(metadataArgs);
      args.setTypes(types);
      sendBase("getUDTs", args);
    }

    public RowSet recv_getUDTs() throws SnappyException, org.apache.thrift.TException
    {
      getUDTs_result result = new getUDTs_result();
      receiveBase(result, "getUDTs");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUDTs failed: unknown result");
    }

    public RowSet getBestRowIdentifier(ServiceMetaDataArgs metadataArgs, int scope, boolean nullable) throws SnappyException, org.apache.thrift.TException
    {
      send_getBestRowIdentifier(metadataArgs, scope, nullable);
      return recv_getBestRowIdentifier();
    }

    public void send_getBestRowIdentifier(ServiceMetaDataArgs metadataArgs, int scope, boolean nullable) throws org.apache.thrift.TException
    {
      getBestRowIdentifier_args args = new getBestRowIdentifier_args();
      args.setMetadataArgs(metadataArgs);
      args.setScope(scope);
      args.setNullable(nullable);
      sendBase("getBestRowIdentifier", args);
    }

    public RowSet recv_getBestRowIdentifier() throws SnappyException, org.apache.thrift.TException
    {
      getBestRowIdentifier_result result = new getBestRowIdentifier_result();
      receiveBase(result, "getBestRowIdentifier");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getBestRowIdentifier failed: unknown result");
    }

    public List fetchActiveConnections(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_fetchActiveConnections(connId, token);
      return recv_fetchActiveConnections();
    }

    public void send_fetchActiveConnections(long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      fetchActiveConnections_args args = new fetchActiveConnections_args();
      args.setConnId(connId);
      args.setToken(token);
      sendBase("fetchActiveConnections", args);
    }

    public List recv_fetchActiveConnections() throws SnappyException, org.apache.thrift.TException
    {
      fetchActiveConnections_result result = new fetchActiveConnections_result();
      receiveBase(result, "fetchActiveConnections");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchActiveConnections failed: unknown result");
    }

    public Map fetchActiveStatements(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_fetchActiveStatements(connId, token);
      return recv_fetchActiveStatements();
    }

    public void send_fetchActiveStatements(long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      fetchActiveStatements_args args = new fetchActiveStatements_args();
      args.setConnId(connId);
      args.setToken(token);
      sendBase("fetchActiveStatements", args);
    }

    public Map recv_fetchActiveStatements() throws SnappyException, org.apache.thrift.TException
    {
      fetchActiveStatements_result result = new fetchActiveStatements_result();
      receiveBase(result, "fetchActiveStatements");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.error != null) {
        throw result.error;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchActiveStatements failed: unknown result");
    }

    public void cancelStatement(long stmtId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_cancelStatement(stmtId, token);
      recv_cancelStatement();
    }

    public void send_cancelStatement(long stmtId, ByteBuffer token) throws org.apache.thrift.TException
    {
      cancelStatement_args args = new cancelStatement_args();
      args.setStmtId(stmtId);
      args.setToken(token);
      sendBase("cancelStatement", args);
    }

    public void recv_cancelStatement() throws SnappyException, org.apache.thrift.TException
    {
      cancelStatement_result result = new cancelStatement_result();
      receiveBase(result, "cancelStatement");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void cancelCurrentStatement(long connId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_cancelCurrentStatement(connId, token);
      recv_cancelCurrentStatement();
    }

    public void send_cancelCurrentStatement(long connId, ByteBuffer token) throws org.apache.thrift.TException
    {
      cancelCurrentStatement_args args = new cancelCurrentStatement_args();
      args.setConnId(connId);
      args.setToken(token);
      sendBase("cancelCurrentStatement", args);
    }

    public void recv_cancelCurrentStatement() throws SnappyException, org.apache.thrift.TException
    {
      cancelCurrentStatement_result result = new cancelCurrentStatement_result();
      receiveBase(result, "cancelCurrentStatement");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void closeResultSet(long cursorId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_closeResultSet(cursorId, token);
      recv_closeResultSet();
    }

    public void send_closeResultSet(long cursorId, ByteBuffer token) throws org.apache.thrift.TException
    {
      closeResultSet_args args = new closeResultSet_args();
      args.setCursorId(cursorId);
      args.setToken(token);
      sendBase("closeResultSet", args);
    }

    public void recv_closeResultSet() throws SnappyException, org.apache.thrift.TException
    {
      closeResultSet_result result = new closeResultSet_result();
      receiveBase(result, "closeResultSet");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void closeStatement(long stmtId, ByteBuffer token) throws SnappyException, org.apache.thrift.TException
    {
      send_closeStatement(stmtId, token);
      recv_closeStatement();
    }

    public void send_closeStatement(long stmtId, ByteBuffer token) throws org.apache.thrift.TException
    {
      closeStatement_args args = new closeStatement_args();
      args.setStmtId(stmtId);
      args.setToken(token);
      sendBase("closeStatement", args);
    }

    public void recv_closeStatement() throws SnappyException, org.apache.thrift.TException
    {
      closeStatement_result result = new closeStatement_result();
      receiveBase(result, "closeStatement");
      if (result.error != null) {
        throw result.error;
      }
      return;
    }

    public void closeConnection(long connId, boolean closeSocket, ByteBuffer token) throws org.apache.thrift.TException
    {
      send_closeConnection(connId, closeSocket, token);
    }

    public void send_closeConnection(long connId, boolean closeSocket, ByteBuffer token) throws org.apache.thrift.TException
    {
      closeConnection_args args = new closeConnection_args();
      args.setConnId(connId);
      args.setCloseSocket(closeSocket);
      args.setToken(token);
      sendBaseOneway("closeConnection", args);
    }

    public void bulkClose(List entities) throws org.apache.thrift.TException
    {
      send_bulkClose(entities);
    }

    public void send_bulkClose(List entities) throws org.apache.thrift.TException
    {
      bulkClose_args args = new bulkClose_args();
      args.setEntities(entities);
      sendBaseOneway("bulkClose", args);
    }

  }
  public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.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("getPreferredServer", new getPreferredServer());
      processMap.put("getAllServersWithPreferredServer", new getAllServersWithPreferredServer());
      processMap.put("openConnection", new openConnection());
      processMap.put("execute", new execute());
      processMap.put("executeUpdate", new executeUpdate());
      processMap.put("executeQuery", new executeQuery());
      processMap.put("prepareStatement", new prepareStatement());
      processMap.put("executePrepared", new executePrepared());
      processMap.put("executePreparedUpdate", new executePreparedUpdate());
      processMap.put("executePreparedQuery", new executePreparedQuery());
      processMap.put("executePreparedBatch", new executePreparedBatch());
      processMap.put("prepareAndExecute", new prepareAndExecute());
      processMap.put("beginTransaction", new beginTransaction());
      processMap.put("setTransactionAttributes", new setTransactionAttributes());
      processMap.put("getTransactionAttributes", new getTransactionAttributes());
      processMap.put("commitTransaction", new commitTransaction());
      processMap.put("rollbackTransaction", new rollbackTransaction());
      processMap.put("getNextResultSet", new getNextResultSet());
      processMap.put("getBlobChunk", new getBlobChunk());
      processMap.put("getClobChunk", new getClobChunk());
      processMap.put("sendBlobChunk", new sendBlobChunk());
      processMap.put("sendClobChunk", new sendClobChunk());
      processMap.put("freeLob", new freeLob());
      processMap.put("scrollCursor", new scrollCursor());
      processMap.put("executeCursorUpdate", new executeCursorUpdate());
      processMap.put("startXATransaction", new startXATransaction());
      processMap.put("prepareXATransaction", new prepareXATransaction());
      processMap.put("commitXATransaction", new commitXATransaction());
      processMap.put("rollbackXATransaction", new rollbackXATransaction());
      processMap.put("forgetXATransaction", new forgetXATransaction());
      processMap.put("endXATransaction", new endXATransaction());
      processMap.put("recoverXATransaction", new recoverXATransaction());
      processMap.put("getServiceMetaData", new getServiceMetaData());
      processMap.put("getSchemaMetaData", new getSchemaMetaData());
      processMap.put("getIndexInfo", new getIndexInfo());
      processMap.put("getUDTs", new getUDTs());
      processMap.put("getBestRowIdentifier", new getBestRowIdentifier());
      processMap.put("fetchActiveConnections", new fetchActiveConnections());
      processMap.put("fetchActiveStatements", new fetchActiveStatements());
      processMap.put("cancelStatement", new cancelStatement());
      processMap.put("cancelCurrentStatement", new cancelCurrentStatement());
      processMap.put("closeResultSet", new closeResultSet());
      processMap.put("closeStatement", new closeStatement());
      processMap.put("closeConnection", new closeConnection());
      processMap.put("bulkClose", new bulkClose());
      return processMap;
    }

    public static class getPreferredServer extends org.apache.thrift.ProcessFunction {
      public getPreferredServer() {
        super("getPreferredServer");
      }

      public getPreferredServer_args getEmptyArgsInstance() {
        return new getPreferredServer_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getPreferredServer_result getResult(I iface, getPreferredServer_args args) throws org.apache.thrift.TException {
        getPreferredServer_result result = new getPreferredServer_result();
        try {
          result.success = iface.getPreferredServer(args.serverTypes, args.serverGroups, args.failedServers);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getAllServersWithPreferredServer extends org.apache.thrift.ProcessFunction {
      public getAllServersWithPreferredServer() {
        super("getAllServersWithPreferredServer");
      }

      public getAllServersWithPreferredServer_args getEmptyArgsInstance() {
        return new getAllServersWithPreferredServer_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getAllServersWithPreferredServer_result getResult(I iface, getAllServersWithPreferredServer_args args) throws org.apache.thrift.TException {
        getAllServersWithPreferredServer_result result = new getAllServersWithPreferredServer_result();
        try {
          result.success = iface.getAllServersWithPreferredServer(args.serverTypes, args.serverGroups, args.failedServers);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class openConnection extends org.apache.thrift.ProcessFunction {
      public openConnection() {
        super("openConnection");
      }

      public openConnection_args getEmptyArgsInstance() {
        return new openConnection_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public openConnection_result getResult(I iface, openConnection_args args) throws org.apache.thrift.TException {
        openConnection_result result = new openConnection_result();
        try {
          result.success = iface.openConnection(args.arguments);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class execute extends org.apache.thrift.ProcessFunction {
      public execute() {
        super("execute");
      }

      public execute_args getEmptyArgsInstance() {
        return new execute_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public execute_result getResult(I iface, execute_args args) throws org.apache.thrift.TException {
        execute_result result = new execute_result();
        try {
          result.success = iface.execute(args.connId, args.sql, args.outputParams, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executeUpdate extends org.apache.thrift.ProcessFunction {
      public executeUpdate() {
        super("executeUpdate");
      }

      public executeUpdate_args getEmptyArgsInstance() {
        return new executeUpdate_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executeUpdate_result getResult(I iface, executeUpdate_args args) throws org.apache.thrift.TException {
        executeUpdate_result result = new executeUpdate_result();
        try {
          result.success = iface.executeUpdate(args.connId, args.sqls, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executeQuery extends org.apache.thrift.ProcessFunction {
      public executeQuery() {
        super("executeQuery");
      }

      public executeQuery_args getEmptyArgsInstance() {
        return new executeQuery_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executeQuery_result getResult(I iface, executeQuery_args args) throws org.apache.thrift.TException {
        executeQuery_result result = new executeQuery_result();
        try {
          result.success = iface.executeQuery(args.connId, args.sql, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class prepareStatement extends org.apache.thrift.ProcessFunction {
      public prepareStatement() {
        super("prepareStatement");
      }

      public prepareStatement_args getEmptyArgsInstance() {
        return new prepareStatement_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public prepareStatement_result getResult(I iface, prepareStatement_args args) throws org.apache.thrift.TException {
        prepareStatement_result result = new prepareStatement_result();
        try {
          result.success = iface.prepareStatement(args.connId, args.sql, args.outputParams, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executePrepared extends org.apache.thrift.ProcessFunction {
      public executePrepared() {
        super("executePrepared");
      }

      public executePrepared_args getEmptyArgsInstance() {
        return new executePrepared_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executePrepared_result getResult(I iface, executePrepared_args args) throws org.apache.thrift.TException {
        executePrepared_result result = new executePrepared_result();
        try {
          result.success = iface.executePrepared(args.stmtId, args.params, args.outputParams, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executePreparedUpdate extends org.apache.thrift.ProcessFunction {
      public executePreparedUpdate() {
        super("executePreparedUpdate");
      }

      public executePreparedUpdate_args getEmptyArgsInstance() {
        return new executePreparedUpdate_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executePreparedUpdate_result getResult(I iface, executePreparedUpdate_args args) throws org.apache.thrift.TException {
        executePreparedUpdate_result result = new executePreparedUpdate_result();
        try {
          result.success = iface.executePreparedUpdate(args.stmtId, args.params, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executePreparedQuery extends org.apache.thrift.ProcessFunction {
      public executePreparedQuery() {
        super("executePreparedQuery");
      }

      public executePreparedQuery_args getEmptyArgsInstance() {
        return new executePreparedQuery_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executePreparedQuery_result getResult(I iface, executePreparedQuery_args args) throws org.apache.thrift.TException {
        executePreparedQuery_result result = new executePreparedQuery_result();
        try {
          result.success = iface.executePreparedQuery(args.stmtId, args.params, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executePreparedBatch extends org.apache.thrift.ProcessFunction {
      public executePreparedBatch() {
        super("executePreparedBatch");
      }

      public executePreparedBatch_args getEmptyArgsInstance() {
        return new executePreparedBatch_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executePreparedBatch_result getResult(I iface, executePreparedBatch_args args) throws org.apache.thrift.TException {
        executePreparedBatch_result result = new executePreparedBatch_result();
        try {
          result.success = iface.executePreparedBatch(args.stmtId, args.paramsBatch, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class prepareAndExecute extends org.apache.thrift.ProcessFunction {
      public prepareAndExecute() {
        super("prepareAndExecute");
      }

      public prepareAndExecute_args getEmptyArgsInstance() {
        return new prepareAndExecute_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public prepareAndExecute_result getResult(I iface, prepareAndExecute_args args) throws org.apache.thrift.TException {
        prepareAndExecute_result result = new prepareAndExecute_result();
        try {
          result.success = iface.prepareAndExecute(args.connId, args.sql, args.paramsBatch, args.outputParams, args.attrs, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class beginTransaction extends org.apache.thrift.ProcessFunction {
      public beginTransaction() {
        super("beginTransaction");
      }

      public beginTransaction_args getEmptyArgsInstance() {
        return new beginTransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public beginTransaction_result getResult(I iface, beginTransaction_args args) throws org.apache.thrift.TException {
        beginTransaction_result result = new beginTransaction_result();
        try {
          result.success = iface.beginTransaction(args.connId, args.isolationLevel, args.flags, args.token);
          result.setSuccessIsSet(true);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class setTransactionAttributes extends org.apache.thrift.ProcessFunction {
      public setTransactionAttributes() {
        super("setTransactionAttributes");
      }

      public setTransactionAttributes_args getEmptyArgsInstance() {
        return new setTransactionAttributes_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public setTransactionAttributes_result getResult(I iface, setTransactionAttributes_args args) throws org.apache.thrift.TException {
        setTransactionAttributes_result result = new setTransactionAttributes_result();
        try {
          iface.setTransactionAttributes(args.connId, args.flags, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getTransactionAttributes extends org.apache.thrift.ProcessFunction {
      public getTransactionAttributes() {
        super("getTransactionAttributes");
      }

      public getTransactionAttributes_args getEmptyArgsInstance() {
        return new getTransactionAttributes_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getTransactionAttributes_result getResult(I iface, getTransactionAttributes_args args) throws org.apache.thrift.TException {
        getTransactionAttributes_result result = new getTransactionAttributes_result();
        try {
          result.success = iface.getTransactionAttributes(args.connId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class commitTransaction extends org.apache.thrift.ProcessFunction {
      public commitTransaction() {
        super("commitTransaction");
      }

      public commitTransaction_args getEmptyArgsInstance() {
        return new commitTransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public commitTransaction_result getResult(I iface, commitTransaction_args args) throws org.apache.thrift.TException {
        commitTransaction_result result = new commitTransaction_result();
        try {
          iface.commitTransaction(args.connId, args.startNewTransaction, args.flags, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class rollbackTransaction extends org.apache.thrift.ProcessFunction {
      public rollbackTransaction() {
        super("rollbackTransaction");
      }

      public rollbackTransaction_args getEmptyArgsInstance() {
        return new rollbackTransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public rollbackTransaction_result getResult(I iface, rollbackTransaction_args args) throws org.apache.thrift.TException {
        rollbackTransaction_result result = new rollbackTransaction_result();
        try {
          iface.rollbackTransaction(args.connId, args.startNewTransaction, args.flags, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getNextResultSet extends org.apache.thrift.ProcessFunction {
      public getNextResultSet() {
        super("getNextResultSet");
      }

      public getNextResultSet_args getEmptyArgsInstance() {
        return new getNextResultSet_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getNextResultSet_result getResult(I iface, getNextResultSet_args args) throws org.apache.thrift.TException {
        getNextResultSet_result result = new getNextResultSet_result();
        try {
          result.success = iface.getNextResultSet(args.cursorId, args.otherResultSetBehaviour, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getBlobChunk extends org.apache.thrift.ProcessFunction {
      public getBlobChunk() {
        super("getBlobChunk");
      }

      public getBlobChunk_args getEmptyArgsInstance() {
        return new getBlobChunk_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getBlobChunk_result getResult(I iface, getBlobChunk_args args) throws org.apache.thrift.TException {
        getBlobChunk_result result = new getBlobChunk_result();
        try {
          result.success = iface.getBlobChunk(args.connId, args.lobId, args.offset, args.size, args.freeLobAtEnd, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getClobChunk extends org.apache.thrift.ProcessFunction {
      public getClobChunk() {
        super("getClobChunk");
      }

      public getClobChunk_args getEmptyArgsInstance() {
        return new getClobChunk_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getClobChunk_result getResult(I iface, getClobChunk_args args) throws org.apache.thrift.TException {
        getClobChunk_result result = new getClobChunk_result();
        try {
          result.success = iface.getClobChunk(args.connId, args.lobId, args.offset, args.size, args.freeLobAtEnd, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class sendBlobChunk extends org.apache.thrift.ProcessFunction {
      public sendBlobChunk() {
        super("sendBlobChunk");
      }

      public sendBlobChunk_args getEmptyArgsInstance() {
        return new sendBlobChunk_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public sendBlobChunk_result getResult(I iface, sendBlobChunk_args args) throws org.apache.thrift.TException {
        sendBlobChunk_result result = new sendBlobChunk_result();
        try {
          result.success = iface.sendBlobChunk(args.chunk, args.connId, args.token);
          result.setSuccessIsSet(true);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class sendClobChunk extends org.apache.thrift.ProcessFunction {
      public sendClobChunk() {
        super("sendClobChunk");
      }

      public sendClobChunk_args getEmptyArgsInstance() {
        return new sendClobChunk_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public sendClobChunk_result getResult(I iface, sendClobChunk_args args) throws org.apache.thrift.TException {
        sendClobChunk_result result = new sendClobChunk_result();
        try {
          result.success = iface.sendClobChunk(args.chunk, args.connId, args.token);
          result.setSuccessIsSet(true);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class freeLob extends org.apache.thrift.ProcessFunction {
      public freeLob() {
        super("freeLob");
      }

      public freeLob_args getEmptyArgsInstance() {
        return new freeLob_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public freeLob_result getResult(I iface, freeLob_args args) throws org.apache.thrift.TException {
        freeLob_result result = new freeLob_result();
        try {
          iface.freeLob(args.connId, args.lobId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class scrollCursor extends org.apache.thrift.ProcessFunction {
      public scrollCursor() {
        super("scrollCursor");
      }

      public scrollCursor_args getEmptyArgsInstance() {
        return new scrollCursor_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public scrollCursor_result getResult(I iface, scrollCursor_args args) throws org.apache.thrift.TException {
        scrollCursor_result result = new scrollCursor_result();
        try {
          result.success = iface.scrollCursor(args.cursorId, args.offset, args.offsetIsAbsolute, args.fetchReverse, args.fetchSize, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class executeCursorUpdate extends org.apache.thrift.ProcessFunction {
      public executeCursorUpdate() {
        super("executeCursorUpdate");
      }

      public executeCursorUpdate_args getEmptyArgsInstance() {
        return new executeCursorUpdate_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executeCursorUpdate_result getResult(I iface, executeCursorUpdate_args args) throws org.apache.thrift.TException {
        executeCursorUpdate_result result = new executeCursorUpdate_result();
        try {
          iface.executeCursorUpdate(args.cursorId, args.operations, args.changedRows, args.changedColumnsList, args.changedRowIndexes, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class startXATransaction extends org.apache.thrift.ProcessFunction {
      public startXATransaction() {
        super("startXATransaction");
      }

      public startXATransaction_args getEmptyArgsInstance() {
        return new startXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public startXATransaction_result getResult(I iface, startXATransaction_args args) throws org.apache.thrift.TException {
        startXATransaction_result result = new startXATransaction_result();
        try {
          iface.startXATransaction(args.connId, args.xid, args.timeoutInSeconds, args.flags, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class prepareXATransaction extends org.apache.thrift.ProcessFunction {
      public prepareXATransaction() {
        super("prepareXATransaction");
      }

      public prepareXATransaction_args getEmptyArgsInstance() {
        return new prepareXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public prepareXATransaction_result getResult(I iface, prepareXATransaction_args args) throws org.apache.thrift.TException {
        prepareXATransaction_result result = new prepareXATransaction_result();
        try {
          result.success = iface.prepareXATransaction(args.connId, args.xid, args.token);
          result.setSuccessIsSet(true);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class commitXATransaction extends org.apache.thrift.ProcessFunction {
      public commitXATransaction() {
        super("commitXATransaction");
      }

      public commitXATransaction_args getEmptyArgsInstance() {
        return new commitXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public commitXATransaction_result getResult(I iface, commitXATransaction_args args) throws org.apache.thrift.TException {
        commitXATransaction_result result = new commitXATransaction_result();
        try {
          iface.commitXATransaction(args.connId, args.xid, args.onePhase, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class rollbackXATransaction extends org.apache.thrift.ProcessFunction {
      public rollbackXATransaction() {
        super("rollbackXATransaction");
      }

      public rollbackXATransaction_args getEmptyArgsInstance() {
        return new rollbackXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public rollbackXATransaction_result getResult(I iface, rollbackXATransaction_args args) throws org.apache.thrift.TException {
        rollbackXATransaction_result result = new rollbackXATransaction_result();
        try {
          iface.rollbackXATransaction(args.connId, args.xid, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class forgetXATransaction extends org.apache.thrift.ProcessFunction {
      public forgetXATransaction() {
        super("forgetXATransaction");
      }

      public forgetXATransaction_args getEmptyArgsInstance() {
        return new forgetXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public forgetXATransaction_result getResult(I iface, forgetXATransaction_args args) throws org.apache.thrift.TException {
        forgetXATransaction_result result = new forgetXATransaction_result();
        try {
          iface.forgetXATransaction(args.connId, args.xid, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class endXATransaction extends org.apache.thrift.ProcessFunction {
      public endXATransaction() {
        super("endXATransaction");
      }

      public endXATransaction_args getEmptyArgsInstance() {
        return new endXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public endXATransaction_result getResult(I iface, endXATransaction_args args) throws org.apache.thrift.TException {
        endXATransaction_result result = new endXATransaction_result();
        try {
          iface.endXATransaction(args.connId, args.xid, args.flags, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class recoverXATransaction extends org.apache.thrift.ProcessFunction {
      public recoverXATransaction() {
        super("recoverXATransaction");
      }

      public recoverXATransaction_args getEmptyArgsInstance() {
        return new recoverXATransaction_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public recoverXATransaction_result getResult(I iface, recoverXATransaction_args args) throws org.apache.thrift.TException {
        recoverXATransaction_result result = new recoverXATransaction_result();
        try {
          result.success = iface.recoverXATransaction(args.connId, args.flag, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getServiceMetaData extends org.apache.thrift.ProcessFunction {
      public getServiceMetaData() {
        super("getServiceMetaData");
      }

      public getServiceMetaData_args getEmptyArgsInstance() {
        return new getServiceMetaData_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getServiceMetaData_result getResult(I iface, getServiceMetaData_args args) throws org.apache.thrift.TException {
        getServiceMetaData_result result = new getServiceMetaData_result();
        try {
          result.success = iface.getServiceMetaData(args.connId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getSchemaMetaData extends org.apache.thrift.ProcessFunction {
      public getSchemaMetaData() {
        super("getSchemaMetaData");
      }

      public getSchemaMetaData_args getEmptyArgsInstance() {
        return new getSchemaMetaData_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getSchemaMetaData_result getResult(I iface, getSchemaMetaData_args args) throws org.apache.thrift.TException {
        getSchemaMetaData_result result = new getSchemaMetaData_result();
        try {
          result.success = iface.getSchemaMetaData(args.schemaCall, args.metadataArgs);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getIndexInfo extends org.apache.thrift.ProcessFunction {
      public getIndexInfo() {
        super("getIndexInfo");
      }

      public getIndexInfo_args getEmptyArgsInstance() {
        return new getIndexInfo_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getIndexInfo_result getResult(I iface, getIndexInfo_args args) throws org.apache.thrift.TException {
        getIndexInfo_result result = new getIndexInfo_result();
        try {
          result.success = iface.getIndexInfo(args.metadataArgs, args.unique, args.approximate);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getUDTs extends org.apache.thrift.ProcessFunction {
      public getUDTs() {
        super("getUDTs");
      }

      public getUDTs_args getEmptyArgsInstance() {
        return new getUDTs_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getUDTs_result getResult(I iface, getUDTs_args args) throws org.apache.thrift.TException {
        getUDTs_result result = new getUDTs_result();
        try {
          result.success = iface.getUDTs(args.metadataArgs, args.types);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class getBestRowIdentifier extends org.apache.thrift.ProcessFunction {
      public getBestRowIdentifier() {
        super("getBestRowIdentifier");
      }

      public getBestRowIdentifier_args getEmptyArgsInstance() {
        return new getBestRowIdentifier_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getBestRowIdentifier_result getResult(I iface, getBestRowIdentifier_args args) throws org.apache.thrift.TException {
        getBestRowIdentifier_result result = new getBestRowIdentifier_result();
        try {
          result.success = iface.getBestRowIdentifier(args.metadataArgs, args.scope, args.nullable);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class fetchActiveConnections extends org.apache.thrift.ProcessFunction {
      public fetchActiveConnections() {
        super("fetchActiveConnections");
      }

      public fetchActiveConnections_args getEmptyArgsInstance() {
        return new fetchActiveConnections_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public fetchActiveConnections_result getResult(I iface, fetchActiveConnections_args args) throws org.apache.thrift.TException {
        fetchActiveConnections_result result = new fetchActiveConnections_result();
        try {
          result.success = iface.fetchActiveConnections(args.connId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class fetchActiveStatements extends org.apache.thrift.ProcessFunction {
      public fetchActiveStatements() {
        super("fetchActiveStatements");
      }

      public fetchActiveStatements_args getEmptyArgsInstance() {
        return new fetchActiveStatements_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public fetchActiveStatements_result getResult(I iface, fetchActiveStatements_args args) throws org.apache.thrift.TException {
        fetchActiveStatements_result result = new fetchActiveStatements_result();
        try {
          result.success = iface.fetchActiveStatements(args.connId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class cancelStatement extends org.apache.thrift.ProcessFunction {
      public cancelStatement() {
        super("cancelStatement");
      }

      public cancelStatement_args getEmptyArgsInstance() {
        return new cancelStatement_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public cancelStatement_result getResult(I iface, cancelStatement_args args) throws org.apache.thrift.TException {
        cancelStatement_result result = new cancelStatement_result();
        try {
          iface.cancelStatement(args.stmtId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class cancelCurrentStatement extends org.apache.thrift.ProcessFunction {
      public cancelCurrentStatement() {
        super("cancelCurrentStatement");
      }

      public cancelCurrentStatement_args getEmptyArgsInstance() {
        return new cancelCurrentStatement_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public cancelCurrentStatement_result getResult(I iface, cancelCurrentStatement_args args) throws org.apache.thrift.TException {
        cancelCurrentStatement_result result = new cancelCurrentStatement_result();
        try {
          iface.cancelCurrentStatement(args.connId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class closeResultSet extends org.apache.thrift.ProcessFunction {
      public closeResultSet() {
        super("closeResultSet");
      }

      public closeResultSet_args getEmptyArgsInstance() {
        return new closeResultSet_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public closeResultSet_result getResult(I iface, closeResultSet_args args) throws org.apache.thrift.TException {
        closeResultSet_result result = new closeResultSet_result();
        try {
          iface.closeResultSet(args.cursorId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class closeStatement extends org.apache.thrift.ProcessFunction {
      public closeStatement() {
        super("closeStatement");
      }

      public closeStatement_args getEmptyArgsInstance() {
        return new closeStatement_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public closeStatement_result getResult(I iface, closeStatement_args args) throws org.apache.thrift.TException {
        closeStatement_result result = new closeStatement_result();
        try {
          iface.closeStatement(args.stmtId, args.token);
        } catch (SnappyException error) {
          result.error = error;
        }
        return result;
      }
    }

    public static class closeConnection extends org.apache.thrift.ProcessFunction {
      public closeConnection() {
        super("closeConnection");
      }

      public closeConnection_args getEmptyArgsInstance() {
        return new closeConnection_args();
      }

      protected boolean isOneway() {
        return true;
      }

      public org.apache.thrift.TBase getResult(I iface, closeConnection_args args) throws org.apache.thrift.TException {
        iface.closeConnection(args.connId, args.closeSocket, args.token);
        return null;
      }
    }

    public static class bulkClose extends org.apache.thrift.ProcessFunction {
      public bulkClose() {
        super("bulkClose");
      }

      public bulkClose_args getEmptyArgsInstance() {
        return new bulkClose_args();
      }

      protected boolean isOneway() {
        return true;
      }

      public org.apache.thrift.TBase getResult(I iface, bulkClose_args args) throws org.apache.thrift.TException {
        iface.bulkClose(args.entities);
        return null;
      }
    }

  }

  public static class getPreferredServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPreferredServer_args");

    private static final org.apache.thrift.protocol.TField SERVER_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("serverTypes", org.apache.thrift.protocol.TType.SET, (short)1);
    private static final org.apache.thrift.protocol.TField SERVER_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("serverGroups", org.apache.thrift.protocol.TType.SET, (short)2);
    private static final org.apache.thrift.protocol.TField FAILED_SERVERS_FIELD_DESC = new org.apache.thrift.protocol.TField("failedServers", org.apache.thrift.protocol.TType.SET, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getPreferredServer_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getPreferredServer_argsTupleSchemeFactory());
    }

    public Set serverTypes; // required
    public Set serverGroups; // required
    public Set failedServers; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERVER_TYPES((short)1, "serverTypes"),
      SERVER_GROUPS((short)2, "serverGroups"),
      FAILED_SERVERS((short)3, "failedServers");

      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: // SERVER_TYPES
            return SERVER_TYPES;
          case 2: // SERVER_GROUPS
            return SERVER_GROUPS;
          case 3: // FAILED_SERVERS
            return FAILED_SERVERS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERVER_TYPES, new org.apache.thrift.meta_data.FieldMetaData("serverTypes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ServerType.class))));
      tmpMap.put(_Fields.SERVER_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("serverGroups", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      tmpMap.put(_Fields.FAILED_SERVERS, new org.apache.thrift.meta_data.FieldMetaData("failedServers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HostAddress.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPreferredServer_args.class, metaDataMap);
    }

    public getPreferredServer_args() {
    }

    public getPreferredServer_args(
      Set serverTypes,
      Set serverGroups,
      Set failedServers)
    {
      this();
      this.serverTypes = serverTypes;
      this.serverGroups = serverGroups;
      this.failedServers = failedServers;
    }

    /**
     * Performs a deep copy on other.
     */
    public getPreferredServer_args(getPreferredServer_args other) {
      if (other.isSetServerTypes()) {
        Set __this__serverTypes = new HashSet(other.serverTypes.size());
        for (ServerType other_element : other.serverTypes) {
          __this__serverTypes.add(other_element);
        }
        this.serverTypes = __this__serverTypes;
      }
      if (other.isSetServerGroups()) {
        Set __this__serverGroups = new HashSet(other.serverGroups);
        this.serverGroups = __this__serverGroups;
      }
      if (other.isSetFailedServers()) {
        Set __this__failedServers = new HashSet(other.failedServers.size());
        for (HostAddress other_element : other.failedServers) {
          __this__failedServers.add(new HostAddress(other_element));
        }
        this.failedServers = __this__failedServers;
      }
    }

    public getPreferredServer_args deepCopy() {
      return new getPreferredServer_args(this);
    }

    @Override
    public void clear() {
      this.serverTypes = null;
      this.serverGroups = null;
      this.failedServers = null;
    }

    public int getServerTypesSize() {
      return (this.serverTypes == null) ? 0 : this.serverTypes.size();
    }

    public java.util.Iterator getServerTypesIterator() {
      return (this.serverTypes == null) ? null : this.serverTypes.iterator();
    }

    public void addToServerTypes(ServerType elem) {
      if (this.serverTypes == null) {
        this.serverTypes = new HashSet();
      }
      this.serverTypes.add(elem);
    }

    public Set getServerTypes() {
      return this.serverTypes;
    }

    public getPreferredServer_args setServerTypes(Set serverTypes) {
      this.serverTypes = serverTypes;
      return this;
    }

    public void unsetServerTypes() {
      this.serverTypes = null;
    }

    /** Returns true if field serverTypes is set (has been assigned a value) and false otherwise */
    public boolean isSetServerTypes() {
      return this.serverTypes != null;
    }

    public void setServerTypesIsSet(boolean value) {
      if (!value) {
        this.serverTypes = null;
      }
    }

    public int getServerGroupsSize() {
      return (this.serverGroups == null) ? 0 : this.serverGroups.size();
    }

    public java.util.Iterator getServerGroupsIterator() {
      return (this.serverGroups == null) ? null : this.serverGroups.iterator();
    }

    public void addToServerGroups(String elem) {
      if (this.serverGroups == null) {
        this.serverGroups = new HashSet();
      }
      this.serverGroups.add(elem);
    }

    public Set getServerGroups() {
      return this.serverGroups;
    }

    public getPreferredServer_args setServerGroups(Set serverGroups) {
      this.serverGroups = serverGroups;
      return this;
    }

    public void unsetServerGroups() {
      this.serverGroups = null;
    }

    /** Returns true if field serverGroups is set (has been assigned a value) and false otherwise */
    public boolean isSetServerGroups() {
      return this.serverGroups != null;
    }

    public void setServerGroupsIsSet(boolean value) {
      if (!value) {
        this.serverGroups = null;
      }
    }

    public int getFailedServersSize() {
      return (this.failedServers == null) ? 0 : this.failedServers.size();
    }

    public java.util.Iterator getFailedServersIterator() {
      return (this.failedServers == null) ? null : this.failedServers.iterator();
    }

    public void addToFailedServers(HostAddress elem) {
      if (this.failedServers == null) {
        this.failedServers = new HashSet();
      }
      this.failedServers.add(elem);
    }

    public Set getFailedServers() {
      return this.failedServers;
    }

    public getPreferredServer_args setFailedServers(Set failedServers) {
      this.failedServers = failedServers;
      return this;
    }

    public void unsetFailedServers() {
      this.failedServers = null;
    }

    /** Returns true if field failedServers is set (has been assigned a value) and false otherwise */
    public boolean isSetFailedServers() {
      return this.failedServers != null;
    }

    public void setFailedServersIsSet(boolean value) {
      if (!value) {
        this.failedServers = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERVER_TYPES:
        if (value == null) {
          unsetServerTypes();
        } else {
          setServerTypes((Set)value);
        }
        break;

      case SERVER_GROUPS:
        if (value == null) {
          unsetServerGroups();
        } else {
          setServerGroups((Set)value);
        }
        break;

      case FAILED_SERVERS:
        if (value == null) {
          unsetFailedServers();
        } else {
          setFailedServers((Set)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERVER_TYPES:
        return getServerTypes();

      case SERVER_GROUPS:
        return getServerGroups();

      case FAILED_SERVERS:
        return getFailedServers();

      }
      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 SERVER_TYPES:
        return isSetServerTypes();
      case SERVER_GROUPS:
        return isSetServerGroups();
      case FAILED_SERVERS:
        return isSetFailedServers();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPreferredServer_args)
        return this.equals((getPreferredServer_args)that);
      return false;
    }

    public boolean equals(getPreferredServer_args that) {
      if (that == null)
        return false;

      boolean this_present_serverTypes = true && this.isSetServerTypes();
      boolean that_present_serverTypes = true && that.isSetServerTypes();
      if (this_present_serverTypes || that_present_serverTypes) {
        if (!(this_present_serverTypes && that_present_serverTypes))
          return false;
        if (!this.serverTypes.equals(that.serverTypes))
          return false;
      }

      boolean this_present_serverGroups = true && this.isSetServerGroups();
      boolean that_present_serverGroups = true && that.isSetServerGroups();
      if (this_present_serverGroups || that_present_serverGroups) {
        if (!(this_present_serverGroups && that_present_serverGroups))
          return false;
        if (!this.serverGroups.equals(that.serverGroups))
          return false;
      }

      boolean this_present_failedServers = true && this.isSetFailedServers();
      boolean that_present_failedServers = true && that.isSetFailedServers();
      if (this_present_failedServers || that_present_failedServers) {
        if (!(this_present_failedServers && that_present_failedServers))
          return false;
        if (!this.failedServers.equals(that.failedServers))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_serverTypes = true && (isSetServerTypes());
      list.add(present_serverTypes);
      if (present_serverTypes)
        list.add(serverTypes);

      boolean present_serverGroups = true && (isSetServerGroups());
      list.add(present_serverGroups);
      if (present_serverGroups)
        list.add(serverGroups);

      boolean present_failedServers = true && (isSetFailedServers());
      list.add(present_failedServers);
      if (present_failedServers)
        list.add(failedServers);

      return list.hashCode();
    }

    @Override
    public int compareTo(getPreferredServer_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetServerTypes()).compareTo(other.isSetServerTypes());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServerTypes()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverTypes, other.serverTypes);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServerGroups()).compareTo(other.isSetServerGroups());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServerGroups()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverGroups, other.serverGroups);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFailedServers()).compareTo(other.isSetFailedServers());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFailedServers()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedServers, other.failedServers);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPreferredServer_args(");
      boolean first = true;

      sb.append("serverTypes:");
      if (this.serverTypes == null) {
        sb.append("null");
      } else {
        sb.append(this.serverTypes);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serverGroups:");
      if (this.serverGroups == null) {
        sb.append("null");
      } else {
        sb.append(this.serverGroups);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("failedServers:");
      if (this.failedServers == null) {
        sb.append("null");
      } else {
        sb.append(this.failedServers);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getPreferredServer_argsStandardSchemeFactory implements SchemeFactory {
      public getPreferredServer_argsStandardScheme getScheme() {
        return new getPreferredServer_argsStandardScheme();
      }
    }

    private static class getPreferredServer_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getPreferredServer_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // SERVER_TYPES
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set536 = iprot.readSetBegin();
                  struct.serverTypes = new HashSet(2*_set536.size);
                  ServerType _elem537;
                  for (int _i538 = 0; _i538 < _set536.size; ++_i538)
                  {
                    _elem537 = io.snappydata.thrift.ServerType.findByValue(iprot.readI32());
                    struct.serverTypes.add(_elem537);
                  }
                  iprot.readSetEnd();
                }
                struct.setServerTypesIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SERVER_GROUPS
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set539 = iprot.readSetBegin();
                  struct.serverGroups = new HashSet(2*_set539.size);
                  String _elem540;
                  for (int _i541 = 0; _i541 < _set539.size; ++_i541)
                  {
                    _elem540 = iprot.readString();
                    struct.serverGroups.add(_elem540);
                  }
                  iprot.readSetEnd();
                }
                struct.setServerGroupsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FAILED_SERVERS
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set542 = iprot.readSetBegin();
                  struct.failedServers = new HashSet(2*_set542.size);
                  HostAddress _elem543;
                  for (int _i544 = 0; _i544 < _set542.size; ++_i544)
                  {
                    _elem543 = new HostAddress();
                    _elem543.read(iprot);
                    struct.failedServers.add(_elem543);
                  }
                  iprot.readSetEnd();
                }
                struct.setFailedServersIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getPreferredServer_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.serverTypes != null) {
          oprot.writeFieldBegin(SERVER_TYPES_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.serverTypes.size()));
            for (ServerType _iter545 : struct.serverTypes)
            {
              oprot.writeI32(_iter545.getValue());
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.serverGroups != null) {
          oprot.writeFieldBegin(SERVER_GROUPS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.serverGroups.size()));
            for (String _iter546 : struct.serverGroups)
            {
              oprot.writeString(_iter546);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.failedServers != null) {
          oprot.writeFieldBegin(FAILED_SERVERS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.failedServers.size()));
            for (HostAddress _iter547 : struct.failedServers)
            {
              _iter547.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getPreferredServer_argsTupleSchemeFactory implements SchemeFactory {
      public getPreferredServer_argsTupleScheme getScheme() {
        return new getPreferredServer_argsTupleScheme();
      }
    }

    private static class getPreferredServer_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetServerTypes()) {
          optionals.set(0);
        }
        if (struct.isSetServerGroups()) {
          optionals.set(1);
        }
        if (struct.isSetFailedServers()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetServerTypes()) {
          {
            oprot.writeI32(struct.serverTypes.size());
            for (ServerType _iter548 : struct.serverTypes)
            {
              oprot.writeI32(_iter548.getValue());
            }
          }
        }
        if (struct.isSetServerGroups()) {
          {
            oprot.writeI32(struct.serverGroups.size());
            for (String _iter549 : struct.serverGroups)
            {
              oprot.writeString(_iter549);
            }
          }
        }
        if (struct.isSetFailedServers()) {
          {
            oprot.writeI32(struct.failedServers.size());
            for (HostAddress _iter550 : struct.failedServers)
            {
              _iter550.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TSet _set551 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
            struct.serverTypes = new HashSet(2*_set551.size);
            ServerType _elem552;
            for (int _i553 = 0; _i553 < _set551.size; ++_i553)
            {
              _elem552 = io.snappydata.thrift.ServerType.findByValue(iprot.readI32());
              struct.serverTypes.add(_elem552);
            }
          }
          struct.setServerTypesIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TSet _set554 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.serverGroups = new HashSet(2*_set554.size);
            String _elem555;
            for (int _i556 = 0; _i556 < _set554.size; ++_i556)
            {
              _elem555 = iprot.readString();
              struct.serverGroups.add(_elem555);
            }
          }
          struct.setServerGroupsIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TSet _set557 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.failedServers = new HashSet(2*_set557.size);
            HostAddress _elem558;
            for (int _i559 = 0; _i559 < _set557.size; ++_i559)
            {
              _elem558 = new HostAddress();
              _elem558.read(iprot);
              struct.failedServers.add(_elem558);
            }
          }
          struct.setFailedServersIsSet(true);
        }
      }
    }

  }

  public static class getPreferredServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPreferredServer_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getPreferredServer_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getPreferredServer_resultTupleSchemeFactory());
    }

    public HostAddress success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HostAddress.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPreferredServer_result.class, metaDataMap);
    }

    public getPreferredServer_result() {
    }

    public getPreferredServer_result(
      HostAddress success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getPreferredServer_result(getPreferredServer_result other) {
      if (other.isSetSuccess()) {
        this.success = new HostAddress(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getPreferredServer_result deepCopy() {
      return new getPreferredServer_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public HostAddress getSuccess() {
      return this.success;
    }

    public getPreferredServer_result setSuccess(HostAddress 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 SnappyException getError() {
      return this.error;
    }

    public getPreferredServer_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((HostAddress)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPreferredServer_result)
        return this.equals((getPreferredServer_result)that);
      return false;
    }

    public boolean equals(getPreferredServer_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getPreferredServer_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPreferredServer_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getPreferredServer_resultStandardSchemeFactory implements SchemeFactory {
      public getPreferredServer_resultStandardScheme getScheme() {
        return new getPreferredServer_resultStandardScheme();
      }
    }

    private static class getPreferredServer_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getPreferredServer_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new HostAddress();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getPreferredServer_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getPreferredServer_resultTupleSchemeFactory implements SchemeFactory {
      public getPreferredServer_resultTupleScheme getScheme() {
        return new getPreferredServer_resultTupleScheme();
      }
    }

    private static class getPreferredServer_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getPreferredServer_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new HostAddress();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getAllServersWithPreferredServer_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllServersWithPreferredServer_args");

    private static final org.apache.thrift.protocol.TField SERVER_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("serverTypes", org.apache.thrift.protocol.TType.SET, (short)1);
    private static final org.apache.thrift.protocol.TField SERVER_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("serverGroups", org.apache.thrift.protocol.TType.SET, (short)2);
    private static final org.apache.thrift.protocol.TField FAILED_SERVERS_FIELD_DESC = new org.apache.thrift.protocol.TField("failedServers", org.apache.thrift.protocol.TType.SET, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getAllServersWithPreferredServer_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getAllServersWithPreferredServer_argsTupleSchemeFactory());
    }

    public Set serverTypes; // required
    public Set serverGroups; // required
    public Set failedServers; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SERVER_TYPES((short)1, "serverTypes"),
      SERVER_GROUPS((short)2, "serverGroups"),
      FAILED_SERVERS((short)3, "failedServers");

      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: // SERVER_TYPES
            return SERVER_TYPES;
          case 2: // SERVER_GROUPS
            return SERVER_GROUPS;
          case 3: // FAILED_SERVERS
            return FAILED_SERVERS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SERVER_TYPES, new org.apache.thrift.meta_data.FieldMetaData("serverTypes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ServerType.class))));
      tmpMap.put(_Fields.SERVER_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("serverGroups", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      tmpMap.put(_Fields.FAILED_SERVERS, new org.apache.thrift.meta_data.FieldMetaData("failedServers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HostAddress.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllServersWithPreferredServer_args.class, metaDataMap);
    }

    public getAllServersWithPreferredServer_args() {
    }

    public getAllServersWithPreferredServer_args(
      Set serverTypes,
      Set serverGroups,
      Set failedServers)
    {
      this();
      this.serverTypes = serverTypes;
      this.serverGroups = serverGroups;
      this.failedServers = failedServers;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllServersWithPreferredServer_args(getAllServersWithPreferredServer_args other) {
      if (other.isSetServerTypes()) {
        Set __this__serverTypes = new HashSet(other.serverTypes.size());
        for (ServerType other_element : other.serverTypes) {
          __this__serverTypes.add(other_element);
        }
        this.serverTypes = __this__serverTypes;
      }
      if (other.isSetServerGroups()) {
        Set __this__serverGroups = new HashSet(other.serverGroups);
        this.serverGroups = __this__serverGroups;
      }
      if (other.isSetFailedServers()) {
        Set __this__failedServers = new HashSet(other.failedServers.size());
        for (HostAddress other_element : other.failedServers) {
          __this__failedServers.add(new HostAddress(other_element));
        }
        this.failedServers = __this__failedServers;
      }
    }

    public getAllServersWithPreferredServer_args deepCopy() {
      return new getAllServersWithPreferredServer_args(this);
    }

    @Override
    public void clear() {
      this.serverTypes = null;
      this.serverGroups = null;
      this.failedServers = null;
    }

    public int getServerTypesSize() {
      return (this.serverTypes == null) ? 0 : this.serverTypes.size();
    }

    public java.util.Iterator getServerTypesIterator() {
      return (this.serverTypes == null) ? null : this.serverTypes.iterator();
    }

    public void addToServerTypes(ServerType elem) {
      if (this.serverTypes == null) {
        this.serverTypes = new HashSet();
      }
      this.serverTypes.add(elem);
    }

    public Set getServerTypes() {
      return this.serverTypes;
    }

    public getAllServersWithPreferredServer_args setServerTypes(Set serverTypes) {
      this.serverTypes = serverTypes;
      return this;
    }

    public void unsetServerTypes() {
      this.serverTypes = null;
    }

    /** Returns true if field serverTypes is set (has been assigned a value) and false otherwise */
    public boolean isSetServerTypes() {
      return this.serverTypes != null;
    }

    public void setServerTypesIsSet(boolean value) {
      if (!value) {
        this.serverTypes = null;
      }
    }

    public int getServerGroupsSize() {
      return (this.serverGroups == null) ? 0 : this.serverGroups.size();
    }

    public java.util.Iterator getServerGroupsIterator() {
      return (this.serverGroups == null) ? null : this.serverGroups.iterator();
    }

    public void addToServerGroups(String elem) {
      if (this.serverGroups == null) {
        this.serverGroups = new HashSet();
      }
      this.serverGroups.add(elem);
    }

    public Set getServerGroups() {
      return this.serverGroups;
    }

    public getAllServersWithPreferredServer_args setServerGroups(Set serverGroups) {
      this.serverGroups = serverGroups;
      return this;
    }

    public void unsetServerGroups() {
      this.serverGroups = null;
    }

    /** Returns true if field serverGroups is set (has been assigned a value) and false otherwise */
    public boolean isSetServerGroups() {
      return this.serverGroups != null;
    }

    public void setServerGroupsIsSet(boolean value) {
      if (!value) {
        this.serverGroups = null;
      }
    }

    public int getFailedServersSize() {
      return (this.failedServers == null) ? 0 : this.failedServers.size();
    }

    public java.util.Iterator getFailedServersIterator() {
      return (this.failedServers == null) ? null : this.failedServers.iterator();
    }

    public void addToFailedServers(HostAddress elem) {
      if (this.failedServers == null) {
        this.failedServers = new HashSet();
      }
      this.failedServers.add(elem);
    }

    public Set getFailedServers() {
      return this.failedServers;
    }

    public getAllServersWithPreferredServer_args setFailedServers(Set failedServers) {
      this.failedServers = failedServers;
      return this;
    }

    public void unsetFailedServers() {
      this.failedServers = null;
    }

    /** Returns true if field failedServers is set (has been assigned a value) and false otherwise */
    public boolean isSetFailedServers() {
      return this.failedServers != null;
    }

    public void setFailedServersIsSet(boolean value) {
      if (!value) {
        this.failedServers = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SERVER_TYPES:
        if (value == null) {
          unsetServerTypes();
        } else {
          setServerTypes((Set)value);
        }
        break;

      case SERVER_GROUPS:
        if (value == null) {
          unsetServerGroups();
        } else {
          setServerGroups((Set)value);
        }
        break;

      case FAILED_SERVERS:
        if (value == null) {
          unsetFailedServers();
        } else {
          setFailedServers((Set)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SERVER_TYPES:
        return getServerTypes();

      case SERVER_GROUPS:
        return getServerGroups();

      case FAILED_SERVERS:
        return getFailedServers();

      }
      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 SERVER_TYPES:
        return isSetServerTypes();
      case SERVER_GROUPS:
        return isSetServerGroups();
      case FAILED_SERVERS:
        return isSetFailedServers();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllServersWithPreferredServer_args)
        return this.equals((getAllServersWithPreferredServer_args)that);
      return false;
    }

    public boolean equals(getAllServersWithPreferredServer_args that) {
      if (that == null)
        return false;

      boolean this_present_serverTypes = true && this.isSetServerTypes();
      boolean that_present_serverTypes = true && that.isSetServerTypes();
      if (this_present_serverTypes || that_present_serverTypes) {
        if (!(this_present_serverTypes && that_present_serverTypes))
          return false;
        if (!this.serverTypes.equals(that.serverTypes))
          return false;
      }

      boolean this_present_serverGroups = true && this.isSetServerGroups();
      boolean that_present_serverGroups = true && that.isSetServerGroups();
      if (this_present_serverGroups || that_present_serverGroups) {
        if (!(this_present_serverGroups && that_present_serverGroups))
          return false;
        if (!this.serverGroups.equals(that.serverGroups))
          return false;
      }

      boolean this_present_failedServers = true && this.isSetFailedServers();
      boolean that_present_failedServers = true && that.isSetFailedServers();
      if (this_present_failedServers || that_present_failedServers) {
        if (!(this_present_failedServers && that_present_failedServers))
          return false;
        if (!this.failedServers.equals(that.failedServers))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_serverTypes = true && (isSetServerTypes());
      list.add(present_serverTypes);
      if (present_serverTypes)
        list.add(serverTypes);

      boolean present_serverGroups = true && (isSetServerGroups());
      list.add(present_serverGroups);
      if (present_serverGroups)
        list.add(serverGroups);

      boolean present_failedServers = true && (isSetFailedServers());
      list.add(present_failedServers);
      if (present_failedServers)
        list.add(failedServers);

      return list.hashCode();
    }

    @Override
    public int compareTo(getAllServersWithPreferredServer_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetServerTypes()).compareTo(other.isSetServerTypes());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServerTypes()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverTypes, other.serverTypes);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetServerGroups()).compareTo(other.isSetServerGroups());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetServerGroups()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverGroups, other.serverGroups);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFailedServers()).compareTo(other.isSetFailedServers());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFailedServers()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedServers, other.failedServers);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllServersWithPreferredServer_args(");
      boolean first = true;

      sb.append("serverTypes:");
      if (this.serverTypes == null) {
        sb.append("null");
      } else {
        sb.append(this.serverTypes);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("serverGroups:");
      if (this.serverGroups == null) {
        sb.append("null");
      } else {
        sb.append(this.serverGroups);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("failedServers:");
      if (this.failedServers == null) {
        sb.append("null");
      } else {
        sb.append(this.failedServers);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getAllServersWithPreferredServer_argsStandardSchemeFactory implements SchemeFactory {
      public getAllServersWithPreferredServer_argsStandardScheme getScheme() {
        return new getAllServersWithPreferredServer_argsStandardScheme();
      }
    }

    private static class getAllServersWithPreferredServer_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllServersWithPreferredServer_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // SERVER_TYPES
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set560 = iprot.readSetBegin();
                  struct.serverTypes = new HashSet(2*_set560.size);
                  ServerType _elem561;
                  for (int _i562 = 0; _i562 < _set560.size; ++_i562)
                  {
                    _elem561 = io.snappydata.thrift.ServerType.findByValue(iprot.readI32());
                    struct.serverTypes.add(_elem561);
                  }
                  iprot.readSetEnd();
                }
                struct.setServerTypesIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SERVER_GROUPS
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set563 = iprot.readSetBegin();
                  struct.serverGroups = new HashSet(2*_set563.size);
                  String _elem564;
                  for (int _i565 = 0; _i565 < _set563.size; ++_i565)
                  {
                    _elem564 = iprot.readString();
                    struct.serverGroups.add(_elem564);
                  }
                  iprot.readSetEnd();
                }
                struct.setServerGroupsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FAILED_SERVERS
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set566 = iprot.readSetBegin();
                  struct.failedServers = new HashSet(2*_set566.size);
                  HostAddress _elem567;
                  for (int _i568 = 0; _i568 < _set566.size; ++_i568)
                  {
                    _elem567 = new HostAddress();
                    _elem567.read(iprot);
                    struct.failedServers.add(_elem567);
                  }
                  iprot.readSetEnd();
                }
                struct.setFailedServersIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getAllServersWithPreferredServer_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.serverTypes != null) {
          oprot.writeFieldBegin(SERVER_TYPES_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.serverTypes.size()));
            for (ServerType _iter569 : struct.serverTypes)
            {
              oprot.writeI32(_iter569.getValue());
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.serverGroups != null) {
          oprot.writeFieldBegin(SERVER_GROUPS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.serverGroups.size()));
            for (String _iter570 : struct.serverGroups)
            {
              oprot.writeString(_iter570);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.failedServers != null) {
          oprot.writeFieldBegin(FAILED_SERVERS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.failedServers.size()));
            for (HostAddress _iter571 : struct.failedServers)
            {
              _iter571.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAllServersWithPreferredServer_argsTupleSchemeFactory implements SchemeFactory {
      public getAllServersWithPreferredServer_argsTupleScheme getScheme() {
        return new getAllServersWithPreferredServer_argsTupleScheme();
      }
    }

    private static class getAllServersWithPreferredServer_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetServerTypes()) {
          optionals.set(0);
        }
        if (struct.isSetServerGroups()) {
          optionals.set(1);
        }
        if (struct.isSetFailedServers()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetServerTypes()) {
          {
            oprot.writeI32(struct.serverTypes.size());
            for (ServerType _iter572 : struct.serverTypes)
            {
              oprot.writeI32(_iter572.getValue());
            }
          }
        }
        if (struct.isSetServerGroups()) {
          {
            oprot.writeI32(struct.serverGroups.size());
            for (String _iter573 : struct.serverGroups)
            {
              oprot.writeString(_iter573);
            }
          }
        }
        if (struct.isSetFailedServers()) {
          {
            oprot.writeI32(struct.failedServers.size());
            for (HostAddress _iter574 : struct.failedServers)
            {
              _iter574.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TSet _set575 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
            struct.serverTypes = new HashSet(2*_set575.size);
            ServerType _elem576;
            for (int _i577 = 0; _i577 < _set575.size; ++_i577)
            {
              _elem576 = io.snappydata.thrift.ServerType.findByValue(iprot.readI32());
              struct.serverTypes.add(_elem576);
            }
          }
          struct.setServerTypesIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TSet _set578 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.serverGroups = new HashSet(2*_set578.size);
            String _elem579;
            for (int _i580 = 0; _i580 < _set578.size; ++_i580)
            {
              _elem579 = iprot.readString();
              struct.serverGroups.add(_elem579);
            }
          }
          struct.setServerGroupsIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TSet _set581 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.failedServers = new HashSet(2*_set581.size);
            HostAddress _elem582;
            for (int _i583 = 0; _i583 < _set581.size; ++_i583)
            {
              _elem582 = new HostAddress();
              _elem582.read(iprot);
              struct.failedServers.add(_elem582);
            }
          }
          struct.setFailedServersIsSet(true);
        }
      }
    }

  }

  public static class getAllServersWithPreferredServer_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllServersWithPreferredServer_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getAllServersWithPreferredServer_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getAllServersWithPreferredServer_resultTupleSchemeFactory());
    }

    public List success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, HostAddress.class))));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllServersWithPreferredServer_result.class, metaDataMap);
    }

    public getAllServersWithPreferredServer_result() {
    }

    public getAllServersWithPreferredServer_result(
      List success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllServersWithPreferredServer_result(getAllServersWithPreferredServer_result other) {
      if (other.isSetSuccess()) {
        List __this__success = new ArrayList(other.success.size());
        for (HostAddress other_element : other.success) {
          __this__success.add(new HostAddress(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getAllServersWithPreferredServer_result deepCopy() {
      return new getAllServersWithPreferredServer_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(HostAddress elem) {
      if (this.success == null) {
        this.success = new ArrayList();
      }
      this.success.add(elem);
    }

    public List getSuccess() {
      return this.success;
    }

    public getAllServersWithPreferredServer_result setSuccess(List 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 SnappyException getError() {
      return this.error;
    }

    public getAllServersWithPreferredServer_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getAllServersWithPreferredServer_result)
        return this.equals((getAllServersWithPreferredServer_result)that);
      return false;
    }

    public boolean equals(getAllServersWithPreferredServer_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getAllServersWithPreferredServer_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getAllServersWithPreferredServer_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getAllServersWithPreferredServer_resultStandardSchemeFactory implements SchemeFactory {
      public getAllServersWithPreferredServer_resultStandardScheme getScheme() {
        return new getAllServersWithPreferredServer_resultStandardScheme();
      }
    }

    private static class getAllServersWithPreferredServer_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllServersWithPreferredServer_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list584 = iprot.readListBegin();
                  struct.success = new ArrayList(_list584.size);
                  HostAddress _elem585;
                  for (int _i586 = 0; _i586 < _list584.size; ++_i586)
                  {
                    _elem585 = new HostAddress();
                    _elem585.read(iprot);
                    struct.success.add(_elem585);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getAllServersWithPreferredServer_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
            for (HostAddress _iter587 : struct.success)
            {
              _iter587.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAllServersWithPreferredServer_resultTupleSchemeFactory implements SchemeFactory {
      public getAllServersWithPreferredServer_resultTupleScheme getScheme() {
        return new getAllServersWithPreferredServer_resultTupleScheme();
      }
    }

    private static class getAllServersWithPreferredServer_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (HostAddress _iter588 : struct.success)
            {
              _iter588.write(oprot);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list589 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList(_list589.size);
            HostAddress _elem590;
            for (int _i591 = 0; _i591 < _list589.size; ++_i591)
            {
              _elem590 = new HostAddress();
              _elem590.read(iprot);
              struct.success.add(_elem590);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class openConnection_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openConnection_args");

    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new openConnection_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new openConnection_argsTupleSchemeFactory());
    }

    public OpenConnectionArgs arguments; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ARGUMENTS((short)1, "arguments");

      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: // ARGUMENTS
            return ARGUMENTS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OpenConnectionArgs.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openConnection_args.class, metaDataMap);
    }

    public openConnection_args() {
    }

    public openConnection_args(
      OpenConnectionArgs arguments)
    {
      this();
      this.arguments = arguments;
    }

    /**
     * Performs a deep copy on other.
     */
    public openConnection_args(openConnection_args other) {
      if (other.isSetArguments()) {
        this.arguments = new OpenConnectionArgs(other.arguments);
      }
    }

    public openConnection_args deepCopy() {
      return new openConnection_args(this);
    }

    @Override
    public void clear() {
      this.arguments = null;
    }

    public OpenConnectionArgs getArguments() {
      return this.arguments;
    }

    public openConnection_args setArguments(OpenConnectionArgs arguments) {
      this.arguments = arguments;
      return this;
    }

    public void unsetArguments() {
      this.arguments = null;
    }

    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
    public boolean isSetArguments() {
      return this.arguments != null;
    }

    public void setArgumentsIsSet(boolean value) {
      if (!value) {
        this.arguments = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ARGUMENTS:
        if (value == null) {
          unsetArguments();
        } else {
          setArguments((OpenConnectionArgs)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ARGUMENTS:
        return getArguments();

      }
      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 ARGUMENTS:
        return isSetArguments();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof openConnection_args)
        return this.equals((openConnection_args)that);
      return false;
    }

    public boolean equals(openConnection_args that) {
      if (that == null)
        return false;

      boolean this_present_arguments = true && this.isSetArguments();
      boolean that_present_arguments = true && that.isSetArguments();
      if (this_present_arguments || that_present_arguments) {
        if (!(this_present_arguments && that_present_arguments))
          return false;
        if (!this.arguments.equals(that.arguments))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_arguments = true && (isSetArguments());
      list.add(present_arguments);
      if (present_arguments)
        list.add(arguments);

      return list.hashCode();
    }

    @Override
    public int compareTo(openConnection_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(other.isSetArguments());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetArguments()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, other.arguments);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("openConnection_args(");
      boolean first = true;

      sb.append("arguments:");
      if (this.arguments == null) {
        sb.append("null");
      } else {
        sb.append(this.arguments);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (arguments != null) {
        arguments.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class openConnection_argsStandardSchemeFactory implements SchemeFactory {
      public openConnection_argsStandardScheme getScheme() {
        return new openConnection_argsStandardScheme();
      }
    }

    private static class openConnection_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, openConnection_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ARGUMENTS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.arguments = new OpenConnectionArgs();
                struct.arguments.read(iprot);
                struct.setArgumentsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, openConnection_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.arguments != null) {
          oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
          struct.arguments.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class openConnection_argsTupleSchemeFactory implements SchemeFactory {
      public openConnection_argsTupleScheme getScheme() {
        return new openConnection_argsTupleScheme();
      }
    }

    private static class openConnection_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, openConnection_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetArguments()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetArguments()) {
          struct.arguments.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, openConnection_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.arguments = new OpenConnectionArgs();
          struct.arguments.read(iprot);
          struct.setArgumentsIsSet(true);
        }
      }
    }

  }

  public static class openConnection_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openConnection_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new openConnection_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new openConnection_resultTupleSchemeFactory());
    }

    public ConnectionProperties success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ConnectionProperties.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(openConnection_result.class, metaDataMap);
    }

    public openConnection_result() {
    }

    public openConnection_result(
      ConnectionProperties success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public openConnection_result(openConnection_result other) {
      if (other.isSetSuccess()) {
        this.success = new ConnectionProperties(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public openConnection_result deepCopy() {
      return new openConnection_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public ConnectionProperties getSuccess() {
      return this.success;
    }

    public openConnection_result setSuccess(ConnectionProperties 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 SnappyException getError() {
      return this.error;
    }

    public openConnection_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ConnectionProperties)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof openConnection_result)
        return this.equals((openConnection_result)that);
      return false;
    }

    public boolean equals(openConnection_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(openConnection_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("openConnection_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class openConnection_resultStandardSchemeFactory implements SchemeFactory {
      public openConnection_resultStandardScheme getScheme() {
        return new openConnection_resultStandardScheme();
      }
    }

    private static class openConnection_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, openConnection_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new ConnectionProperties();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, openConnection_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class openConnection_resultTupleSchemeFactory implements SchemeFactory {
      public openConnection_resultTupleScheme getScheme() {
        return new openConnection_resultTupleScheme();
      }
    }

    private static class openConnection_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, openConnection_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, openConnection_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new ConnectionProperties();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class execute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField OUTPUT_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("outputParams", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)5);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new execute_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new execute_argsTupleSchemeFactory());
    }

    public long connId; // required
    public String sql; // required
    public Map outputParams; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      SQL((short)2, "sql"),
      OUTPUT_PARAMS((short)3, "outputParams"),
      ATTRS((short)4, "attrs"),
      TOKEN((short)5, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // SQL
            return SQL;
          case 3: // OUTPUT_PARAMS
            return OUTPUT_PARAMS;
          case 4: // ATTRS
            return ATTRS;
          case 5: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.OUTPUT_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("outputParams", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OutputParameter.class))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_args.class, metaDataMap);
    }

    public execute_args() {
    }

    public execute_args(
      long connId,
      String sql,
      Map outputParams,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.sql = sql;
      this.outputParams = outputParams;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public execute_args(execute_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetSql()) {
        this.sql = other.sql;
      }
      if (other.isSetOutputParams()) {
        Map __this__outputParams = new HashMap(other.outputParams.size());
        for (Map.Entry other_element : other.outputParams.entrySet()) {

          Integer other_element_key = other_element.getKey();
          OutputParameter other_element_value = other_element.getValue();

          Integer __this__outputParams_copy_key = other_element_key;

          OutputParameter __this__outputParams_copy_value = new OutputParameter(other_element_value);

          __this__outputParams.put(__this__outputParams_copy_key, __this__outputParams_copy_value);
        }
        this.outputParams = __this__outputParams;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public execute_args deepCopy() {
      return new execute_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.sql = null;
      this.outputParams = null;
      this.attrs = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public execute_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public String getSql() {
      return this.sql;
    }

    public execute_args setSql(String sql) {
      this.sql = sql;
      return this;
    }

    public void unsetSql() {
      this.sql = null;
    }

    /** Returns true if field sql is set (has been assigned a value) and false otherwise */
    public boolean isSetSql() {
      return this.sql != null;
    }

    public void setSqlIsSet(boolean value) {
      if (!value) {
        this.sql = null;
      }
    }

    public int getOutputParamsSize() {
      return (this.outputParams == null) ? 0 : this.outputParams.size();
    }

    public void putToOutputParams(int key, OutputParameter val) {
      if (this.outputParams == null) {
        this.outputParams = new HashMap();
      }
      this.outputParams.put(key, val);
    }

    public Map getOutputParams() {
      return this.outputParams;
    }

    public execute_args setOutputParams(Map outputParams) {
      this.outputParams = outputParams;
      return this;
    }

    public void unsetOutputParams() {
      this.outputParams = null;
    }

    /** Returns true if field outputParams is set (has been assigned a value) and false otherwise */
    public boolean isSetOutputParams() {
      return this.outputParams != null;
    }

    public void setOutputParamsIsSet(boolean value) {
      if (!value) {
        this.outputParams = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public execute_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public execute_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public execute_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case SQL:
        if (value == null) {
          unsetSql();
        } else {
          setSql((String)value);
        }
        break;

      case OUTPUT_PARAMS:
        if (value == null) {
          unsetOutputParams();
        } else {
          setOutputParams((Map)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case SQL:
        return getSql();

      case OUTPUT_PARAMS:
        return getOutputParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case SQL:
        return isSetSql();
      case OUTPUT_PARAMS:
        return isSetOutputParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof execute_args)
        return this.equals((execute_args)that);
      return false;
    }

    public boolean equals(execute_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_sql = true && this.isSetSql();
      boolean that_present_sql = true && that.isSetSql();
      if (this_present_sql || that_present_sql) {
        if (!(this_present_sql && that_present_sql))
          return false;
        if (!this.sql.equals(that.sql))
          return false;
      }

      boolean this_present_outputParams = true && this.isSetOutputParams();
      boolean that_present_outputParams = true && that.isSetOutputParams();
      if (this_present_outputParams || that_present_outputParams) {
        if (!(this_present_outputParams && that_present_outputParams))
          return false;
        if (!this.outputParams.equals(that.outputParams))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_sql = true && (isSetSql());
      list.add(present_sql);
      if (present_sql)
        list.add(sql);

      boolean present_outputParams = true && (isSetOutputParams());
      list.add(present_outputParams);
      if (present_outputParams)
        list.add(outputParams);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(execute_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSql()).compareTo(other.isSetSql());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSql()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, other.sql);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOutputParams()).compareTo(other.isSetOutputParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOutputParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputParams, other.outputParams);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("execute_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sql:");
      if (this.sql == null) {
        sb.append("null");
      } else {
        sb.append(this.sql);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("outputParams:");
      if (this.outputParams == null) {
        sb.append("null");
      } else {
        sb.append(this.outputParams);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class execute_argsStandardSchemeFactory implements SchemeFactory {
      public execute_argsStandardScheme getScheme() {
        return new execute_argsStandardScheme();
      }
    }

    private static class execute_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, execute_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SQL
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sql = iprot.readString();
                struct.setSqlIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OUTPUT_PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map592 = iprot.readMapBegin();
                  struct.outputParams = new HashMap(2*_map592.size);
                  int _key593;
                  OutputParameter _val594;
                  for (int _i595 = 0; _i595 < _map592.size; ++_i595)
                  {
                    _key593 = iprot.readI32();
                    _val594 = new OutputParameter();
                    _val594.read(iprot);
                    struct.outputParams.put(_key593, _val594);
                  }
                  iprot.readMapEnd();
                }
                struct.setOutputParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, execute_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.sql != null) {
          oprot.writeFieldBegin(SQL_FIELD_DESC);
          oprot.writeString(struct.sql);
          oprot.writeFieldEnd();
        }
        if (struct.outputParams != null) {
          oprot.writeFieldBegin(OUTPUT_PARAMS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.outputParams.size()));
            for (Map.Entry _iter596 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter596.getKey());
              _iter596.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class execute_argsTupleSchemeFactory implements SchemeFactory {
      public execute_argsTupleScheme getScheme() {
        return new execute_argsTupleScheme();
      }
    }

    private static class execute_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetSql()) {
          optionals.set(1);
        }
        if (struct.isSetOutputParams()) {
          optionals.set(2);
        }
        if (struct.isSetAttrs()) {
          optionals.set(3);
        }
        if (struct.isSetToken()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetSql()) {
          oprot.writeString(struct.sql);
        }
        if (struct.isSetOutputParams()) {
          {
            oprot.writeI32(struct.outputParams.size());
            for (Map.Entry _iter597 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter597.getKey());
              _iter597.getValue().write(oprot);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.sql = iprot.readString();
          struct.setSqlIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map598 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.outputParams = new HashMap(2*_map598.size);
            int _key599;
            OutputParameter _val600;
            for (int _i601 = 0; _i601 < _map598.size; ++_i601)
            {
              _key599 = iprot.readI32();
              _val600 = new OutputParameter();
              _val600.read(iprot);
              struct.outputParams.put(_key599, _val600);
            }
          }
          struct.setOutputParamsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class execute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("execute_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new execute_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new execute_resultTupleSchemeFactory());
    }

    public StatementResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(execute_result.class, metaDataMap);
    }

    public execute_result() {
    }

    public execute_result(
      StatementResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public execute_result(execute_result other) {
      if (other.isSetSuccess()) {
        this.success = new StatementResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public execute_result deepCopy() {
      return new execute_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public StatementResult getSuccess() {
      return this.success;
    }

    public execute_result setSuccess(StatementResult 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 SnappyException getError() {
      return this.error;
    }

    public execute_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((StatementResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof execute_result)
        return this.equals((execute_result)that);
      return false;
    }

    public boolean equals(execute_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(execute_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("execute_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class execute_resultStandardSchemeFactory implements SchemeFactory {
      public execute_resultStandardScheme getScheme() {
        return new execute_resultStandardScheme();
      }
    }

    private static class execute_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new StatementResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, execute_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class execute_resultTupleSchemeFactory implements SchemeFactory {
      public execute_resultTupleScheme getScheme() {
        return new execute_resultTupleScheme();
      }
    }

    private static class execute_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, execute_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new StatementResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executeUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeUpdate_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SQLS_FIELD_DESC = new org.apache.thrift.protocol.TField("sqls", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeUpdate_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeUpdate_argsTupleSchemeFactory());
    }

    public long connId; // required
    public List sqls; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      SQLS((short)2, "sqls"),
      ATTRS((short)3, "attrs"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // SQLS
            return SQLS;
          case 3: // ATTRS
            return ATTRS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SQLS, new org.apache.thrift.meta_data.FieldMetaData("sqls", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeUpdate_args.class, metaDataMap);
    }

    public executeUpdate_args() {
    }

    public executeUpdate_args(
      long connId,
      List sqls,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.sqls = sqls;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executeUpdate_args(executeUpdate_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetSqls()) {
        List __this__sqls = new ArrayList(other.sqls);
        this.sqls = __this__sqls;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executeUpdate_args deepCopy() {
      return new executeUpdate_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.sqls = null;
      this.attrs = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public executeUpdate_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public int getSqlsSize() {
      return (this.sqls == null) ? 0 : this.sqls.size();
    }

    public java.util.Iterator getSqlsIterator() {
      return (this.sqls == null) ? null : this.sqls.iterator();
    }

    public void addToSqls(String elem) {
      if (this.sqls == null) {
        this.sqls = new ArrayList();
      }
      this.sqls.add(elem);
    }

    public List getSqls() {
      return this.sqls;
    }

    public executeUpdate_args setSqls(List sqls) {
      this.sqls = sqls;
      return this;
    }

    public void unsetSqls() {
      this.sqls = null;
    }

    /** Returns true if field sqls is set (has been assigned a value) and false otherwise */
    public boolean isSetSqls() {
      return this.sqls != null;
    }

    public void setSqlsIsSet(boolean value) {
      if (!value) {
        this.sqls = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executeUpdate_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executeUpdate_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executeUpdate_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case SQLS:
        if (value == null) {
          unsetSqls();
        } else {
          setSqls((List)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case SQLS:
        return getSqls();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case SQLS:
        return isSetSqls();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeUpdate_args)
        return this.equals((executeUpdate_args)that);
      return false;
    }

    public boolean equals(executeUpdate_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_sqls = true && this.isSetSqls();
      boolean that_present_sqls = true && that.isSetSqls();
      if (this_present_sqls || that_present_sqls) {
        if (!(this_present_sqls && that_present_sqls))
          return false;
        if (!this.sqls.equals(that.sqls))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_sqls = true && (isSetSqls());
      list.add(present_sqls);
      if (present_sqls)
        list.add(sqls);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeUpdate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSqls()).compareTo(other.isSetSqls());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSqls()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqls, other.sqls);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeUpdate_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sqls:");
      if (this.sqls == null) {
        sb.append("null");
      } else {
        sb.append(this.sqls);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeUpdate_argsStandardSchemeFactory implements SchemeFactory {
      public executeUpdate_argsStandardScheme getScheme() {
        return new executeUpdate_argsStandardScheme();
      }
    }

    private static class executeUpdate_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeUpdate_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SQLS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list602 = iprot.readListBegin();
                  struct.sqls = new ArrayList(_list602.size);
                  String _elem603;
                  for (int _i604 = 0; _i604 < _list602.size; ++_i604)
                  {
                    _elem603 = iprot.readString();
                    struct.sqls.add(_elem603);
                  }
                  iprot.readListEnd();
                }
                struct.setSqlsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeUpdate_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.sqls != null) {
          oprot.writeFieldBegin(SQLS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sqls.size()));
            for (String _iter605 : struct.sqls)
            {
              oprot.writeString(_iter605);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeUpdate_argsTupleSchemeFactory implements SchemeFactory {
      public executeUpdate_argsTupleScheme getScheme() {
        return new executeUpdate_argsTupleScheme();
      }
    }

    private static class executeUpdate_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetSqls()) {
          optionals.set(1);
        }
        if (struct.isSetAttrs()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetSqls()) {
          {
            oprot.writeI32(struct.sqls.size());
            for (String _iter606 : struct.sqls)
            {
              oprot.writeString(_iter606);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list607 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.sqls = new ArrayList(_list607.size);
            String _elem608;
            for (int _i609 = 0; _i609 < _list607.size; ++_i609)
            {
              _elem608 = iprot.readString();
              struct.sqls.add(_elem608);
            }
          }
          struct.setSqlsIsSet(true);
        }
        if (incoming.get(2)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executeUpdate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeUpdate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeUpdate_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeUpdate_resultTupleSchemeFactory());
    }

    public UpdateResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UpdateResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeUpdate_result.class, metaDataMap);
    }

    public executeUpdate_result() {
    }

    public executeUpdate_result(
      UpdateResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executeUpdate_result(executeUpdate_result other) {
      if (other.isSetSuccess()) {
        this.success = new UpdateResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executeUpdate_result deepCopy() {
      return new executeUpdate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public UpdateResult getSuccess() {
      return this.success;
    }

    public executeUpdate_result setSuccess(UpdateResult 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 SnappyException getError() {
      return this.error;
    }

    public executeUpdate_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UpdateResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeUpdate_result)
        return this.equals((executeUpdate_result)that);
      return false;
    }

    public boolean equals(executeUpdate_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeUpdate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeUpdate_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeUpdate_resultStandardSchemeFactory implements SchemeFactory {
      public executeUpdate_resultStandardScheme getScheme() {
        return new executeUpdate_resultStandardScheme();
      }
    }

    private static class executeUpdate_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeUpdate_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new UpdateResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeUpdate_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeUpdate_resultTupleSchemeFactory implements SchemeFactory {
      public executeUpdate_resultTupleScheme getScheme() {
        return new executeUpdate_resultTupleScheme();
      }
    }

    private static class executeUpdate_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new UpdateResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executeQuery_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeQuery_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeQuery_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeQuery_argsTupleSchemeFactory());
    }

    public long connId; // required
    public String sql; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      SQL((short)2, "sql"),
      ATTRS((short)3, "attrs"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // SQL
            return SQL;
          case 3: // ATTRS
            return ATTRS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeQuery_args.class, metaDataMap);
    }

    public executeQuery_args() {
    }

    public executeQuery_args(
      long connId,
      String sql,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.sql = sql;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executeQuery_args(executeQuery_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetSql()) {
        this.sql = other.sql;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executeQuery_args deepCopy() {
      return new executeQuery_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.sql = null;
      this.attrs = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public executeQuery_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public String getSql() {
      return this.sql;
    }

    public executeQuery_args setSql(String sql) {
      this.sql = sql;
      return this;
    }

    public void unsetSql() {
      this.sql = null;
    }

    /** Returns true if field sql is set (has been assigned a value) and false otherwise */
    public boolean isSetSql() {
      return this.sql != null;
    }

    public void setSqlIsSet(boolean value) {
      if (!value) {
        this.sql = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executeQuery_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executeQuery_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executeQuery_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case SQL:
        if (value == null) {
          unsetSql();
        } else {
          setSql((String)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case SQL:
        return getSql();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case SQL:
        return isSetSql();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeQuery_args)
        return this.equals((executeQuery_args)that);
      return false;
    }

    public boolean equals(executeQuery_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_sql = true && this.isSetSql();
      boolean that_present_sql = true && that.isSetSql();
      if (this_present_sql || that_present_sql) {
        if (!(this_present_sql && that_present_sql))
          return false;
        if (!this.sql.equals(that.sql))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_sql = true && (isSetSql());
      list.add(present_sql);
      if (present_sql)
        list.add(sql);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeQuery_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSql()).compareTo(other.isSetSql());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSql()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, other.sql);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeQuery_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sql:");
      if (this.sql == null) {
        sb.append("null");
      } else {
        sb.append(this.sql);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeQuery_argsStandardSchemeFactory implements SchemeFactory {
      public executeQuery_argsStandardScheme getScheme() {
        return new executeQuery_argsStandardScheme();
      }
    }

    private static class executeQuery_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeQuery_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SQL
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sql = iprot.readString();
                struct.setSqlIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeQuery_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.sql != null) {
          oprot.writeFieldBegin(SQL_FIELD_DESC);
          oprot.writeString(struct.sql);
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeQuery_argsTupleSchemeFactory implements SchemeFactory {
      public executeQuery_argsTupleScheme getScheme() {
        return new executeQuery_argsTupleScheme();
      }
    }

    private static class executeQuery_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeQuery_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetSql()) {
          optionals.set(1);
        }
        if (struct.isSetAttrs()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetSql()) {
          oprot.writeString(struct.sql);
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeQuery_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.sql = iprot.readString();
          struct.setSqlIsSet(true);
        }
        if (incoming.get(2)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executeQuery_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeQuery_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeQuery_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeQuery_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeQuery_result.class, metaDataMap);
    }

    public executeQuery_result() {
    }

    public executeQuery_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executeQuery_result(executeQuery_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executeQuery_result deepCopy() {
      return new executeQuery_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public executeQuery_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public executeQuery_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeQuery_result)
        return this.equals((executeQuery_result)that);
      return false;
    }

    public boolean equals(executeQuery_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeQuery_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeQuery_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeQuery_resultStandardSchemeFactory implements SchemeFactory {
      public executeQuery_resultStandardScheme getScheme() {
        return new executeQuery_resultStandardScheme();
      }
    }

    private static class executeQuery_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeQuery_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeQuery_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeQuery_resultTupleSchemeFactory implements SchemeFactory {
      public executeQuery_resultTupleScheme getScheme() {
        return new executeQuery_resultTupleScheme();
      }
    }

    private static class executeQuery_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeQuery_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeQuery_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class prepareStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareStatement_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField OUTPUT_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("outputParams", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)5);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareStatement_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareStatement_argsTupleSchemeFactory());
    }

    public long connId; // required
    public String sql; // required
    public Map outputParams; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      SQL((short)2, "sql"),
      OUTPUT_PARAMS((short)3, "outputParams"),
      ATTRS((short)4, "attrs"),
      TOKEN((short)5, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // SQL
            return SQL;
          case 3: // OUTPUT_PARAMS
            return OUTPUT_PARAMS;
          case 4: // ATTRS
            return ATTRS;
          case 5: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.OUTPUT_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("outputParams", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OutputParameter.class))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareStatement_args.class, metaDataMap);
    }

    public prepareStatement_args() {
    }

    public prepareStatement_args(
      long connId,
      String sql,
      Map outputParams,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.sql = sql;
      this.outputParams = outputParams;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareStatement_args(prepareStatement_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetSql()) {
        this.sql = other.sql;
      }
      if (other.isSetOutputParams()) {
        Map __this__outputParams = new HashMap(other.outputParams.size());
        for (Map.Entry other_element : other.outputParams.entrySet()) {

          Integer other_element_key = other_element.getKey();
          OutputParameter other_element_value = other_element.getValue();

          Integer __this__outputParams_copy_key = other_element_key;

          OutputParameter __this__outputParams_copy_value = new OutputParameter(other_element_value);

          __this__outputParams.put(__this__outputParams_copy_key, __this__outputParams_copy_value);
        }
        this.outputParams = __this__outputParams;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public prepareStatement_args deepCopy() {
      return new prepareStatement_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.sql = null;
      this.outputParams = null;
      this.attrs = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public prepareStatement_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public String getSql() {
      return this.sql;
    }

    public prepareStatement_args setSql(String sql) {
      this.sql = sql;
      return this;
    }

    public void unsetSql() {
      this.sql = null;
    }

    /** Returns true if field sql is set (has been assigned a value) and false otherwise */
    public boolean isSetSql() {
      return this.sql != null;
    }

    public void setSqlIsSet(boolean value) {
      if (!value) {
        this.sql = null;
      }
    }

    public int getOutputParamsSize() {
      return (this.outputParams == null) ? 0 : this.outputParams.size();
    }

    public void putToOutputParams(int key, OutputParameter val) {
      if (this.outputParams == null) {
        this.outputParams = new HashMap();
      }
      this.outputParams.put(key, val);
    }

    public Map getOutputParams() {
      return this.outputParams;
    }

    public prepareStatement_args setOutputParams(Map outputParams) {
      this.outputParams = outputParams;
      return this;
    }

    public void unsetOutputParams() {
      this.outputParams = null;
    }

    /** Returns true if field outputParams is set (has been assigned a value) and false otherwise */
    public boolean isSetOutputParams() {
      return this.outputParams != null;
    }

    public void setOutputParamsIsSet(boolean value) {
      if (!value) {
        this.outputParams = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public prepareStatement_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public prepareStatement_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public prepareStatement_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case SQL:
        if (value == null) {
          unsetSql();
        } else {
          setSql((String)value);
        }
        break;

      case OUTPUT_PARAMS:
        if (value == null) {
          unsetOutputParams();
        } else {
          setOutputParams((Map)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case SQL:
        return getSql();

      case OUTPUT_PARAMS:
        return getOutputParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case SQL:
        return isSetSql();
      case OUTPUT_PARAMS:
        return isSetOutputParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareStatement_args)
        return this.equals((prepareStatement_args)that);
      return false;
    }

    public boolean equals(prepareStatement_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_sql = true && this.isSetSql();
      boolean that_present_sql = true && that.isSetSql();
      if (this_present_sql || that_present_sql) {
        if (!(this_present_sql && that_present_sql))
          return false;
        if (!this.sql.equals(that.sql))
          return false;
      }

      boolean this_present_outputParams = true && this.isSetOutputParams();
      boolean that_present_outputParams = true && that.isSetOutputParams();
      if (this_present_outputParams || that_present_outputParams) {
        if (!(this_present_outputParams && that_present_outputParams))
          return false;
        if (!this.outputParams.equals(that.outputParams))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_sql = true && (isSetSql());
      list.add(present_sql);
      if (present_sql)
        list.add(sql);

      boolean present_outputParams = true && (isSetOutputParams());
      list.add(present_outputParams);
      if (present_outputParams)
        list.add(outputParams);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareStatement_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSql()).compareTo(other.isSetSql());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSql()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, other.sql);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOutputParams()).compareTo(other.isSetOutputParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOutputParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputParams, other.outputParams);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareStatement_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sql:");
      if (this.sql == null) {
        sb.append("null");
      } else {
        sb.append(this.sql);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("outputParams:");
      if (this.outputParams == null) {
        sb.append("null");
      } else {
        sb.append(this.outputParams);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareStatement_argsStandardSchemeFactory implements SchemeFactory {
      public prepareStatement_argsStandardScheme getScheme() {
        return new prepareStatement_argsStandardScheme();
      }
    }

    private static class prepareStatement_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareStatement_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SQL
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sql = iprot.readString();
                struct.setSqlIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OUTPUT_PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map610 = iprot.readMapBegin();
                  struct.outputParams = new HashMap(2*_map610.size);
                  int _key611;
                  OutputParameter _val612;
                  for (int _i613 = 0; _i613 < _map610.size; ++_i613)
                  {
                    _key611 = iprot.readI32();
                    _val612 = new OutputParameter();
                    _val612.read(iprot);
                    struct.outputParams.put(_key611, _val612);
                  }
                  iprot.readMapEnd();
                }
                struct.setOutputParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareStatement_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.sql != null) {
          oprot.writeFieldBegin(SQL_FIELD_DESC);
          oprot.writeString(struct.sql);
          oprot.writeFieldEnd();
        }
        if (struct.outputParams != null) {
          oprot.writeFieldBegin(OUTPUT_PARAMS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.outputParams.size()));
            for (Map.Entry _iter614 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter614.getKey());
              _iter614.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareStatement_argsTupleSchemeFactory implements SchemeFactory {
      public prepareStatement_argsTupleScheme getScheme() {
        return new prepareStatement_argsTupleScheme();
      }
    }

    private static class prepareStatement_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetSql()) {
          optionals.set(1);
        }
        if (struct.isSetOutputParams()) {
          optionals.set(2);
        }
        if (struct.isSetAttrs()) {
          optionals.set(3);
        }
        if (struct.isSetToken()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetSql()) {
          oprot.writeString(struct.sql);
        }
        if (struct.isSetOutputParams()) {
          {
            oprot.writeI32(struct.outputParams.size());
            for (Map.Entry _iter615 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter615.getKey());
              _iter615.getValue().write(oprot);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.sql = iprot.readString();
          struct.setSqlIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map616 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.outputParams = new HashMap(2*_map616.size);
            int _key617;
            OutputParameter _val618;
            for (int _i619 = 0; _i619 < _map616.size; ++_i619)
            {
              _key617 = iprot.readI32();
              _val618 = new OutputParameter();
              _val618.read(iprot);
              struct.outputParams.put(_key617, _val618);
            }
          }
          struct.setOutputParamsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class prepareStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareStatement_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareStatement_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareStatement_resultTupleSchemeFactory());
    }

    public PrepareResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PrepareResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareStatement_result.class, metaDataMap);
    }

    public prepareStatement_result() {
    }

    public prepareStatement_result(
      PrepareResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareStatement_result(prepareStatement_result other) {
      if (other.isSetSuccess()) {
        this.success = new PrepareResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public prepareStatement_result deepCopy() {
      return new prepareStatement_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public PrepareResult getSuccess() {
      return this.success;
    }

    public prepareStatement_result setSuccess(PrepareResult 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 SnappyException getError() {
      return this.error;
    }

    public prepareStatement_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PrepareResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareStatement_result)
        return this.equals((prepareStatement_result)that);
      return false;
    }

    public boolean equals(prepareStatement_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareStatement_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareStatement_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareStatement_resultStandardSchemeFactory implements SchemeFactory {
      public prepareStatement_resultStandardScheme getScheme() {
        return new prepareStatement_resultStandardScheme();
      }
    }

    private static class prepareStatement_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareStatement_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new PrepareResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareStatement_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareStatement_resultTupleSchemeFactory implements SchemeFactory {
      public prepareStatement_resultTupleScheme getScheme() {
        return new prepareStatement_resultTupleScheme();
      }
    }

    private static class prepareStatement_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new PrepareResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executePrepared_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePrepared_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("params", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField OUTPUT_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("outputParams", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)4);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)5);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePrepared_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePrepared_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public Row params; // required
    public Map outputParams; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      PARAMS((short)2, "params"),
      OUTPUT_PARAMS((short)3, "outputParams"),
      ATTRS((short)4, "attrs"),
      TOKEN((short)5, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // PARAMS
            return PARAMS;
          case 3: // OUTPUT_PARAMS
            return OUTPUT_PARAMS;
          case 4: // ATTRS
            return ATTRS;
          case 5: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PARAMS, new org.apache.thrift.meta_data.FieldMetaData("params", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class)));
      tmpMap.put(_Fields.OUTPUT_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("outputParams", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OutputParameter.class))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePrepared_args.class, metaDataMap);
    }

    public executePrepared_args() {
    }

    public executePrepared_args(
      long stmtId,
      Row params,
      Map outputParams,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.params = params;
      this.outputParams = outputParams;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executePrepared_args(executePrepared_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetParams()) {
        this.params = new Row(other.params);
      }
      if (other.isSetOutputParams()) {
        Map __this__outputParams = new HashMap(other.outputParams.size());
        for (Map.Entry other_element : other.outputParams.entrySet()) {

          Integer other_element_key = other_element.getKey();
          OutputParameter other_element_value = other_element.getValue();

          Integer __this__outputParams_copy_key = other_element_key;

          OutputParameter __this__outputParams_copy_value = new OutputParameter(other_element_value);

          __this__outputParams.put(__this__outputParams_copy_key, __this__outputParams_copy_value);
        }
        this.outputParams = __this__outputParams;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executePrepared_args deepCopy() {
      return new executePrepared_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.params = null;
      this.outputParams = null;
      this.attrs = null;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public executePrepared_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public Row getParams() {
      return this.params;
    }

    public executePrepared_args setParams(Row params) {
      this.params = params;
      return this;
    }

    public void unsetParams() {
      this.params = null;
    }

    /** Returns true if field params is set (has been assigned a value) and false otherwise */
    public boolean isSetParams() {
      return this.params != null;
    }

    public void setParamsIsSet(boolean value) {
      if (!value) {
        this.params = null;
      }
    }

    public int getOutputParamsSize() {
      return (this.outputParams == null) ? 0 : this.outputParams.size();
    }

    public void putToOutputParams(int key, OutputParameter val) {
      if (this.outputParams == null) {
        this.outputParams = new HashMap();
      }
      this.outputParams.put(key, val);
    }

    public Map getOutputParams() {
      return this.outputParams;
    }

    public executePrepared_args setOutputParams(Map outputParams) {
      this.outputParams = outputParams;
      return this;
    }

    public void unsetOutputParams() {
      this.outputParams = null;
    }

    /** Returns true if field outputParams is set (has been assigned a value) and false otherwise */
    public boolean isSetOutputParams() {
      return this.outputParams != null;
    }

    public void setOutputParamsIsSet(boolean value) {
      if (!value) {
        this.outputParams = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executePrepared_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executePrepared_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executePrepared_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case PARAMS:
        if (value == null) {
          unsetParams();
        } else {
          setParams((Row)value);
        }
        break;

      case OUTPUT_PARAMS:
        if (value == null) {
          unsetOutputParams();
        } else {
          setOutputParams((Map)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case PARAMS:
        return getParams();

      case OUTPUT_PARAMS:
        return getOutputParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case PARAMS:
        return isSetParams();
      case OUTPUT_PARAMS:
        return isSetOutputParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePrepared_args)
        return this.equals((executePrepared_args)that);
      return false;
    }

    public boolean equals(executePrepared_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_params = true && this.isSetParams();
      boolean that_present_params = true && that.isSetParams();
      if (this_present_params || that_present_params) {
        if (!(this_present_params && that_present_params))
          return false;
        if (!this.params.equals(that.params))
          return false;
      }

      boolean this_present_outputParams = true && this.isSetOutputParams();
      boolean that_present_outputParams = true && that.isSetOutputParams();
      if (this_present_outputParams || that_present_outputParams) {
        if (!(this_present_outputParams && that_present_outputParams))
          return false;
        if (!this.outputParams.equals(that.outputParams))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_params = true && (isSetParams());
      list.add(present_params);
      if (present_params)
        list.add(params);

      boolean present_outputParams = true && (isSetOutputParams());
      list.add(present_outputParams);
      if (present_outputParams)
        list.add(outputParams);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePrepared_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetParams()).compareTo(other.isSetParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.params, other.params);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOutputParams()).compareTo(other.isSetOutputParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOutputParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputParams, other.outputParams);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePrepared_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("params:");
      if (this.params == null) {
        sb.append("null");
      } else {
        sb.append(this.params);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("outputParams:");
      if (this.outputParams == null) {
        sb.append("null");
      } else {
        sb.append(this.outputParams);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (params != null) {
        params.validate();
      }
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePrepared_argsStandardSchemeFactory implements SchemeFactory {
      public executePrepared_argsStandardScheme getScheme() {
        return new executePrepared_argsStandardScheme();
      }
    }

    private static class executePrepared_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePrepared_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.params = new Row();
                struct.params.read(iprot);
                struct.setParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OUTPUT_PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map620 = iprot.readMapBegin();
                  struct.outputParams = new HashMap(2*_map620.size);
                  int _key621;
                  OutputParameter _val622;
                  for (int _i623 = 0; _i623 < _map620.size; ++_i623)
                  {
                    _key621 = iprot.readI32();
                    _val622 = new OutputParameter();
                    _val622.read(iprot);
                    struct.outputParams.put(_key621, _val622);
                  }
                  iprot.readMapEnd();
                }
                struct.setOutputParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePrepared_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.params != null) {
          oprot.writeFieldBegin(PARAMS_FIELD_DESC);
          struct.params.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.outputParams != null) {
          oprot.writeFieldBegin(OUTPUT_PARAMS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.outputParams.size()));
            for (Map.Entry _iter624 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter624.getKey());
              _iter624.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePrepared_argsTupleSchemeFactory implements SchemeFactory {
      public executePrepared_argsTupleScheme getScheme() {
        return new executePrepared_argsTupleScheme();
      }
    }

    private static class executePrepared_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePrepared_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetParams()) {
          optionals.set(1);
        }
        if (struct.isSetOutputParams()) {
          optionals.set(2);
        }
        if (struct.isSetAttrs()) {
          optionals.set(3);
        }
        if (struct.isSetToken()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetParams()) {
          struct.params.write(oprot);
        }
        if (struct.isSetOutputParams()) {
          {
            oprot.writeI32(struct.outputParams.size());
            for (Map.Entry _iter625 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter625.getKey());
              _iter625.getValue().write(oprot);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePrepared_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.params = new Row();
          struct.params.read(iprot);
          struct.setParamsIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map626 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.outputParams = new HashMap(2*_map626.size);
            int _key627;
            OutputParameter _val628;
            for (int _i629 = 0; _i629 < _map626.size; ++_i629)
            {
              _key627 = iprot.readI32();
              _val628 = new OutputParameter();
              _val628.read(iprot);
              struct.outputParams.put(_key627, _val628);
            }
          }
          struct.setOutputParamsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executePrepared_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePrepared_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePrepared_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePrepared_resultTupleSchemeFactory());
    }

    public StatementResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePrepared_result.class, metaDataMap);
    }

    public executePrepared_result() {
    }

    public executePrepared_result(
      StatementResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executePrepared_result(executePrepared_result other) {
      if (other.isSetSuccess()) {
        this.success = new StatementResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executePrepared_result deepCopy() {
      return new executePrepared_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public StatementResult getSuccess() {
      return this.success;
    }

    public executePrepared_result setSuccess(StatementResult 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 SnappyException getError() {
      return this.error;
    }

    public executePrepared_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((StatementResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePrepared_result)
        return this.equals((executePrepared_result)that);
      return false;
    }

    public boolean equals(executePrepared_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePrepared_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePrepared_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePrepared_resultStandardSchemeFactory implements SchemeFactory {
      public executePrepared_resultStandardScheme getScheme() {
        return new executePrepared_resultStandardScheme();
      }
    }

    private static class executePrepared_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePrepared_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new StatementResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePrepared_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePrepared_resultTupleSchemeFactory implements SchemeFactory {
      public executePrepared_resultTupleScheme getScheme() {
        return new executePrepared_resultTupleScheme();
      }
    }

    private static class executePrepared_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePrepared_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePrepared_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new StatementResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executePreparedUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedUpdate_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("params", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedUpdate_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedUpdate_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public Row params; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      PARAMS((short)2, "params"),
      ATTRS((short)3, "attrs"),
      TOKEN((short)4, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // PARAMS
            return PARAMS;
          case 3: // ATTRS
            return ATTRS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PARAMS, new org.apache.thrift.meta_data.FieldMetaData("params", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class)));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedUpdate_args.class, metaDataMap);
    }

    public executePreparedUpdate_args() {
    }

    public executePreparedUpdate_args(
      long stmtId,
      Row params,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.params = params;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedUpdate_args(executePreparedUpdate_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetParams()) {
        this.params = new Row(other.params);
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executePreparedUpdate_args deepCopy() {
      return new executePreparedUpdate_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.params = null;
      this.attrs = null;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public executePreparedUpdate_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public Row getParams() {
      return this.params;
    }

    public executePreparedUpdate_args setParams(Row params) {
      this.params = params;
      return this;
    }

    public void unsetParams() {
      this.params = null;
    }

    /** Returns true if field params is set (has been assigned a value) and false otherwise */
    public boolean isSetParams() {
      return this.params != null;
    }

    public void setParamsIsSet(boolean value) {
      if (!value) {
        this.params = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executePreparedUpdate_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executePreparedUpdate_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executePreparedUpdate_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case PARAMS:
        if (value == null) {
          unsetParams();
        } else {
          setParams((Row)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case PARAMS:
        return getParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case PARAMS:
        return isSetParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedUpdate_args)
        return this.equals((executePreparedUpdate_args)that);
      return false;
    }

    public boolean equals(executePreparedUpdate_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_params = true && this.isSetParams();
      boolean that_present_params = true && that.isSetParams();
      if (this_present_params || that_present_params) {
        if (!(this_present_params && that_present_params))
          return false;
        if (!this.params.equals(that.params))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_params = true && (isSetParams());
      list.add(present_params);
      if (present_params)
        list.add(params);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedUpdate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetParams()).compareTo(other.isSetParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.params, other.params);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedUpdate_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("params:");
      if (this.params == null) {
        sb.append("null");
      } else {
        sb.append(this.params);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (params != null) {
        params.validate();
      }
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedUpdate_argsStandardSchemeFactory implements SchemeFactory {
      public executePreparedUpdate_argsStandardScheme getScheme() {
        return new executePreparedUpdate_argsStandardScheme();
      }
    }

    private static class executePreparedUpdate_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedUpdate_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.params = new Row();
                struct.params.read(iprot);
                struct.setParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedUpdate_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.params != null) {
          oprot.writeFieldBegin(PARAMS_FIELD_DESC);
          struct.params.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedUpdate_argsTupleSchemeFactory implements SchemeFactory {
      public executePreparedUpdate_argsTupleScheme getScheme() {
        return new executePreparedUpdate_argsTupleScheme();
      }
    }

    private static class executePreparedUpdate_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetParams()) {
          optionals.set(1);
        }
        if (struct.isSetAttrs()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetParams()) {
          struct.params.write(oprot);
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.params = new Row();
          struct.params.read(iprot);
          struct.setParamsIsSet(true);
        }
        if (incoming.get(2)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executePreparedUpdate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedUpdate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedUpdate_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedUpdate_resultTupleSchemeFactory());
    }

    public UpdateResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UpdateResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedUpdate_result.class, metaDataMap);
    }

    public executePreparedUpdate_result() {
    }

    public executePreparedUpdate_result(
      UpdateResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedUpdate_result(executePreparedUpdate_result other) {
      if (other.isSetSuccess()) {
        this.success = new UpdateResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executePreparedUpdate_result deepCopy() {
      return new executePreparedUpdate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public UpdateResult getSuccess() {
      return this.success;
    }

    public executePreparedUpdate_result setSuccess(UpdateResult 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 SnappyException getError() {
      return this.error;
    }

    public executePreparedUpdate_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UpdateResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedUpdate_result)
        return this.equals((executePreparedUpdate_result)that);
      return false;
    }

    public boolean equals(executePreparedUpdate_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedUpdate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedUpdate_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedUpdate_resultStandardSchemeFactory implements SchemeFactory {
      public executePreparedUpdate_resultStandardScheme getScheme() {
        return new executePreparedUpdate_resultStandardScheme();
      }
    }

    private static class executePreparedUpdate_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedUpdate_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new UpdateResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedUpdate_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedUpdate_resultTupleSchemeFactory implements SchemeFactory {
      public executePreparedUpdate_resultTupleScheme getScheme() {
        return new executePreparedUpdate_resultTupleScheme();
      }
    }

    private static class executePreparedUpdate_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new UpdateResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executePreparedQuery_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedQuery_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("params", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedQuery_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedQuery_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public Row params; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      PARAMS((short)2, "params"),
      ATTRS((short)3, "attrs"),
      TOKEN((short)4, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // PARAMS
            return PARAMS;
          case 3: // ATTRS
            return ATTRS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PARAMS, new org.apache.thrift.meta_data.FieldMetaData("params", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class)));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedQuery_args.class, metaDataMap);
    }

    public executePreparedQuery_args() {
    }

    public executePreparedQuery_args(
      long stmtId,
      Row params,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.params = params;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedQuery_args(executePreparedQuery_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetParams()) {
        this.params = new Row(other.params);
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executePreparedQuery_args deepCopy() {
      return new executePreparedQuery_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.params = null;
      this.attrs = null;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public executePreparedQuery_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public Row getParams() {
      return this.params;
    }

    public executePreparedQuery_args setParams(Row params) {
      this.params = params;
      return this;
    }

    public void unsetParams() {
      this.params = null;
    }

    /** Returns true if field params is set (has been assigned a value) and false otherwise */
    public boolean isSetParams() {
      return this.params != null;
    }

    public void setParamsIsSet(boolean value) {
      if (!value) {
        this.params = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executePreparedQuery_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executePreparedQuery_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executePreparedQuery_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case PARAMS:
        if (value == null) {
          unsetParams();
        } else {
          setParams((Row)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case PARAMS:
        return getParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case PARAMS:
        return isSetParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedQuery_args)
        return this.equals((executePreparedQuery_args)that);
      return false;
    }

    public boolean equals(executePreparedQuery_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_params = true && this.isSetParams();
      boolean that_present_params = true && that.isSetParams();
      if (this_present_params || that_present_params) {
        if (!(this_present_params && that_present_params))
          return false;
        if (!this.params.equals(that.params))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_params = true && (isSetParams());
      list.add(present_params);
      if (present_params)
        list.add(params);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedQuery_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetParams()).compareTo(other.isSetParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.params, other.params);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedQuery_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("params:");
      if (this.params == null) {
        sb.append("null");
      } else {
        sb.append(this.params);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (params != null) {
        params.validate();
      }
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedQuery_argsStandardSchemeFactory implements SchemeFactory {
      public executePreparedQuery_argsStandardScheme getScheme() {
        return new executePreparedQuery_argsStandardScheme();
      }
    }

    private static class executePreparedQuery_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedQuery_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.params = new Row();
                struct.params.read(iprot);
                struct.setParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedQuery_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.params != null) {
          oprot.writeFieldBegin(PARAMS_FIELD_DESC);
          struct.params.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedQuery_argsTupleSchemeFactory implements SchemeFactory {
      public executePreparedQuery_argsTupleScheme getScheme() {
        return new executePreparedQuery_argsTupleScheme();
      }
    }

    private static class executePreparedQuery_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedQuery_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetParams()) {
          optionals.set(1);
        }
        if (struct.isSetAttrs()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetParams()) {
          struct.params.write(oprot);
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedQuery_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.params = new Row();
          struct.params.read(iprot);
          struct.setParamsIsSet(true);
        }
        if (incoming.get(2)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executePreparedQuery_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedQuery_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedQuery_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedQuery_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedQuery_result.class, metaDataMap);
    }

    public executePreparedQuery_result() {
    }

    public executePreparedQuery_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedQuery_result(executePreparedQuery_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executePreparedQuery_result deepCopy() {
      return new executePreparedQuery_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public executePreparedQuery_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public executePreparedQuery_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedQuery_result)
        return this.equals((executePreparedQuery_result)that);
      return false;
    }

    public boolean equals(executePreparedQuery_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedQuery_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedQuery_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedQuery_resultStandardSchemeFactory implements SchemeFactory {
      public executePreparedQuery_resultStandardScheme getScheme() {
        return new executePreparedQuery_resultStandardScheme();
      }
    }

    private static class executePreparedQuery_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedQuery_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedQuery_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedQuery_resultTupleSchemeFactory implements SchemeFactory {
      public executePreparedQuery_resultTupleScheme getScheme() {
        return new executePreparedQuery_resultTupleScheme();
      }
    }

    private static class executePreparedQuery_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedQuery_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedQuery_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executePreparedBatch_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedBatch_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField PARAMS_BATCH_FIELD_DESC = new org.apache.thrift.protocol.TField("paramsBatch", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedBatch_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedBatch_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public List paramsBatch; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      PARAMS_BATCH((short)2, "paramsBatch"),
      ATTRS((short)3, "attrs"),
      TOKEN((short)4, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // PARAMS_BATCH
            return PARAMS_BATCH;
          case 3: // ATTRS
            return ATTRS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PARAMS_BATCH, new org.apache.thrift.meta_data.FieldMetaData("paramsBatch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedBatch_args.class, metaDataMap);
    }

    public executePreparedBatch_args() {
    }

    public executePreparedBatch_args(
      long stmtId,
      List paramsBatch,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.paramsBatch = paramsBatch;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedBatch_args(executePreparedBatch_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetParamsBatch()) {
        List __this__paramsBatch = new ArrayList(other.paramsBatch.size());
        for (Row other_element : other.paramsBatch) {
          __this__paramsBatch.add(new Row(other_element));
        }
        this.paramsBatch = __this__paramsBatch;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executePreparedBatch_args deepCopy() {
      return new executePreparedBatch_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.paramsBatch = null;
      this.attrs = null;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public executePreparedBatch_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public int getParamsBatchSize() {
      return (this.paramsBatch == null) ? 0 : this.paramsBatch.size();
    }

    public java.util.Iterator getParamsBatchIterator() {
      return (this.paramsBatch == null) ? null : this.paramsBatch.iterator();
    }

    public void addToParamsBatch(Row elem) {
      if (this.paramsBatch == null) {
        this.paramsBatch = new ArrayList();
      }
      this.paramsBatch.add(elem);
    }

    public List getParamsBatch() {
      return this.paramsBatch;
    }

    public executePreparedBatch_args setParamsBatch(List paramsBatch) {
      this.paramsBatch = paramsBatch;
      return this;
    }

    public void unsetParamsBatch() {
      this.paramsBatch = null;
    }

    /** Returns true if field paramsBatch is set (has been assigned a value) and false otherwise */
    public boolean isSetParamsBatch() {
      return this.paramsBatch != null;
    }

    public void setParamsBatchIsSet(boolean value) {
      if (!value) {
        this.paramsBatch = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public executePreparedBatch_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executePreparedBatch_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executePreparedBatch_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case PARAMS_BATCH:
        if (value == null) {
          unsetParamsBatch();
        } else {
          setParamsBatch((List)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case PARAMS_BATCH:
        return getParamsBatch();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case PARAMS_BATCH:
        return isSetParamsBatch();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedBatch_args)
        return this.equals((executePreparedBatch_args)that);
      return false;
    }

    public boolean equals(executePreparedBatch_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_paramsBatch = true && this.isSetParamsBatch();
      boolean that_present_paramsBatch = true && that.isSetParamsBatch();
      if (this_present_paramsBatch || that_present_paramsBatch) {
        if (!(this_present_paramsBatch && that_present_paramsBatch))
          return false;
        if (!this.paramsBatch.equals(that.paramsBatch))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_paramsBatch = true && (isSetParamsBatch());
      list.add(present_paramsBatch);
      if (present_paramsBatch)
        list.add(paramsBatch);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedBatch_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetParamsBatch()).compareTo(other.isSetParamsBatch());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetParamsBatch()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paramsBatch, other.paramsBatch);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedBatch_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("paramsBatch:");
      if (this.paramsBatch == null) {
        sb.append("null");
      } else {
        sb.append(this.paramsBatch);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedBatch_argsStandardSchemeFactory implements SchemeFactory {
      public executePreparedBatch_argsStandardScheme getScheme() {
        return new executePreparedBatch_argsStandardScheme();
      }
    }

    private static class executePreparedBatch_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedBatch_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PARAMS_BATCH
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list630 = iprot.readListBegin();
                  struct.paramsBatch = new ArrayList(_list630.size);
                  Row _elem631;
                  for (int _i632 = 0; _i632 < _list630.size; ++_i632)
                  {
                    _elem631 = new Row();
                    _elem631.read(iprot);
                    struct.paramsBatch.add(_elem631);
                  }
                  iprot.readListEnd();
                }
                struct.setParamsBatchIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedBatch_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.paramsBatch != null) {
          oprot.writeFieldBegin(PARAMS_BATCH_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.paramsBatch.size()));
            for (Row _iter633 : struct.paramsBatch)
            {
              _iter633.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedBatch_argsTupleSchemeFactory implements SchemeFactory {
      public executePreparedBatch_argsTupleScheme getScheme() {
        return new executePreparedBatch_argsTupleScheme();
      }
    }

    private static class executePreparedBatch_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedBatch_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetParamsBatch()) {
          optionals.set(1);
        }
        if (struct.isSetAttrs()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetParamsBatch()) {
          {
            oprot.writeI32(struct.paramsBatch.size());
            for (Row _iter634 : struct.paramsBatch)
            {
              _iter634.write(oprot);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedBatch_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list635 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.paramsBatch = new ArrayList(_list635.size);
            Row _elem636;
            for (int _i637 = 0; _i637 < _list635.size; ++_i637)
            {
              _elem636 = new Row();
              _elem636.read(iprot);
              struct.paramsBatch.add(_elem636);
            }
          }
          struct.setParamsBatchIsSet(true);
        }
        if (incoming.get(2)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executePreparedBatch_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executePreparedBatch_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executePreparedBatch_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executePreparedBatch_resultTupleSchemeFactory());
    }

    public UpdateResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UpdateResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executePreparedBatch_result.class, metaDataMap);
    }

    public executePreparedBatch_result() {
    }

    public executePreparedBatch_result(
      UpdateResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executePreparedBatch_result(executePreparedBatch_result other) {
      if (other.isSetSuccess()) {
        this.success = new UpdateResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executePreparedBatch_result deepCopy() {
      return new executePreparedBatch_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public UpdateResult getSuccess() {
      return this.success;
    }

    public executePreparedBatch_result setSuccess(UpdateResult 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 SnappyException getError() {
      return this.error;
    }

    public executePreparedBatch_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((UpdateResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executePreparedBatch_result)
        return this.equals((executePreparedBatch_result)that);
      return false;
    }

    public boolean equals(executePreparedBatch_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executePreparedBatch_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executePreparedBatch_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executePreparedBatch_resultStandardSchemeFactory implements SchemeFactory {
      public executePreparedBatch_resultStandardScheme getScheme() {
        return new executePreparedBatch_resultStandardScheme();
      }
    }

    private static class executePreparedBatch_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executePreparedBatch_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new UpdateResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executePreparedBatch_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executePreparedBatch_resultTupleSchemeFactory implements SchemeFactory {
      public executePreparedBatch_resultTupleScheme getScheme() {
        return new executePreparedBatch_resultTupleScheme();
      }
    }

    private static class executePreparedBatch_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executePreparedBatch_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executePreparedBatch_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new UpdateResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class prepareAndExecute_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareAndExecute_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField SQL_FIELD_DESC = new org.apache.thrift.protocol.TField("sql", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField PARAMS_BATCH_FIELD_DESC = new org.apache.thrift.protocol.TField("paramsBatch", org.apache.thrift.protocol.TType.LIST, (short)3);
    private static final org.apache.thrift.protocol.TField OUTPUT_PARAMS_FIELD_DESC = new org.apache.thrift.protocol.TField("outputParams", org.apache.thrift.protocol.TType.MAP, (short)4);
    private static final org.apache.thrift.protocol.TField ATTRS_FIELD_DESC = new org.apache.thrift.protocol.TField("attrs", org.apache.thrift.protocol.TType.STRUCT, (short)5);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)6);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareAndExecute_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareAndExecute_argsTupleSchemeFactory());
    }

    public long connId; // required
    public String sql; // required
    public List paramsBatch; // required
    public Map outputParams; // required
    public StatementAttrs attrs; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      SQL((short)2, "sql"),
      PARAMS_BATCH((short)3, "paramsBatch"),
      OUTPUT_PARAMS((short)4, "outputParams"),
      ATTRS((short)5, "attrs"),
      TOKEN((short)6, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // SQL
            return SQL;
          case 3: // PARAMS_BATCH
            return PARAMS_BATCH;
          case 4: // OUTPUT_PARAMS
            return OUTPUT_PARAMS;
          case 5: // ATTRS
            return ATTRS;
          case 6: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SQL, new org.apache.thrift.meta_data.FieldMetaData("sql", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PARAMS_BATCH, new org.apache.thrift.meta_data.FieldMetaData("paramsBatch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class))));
      tmpMap.put(_Fields.OUTPUT_PARAMS, new org.apache.thrift.meta_data.FieldMetaData("outputParams", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OutputParameter.class))));
      tmpMap.put(_Fields.ATTRS, new org.apache.thrift.meta_data.FieldMetaData("attrs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementAttrs.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareAndExecute_args.class, metaDataMap);
    }

    public prepareAndExecute_args() {
    }

    public prepareAndExecute_args(
      long connId,
      String sql,
      List paramsBatch,
      Map outputParams,
      StatementAttrs attrs,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.sql = sql;
      this.paramsBatch = paramsBatch;
      this.outputParams = outputParams;
      this.attrs = attrs;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareAndExecute_args(prepareAndExecute_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetSql()) {
        this.sql = other.sql;
      }
      if (other.isSetParamsBatch()) {
        List __this__paramsBatch = new ArrayList(other.paramsBatch.size());
        for (Row other_element : other.paramsBatch) {
          __this__paramsBatch.add(new Row(other_element));
        }
        this.paramsBatch = __this__paramsBatch;
      }
      if (other.isSetOutputParams()) {
        Map __this__outputParams = new HashMap(other.outputParams.size());
        for (Map.Entry other_element : other.outputParams.entrySet()) {

          Integer other_element_key = other_element.getKey();
          OutputParameter other_element_value = other_element.getValue();

          Integer __this__outputParams_copy_key = other_element_key;

          OutputParameter __this__outputParams_copy_value = new OutputParameter(other_element_value);

          __this__outputParams.put(__this__outputParams_copy_key, __this__outputParams_copy_value);
        }
        this.outputParams = __this__outputParams;
      }
      if (other.isSetAttrs()) {
        this.attrs = new StatementAttrs(other.attrs);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public prepareAndExecute_args deepCopy() {
      return new prepareAndExecute_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.sql = null;
      this.paramsBatch = null;
      this.outputParams = null;
      this.attrs = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public prepareAndExecute_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public String getSql() {
      return this.sql;
    }

    public prepareAndExecute_args setSql(String sql) {
      this.sql = sql;
      return this;
    }

    public void unsetSql() {
      this.sql = null;
    }

    /** Returns true if field sql is set (has been assigned a value) and false otherwise */
    public boolean isSetSql() {
      return this.sql != null;
    }

    public void setSqlIsSet(boolean value) {
      if (!value) {
        this.sql = null;
      }
    }

    public int getParamsBatchSize() {
      return (this.paramsBatch == null) ? 0 : this.paramsBatch.size();
    }

    public java.util.Iterator getParamsBatchIterator() {
      return (this.paramsBatch == null) ? null : this.paramsBatch.iterator();
    }

    public void addToParamsBatch(Row elem) {
      if (this.paramsBatch == null) {
        this.paramsBatch = new ArrayList();
      }
      this.paramsBatch.add(elem);
    }

    public List getParamsBatch() {
      return this.paramsBatch;
    }

    public prepareAndExecute_args setParamsBatch(List paramsBatch) {
      this.paramsBatch = paramsBatch;
      return this;
    }

    public void unsetParamsBatch() {
      this.paramsBatch = null;
    }

    /** Returns true if field paramsBatch is set (has been assigned a value) and false otherwise */
    public boolean isSetParamsBatch() {
      return this.paramsBatch != null;
    }

    public void setParamsBatchIsSet(boolean value) {
      if (!value) {
        this.paramsBatch = null;
      }
    }

    public int getOutputParamsSize() {
      return (this.outputParams == null) ? 0 : this.outputParams.size();
    }

    public void putToOutputParams(int key, OutputParameter val) {
      if (this.outputParams == null) {
        this.outputParams = new HashMap();
      }
      this.outputParams.put(key, val);
    }

    public Map getOutputParams() {
      return this.outputParams;
    }

    public prepareAndExecute_args setOutputParams(Map outputParams) {
      this.outputParams = outputParams;
      return this;
    }

    public void unsetOutputParams() {
      this.outputParams = null;
    }

    /** Returns true if field outputParams is set (has been assigned a value) and false otherwise */
    public boolean isSetOutputParams() {
      return this.outputParams != null;
    }

    public void setOutputParamsIsSet(boolean value) {
      if (!value) {
        this.outputParams = null;
      }
    }

    public StatementAttrs getAttrs() {
      return this.attrs;
    }

    public prepareAndExecute_args setAttrs(StatementAttrs attrs) {
      this.attrs = attrs;
      return this;
    }

    public void unsetAttrs() {
      this.attrs = null;
    }

    /** Returns true if field attrs is set (has been assigned a value) and false otherwise */
    public boolean isSetAttrs() {
      return this.attrs != null;
    }

    public void setAttrsIsSet(boolean value) {
      if (!value) {
        this.attrs = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public prepareAndExecute_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public prepareAndExecute_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case SQL:
        if (value == null) {
          unsetSql();
        } else {
          setSql((String)value);
        }
        break;

      case PARAMS_BATCH:
        if (value == null) {
          unsetParamsBatch();
        } else {
          setParamsBatch((List)value);
        }
        break;

      case OUTPUT_PARAMS:
        if (value == null) {
          unsetOutputParams();
        } else {
          setOutputParams((Map)value);
        }
        break;

      case ATTRS:
        if (value == null) {
          unsetAttrs();
        } else {
          setAttrs((StatementAttrs)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case SQL:
        return getSql();

      case PARAMS_BATCH:
        return getParamsBatch();

      case OUTPUT_PARAMS:
        return getOutputParams();

      case ATTRS:
        return getAttrs();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case SQL:
        return isSetSql();
      case PARAMS_BATCH:
        return isSetParamsBatch();
      case OUTPUT_PARAMS:
        return isSetOutputParams();
      case ATTRS:
        return isSetAttrs();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareAndExecute_args)
        return this.equals((prepareAndExecute_args)that);
      return false;
    }

    public boolean equals(prepareAndExecute_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_sql = true && this.isSetSql();
      boolean that_present_sql = true && that.isSetSql();
      if (this_present_sql || that_present_sql) {
        if (!(this_present_sql && that_present_sql))
          return false;
        if (!this.sql.equals(that.sql))
          return false;
      }

      boolean this_present_paramsBatch = true && this.isSetParamsBatch();
      boolean that_present_paramsBatch = true && that.isSetParamsBatch();
      if (this_present_paramsBatch || that_present_paramsBatch) {
        if (!(this_present_paramsBatch && that_present_paramsBatch))
          return false;
        if (!this.paramsBatch.equals(that.paramsBatch))
          return false;
      }

      boolean this_present_outputParams = true && this.isSetOutputParams();
      boolean that_present_outputParams = true && that.isSetOutputParams();
      if (this_present_outputParams || that_present_outputParams) {
        if (!(this_present_outputParams && that_present_outputParams))
          return false;
        if (!this.outputParams.equals(that.outputParams))
          return false;
      }

      boolean this_present_attrs = true && this.isSetAttrs();
      boolean that_present_attrs = true && that.isSetAttrs();
      if (this_present_attrs || that_present_attrs) {
        if (!(this_present_attrs && that_present_attrs))
          return false;
        if (!this.attrs.equals(that.attrs))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_sql = true && (isSetSql());
      list.add(present_sql);
      if (present_sql)
        list.add(sql);

      boolean present_paramsBatch = true && (isSetParamsBatch());
      list.add(present_paramsBatch);
      if (present_paramsBatch)
        list.add(paramsBatch);

      boolean present_outputParams = true && (isSetOutputParams());
      list.add(present_outputParams);
      if (present_outputParams)
        list.add(outputParams);

      boolean present_attrs = true && (isSetAttrs());
      list.add(present_attrs);
      if (present_attrs)
        list.add(attrs);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareAndExecute_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSql()).compareTo(other.isSetSql());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSql()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sql, other.sql);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetParamsBatch()).compareTo(other.isSetParamsBatch());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetParamsBatch()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paramsBatch, other.paramsBatch);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOutputParams()).compareTo(other.isSetOutputParams());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOutputParams()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputParams, other.outputParams);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttrs()).compareTo(other.isSetAttrs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttrs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attrs, other.attrs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareAndExecute_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("sql:");
      if (this.sql == null) {
        sb.append("null");
      } else {
        sb.append(this.sql);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("paramsBatch:");
      if (this.paramsBatch == null) {
        sb.append("null");
      } else {
        sb.append(this.paramsBatch);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("outputParams:");
      if (this.outputParams == null) {
        sb.append("null");
      } else {
        sb.append(this.outputParams);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attrs:");
      if (this.attrs == null) {
        sb.append("null");
      } else {
        sb.append(this.attrs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (attrs != null) {
        attrs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareAndExecute_argsStandardSchemeFactory implements SchemeFactory {
      public prepareAndExecute_argsStandardScheme getScheme() {
        return new prepareAndExecute_argsStandardScheme();
      }
    }

    private static class prepareAndExecute_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareAndExecute_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SQL
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sql = iprot.readString();
                struct.setSqlIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // PARAMS_BATCH
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list638 = iprot.readListBegin();
                  struct.paramsBatch = new ArrayList(_list638.size);
                  Row _elem639;
                  for (int _i640 = 0; _i640 < _list638.size; ++_i640)
                  {
                    _elem639 = new Row();
                    _elem639.read(iprot);
                    struct.paramsBatch.add(_elem639);
                  }
                  iprot.readListEnd();
                }
                struct.setParamsBatchIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // OUTPUT_PARAMS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map641 = iprot.readMapBegin();
                  struct.outputParams = new HashMap(2*_map641.size);
                  int _key642;
                  OutputParameter _val643;
                  for (int _i644 = 0; _i644 < _map641.size; ++_i644)
                  {
                    _key642 = iprot.readI32();
                    _val643 = new OutputParameter();
                    _val643.read(iprot);
                    struct.outputParams.put(_key642, _val643);
                  }
                  iprot.readMapEnd();
                }
                struct.setOutputParamsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // ATTRS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.attrs = new StatementAttrs();
                struct.attrs.read(iprot);
                struct.setAttrsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareAndExecute_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.sql != null) {
          oprot.writeFieldBegin(SQL_FIELD_DESC);
          oprot.writeString(struct.sql);
          oprot.writeFieldEnd();
        }
        if (struct.paramsBatch != null) {
          oprot.writeFieldBegin(PARAMS_BATCH_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.paramsBatch.size()));
            for (Row _iter645 : struct.paramsBatch)
            {
              _iter645.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.outputParams != null) {
          oprot.writeFieldBegin(OUTPUT_PARAMS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.outputParams.size()));
            for (Map.Entry _iter646 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter646.getKey());
              _iter646.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.attrs != null) {
          oprot.writeFieldBegin(ATTRS_FIELD_DESC);
          struct.attrs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareAndExecute_argsTupleSchemeFactory implements SchemeFactory {
      public prepareAndExecute_argsTupleScheme getScheme() {
        return new prepareAndExecute_argsTupleScheme();
      }
    }

    private static class prepareAndExecute_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareAndExecute_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetSql()) {
          optionals.set(1);
        }
        if (struct.isSetParamsBatch()) {
          optionals.set(2);
        }
        if (struct.isSetOutputParams()) {
          optionals.set(3);
        }
        if (struct.isSetAttrs()) {
          optionals.set(4);
        }
        if (struct.isSetToken()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetSql()) {
          oprot.writeString(struct.sql);
        }
        if (struct.isSetParamsBatch()) {
          {
            oprot.writeI32(struct.paramsBatch.size());
            for (Row _iter647 : struct.paramsBatch)
            {
              _iter647.write(oprot);
            }
          }
        }
        if (struct.isSetOutputParams()) {
          {
            oprot.writeI32(struct.outputParams.size());
            for (Map.Entry _iter648 : struct.outputParams.entrySet())
            {
              oprot.writeI32(_iter648.getKey());
              _iter648.getValue().write(oprot);
            }
          }
        }
        if (struct.isSetAttrs()) {
          struct.attrs.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareAndExecute_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.sql = iprot.readString();
          struct.setSqlIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TList _list649 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.paramsBatch = new ArrayList(_list649.size);
            Row _elem650;
            for (int _i651 = 0; _i651 < _list649.size; ++_i651)
            {
              _elem650 = new Row();
              _elem650.read(iprot);
              struct.paramsBatch.add(_elem650);
            }
          }
          struct.setParamsBatchIsSet(true);
        }
        if (incoming.get(3)) {
          {
            org.apache.thrift.protocol.TMap _map652 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.outputParams = new HashMap(2*_map652.size);
            int _key653;
            OutputParameter _val654;
            for (int _i655 = 0; _i655 < _map652.size; ++_i655)
            {
              _key653 = iprot.readI32();
              _val654 = new OutputParameter();
              _val654.read(iprot);
              struct.outputParams.put(_key653, _val654);
            }
          }
          struct.setOutputParamsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.attrs = new StatementAttrs();
          struct.attrs.read(iprot);
          struct.setAttrsIsSet(true);
        }
        if (incoming.get(5)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class prepareAndExecute_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareAndExecute_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareAndExecute_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareAndExecute_resultTupleSchemeFactory());
    }

    public StatementResult success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StatementResult.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareAndExecute_result.class, metaDataMap);
    }

    public prepareAndExecute_result() {
    }

    public prepareAndExecute_result(
      StatementResult success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareAndExecute_result(prepareAndExecute_result other) {
      if (other.isSetSuccess()) {
        this.success = new StatementResult(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public prepareAndExecute_result deepCopy() {
      return new prepareAndExecute_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public StatementResult getSuccess() {
      return this.success;
    }

    public prepareAndExecute_result setSuccess(StatementResult 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 SnappyException getError() {
      return this.error;
    }

    public prepareAndExecute_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((StatementResult)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareAndExecute_result)
        return this.equals((prepareAndExecute_result)that);
      return false;
    }

    public boolean equals(prepareAndExecute_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareAndExecute_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareAndExecute_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareAndExecute_resultStandardSchemeFactory implements SchemeFactory {
      public prepareAndExecute_resultStandardScheme getScheme() {
        return new prepareAndExecute_resultStandardScheme();
      }
    }

    private static class prepareAndExecute_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareAndExecute_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new StatementResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareAndExecute_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareAndExecute_resultTupleSchemeFactory implements SchemeFactory {
      public prepareAndExecute_resultTupleScheme getScheme() {
        return new prepareAndExecute_resultTupleScheme();
      }
    }

    private static class prepareAndExecute_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareAndExecute_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareAndExecute_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new StatementResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class beginTransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginTransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField ISOLATION_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("isolationLevel", org.apache.thrift.protocol.TType.BYTE, (short)2);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new beginTransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new beginTransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public byte isolationLevel; // required
    public Map flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      ISOLATION_LEVEL((short)2, "isolationLevel"),
      FLAGS((short)3, "flags"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // ISOLATION_LEVEL
            return ISOLATION_LEVEL;
          case 3: // FLAGS
            return FLAGS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __ISOLATIONLEVEL_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ISOLATION_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("isolationLevel", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransactionAttribute.class), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginTransaction_args.class, metaDataMap);
    }

    public beginTransaction_args() {
    }

    public beginTransaction_args(
      long connId,
      byte isolationLevel,
      Map flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.isolationLevel = isolationLevel;
      setIsolationLevelIsSet(true);
      this.flags = flags;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public beginTransaction_args(beginTransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.isolationLevel = other.isolationLevel;
      if (other.isSetFlags()) {
        Map __this__flags = new HashMap(other.flags.size());
        for (Map.Entry other_element : other.flags.entrySet()) {

          TransactionAttribute other_element_key = other_element.getKey();
          Boolean other_element_value = other_element.getValue();

          TransactionAttribute __this__flags_copy_key = other_element_key;

          Boolean __this__flags_copy_value = other_element_value;

          __this__flags.put(__this__flags_copy_key, __this__flags_copy_value);
        }
        this.flags = __this__flags;
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public beginTransaction_args deepCopy() {
      return new beginTransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setIsolationLevelIsSet(false);
      this.isolationLevel = 0;
      this.flags = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public beginTransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte getIsolationLevel() {
      return this.isolationLevel;
    }

    public beginTransaction_args setIsolationLevel(byte isolationLevel) {
      this.isolationLevel = isolationLevel;
      setIsolationLevelIsSet(true);
      return this;
    }

    public void unsetIsolationLevel() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISOLATIONLEVEL_ISSET_ID);
    }

    /** Returns true if field isolationLevel is set (has been assigned a value) and false otherwise */
    public boolean isSetIsolationLevel() {
      return EncodingUtils.testBit(__isset_bitfield, __ISOLATIONLEVEL_ISSET_ID);
    }

    public void setIsolationLevelIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISOLATIONLEVEL_ISSET_ID, value);
    }

    public int getFlagsSize() {
      return (this.flags == null) ? 0 : this.flags.size();
    }

    public void putToFlags(TransactionAttribute key, boolean val) {
      if (this.flags == null) {
        this.flags = new HashMap();
      }
      this.flags.put(key, val);
    }

    public Map getFlags() {
      return this.flags;
    }

    public beginTransaction_args setFlags(Map flags) {
      this.flags = flags;
      return this;
    }

    public void unsetFlags() {
      this.flags = null;
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return this.flags != null;
    }

    public void setFlagsIsSet(boolean value) {
      if (!value) {
        this.flags = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public beginTransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public beginTransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case ISOLATION_LEVEL:
        if (value == null) {
          unsetIsolationLevel();
        } else {
          setIsolationLevel((Byte)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Map)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case ISOLATION_LEVEL:
        return getIsolationLevel();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case ISOLATION_LEVEL:
        return isSetIsolationLevel();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof beginTransaction_args)
        return this.equals((beginTransaction_args)that);
      return false;
    }

    public boolean equals(beginTransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_isolationLevel = true;
      boolean that_present_isolationLevel = true;
      if (this_present_isolationLevel || that_present_isolationLevel) {
        if (!(this_present_isolationLevel && that_present_isolationLevel))
          return false;
        if (this.isolationLevel != that.isolationLevel)
          return false;
      }

      boolean this_present_flags = true && this.isSetFlags();
      boolean that_present_flags = true && that.isSetFlags();
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (!this.flags.equals(that.flags))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_isolationLevel = true;
      list.add(present_isolationLevel);
      if (present_isolationLevel)
        list.add(isolationLevel);

      boolean present_flags = true && (isSetFlags());
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(beginTransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsolationLevel()).compareTo(other.isSetIsolationLevel());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsolationLevel()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isolationLevel, other.isolationLevel);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("beginTransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isolationLevel:");
      sb.append(this.isolationLevel);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      if (this.flags == null) {
        sb.append("null");
      } else {
        sb.append(this.flags);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class beginTransaction_argsStandardSchemeFactory implements SchemeFactory {
      public beginTransaction_argsStandardScheme getScheme() {
        return new beginTransaction_argsStandardScheme();
      }
    }

    private static class beginTransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, beginTransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // ISOLATION_LEVEL
              if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
                struct.isolationLevel = iprot.readByte();
                struct.setIsolationLevelIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map656 = iprot.readMapBegin();
                  struct.flags = new HashMap(2*_map656.size);
                  TransactionAttribute _key657;
                  boolean _val658;
                  for (int _i659 = 0; _i659 < _map656.size; ++_i659)
                  {
                    _key657 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
                    _val658 = iprot.readBool();
                    struct.flags.put(_key657, _val658);
                  }
                  iprot.readMapEnd();
                }
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, beginTransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(ISOLATION_LEVEL_FIELD_DESC);
        oprot.writeByte(struct.isolationLevel);
        oprot.writeFieldEnd();
        if (struct.flags != null) {
          oprot.writeFieldBegin(FLAGS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.flags.size()));
            for (Map.Entry _iter660 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter660.getKey().getValue());
              oprot.writeBool(_iter660.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class beginTransaction_argsTupleSchemeFactory implements SchemeFactory {
      public beginTransaction_argsTupleScheme getScheme() {
        return new beginTransaction_argsTupleScheme();
      }
    }

    private static class beginTransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, beginTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetIsolationLevel()) {
          optionals.set(1);
        }
        if (struct.isSetFlags()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetIsolationLevel()) {
          oprot.writeByte(struct.isolationLevel);
        }
        if (struct.isSetFlags()) {
          {
            oprot.writeI32(struct.flags.size());
            for (Map.Entry _iter661 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter661.getKey().getValue());
              oprot.writeBool(_iter661.getValue());
            }
          }
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, beginTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.isolationLevel = iprot.readByte();
          struct.setIsolationLevelIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map662 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, iprot.readI32());
            struct.flags = new HashMap(2*_map662.size);
            TransactionAttribute _key663;
            boolean _val664;
            for (int _i665 = 0; _i665 < _map662.size; ++_i665)
            {
              _key663 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
              _val664 = iprot.readBool();
              struct.flags.put(_key663, _val664);
            }
          }
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class beginTransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("beginTransaction_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BYTE, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new beginTransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new beginTransaction_resultTupleSchemeFactory());
    }

    public byte success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(beginTransaction_result.class, metaDataMap);
    }

    public beginTransaction_result() {
    }

    public beginTransaction_result(
      byte success,
      SnappyException error)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public beginTransaction_result(beginTransaction_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public beginTransaction_result deepCopy() {
      return new beginTransaction_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.error = null;
    }

    public byte getSuccess() {
      return this.success;
    }

    public beginTransaction_result setSuccess(byte success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public SnappyException getError() {
      return this.error;
    }

    public beginTransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Byte)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof beginTransaction_result)
        return this.equals((beginTransaction_result)that);
      return false;
    }

    public boolean equals(beginTransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(beginTransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("beginTransaction_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class beginTransaction_resultStandardSchemeFactory implements SchemeFactory {
      public beginTransaction_resultStandardScheme getScheme() {
        return new beginTransaction_resultStandardScheme();
      }
    }

    private static class beginTransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, beginTransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
                struct.success = iprot.readByte();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, beginTransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeByte(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class beginTransaction_resultTupleSchemeFactory implements SchemeFactory {
      public beginTransaction_resultTupleScheme getScheme() {
        return new beginTransaction_resultTupleScheme();
      }
    }

    private static class beginTransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, beginTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeByte(struct.success);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, beginTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readByte();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class setTransactionAttributes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setTransactionAttributes_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.MAP, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new setTransactionAttributes_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new setTransactionAttributes_argsTupleSchemeFactory());
    }

    public long connId; // required
    public Map flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      FLAGS((short)2, "flags"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // FLAGS
            return FLAGS;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransactionAttribute.class), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setTransactionAttributes_args.class, metaDataMap);
    }

    public setTransactionAttributes_args() {
    }

    public setTransactionAttributes_args(
      long connId,
      Map flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.flags = flags;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public setTransactionAttributes_args(setTransactionAttributes_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetFlags()) {
        Map __this__flags = new HashMap(other.flags.size());
        for (Map.Entry other_element : other.flags.entrySet()) {

          TransactionAttribute other_element_key = other_element.getKey();
          Boolean other_element_value = other_element.getValue();

          TransactionAttribute __this__flags_copy_key = other_element_key;

          Boolean __this__flags_copy_value = other_element_value;

          __this__flags.put(__this__flags_copy_key, __this__flags_copy_value);
        }
        this.flags = __this__flags;
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public setTransactionAttributes_args deepCopy() {
      return new setTransactionAttributes_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.flags = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public setTransactionAttributes_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public int getFlagsSize() {
      return (this.flags == null) ? 0 : this.flags.size();
    }

    public void putToFlags(TransactionAttribute key, boolean val) {
      if (this.flags == null) {
        this.flags = new HashMap();
      }
      this.flags.put(key, val);
    }

    public Map getFlags() {
      return this.flags;
    }

    public setTransactionAttributes_args setFlags(Map flags) {
      this.flags = flags;
      return this;
    }

    public void unsetFlags() {
      this.flags = null;
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return this.flags != null;
    }

    public void setFlagsIsSet(boolean value) {
      if (!value) {
        this.flags = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public setTransactionAttributes_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public setTransactionAttributes_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Map)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setTransactionAttributes_args)
        return this.equals((setTransactionAttributes_args)that);
      return false;
    }

    public boolean equals(setTransactionAttributes_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_flags = true && this.isSetFlags();
      boolean that_present_flags = true && that.isSetFlags();
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (!this.flags.equals(that.flags))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_flags = true && (isSetFlags());
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(setTransactionAttributes_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setTransactionAttributes_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      if (this.flags == null) {
        sb.append("null");
      } else {
        sb.append(this.flags);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class setTransactionAttributes_argsStandardSchemeFactory implements SchemeFactory {
      public setTransactionAttributes_argsStandardScheme getScheme() {
        return new setTransactionAttributes_argsStandardScheme();
      }
    }

    private static class setTransactionAttributes_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, setTransactionAttributes_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map666 = iprot.readMapBegin();
                  struct.flags = new HashMap(2*_map666.size);
                  TransactionAttribute _key667;
                  boolean _val668;
                  for (int _i669 = 0; _i669 < _map666.size; ++_i669)
                  {
                    _key667 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
                    _val668 = iprot.readBool();
                    struct.flags.put(_key667, _val668);
                  }
                  iprot.readMapEnd();
                }
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, setTransactionAttributes_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.flags != null) {
          oprot.writeFieldBegin(FLAGS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.flags.size()));
            for (Map.Entry _iter670 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter670.getKey().getValue());
              oprot.writeBool(_iter670.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class setTransactionAttributes_argsTupleSchemeFactory implements SchemeFactory {
      public setTransactionAttributes_argsTupleScheme getScheme() {
        return new setTransactionAttributes_argsTupleScheme();
      }
    }

    private static class setTransactionAttributes_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, setTransactionAttributes_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetFlags()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetFlags()) {
          {
            oprot.writeI32(struct.flags.size());
            for (Map.Entry _iter671 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter671.getKey().getValue());
              oprot.writeBool(_iter671.getValue());
            }
          }
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, setTransactionAttributes_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TMap _map672 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, iprot.readI32());
            struct.flags = new HashMap(2*_map672.size);
            TransactionAttribute _key673;
            boolean _val674;
            for (int _i675 = 0; _i675 < _map672.size; ++_i675)
            {
              _key673 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
              _val674 = iprot.readBool();
              struct.flags.put(_key673, _val674);
            }
          }
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class setTransactionAttributes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setTransactionAttributes_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new setTransactionAttributes_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new setTransactionAttributes_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setTransactionAttributes_result.class, metaDataMap);
    }

    public setTransactionAttributes_result() {
    }

    public setTransactionAttributes_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public setTransactionAttributes_result(setTransactionAttributes_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public setTransactionAttributes_result deepCopy() {
      return new setTransactionAttributes_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public setTransactionAttributes_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof setTransactionAttributes_result)
        return this.equals((setTransactionAttributes_result)that);
      return false;
    }

    public boolean equals(setTransactionAttributes_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(setTransactionAttributes_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("setTransactionAttributes_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class setTransactionAttributes_resultStandardSchemeFactory implements SchemeFactory {
      public setTransactionAttributes_resultStandardScheme getScheme() {
        return new setTransactionAttributes_resultStandardScheme();
      }
    }

    private static class setTransactionAttributes_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, setTransactionAttributes_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, setTransactionAttributes_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class setTransactionAttributes_resultTupleSchemeFactory implements SchemeFactory {
      public setTransactionAttributes_resultTupleScheme getScheme() {
        return new setTransactionAttributes_resultTupleScheme();
      }
    }

    private static class setTransactionAttributes_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, setTransactionAttributes_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, setTransactionAttributes_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getTransactionAttributes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransactionAttributes_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getTransactionAttributes_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getTransactionAttributes_argsTupleSchemeFactory());
    }

    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      TOKEN((short)2, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransactionAttributes_args.class, metaDataMap);
    }

    public getTransactionAttributes_args() {
    }

    public getTransactionAttributes_args(
      long connId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public getTransactionAttributes_args(getTransactionAttributes_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public getTransactionAttributes_args deepCopy() {
      return new getTransactionAttributes_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public getTransactionAttributes_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public getTransactionAttributes_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public getTransactionAttributes_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransactionAttributes_args)
        return this.equals((getTransactionAttributes_args)that);
      return false;
    }

    public boolean equals(getTransactionAttributes_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(getTransactionAttributes_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransactionAttributes_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getTransactionAttributes_argsStandardSchemeFactory implements SchemeFactory {
      public getTransactionAttributes_argsStandardScheme getScheme() {
        return new getTransactionAttributes_argsStandardScheme();
      }
    }

    private static class getTransactionAttributes_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getTransactionAttributes_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getTransactionAttributes_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getTransactionAttributes_argsTupleSchemeFactory implements SchemeFactory {
      public getTransactionAttributes_argsTupleScheme getScheme() {
        return new getTransactionAttributes_argsTupleScheme();
      }
    }

    private static class getTransactionAttributes_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getTransactionAttributes_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getTransactionAttributes_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class getTransactionAttributes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getTransactionAttributes_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getTransactionAttributes_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getTransactionAttributes_resultTupleSchemeFactory());
    }

    public Map success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransactionAttribute.class), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getTransactionAttributes_result.class, metaDataMap);
    }

    public getTransactionAttributes_result() {
    }

    public getTransactionAttributes_result(
      Map success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getTransactionAttributes_result(getTransactionAttributes_result other) {
      if (other.isSetSuccess()) {
        Map __this__success = new HashMap(other.success.size());
        for (Map.Entry other_element : other.success.entrySet()) {

          TransactionAttribute other_element_key = other_element.getKey();
          Boolean other_element_value = other_element.getValue();

          TransactionAttribute __this__success_copy_key = other_element_key;

          Boolean __this__success_copy_value = other_element_value;

          __this__success.put(__this__success_copy_key, __this__success_copy_value);
        }
        this.success = __this__success;
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getTransactionAttributes_result deepCopy() {
      return new getTransactionAttributes_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public void putToSuccess(TransactionAttribute key, boolean val) {
      if (this.success == null) {
        this.success = new HashMap();
      }
      this.success.put(key, val);
    }

    public Map getSuccess() {
      return this.success;
    }

    public getTransactionAttributes_result setSuccess(Map 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 SnappyException getError() {
      return this.error;
    }

    public getTransactionAttributes_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Map)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getTransactionAttributes_result)
        return this.equals((getTransactionAttributes_result)that);
      return false;
    }

    public boolean equals(getTransactionAttributes_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getTransactionAttributes_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getTransactionAttributes_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getTransactionAttributes_resultStandardSchemeFactory implements SchemeFactory {
      public getTransactionAttributes_resultStandardScheme getScheme() {
        return new getTransactionAttributes_resultStandardScheme();
      }
    }

    private static class getTransactionAttributes_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getTransactionAttributes_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map676 = iprot.readMapBegin();
                  struct.success = new HashMap(2*_map676.size);
                  TransactionAttribute _key677;
                  boolean _val678;
                  for (int _i679 = 0; _i679 < _map676.size; ++_i679)
                  {
                    _key677 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
                    _val678 = iprot.readBool();
                    struct.success.put(_key677, _val678);
                  }
                  iprot.readMapEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getTransactionAttributes_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.success.size()));
            for (Map.Entry _iter680 : struct.success.entrySet())
            {
              oprot.writeI32(_iter680.getKey().getValue());
              oprot.writeBool(_iter680.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getTransactionAttributes_resultTupleSchemeFactory implements SchemeFactory {
      public getTransactionAttributes_resultTupleScheme getScheme() {
        return new getTransactionAttributes_resultTupleScheme();
      }
    }

    private static class getTransactionAttributes_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getTransactionAttributes_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (Map.Entry _iter681 : struct.success.entrySet())
            {
              oprot.writeI32(_iter681.getKey().getValue());
              oprot.writeBool(_iter681.getValue());
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getTransactionAttributes_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TMap _map682 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, iprot.readI32());
            struct.success = new HashMap(2*_map682.size);
            TransactionAttribute _key683;
            boolean _val684;
            for (int _i685 = 0; _i685 < _map682.size; ++_i685)
            {
              _key683 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
              _val684 = iprot.readBool();
              struct.success.put(_key683, _val684);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class commitTransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("commitTransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField START_NEW_TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("startNewTransaction", org.apache.thrift.protocol.TType.BOOL, (short)2);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new commitTransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new commitTransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public boolean startNewTransaction; // required
    public Map flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      START_NEW_TRANSACTION((short)2, "startNewTransaction"),
      FLAGS((short)3, "flags"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // START_NEW_TRANSACTION
            return START_NEW_TRANSACTION;
          case 3: // FLAGS
            return FLAGS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __STARTNEWTRANSACTION_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.START_NEW_TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("startNewTransaction", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransactionAttribute.class), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_args.class, metaDataMap);
    }

    public commitTransaction_args() {
    }

    public commitTransaction_args(
      long connId,
      boolean startNewTransaction,
      Map flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.startNewTransaction = startNewTransaction;
      setStartNewTransactionIsSet(true);
      this.flags = flags;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public commitTransaction_args(commitTransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.startNewTransaction = other.startNewTransaction;
      if (other.isSetFlags()) {
        Map __this__flags = new HashMap(other.flags.size());
        for (Map.Entry other_element : other.flags.entrySet()) {

          TransactionAttribute other_element_key = other_element.getKey();
          Boolean other_element_value = other_element.getValue();

          TransactionAttribute __this__flags_copy_key = other_element_key;

          Boolean __this__flags_copy_value = other_element_value;

          __this__flags.put(__this__flags_copy_key, __this__flags_copy_value);
        }
        this.flags = __this__flags;
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public commitTransaction_args deepCopy() {
      return new commitTransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setStartNewTransactionIsSet(false);
      this.startNewTransaction = false;
      this.flags = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public commitTransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public boolean isStartNewTransaction() {
      return this.startNewTransaction;
    }

    public commitTransaction_args setStartNewTransaction(boolean startNewTransaction) {
      this.startNewTransaction = startNewTransaction;
      setStartNewTransactionIsSet(true);
      return this;
    }

    public void unsetStartNewTransaction() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID);
    }

    /** Returns true if field startNewTransaction is set (has been assigned a value) and false otherwise */
    public boolean isSetStartNewTransaction() {
      return EncodingUtils.testBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID);
    }

    public void setStartNewTransactionIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID, value);
    }

    public int getFlagsSize() {
      return (this.flags == null) ? 0 : this.flags.size();
    }

    public void putToFlags(TransactionAttribute key, boolean val) {
      if (this.flags == null) {
        this.flags = new HashMap();
      }
      this.flags.put(key, val);
    }

    public Map getFlags() {
      return this.flags;
    }

    public commitTransaction_args setFlags(Map flags) {
      this.flags = flags;
      return this;
    }

    public void unsetFlags() {
      this.flags = null;
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return this.flags != null;
    }

    public void setFlagsIsSet(boolean value) {
      if (!value) {
        this.flags = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public commitTransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public commitTransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case START_NEW_TRANSACTION:
        if (value == null) {
          unsetStartNewTransaction();
        } else {
          setStartNewTransaction((Boolean)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Map)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case START_NEW_TRANSACTION:
        return isStartNewTransaction();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case START_NEW_TRANSACTION:
        return isSetStartNewTransaction();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof commitTransaction_args)
        return this.equals((commitTransaction_args)that);
      return false;
    }

    public boolean equals(commitTransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_startNewTransaction = true;
      boolean that_present_startNewTransaction = true;
      if (this_present_startNewTransaction || that_present_startNewTransaction) {
        if (!(this_present_startNewTransaction && that_present_startNewTransaction))
          return false;
        if (this.startNewTransaction != that.startNewTransaction)
          return false;
      }

      boolean this_present_flags = true && this.isSetFlags();
      boolean that_present_flags = true && that.isSetFlags();
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (!this.flags.equals(that.flags))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_startNewTransaction = true;
      list.add(present_startNewTransaction);
      if (present_startNewTransaction)
        list.add(startNewTransaction);

      boolean present_flags = true && (isSetFlags());
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(commitTransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetStartNewTransaction()).compareTo(other.isSetStartNewTransaction());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartNewTransaction()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startNewTransaction, other.startNewTransaction);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("commitTransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("startNewTransaction:");
      sb.append(this.startNewTransaction);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      if (this.flags == null) {
        sb.append("null");
      } else {
        sb.append(this.flags);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class commitTransaction_argsStandardSchemeFactory implements SchemeFactory {
      public commitTransaction_argsStandardScheme getScheme() {
        return new commitTransaction_argsStandardScheme();
      }
    }

    private static class commitTransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // START_NEW_TRANSACTION
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.startNewTransaction = iprot.readBool();
                struct.setStartNewTransactionIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map686 = iprot.readMapBegin();
                  struct.flags = new HashMap(2*_map686.size);
                  TransactionAttribute _key687;
                  boolean _val688;
                  for (int _i689 = 0; _i689 < _map686.size; ++_i689)
                  {
                    _key687 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
                    _val688 = iprot.readBool();
                    struct.flags.put(_key687, _val688);
                  }
                  iprot.readMapEnd();
                }
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(START_NEW_TRANSACTION_FIELD_DESC);
        oprot.writeBool(struct.startNewTransaction);
        oprot.writeFieldEnd();
        if (struct.flags != null) {
          oprot.writeFieldBegin(FLAGS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.flags.size()));
            for (Map.Entry _iter690 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter690.getKey().getValue());
              oprot.writeBool(_iter690.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class commitTransaction_argsTupleSchemeFactory implements SchemeFactory {
      public commitTransaction_argsTupleScheme getScheme() {
        return new commitTransaction_argsTupleScheme();
      }
    }

    private static class commitTransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetStartNewTransaction()) {
          optionals.set(1);
        }
        if (struct.isSetFlags()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetStartNewTransaction()) {
          oprot.writeBool(struct.startNewTransaction);
        }
        if (struct.isSetFlags()) {
          {
            oprot.writeI32(struct.flags.size());
            for (Map.Entry _iter691 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter691.getKey().getValue());
              oprot.writeBool(_iter691.getValue());
            }
          }
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.startNewTransaction = iprot.readBool();
          struct.setStartNewTransactionIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map692 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, iprot.readI32());
            struct.flags = new HashMap(2*_map692.size);
            TransactionAttribute _key693;
            boolean _val694;
            for (int _i695 = 0; _i695 < _map692.size; ++_i695)
            {
              _key693 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
              _val694 = iprot.readBool();
              struct.flags.put(_key693, _val694);
            }
          }
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class commitTransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("commitTransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new commitTransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new commitTransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitTransaction_result.class, metaDataMap);
    }

    public commitTransaction_result() {
    }

    public commitTransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public commitTransaction_result(commitTransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public commitTransaction_result deepCopy() {
      return new commitTransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public commitTransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof commitTransaction_result)
        return this.equals((commitTransaction_result)that);
      return false;
    }

    public boolean equals(commitTransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(commitTransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("commitTransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class commitTransaction_resultStandardSchemeFactory implements SchemeFactory {
      public commitTransaction_resultStandardScheme getScheme() {
        return new commitTransaction_resultStandardScheme();
      }
    }

    private static class commitTransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, commitTransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, commitTransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class commitTransaction_resultTupleSchemeFactory implements SchemeFactory {
      public commitTransaction_resultTupleScheme getScheme() {
        return new commitTransaction_resultTupleScheme();
      }
    }

    private static class commitTransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, commitTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class rollbackTransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rollbackTransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField START_NEW_TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("startNewTransaction", org.apache.thrift.protocol.TType.BOOL, (short)2);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.MAP, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new rollbackTransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new rollbackTransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public boolean startNewTransaction; // required
    public Map flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      START_NEW_TRANSACTION((short)2, "startNewTransaction"),
      FLAGS((short)3, "flags"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // START_NEW_TRANSACTION
            return START_NEW_TRANSACTION;
          case 3: // FLAGS
            return FLAGS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __STARTNEWTRANSACTION_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.START_NEW_TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("startNewTransaction", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TransactionAttribute.class), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rollbackTransaction_args.class, metaDataMap);
    }

    public rollbackTransaction_args() {
    }

    public rollbackTransaction_args(
      long connId,
      boolean startNewTransaction,
      Map flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.startNewTransaction = startNewTransaction;
      setStartNewTransactionIsSet(true);
      this.flags = flags;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public rollbackTransaction_args(rollbackTransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.startNewTransaction = other.startNewTransaction;
      if (other.isSetFlags()) {
        Map __this__flags = new HashMap(other.flags.size());
        for (Map.Entry other_element : other.flags.entrySet()) {

          TransactionAttribute other_element_key = other_element.getKey();
          Boolean other_element_value = other_element.getValue();

          TransactionAttribute __this__flags_copy_key = other_element_key;

          Boolean __this__flags_copy_value = other_element_value;

          __this__flags.put(__this__flags_copy_key, __this__flags_copy_value);
        }
        this.flags = __this__flags;
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public rollbackTransaction_args deepCopy() {
      return new rollbackTransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setStartNewTransactionIsSet(false);
      this.startNewTransaction = false;
      this.flags = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public rollbackTransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public boolean isStartNewTransaction() {
      return this.startNewTransaction;
    }

    public rollbackTransaction_args setStartNewTransaction(boolean startNewTransaction) {
      this.startNewTransaction = startNewTransaction;
      setStartNewTransactionIsSet(true);
      return this;
    }

    public void unsetStartNewTransaction() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID);
    }

    /** Returns true if field startNewTransaction is set (has been assigned a value) and false otherwise */
    public boolean isSetStartNewTransaction() {
      return EncodingUtils.testBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID);
    }

    public void setStartNewTransactionIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTNEWTRANSACTION_ISSET_ID, value);
    }

    public int getFlagsSize() {
      return (this.flags == null) ? 0 : this.flags.size();
    }

    public void putToFlags(TransactionAttribute key, boolean val) {
      if (this.flags == null) {
        this.flags = new HashMap();
      }
      this.flags.put(key, val);
    }

    public Map getFlags() {
      return this.flags;
    }

    public rollbackTransaction_args setFlags(Map flags) {
      this.flags = flags;
      return this;
    }

    public void unsetFlags() {
      this.flags = null;
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return this.flags != null;
    }

    public void setFlagsIsSet(boolean value) {
      if (!value) {
        this.flags = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public rollbackTransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public rollbackTransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case START_NEW_TRANSACTION:
        if (value == null) {
          unsetStartNewTransaction();
        } else {
          setStartNewTransaction((Boolean)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Map)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case START_NEW_TRANSACTION:
        return isStartNewTransaction();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case START_NEW_TRANSACTION:
        return isSetStartNewTransaction();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof rollbackTransaction_args)
        return this.equals((rollbackTransaction_args)that);
      return false;
    }

    public boolean equals(rollbackTransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_startNewTransaction = true;
      boolean that_present_startNewTransaction = true;
      if (this_present_startNewTransaction || that_present_startNewTransaction) {
        if (!(this_present_startNewTransaction && that_present_startNewTransaction))
          return false;
        if (this.startNewTransaction != that.startNewTransaction)
          return false;
      }

      boolean this_present_flags = true && this.isSetFlags();
      boolean that_present_flags = true && that.isSetFlags();
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (!this.flags.equals(that.flags))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_startNewTransaction = true;
      list.add(present_startNewTransaction);
      if (present_startNewTransaction)
        list.add(startNewTransaction);

      boolean present_flags = true && (isSetFlags());
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(rollbackTransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetStartNewTransaction()).compareTo(other.isSetStartNewTransaction());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartNewTransaction()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startNewTransaction, other.startNewTransaction);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("rollbackTransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("startNewTransaction:");
      sb.append(this.startNewTransaction);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      if (this.flags == null) {
        sb.append("null");
      } else {
        sb.append(this.flags);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class rollbackTransaction_argsStandardSchemeFactory implements SchemeFactory {
      public rollbackTransaction_argsStandardScheme getScheme() {
        return new rollbackTransaction_argsStandardScheme();
      }
    }

    private static class rollbackTransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, rollbackTransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // START_NEW_TRANSACTION
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.startNewTransaction = iprot.readBool();
                struct.setStartNewTransactionIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map696 = iprot.readMapBegin();
                  struct.flags = new HashMap(2*_map696.size);
                  TransactionAttribute _key697;
                  boolean _val698;
                  for (int _i699 = 0; _i699 < _map696.size; ++_i699)
                  {
                    _key697 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
                    _val698 = iprot.readBool();
                    struct.flags.put(_key697, _val698);
                  }
                  iprot.readMapEnd();
                }
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, rollbackTransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(START_NEW_TRANSACTION_FIELD_DESC);
        oprot.writeBool(struct.startNewTransaction);
        oprot.writeFieldEnd();
        if (struct.flags != null) {
          oprot.writeFieldBegin(FLAGS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, struct.flags.size()));
            for (Map.Entry _iter700 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter700.getKey().getValue());
              oprot.writeBool(_iter700.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class rollbackTransaction_argsTupleSchemeFactory implements SchemeFactory {
      public rollbackTransaction_argsTupleScheme getScheme() {
        return new rollbackTransaction_argsTupleScheme();
      }
    }

    private static class rollbackTransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, rollbackTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetStartNewTransaction()) {
          optionals.set(1);
        }
        if (struct.isSetFlags()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetStartNewTransaction()) {
          oprot.writeBool(struct.startNewTransaction);
        }
        if (struct.isSetFlags()) {
          {
            oprot.writeI32(struct.flags.size());
            for (Map.Entry _iter701 : struct.flags.entrySet())
            {
              oprot.writeI32(_iter701.getKey().getValue());
              oprot.writeBool(_iter701.getValue());
            }
          }
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, rollbackTransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.startNewTransaction = iprot.readBool();
          struct.setStartNewTransactionIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TMap _map702 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.BOOL, iprot.readI32());
            struct.flags = new HashMap(2*_map702.size);
            TransactionAttribute _key703;
            boolean _val704;
            for (int _i705 = 0; _i705 < _map702.size; ++_i705)
            {
              _key703 = io.snappydata.thrift.TransactionAttribute.findByValue(iprot.readI32());
              _val704 = iprot.readBool();
              struct.flags.put(_key703, _val704);
            }
          }
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class rollbackTransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rollbackTransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new rollbackTransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new rollbackTransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rollbackTransaction_result.class, metaDataMap);
    }

    public rollbackTransaction_result() {
    }

    public rollbackTransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public rollbackTransaction_result(rollbackTransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public rollbackTransaction_result deepCopy() {
      return new rollbackTransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public rollbackTransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof rollbackTransaction_result)
        return this.equals((rollbackTransaction_result)that);
      return false;
    }

    public boolean equals(rollbackTransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(rollbackTransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("rollbackTransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class rollbackTransaction_resultStandardSchemeFactory implements SchemeFactory {
      public rollbackTransaction_resultStandardScheme getScheme() {
        return new rollbackTransaction_resultStandardScheme();
      }
    }

    private static class rollbackTransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, rollbackTransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, rollbackTransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class rollbackTransaction_resultTupleSchemeFactory implements SchemeFactory {
      public rollbackTransaction_resultTupleScheme getScheme() {
        return new rollbackTransaction_resultTupleScheme();
      }
    }

    private static class rollbackTransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, rollbackTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, rollbackTransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getNextResultSet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNextResultSet_args");

    private static final org.apache.thrift.protocol.TField CURSOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cursorId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField OTHER_RESULT_SET_BEHAVIOUR_FIELD_DESC = new org.apache.thrift.protocol.TField("otherResultSetBehaviour", org.apache.thrift.protocol.TType.BYTE, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getNextResultSet_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getNextResultSet_argsTupleSchemeFactory());
    }

    public long cursorId; // required
    public byte otherResultSetBehaviour; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CURSOR_ID((short)1, "cursorId"),
      OTHER_RESULT_SET_BEHAVIOUR((short)2, "otherResultSetBehaviour"),
      TOKEN((short)3, "token");

      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: // CURSOR_ID
            return CURSOR_ID;
          case 2: // OTHER_RESULT_SET_BEHAVIOUR
            return OTHER_RESULT_SET_BEHAVIOUR;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CURSORID_ISSET_ID = 0;
    private static final int __OTHERRESULTSETBEHAVIOUR_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CURSOR_ID, new org.apache.thrift.meta_data.FieldMetaData("cursorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.OTHER_RESULT_SET_BEHAVIOUR, new org.apache.thrift.meta_data.FieldMetaData("otherResultSetBehaviour", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNextResultSet_args.class, metaDataMap);
    }

    public getNextResultSet_args() {
    }

    public getNextResultSet_args(
      long cursorId,
      byte otherResultSetBehaviour,
      ByteBuffer token)
    {
      this();
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      this.otherResultSetBehaviour = otherResultSetBehaviour;
      setOtherResultSetBehaviourIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public getNextResultSet_args(getNextResultSet_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.cursorId = other.cursorId;
      this.otherResultSetBehaviour = other.otherResultSetBehaviour;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public getNextResultSet_args deepCopy() {
      return new getNextResultSet_args(this);
    }

    @Override
    public void clear() {
      setCursorIdIsSet(false);
      this.cursorId = 0;
      setOtherResultSetBehaviourIsSet(false);
      this.otherResultSetBehaviour = 0;
      this.token = null;
    }

    public long getCursorId() {
      return this.cursorId;
    }

    public getNextResultSet_args setCursorId(long cursorId) {
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      return this;
    }

    public void unsetCursorId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    /** Returns true if field cursorId is set (has been assigned a value) and false otherwise */
    public boolean isSetCursorId() {
      return EncodingUtils.testBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    public void setCursorIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CURSORID_ISSET_ID, value);
    }

    public byte getOtherResultSetBehaviour() {
      return this.otherResultSetBehaviour;
    }

    public getNextResultSet_args setOtherResultSetBehaviour(byte otherResultSetBehaviour) {
      this.otherResultSetBehaviour = otherResultSetBehaviour;
      setOtherResultSetBehaviourIsSet(true);
      return this;
    }

    public void unsetOtherResultSetBehaviour() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OTHERRESULTSETBEHAVIOUR_ISSET_ID);
    }

    /** Returns true if field otherResultSetBehaviour is set (has been assigned a value) and false otherwise */
    public boolean isSetOtherResultSetBehaviour() {
      return EncodingUtils.testBit(__isset_bitfield, __OTHERRESULTSETBEHAVIOUR_ISSET_ID);
    }

    public void setOtherResultSetBehaviourIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OTHERRESULTSETBEHAVIOUR_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public getNextResultSet_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public getNextResultSet_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CURSOR_ID:
        if (value == null) {
          unsetCursorId();
        } else {
          setCursorId((Long)value);
        }
        break;

      case OTHER_RESULT_SET_BEHAVIOUR:
        if (value == null) {
          unsetOtherResultSetBehaviour();
        } else {
          setOtherResultSetBehaviour((Byte)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CURSOR_ID:
        return getCursorId();

      case OTHER_RESULT_SET_BEHAVIOUR:
        return getOtherResultSetBehaviour();

      case TOKEN:
        return getToken();

      }
      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 CURSOR_ID:
        return isSetCursorId();
      case OTHER_RESULT_SET_BEHAVIOUR:
        return isSetOtherResultSetBehaviour();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getNextResultSet_args)
        return this.equals((getNextResultSet_args)that);
      return false;
    }

    public boolean equals(getNextResultSet_args that) {
      if (that == null)
        return false;

      boolean this_present_cursorId = true;
      boolean that_present_cursorId = true;
      if (this_present_cursorId || that_present_cursorId) {
        if (!(this_present_cursorId && that_present_cursorId))
          return false;
        if (this.cursorId != that.cursorId)
          return false;
      }

      boolean this_present_otherResultSetBehaviour = true;
      boolean that_present_otherResultSetBehaviour = true;
      if (this_present_otherResultSetBehaviour || that_present_otherResultSetBehaviour) {
        if (!(this_present_otherResultSetBehaviour && that_present_otherResultSetBehaviour))
          return false;
        if (this.otherResultSetBehaviour != that.otherResultSetBehaviour)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_cursorId = true;
      list.add(present_cursorId);
      if (present_cursorId)
        list.add(cursorId);

      boolean present_otherResultSetBehaviour = true;
      list.add(present_otherResultSetBehaviour);
      if (present_otherResultSetBehaviour)
        list.add(otherResultSetBehaviour);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(getNextResultSet_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCursorId()).compareTo(other.isSetCursorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCursorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cursorId, other.cursorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOtherResultSetBehaviour()).compareTo(other.isSetOtherResultSetBehaviour());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOtherResultSetBehaviour()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherResultSetBehaviour, other.otherResultSetBehaviour);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getNextResultSet_args(");
      boolean first = true;

      sb.append("cursorId:");
      sb.append(this.cursorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("otherResultSetBehaviour:");
      sb.append(this.otherResultSetBehaviour);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getNextResultSet_argsStandardSchemeFactory implements SchemeFactory {
      public getNextResultSet_argsStandardScheme getScheme() {
        return new getNextResultSet_argsStandardScheme();
      }
    }

    private static class getNextResultSet_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getNextResultSet_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CURSOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.cursorId = iprot.readI64();
                struct.setCursorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // OTHER_RESULT_SET_BEHAVIOUR
              if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
                struct.otherResultSetBehaviour = iprot.readByte();
                struct.setOtherResultSetBehaviourIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getNextResultSet_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CURSOR_ID_FIELD_DESC);
        oprot.writeI64(struct.cursorId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(OTHER_RESULT_SET_BEHAVIOUR_FIELD_DESC);
        oprot.writeByte(struct.otherResultSetBehaviour);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getNextResultSet_argsTupleSchemeFactory implements SchemeFactory {
      public getNextResultSet_argsTupleScheme getScheme() {
        return new getNextResultSet_argsTupleScheme();
      }
    }

    private static class getNextResultSet_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getNextResultSet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCursorId()) {
          optionals.set(0);
        }
        if (struct.isSetOtherResultSetBehaviour()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetCursorId()) {
          oprot.writeI64(struct.cursorId);
        }
        if (struct.isSetOtherResultSetBehaviour()) {
          oprot.writeByte(struct.otherResultSetBehaviour);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getNextResultSet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.cursorId = iprot.readI64();
          struct.setCursorIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.otherResultSetBehaviour = iprot.readByte();
          struct.setOtherResultSetBehaviourIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class getNextResultSet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNextResultSet_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getNextResultSet_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getNextResultSet_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNextResultSet_result.class, metaDataMap);
    }

    public getNextResultSet_result() {
    }

    public getNextResultSet_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getNextResultSet_result(getNextResultSet_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getNextResultSet_result deepCopy() {
      return new getNextResultSet_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public getNextResultSet_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public getNextResultSet_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getNextResultSet_result)
        return this.equals((getNextResultSet_result)that);
      return false;
    }

    public boolean equals(getNextResultSet_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getNextResultSet_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getNextResultSet_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getNextResultSet_resultStandardSchemeFactory implements SchemeFactory {
      public getNextResultSet_resultStandardScheme getScheme() {
        return new getNextResultSet_resultStandardScheme();
      }
    }

    private static class getNextResultSet_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getNextResultSet_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getNextResultSet_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getNextResultSet_resultTupleSchemeFactory implements SchemeFactory {
      public getNextResultSet_resultTupleScheme getScheme() {
        return new getNextResultSet_resultTupleScheme();
      }
    }

    private static class getNextResultSet_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getNextResultSet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getNextResultSet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getBlobChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlobChunk_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField LOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("lobId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("size", org.apache.thrift.protocol.TType.I32, (short)4);
    private static final org.apache.thrift.protocol.TField FREE_LOB_AT_END_FIELD_DESC = new org.apache.thrift.protocol.TField("freeLobAtEnd", org.apache.thrift.protocol.TType.BOOL, (short)5);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)6);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getBlobChunk_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getBlobChunk_argsTupleSchemeFactory());
    }

    public long connId; // required
    public long lobId; // required
    public long offset; // required
    public int size; // required
    public boolean freeLobAtEnd; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      LOB_ID((short)2, "lobId"),
      OFFSET((short)3, "offset"),
      SIZE((short)4, "size"),
      FREE_LOB_AT_END((short)5, "freeLobAtEnd"),
      TOKEN((short)6, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // LOB_ID
            return LOB_ID;
          case 3: // OFFSET
            return OFFSET;
          case 4: // SIZE
            return SIZE;
          case 5: // FREE_LOB_AT_END
            return FREE_LOB_AT_END;
          case 6: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __LOBID_ISSET_ID = 1;
    private static final int __OFFSET_ISSET_ID = 2;
    private static final int __SIZE_ISSET_ID = 3;
    private static final int __FREELOBATEND_ISSET_ID = 4;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.LOB_ID, new org.apache.thrift.meta_data.FieldMetaData("lobId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SIZE, new org.apache.thrift.meta_data.FieldMetaData("size", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.FREE_LOB_AT_END, new org.apache.thrift.meta_data.FieldMetaData("freeLobAtEnd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlobChunk_args.class, metaDataMap);
    }

    public getBlobChunk_args() {
    }

    public getBlobChunk_args(
      long connId,
      long lobId,
      long offset,
      int size,
      boolean freeLobAtEnd,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.lobId = lobId;
      setLobIdIsSet(true);
      this.offset = offset;
      setOffsetIsSet(true);
      this.size = size;
      setSizeIsSet(true);
      this.freeLobAtEnd = freeLobAtEnd;
      setFreeLobAtEndIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public getBlobChunk_args(getBlobChunk_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.lobId = other.lobId;
      this.offset = other.offset;
      this.size = other.size;
      this.freeLobAtEnd = other.freeLobAtEnd;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public getBlobChunk_args deepCopy() {
      return new getBlobChunk_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setLobIdIsSet(false);
      this.lobId = 0;
      setOffsetIsSet(false);
      this.offset = 0;
      setSizeIsSet(false);
      this.size = 0;
      setFreeLobAtEndIsSet(false);
      this.freeLobAtEnd = false;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public getBlobChunk_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public long getLobId() {
      return this.lobId;
    }

    public getBlobChunk_args setLobId(long lobId) {
      this.lobId = lobId;
      setLobIdIsSet(true);
      return this;
    }

    public void unsetLobId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    /** Returns true if field lobId is set (has been assigned a value) and false otherwise */
    public boolean isSetLobId() {
      return EncodingUtils.testBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    public void setLobIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOBID_ISSET_ID, value);
    }

    public long getOffset() {
      return this.offset;
    }

    public getBlobChunk_args setOffset(long offset) {
      this.offset = offset;
      setOffsetIsSet(true);
      return this;
    }

    public void unsetOffset() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    /** Returns true if field offset is set (has been assigned a value) and false otherwise */
    public boolean isSetOffset() {
      return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    public void setOffsetIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
    }

    public int getSize() {
      return this.size;
    }

    public getBlobChunk_args setSize(int size) {
      this.size = size;
      setSizeIsSet(true);
      return this;
    }

    public void unsetSize() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SIZE_ISSET_ID);
    }

    /** Returns true if field size is set (has been assigned a value) and false otherwise */
    public boolean isSetSize() {
      return EncodingUtils.testBit(__isset_bitfield, __SIZE_ISSET_ID);
    }

    public void setSizeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SIZE_ISSET_ID, value);
    }

    public boolean isFreeLobAtEnd() {
      return this.freeLobAtEnd;
    }

    public getBlobChunk_args setFreeLobAtEnd(boolean freeLobAtEnd) {
      this.freeLobAtEnd = freeLobAtEnd;
      setFreeLobAtEndIsSet(true);
      return this;
    }

    public void unsetFreeLobAtEnd() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FREELOBATEND_ISSET_ID);
    }

    /** Returns true if field freeLobAtEnd is set (has been assigned a value) and false otherwise */
    public boolean isSetFreeLobAtEnd() {
      return EncodingUtils.testBit(__isset_bitfield, __FREELOBATEND_ISSET_ID);
    }

    public void setFreeLobAtEndIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FREELOBATEND_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public getBlobChunk_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public getBlobChunk_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case LOB_ID:
        if (value == null) {
          unsetLobId();
        } else {
          setLobId((Long)value);
        }
        break;

      case OFFSET:
        if (value == null) {
          unsetOffset();
        } else {
          setOffset((Long)value);
        }
        break;

      case SIZE:
        if (value == null) {
          unsetSize();
        } else {
          setSize((Integer)value);
        }
        break;

      case FREE_LOB_AT_END:
        if (value == null) {
          unsetFreeLobAtEnd();
        } else {
          setFreeLobAtEnd((Boolean)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case LOB_ID:
        return getLobId();

      case OFFSET:
        return getOffset();

      case SIZE:
        return getSize();

      case FREE_LOB_AT_END:
        return isFreeLobAtEnd();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case LOB_ID:
        return isSetLobId();
      case OFFSET:
        return isSetOffset();
      case SIZE:
        return isSetSize();
      case FREE_LOB_AT_END:
        return isSetFreeLobAtEnd();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBlobChunk_args)
        return this.equals((getBlobChunk_args)that);
      return false;
    }

    public boolean equals(getBlobChunk_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_lobId = true;
      boolean that_present_lobId = true;
      if (this_present_lobId || that_present_lobId) {
        if (!(this_present_lobId && that_present_lobId))
          return false;
        if (this.lobId != that.lobId)
          return false;
      }

      boolean this_present_offset = true;
      boolean that_present_offset = true;
      if (this_present_offset || that_present_offset) {
        if (!(this_present_offset && that_present_offset))
          return false;
        if (this.offset != that.offset)
          return false;
      }

      boolean this_present_size = true;
      boolean that_present_size = true;
      if (this_present_size || that_present_size) {
        if (!(this_present_size && that_present_size))
          return false;
        if (this.size != that.size)
          return false;
      }

      boolean this_present_freeLobAtEnd = true;
      boolean that_present_freeLobAtEnd = true;
      if (this_present_freeLobAtEnd || that_present_freeLobAtEnd) {
        if (!(this_present_freeLobAtEnd && that_present_freeLobAtEnd))
          return false;
        if (this.freeLobAtEnd != that.freeLobAtEnd)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_lobId = true;
      list.add(present_lobId);
      if (present_lobId)
        list.add(lobId);

      boolean present_offset = true;
      list.add(present_offset);
      if (present_offset)
        list.add(offset);

      boolean present_size = true;
      list.add(present_size);
      if (present_size)
        list.add(size);

      boolean present_freeLobAtEnd = true;
      list.add(present_freeLobAtEnd);
      if (present_freeLobAtEnd)
        list.add(freeLobAtEnd);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(getBlobChunk_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLobId()).compareTo(other.isSetLobId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLobId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lobId, other.lobId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOffset()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSize()).compareTo(other.isSetSize());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSize()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, other.size);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFreeLobAtEnd()).compareTo(other.isSetFreeLobAtEnd());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFreeLobAtEnd()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freeLobAtEnd, other.freeLobAtEnd);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBlobChunk_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("lobId:");
      sb.append(this.lobId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("offset:");
      sb.append(this.offset);
      first = false;
      if (!first) sb.append(", ");
      sb.append("size:");
      sb.append(this.size);
      first = false;
      if (!first) sb.append(", ");
      sb.append("freeLobAtEnd:");
      sb.append(this.freeLobAtEnd);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getBlobChunk_argsStandardSchemeFactory implements SchemeFactory {
      public getBlobChunk_argsStandardScheme getScheme() {
        return new getBlobChunk_argsStandardScheme();
      }
    }

    private static class getBlobChunk_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getBlobChunk_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // LOB_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.lobId = iprot.readI64();
                struct.setLobIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OFFSET
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.offset = iprot.readI64();
                struct.setOffsetIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SIZE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.size = iprot.readI32();
                struct.setSizeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // FREE_LOB_AT_END
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.freeLobAtEnd = iprot.readBool();
                struct.setFreeLobAtEndIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getBlobChunk_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(LOB_ID_FIELD_DESC);
        oprot.writeI64(struct.lobId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(OFFSET_FIELD_DESC);
        oprot.writeI64(struct.offset);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(SIZE_FIELD_DESC);
        oprot.writeI32(struct.size);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FREE_LOB_AT_END_FIELD_DESC);
        oprot.writeBool(struct.freeLobAtEnd);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getBlobChunk_argsTupleSchemeFactory implements SchemeFactory {
      public getBlobChunk_argsTupleScheme getScheme() {
        return new getBlobChunk_argsTupleScheme();
      }
    }

    private static class getBlobChunk_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getBlobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetLobId()) {
          optionals.set(1);
        }
        if (struct.isSetOffset()) {
          optionals.set(2);
        }
        if (struct.isSetSize()) {
          optionals.set(3);
        }
        if (struct.isSetFreeLobAtEnd()) {
          optionals.set(4);
        }
        if (struct.isSetToken()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetLobId()) {
          oprot.writeI64(struct.lobId);
        }
        if (struct.isSetOffset()) {
          oprot.writeI64(struct.offset);
        }
        if (struct.isSetSize()) {
          oprot.writeI32(struct.size);
        }
        if (struct.isSetFreeLobAtEnd()) {
          oprot.writeBool(struct.freeLobAtEnd);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getBlobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.lobId = iprot.readI64();
          struct.setLobIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.offset = iprot.readI64();
          struct.setOffsetIsSet(true);
        }
        if (incoming.get(3)) {
          struct.size = iprot.readI32();
          struct.setSizeIsSet(true);
        }
        if (incoming.get(4)) {
          struct.freeLobAtEnd = iprot.readBool();
          struct.setFreeLobAtEndIsSet(true);
        }
        if (incoming.get(5)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class getBlobChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBlobChunk_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getBlobChunk_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getBlobChunk_resultTupleSchemeFactory());
    }

    public BlobChunk success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BlobChunk.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBlobChunk_result.class, metaDataMap);
    }

    public getBlobChunk_result() {
    }

    public getBlobChunk_result(
      BlobChunk success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getBlobChunk_result(getBlobChunk_result other) {
      if (other.isSetSuccess()) {
        this.success = new BlobChunk(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getBlobChunk_result deepCopy() {
      return new getBlobChunk_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public BlobChunk getSuccess() {
      return this.success;
    }

    public getBlobChunk_result setSuccess(BlobChunk 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 SnappyException getError() {
      return this.error;
    }

    public getBlobChunk_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((BlobChunk)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBlobChunk_result)
        return this.equals((getBlobChunk_result)that);
      return false;
    }

    public boolean equals(getBlobChunk_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getBlobChunk_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBlobChunk_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getBlobChunk_resultStandardSchemeFactory implements SchemeFactory {
      public getBlobChunk_resultStandardScheme getScheme() {
        return new getBlobChunk_resultStandardScheme();
      }
    }

    private static class getBlobChunk_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getBlobChunk_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new BlobChunk();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getBlobChunk_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getBlobChunk_resultTupleSchemeFactory implements SchemeFactory {
      public getBlobChunk_resultTupleScheme getScheme() {
        return new getBlobChunk_resultTupleScheme();
      }
    }

    private static class getBlobChunk_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getBlobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getBlobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new BlobChunk();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getClobChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClobChunk_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField LOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("lobId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("size", org.apache.thrift.protocol.TType.I32, (short)4);
    private static final org.apache.thrift.protocol.TField FREE_LOB_AT_END_FIELD_DESC = new org.apache.thrift.protocol.TField("freeLobAtEnd", org.apache.thrift.protocol.TType.BOOL, (short)5);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)6);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getClobChunk_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getClobChunk_argsTupleSchemeFactory());
    }

    public long connId; // required
    public long lobId; // required
    public long offset; // required
    public int size; // required
    public boolean freeLobAtEnd; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      LOB_ID((short)2, "lobId"),
      OFFSET((short)3, "offset"),
      SIZE((short)4, "size"),
      FREE_LOB_AT_END((short)5, "freeLobAtEnd"),
      TOKEN((short)6, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // LOB_ID
            return LOB_ID;
          case 3: // OFFSET
            return OFFSET;
          case 4: // SIZE
            return SIZE;
          case 5: // FREE_LOB_AT_END
            return FREE_LOB_AT_END;
          case 6: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __LOBID_ISSET_ID = 1;
    private static final int __OFFSET_ISSET_ID = 2;
    private static final int __SIZE_ISSET_ID = 3;
    private static final int __FREELOBATEND_ISSET_ID = 4;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.LOB_ID, new org.apache.thrift.meta_data.FieldMetaData("lobId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.SIZE, new org.apache.thrift.meta_data.FieldMetaData("size", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.FREE_LOB_AT_END, new org.apache.thrift.meta_data.FieldMetaData("freeLobAtEnd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClobChunk_args.class, metaDataMap);
    }

    public getClobChunk_args() {
    }

    public getClobChunk_args(
      long connId,
      long lobId,
      long offset,
      int size,
      boolean freeLobAtEnd,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.lobId = lobId;
      setLobIdIsSet(true);
      this.offset = offset;
      setOffsetIsSet(true);
      this.size = size;
      setSizeIsSet(true);
      this.freeLobAtEnd = freeLobAtEnd;
      setFreeLobAtEndIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public getClobChunk_args(getClobChunk_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.lobId = other.lobId;
      this.offset = other.offset;
      this.size = other.size;
      this.freeLobAtEnd = other.freeLobAtEnd;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public getClobChunk_args deepCopy() {
      return new getClobChunk_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setLobIdIsSet(false);
      this.lobId = 0;
      setOffsetIsSet(false);
      this.offset = 0;
      setSizeIsSet(false);
      this.size = 0;
      setFreeLobAtEndIsSet(false);
      this.freeLobAtEnd = false;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public getClobChunk_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public long getLobId() {
      return this.lobId;
    }

    public getClobChunk_args setLobId(long lobId) {
      this.lobId = lobId;
      setLobIdIsSet(true);
      return this;
    }

    public void unsetLobId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    /** Returns true if field lobId is set (has been assigned a value) and false otherwise */
    public boolean isSetLobId() {
      return EncodingUtils.testBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    public void setLobIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOBID_ISSET_ID, value);
    }

    public long getOffset() {
      return this.offset;
    }

    public getClobChunk_args setOffset(long offset) {
      this.offset = offset;
      setOffsetIsSet(true);
      return this;
    }

    public void unsetOffset() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    /** Returns true if field offset is set (has been assigned a value) and false otherwise */
    public boolean isSetOffset() {
      return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    public void setOffsetIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
    }

    public int getSize() {
      return this.size;
    }

    public getClobChunk_args setSize(int size) {
      this.size = size;
      setSizeIsSet(true);
      return this;
    }

    public void unsetSize() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SIZE_ISSET_ID);
    }

    /** Returns true if field size is set (has been assigned a value) and false otherwise */
    public boolean isSetSize() {
      return EncodingUtils.testBit(__isset_bitfield, __SIZE_ISSET_ID);
    }

    public void setSizeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SIZE_ISSET_ID, value);
    }

    public boolean isFreeLobAtEnd() {
      return this.freeLobAtEnd;
    }

    public getClobChunk_args setFreeLobAtEnd(boolean freeLobAtEnd) {
      this.freeLobAtEnd = freeLobAtEnd;
      setFreeLobAtEndIsSet(true);
      return this;
    }

    public void unsetFreeLobAtEnd() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FREELOBATEND_ISSET_ID);
    }

    /** Returns true if field freeLobAtEnd is set (has been assigned a value) and false otherwise */
    public boolean isSetFreeLobAtEnd() {
      return EncodingUtils.testBit(__isset_bitfield, __FREELOBATEND_ISSET_ID);
    }

    public void setFreeLobAtEndIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FREELOBATEND_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public getClobChunk_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public getClobChunk_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case LOB_ID:
        if (value == null) {
          unsetLobId();
        } else {
          setLobId((Long)value);
        }
        break;

      case OFFSET:
        if (value == null) {
          unsetOffset();
        } else {
          setOffset((Long)value);
        }
        break;

      case SIZE:
        if (value == null) {
          unsetSize();
        } else {
          setSize((Integer)value);
        }
        break;

      case FREE_LOB_AT_END:
        if (value == null) {
          unsetFreeLobAtEnd();
        } else {
          setFreeLobAtEnd((Boolean)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case LOB_ID:
        return getLobId();

      case OFFSET:
        return getOffset();

      case SIZE:
        return getSize();

      case FREE_LOB_AT_END:
        return isFreeLobAtEnd();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case LOB_ID:
        return isSetLobId();
      case OFFSET:
        return isSetOffset();
      case SIZE:
        return isSetSize();
      case FREE_LOB_AT_END:
        return isSetFreeLobAtEnd();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getClobChunk_args)
        return this.equals((getClobChunk_args)that);
      return false;
    }

    public boolean equals(getClobChunk_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_lobId = true;
      boolean that_present_lobId = true;
      if (this_present_lobId || that_present_lobId) {
        if (!(this_present_lobId && that_present_lobId))
          return false;
        if (this.lobId != that.lobId)
          return false;
      }

      boolean this_present_offset = true;
      boolean that_present_offset = true;
      if (this_present_offset || that_present_offset) {
        if (!(this_present_offset && that_present_offset))
          return false;
        if (this.offset != that.offset)
          return false;
      }

      boolean this_present_size = true;
      boolean that_present_size = true;
      if (this_present_size || that_present_size) {
        if (!(this_present_size && that_present_size))
          return false;
        if (this.size != that.size)
          return false;
      }

      boolean this_present_freeLobAtEnd = true;
      boolean that_present_freeLobAtEnd = true;
      if (this_present_freeLobAtEnd || that_present_freeLobAtEnd) {
        if (!(this_present_freeLobAtEnd && that_present_freeLobAtEnd))
          return false;
        if (this.freeLobAtEnd != that.freeLobAtEnd)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_lobId = true;
      list.add(present_lobId);
      if (present_lobId)
        list.add(lobId);

      boolean present_offset = true;
      list.add(present_offset);
      if (present_offset)
        list.add(offset);

      boolean present_size = true;
      list.add(present_size);
      if (present_size)
        list.add(size);

      boolean present_freeLobAtEnd = true;
      list.add(present_freeLobAtEnd);
      if (present_freeLobAtEnd)
        list.add(freeLobAtEnd);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(getClobChunk_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLobId()).compareTo(other.isSetLobId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLobId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lobId, other.lobId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOffset()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSize()).compareTo(other.isSetSize());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSize()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.size, other.size);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFreeLobAtEnd()).compareTo(other.isSetFreeLobAtEnd());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFreeLobAtEnd()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freeLobAtEnd, other.freeLobAtEnd);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getClobChunk_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("lobId:");
      sb.append(this.lobId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("offset:");
      sb.append(this.offset);
      first = false;
      if (!first) sb.append(", ");
      sb.append("size:");
      sb.append(this.size);
      first = false;
      if (!first) sb.append(", ");
      sb.append("freeLobAtEnd:");
      sb.append(this.freeLobAtEnd);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getClobChunk_argsStandardSchemeFactory implements SchemeFactory {
      public getClobChunk_argsStandardScheme getScheme() {
        return new getClobChunk_argsStandardScheme();
      }
    }

    private static class getClobChunk_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getClobChunk_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // LOB_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.lobId = iprot.readI64();
                struct.setLobIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OFFSET
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.offset = iprot.readI64();
                struct.setOffsetIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SIZE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.size = iprot.readI32();
                struct.setSizeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // FREE_LOB_AT_END
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.freeLobAtEnd = iprot.readBool();
                struct.setFreeLobAtEndIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getClobChunk_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(LOB_ID_FIELD_DESC);
        oprot.writeI64(struct.lobId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(OFFSET_FIELD_DESC);
        oprot.writeI64(struct.offset);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(SIZE_FIELD_DESC);
        oprot.writeI32(struct.size);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FREE_LOB_AT_END_FIELD_DESC);
        oprot.writeBool(struct.freeLobAtEnd);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getClobChunk_argsTupleSchemeFactory implements SchemeFactory {
      public getClobChunk_argsTupleScheme getScheme() {
        return new getClobChunk_argsTupleScheme();
      }
    }

    private static class getClobChunk_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getClobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetLobId()) {
          optionals.set(1);
        }
        if (struct.isSetOffset()) {
          optionals.set(2);
        }
        if (struct.isSetSize()) {
          optionals.set(3);
        }
        if (struct.isSetFreeLobAtEnd()) {
          optionals.set(4);
        }
        if (struct.isSetToken()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetLobId()) {
          oprot.writeI64(struct.lobId);
        }
        if (struct.isSetOffset()) {
          oprot.writeI64(struct.offset);
        }
        if (struct.isSetSize()) {
          oprot.writeI32(struct.size);
        }
        if (struct.isSetFreeLobAtEnd()) {
          oprot.writeBool(struct.freeLobAtEnd);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getClobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.lobId = iprot.readI64();
          struct.setLobIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.offset = iprot.readI64();
          struct.setOffsetIsSet(true);
        }
        if (incoming.get(3)) {
          struct.size = iprot.readI32();
          struct.setSizeIsSet(true);
        }
        if (incoming.get(4)) {
          struct.freeLobAtEnd = iprot.readBool();
          struct.setFreeLobAtEndIsSet(true);
        }
        if (incoming.get(5)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class getClobChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClobChunk_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getClobChunk_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getClobChunk_resultTupleSchemeFactory());
    }

    public ClobChunk success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClobChunk.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClobChunk_result.class, metaDataMap);
    }

    public getClobChunk_result() {
    }

    public getClobChunk_result(
      ClobChunk success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getClobChunk_result(getClobChunk_result other) {
      if (other.isSetSuccess()) {
        this.success = new ClobChunk(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getClobChunk_result deepCopy() {
      return new getClobChunk_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public ClobChunk getSuccess() {
      return this.success;
    }

    public getClobChunk_result setSuccess(ClobChunk 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 SnappyException getError() {
      return this.error;
    }

    public getClobChunk_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ClobChunk)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getClobChunk_result)
        return this.equals((getClobChunk_result)that);
      return false;
    }

    public boolean equals(getClobChunk_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getClobChunk_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getClobChunk_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getClobChunk_resultStandardSchemeFactory implements SchemeFactory {
      public getClobChunk_resultStandardScheme getScheme() {
        return new getClobChunk_resultStandardScheme();
      }
    }

    private static class getClobChunk_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getClobChunk_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new ClobChunk();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getClobChunk_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getClobChunk_resultTupleSchemeFactory implements SchemeFactory {
      public getClobChunk_resultTupleScheme getScheme() {
        return new getClobChunk_resultTupleScheme();
      }
    }

    private static class getClobChunk_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getClobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getClobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new ClobChunk();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class sendBlobChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendBlobChunk_args");

    private static final org.apache.thrift.protocol.TField CHUNK_FIELD_DESC = new org.apache.thrift.protocol.TField("chunk", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendBlobChunk_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendBlobChunk_argsTupleSchemeFactory());
    }

    public BlobChunk chunk; // required
    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CHUNK((short)1, "chunk"),
      CONN_ID((short)2, "connId"),
      TOKEN((short)3, "token");

      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: // CHUNK
            return CHUNK;
          case 2: // CONN_ID
            return CONN_ID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CHUNK, new org.apache.thrift.meta_data.FieldMetaData("chunk", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BlobChunk.class)));
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendBlobChunk_args.class, metaDataMap);
    }

    public sendBlobChunk_args() {
    }

    public sendBlobChunk_args(
      BlobChunk chunk,
      long connId,
      ByteBuffer token)
    {
      this();
      this.chunk = chunk;
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public sendBlobChunk_args(sendBlobChunk_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetChunk()) {
        this.chunk = new BlobChunk(other.chunk);
      }
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public sendBlobChunk_args deepCopy() {
      return new sendBlobChunk_args(this);
    }

    @Override
    public void clear() {
      this.chunk = null;
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public BlobChunk getChunk() {
      return this.chunk;
    }

    public sendBlobChunk_args setChunk(BlobChunk chunk) {
      this.chunk = chunk;
      return this;
    }

    public void unsetChunk() {
      this.chunk = null;
    }

    /** Returns true if field chunk is set (has been assigned a value) and false otherwise */
    public boolean isSetChunk() {
      return this.chunk != null;
    }

    public void setChunkIsSet(boolean value) {
      if (!value) {
        this.chunk = null;
      }
    }

    public long getConnId() {
      return this.connId;
    }

    public sendBlobChunk_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public sendBlobChunk_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public sendBlobChunk_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CHUNK:
        if (value == null) {
          unsetChunk();
        } else {
          setChunk((BlobChunk)value);
        }
        break;

      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CHUNK:
        return getChunk();

      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CHUNK:
        return isSetChunk();
      case CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendBlobChunk_args)
        return this.equals((sendBlobChunk_args)that);
      return false;
    }

    public boolean equals(sendBlobChunk_args that) {
      if (that == null)
        return false;

      boolean this_present_chunk = true && this.isSetChunk();
      boolean that_present_chunk = true && that.isSetChunk();
      if (this_present_chunk || that_present_chunk) {
        if (!(this_present_chunk && that_present_chunk))
          return false;
        if (!this.chunk.equals(that.chunk))
          return false;
      }

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_chunk = true && (isSetChunk());
      list.add(present_chunk);
      if (present_chunk)
        list.add(chunk);

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(sendBlobChunk_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetChunk()).compareTo(other.isSetChunk());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetChunk()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chunk, other.chunk);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendBlobChunk_args(");
      boolean first = true;

      sb.append("chunk:");
      if (this.chunk == null) {
        sb.append("null");
      } else {
        sb.append(this.chunk);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (chunk != null) {
        chunk.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendBlobChunk_argsStandardSchemeFactory implements SchemeFactory {
      public sendBlobChunk_argsStandardScheme getScheme() {
        return new sendBlobChunk_argsStandardScheme();
      }
    }

    private static class sendBlobChunk_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendBlobChunk_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CHUNK
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.chunk = new BlobChunk();
                struct.chunk.read(iprot);
                struct.setChunkIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendBlobChunk_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.chunk != null) {
          oprot.writeFieldBegin(CHUNK_FIELD_DESC);
          struct.chunk.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendBlobChunk_argsTupleSchemeFactory implements SchemeFactory {
      public sendBlobChunk_argsTupleScheme getScheme() {
        return new sendBlobChunk_argsTupleScheme();
      }
    }

    private static class sendBlobChunk_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendBlobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetChunk()) {
          optionals.set(0);
        }
        if (struct.isSetConnId()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetChunk()) {
          struct.chunk.write(oprot);
        }
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendBlobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.chunk = new BlobChunk();
          struct.chunk.read(iprot);
          struct.setChunkIsSet(true);
        }
        if (incoming.get(1)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class sendBlobChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendBlobChunk_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendBlobChunk_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendBlobChunk_resultTupleSchemeFactory());
    }

    public long success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendBlobChunk_result.class, metaDataMap);
    }

    public sendBlobChunk_result() {
    }

    public sendBlobChunk_result(
      long success,
      SnappyException error)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public sendBlobChunk_result(sendBlobChunk_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public sendBlobChunk_result deepCopy() {
      return new sendBlobChunk_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.error = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public sendBlobChunk_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public SnappyException getError() {
      return this.error;
    }

    public sendBlobChunk_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendBlobChunk_result)
        return this.equals((sendBlobChunk_result)that);
      return false;
    }

    public boolean equals(sendBlobChunk_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(sendBlobChunk_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendBlobChunk_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendBlobChunk_resultStandardSchemeFactory implements SchemeFactory {
      public sendBlobChunk_resultStandardScheme getScheme() {
        return new sendBlobChunk_resultStandardScheme();
      }
    }

    private static class sendBlobChunk_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendBlobChunk_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.success = iprot.readI64();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendBlobChunk_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeI64(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendBlobChunk_resultTupleSchemeFactory implements SchemeFactory {
      public sendBlobChunk_resultTupleScheme getScheme() {
        return new sendBlobChunk_resultTupleScheme();
      }
    }

    private static class sendBlobChunk_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendBlobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeI64(struct.success);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendBlobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class sendClobChunk_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendClobChunk_args");

    private static final org.apache.thrift.protocol.TField CHUNK_FIELD_DESC = new org.apache.thrift.protocol.TField("chunk", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendClobChunk_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendClobChunk_argsTupleSchemeFactory());
    }

    public ClobChunk chunk; // required
    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CHUNK((short)1, "chunk"),
      CONN_ID((short)2, "connId"),
      TOKEN((short)3, "token");

      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: // CHUNK
            return CHUNK;
          case 2: // CONN_ID
            return CONN_ID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CHUNK, new org.apache.thrift.meta_data.FieldMetaData("chunk", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClobChunk.class)));
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendClobChunk_args.class, metaDataMap);
    }

    public sendClobChunk_args() {
    }

    public sendClobChunk_args(
      ClobChunk chunk,
      long connId,
      ByteBuffer token)
    {
      this();
      this.chunk = chunk;
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public sendClobChunk_args(sendClobChunk_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetChunk()) {
        this.chunk = new ClobChunk(other.chunk);
      }
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public sendClobChunk_args deepCopy() {
      return new sendClobChunk_args(this);
    }

    @Override
    public void clear() {
      this.chunk = null;
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public ClobChunk getChunk() {
      return this.chunk;
    }

    public sendClobChunk_args setChunk(ClobChunk chunk) {
      this.chunk = chunk;
      return this;
    }

    public void unsetChunk() {
      this.chunk = null;
    }

    /** Returns true if field chunk is set (has been assigned a value) and false otherwise */
    public boolean isSetChunk() {
      return this.chunk != null;
    }

    public void setChunkIsSet(boolean value) {
      if (!value) {
        this.chunk = null;
      }
    }

    public long getConnId() {
      return this.connId;
    }

    public sendClobChunk_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public sendClobChunk_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public sendClobChunk_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CHUNK:
        if (value == null) {
          unsetChunk();
        } else {
          setChunk((ClobChunk)value);
        }
        break;

      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CHUNK:
        return getChunk();

      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CHUNK:
        return isSetChunk();
      case CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendClobChunk_args)
        return this.equals((sendClobChunk_args)that);
      return false;
    }

    public boolean equals(sendClobChunk_args that) {
      if (that == null)
        return false;

      boolean this_present_chunk = true && this.isSetChunk();
      boolean that_present_chunk = true && that.isSetChunk();
      if (this_present_chunk || that_present_chunk) {
        if (!(this_present_chunk && that_present_chunk))
          return false;
        if (!this.chunk.equals(that.chunk))
          return false;
      }

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_chunk = true && (isSetChunk());
      list.add(present_chunk);
      if (present_chunk)
        list.add(chunk);

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(sendClobChunk_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetChunk()).compareTo(other.isSetChunk());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetChunk()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chunk, other.chunk);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendClobChunk_args(");
      boolean first = true;

      sb.append("chunk:");
      if (this.chunk == null) {
        sb.append("null");
      } else {
        sb.append(this.chunk);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (chunk != null) {
        chunk.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendClobChunk_argsStandardSchemeFactory implements SchemeFactory {
      public sendClobChunk_argsStandardScheme getScheme() {
        return new sendClobChunk_argsStandardScheme();
      }
    }

    private static class sendClobChunk_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendClobChunk_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CHUNK
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.chunk = new ClobChunk();
                struct.chunk.read(iprot);
                struct.setChunkIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendClobChunk_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.chunk != null) {
          oprot.writeFieldBegin(CHUNK_FIELD_DESC);
          struct.chunk.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendClobChunk_argsTupleSchemeFactory implements SchemeFactory {
      public sendClobChunk_argsTupleScheme getScheme() {
        return new sendClobChunk_argsTupleScheme();
      }
    }

    private static class sendClobChunk_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendClobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetChunk()) {
          optionals.set(0);
        }
        if (struct.isSetConnId()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetChunk()) {
          struct.chunk.write(oprot);
        }
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendClobChunk_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.chunk = new ClobChunk();
          struct.chunk.read(iprot);
          struct.setChunkIsSet(true);
        }
        if (incoming.get(1)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class sendClobChunk_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendClobChunk_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new sendClobChunk_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new sendClobChunk_resultTupleSchemeFactory());
    }

    public long success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendClobChunk_result.class, metaDataMap);
    }

    public sendClobChunk_result() {
    }

    public sendClobChunk_result(
      long success,
      SnappyException error)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public sendClobChunk_result(sendClobChunk_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public sendClobChunk_result deepCopy() {
      return new sendClobChunk_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.error = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public sendClobChunk_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public SnappyException getError() {
      return this.error;
    }

    public sendClobChunk_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof sendClobChunk_result)
        return this.equals((sendClobChunk_result)that);
      return false;
    }

    public boolean equals(sendClobChunk_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(sendClobChunk_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("sendClobChunk_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class sendClobChunk_resultStandardSchemeFactory implements SchemeFactory {
      public sendClobChunk_resultStandardScheme getScheme() {
        return new sendClobChunk_resultStandardScheme();
      }
    }

    private static class sendClobChunk_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, sendClobChunk_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.success = iprot.readI64();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, sendClobChunk_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeI64(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class sendClobChunk_resultTupleSchemeFactory implements SchemeFactory {
      public sendClobChunk_resultTupleScheme getScheme() {
        return new sendClobChunk_resultTupleScheme();
      }
    }

    private static class sendClobChunk_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, sendClobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeI64(struct.success);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, sendClobChunk_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class freeLob_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("freeLob_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField LOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("lobId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new freeLob_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new freeLob_argsTupleSchemeFactory());
    }

    public long connId; // required
    public long lobId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      LOB_ID((short)2, "lobId"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // LOB_ID
            return LOB_ID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __LOBID_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.LOB_ID, new org.apache.thrift.meta_data.FieldMetaData("lobId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(freeLob_args.class, metaDataMap);
    }

    public freeLob_args() {
    }

    public freeLob_args(
      long connId,
      long lobId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.lobId = lobId;
      setLobIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public freeLob_args(freeLob_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.lobId = other.lobId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public freeLob_args deepCopy() {
      return new freeLob_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setLobIdIsSet(false);
      this.lobId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public freeLob_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public long getLobId() {
      return this.lobId;
    }

    public freeLob_args setLobId(long lobId) {
      this.lobId = lobId;
      setLobIdIsSet(true);
      return this;
    }

    public void unsetLobId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    /** Returns true if field lobId is set (has been assigned a value) and false otherwise */
    public boolean isSetLobId() {
      return EncodingUtils.testBit(__isset_bitfield, __LOBID_ISSET_ID);
    }

    public void setLobIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LOBID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public freeLob_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public freeLob_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case LOB_ID:
        if (value == null) {
          unsetLobId();
        } else {
          setLobId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case LOB_ID:
        return getLobId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case LOB_ID:
        return isSetLobId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof freeLob_args)
        return this.equals((freeLob_args)that);
      return false;
    }

    public boolean equals(freeLob_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_lobId = true;
      boolean that_present_lobId = true;
      if (this_present_lobId || that_present_lobId) {
        if (!(this_present_lobId && that_present_lobId))
          return false;
        if (this.lobId != that.lobId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_lobId = true;
      list.add(present_lobId);
      if (present_lobId)
        list.add(lobId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(freeLob_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetLobId()).compareTo(other.isSetLobId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLobId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lobId, other.lobId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("freeLob_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("lobId:");
      sb.append(this.lobId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class freeLob_argsStandardSchemeFactory implements SchemeFactory {
      public freeLob_argsStandardScheme getScheme() {
        return new freeLob_argsStandardScheme();
      }
    }

    private static class freeLob_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, freeLob_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // LOB_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.lobId = iprot.readI64();
                struct.setLobIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, freeLob_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(LOB_ID_FIELD_DESC);
        oprot.writeI64(struct.lobId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class freeLob_argsTupleSchemeFactory implements SchemeFactory {
      public freeLob_argsTupleScheme getScheme() {
        return new freeLob_argsTupleScheme();
      }
    }

    private static class freeLob_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, freeLob_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetLobId()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetLobId()) {
          oprot.writeI64(struct.lobId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, freeLob_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.lobId = iprot.readI64();
          struct.setLobIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class freeLob_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("freeLob_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new freeLob_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new freeLob_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(freeLob_result.class, metaDataMap);
    }

    public freeLob_result() {
    }

    public freeLob_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public freeLob_result(freeLob_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public freeLob_result deepCopy() {
      return new freeLob_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public freeLob_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof freeLob_result)
        return this.equals((freeLob_result)that);
      return false;
    }

    public boolean equals(freeLob_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(freeLob_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("freeLob_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class freeLob_resultStandardSchemeFactory implements SchemeFactory {
      public freeLob_resultStandardScheme getScheme() {
        return new freeLob_resultStandardScheme();
      }
    }

    private static class freeLob_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, freeLob_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, freeLob_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class freeLob_resultTupleSchemeFactory implements SchemeFactory {
      public freeLob_resultTupleScheme getScheme() {
        return new freeLob_resultTupleScheme();
      }
    }

    private static class freeLob_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, freeLob_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, freeLob_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class scrollCursor_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scrollCursor_args");

    private static final org.apache.thrift.protocol.TField CURSOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cursorId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("offset", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField OFFSET_IS_ABSOLUTE_FIELD_DESC = new org.apache.thrift.protocol.TField("offsetIsAbsolute", org.apache.thrift.protocol.TType.BOOL, (short)3);
    private static final org.apache.thrift.protocol.TField FETCH_REVERSE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchReverse", org.apache.thrift.protocol.TType.BOOL, (short)4);
    private static final org.apache.thrift.protocol.TField FETCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchSize", org.apache.thrift.protocol.TType.I32, (short)5);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)6);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new scrollCursor_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new scrollCursor_argsTupleSchemeFactory());
    }

    public long cursorId; // required
    public int offset; // required
    public boolean offsetIsAbsolute; // required
    public boolean fetchReverse; // required
    public int fetchSize; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CURSOR_ID((short)1, "cursorId"),
      OFFSET((short)2, "offset"),
      OFFSET_IS_ABSOLUTE((short)3, "offsetIsAbsolute"),
      FETCH_REVERSE((short)4, "fetchReverse"),
      FETCH_SIZE((short)5, "fetchSize"),
      TOKEN((short)6, "token");

      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: // CURSOR_ID
            return CURSOR_ID;
          case 2: // OFFSET
            return OFFSET;
          case 3: // OFFSET_IS_ABSOLUTE
            return OFFSET_IS_ABSOLUTE;
          case 4: // FETCH_REVERSE
            return FETCH_REVERSE;
          case 5: // FETCH_SIZE
            return FETCH_SIZE;
          case 6: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CURSORID_ISSET_ID = 0;
    private static final int __OFFSET_ISSET_ID = 1;
    private static final int __OFFSETISABSOLUTE_ISSET_ID = 2;
    private static final int __FETCHREVERSE_ISSET_ID = 3;
    private static final int __FETCHSIZE_ISSET_ID = 4;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CURSOR_ID, new org.apache.thrift.meta_data.FieldMetaData("cursorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.OFFSET, new org.apache.thrift.meta_data.FieldMetaData("offset", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.OFFSET_IS_ABSOLUTE, new org.apache.thrift.meta_data.FieldMetaData("offsetIsAbsolute", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.FETCH_REVERSE, new org.apache.thrift.meta_data.FieldMetaData("fetchReverse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.FETCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("fetchSize", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scrollCursor_args.class, metaDataMap);
    }

    public scrollCursor_args() {
    }

    public scrollCursor_args(
      long cursorId,
      int offset,
      boolean offsetIsAbsolute,
      boolean fetchReverse,
      int fetchSize,
      ByteBuffer token)
    {
      this();
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      this.offset = offset;
      setOffsetIsSet(true);
      this.offsetIsAbsolute = offsetIsAbsolute;
      setOffsetIsAbsoluteIsSet(true);
      this.fetchReverse = fetchReverse;
      setFetchReverseIsSet(true);
      this.fetchSize = fetchSize;
      setFetchSizeIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public scrollCursor_args(scrollCursor_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.cursorId = other.cursorId;
      this.offset = other.offset;
      this.offsetIsAbsolute = other.offsetIsAbsolute;
      this.fetchReverse = other.fetchReverse;
      this.fetchSize = other.fetchSize;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public scrollCursor_args deepCopy() {
      return new scrollCursor_args(this);
    }

    @Override
    public void clear() {
      setCursorIdIsSet(false);
      this.cursorId = 0;
      setOffsetIsSet(false);
      this.offset = 0;
      setOffsetIsAbsoluteIsSet(false);
      this.offsetIsAbsolute = false;
      setFetchReverseIsSet(false);
      this.fetchReverse = false;
      setFetchSizeIsSet(false);
      this.fetchSize = 0;
      this.token = null;
    }

    public long getCursorId() {
      return this.cursorId;
    }

    public scrollCursor_args setCursorId(long cursorId) {
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      return this;
    }

    public void unsetCursorId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    /** Returns true if field cursorId is set (has been assigned a value) and false otherwise */
    public boolean isSetCursorId() {
      return EncodingUtils.testBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    public void setCursorIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CURSORID_ISSET_ID, value);
    }

    public int getOffset() {
      return this.offset;
    }

    public scrollCursor_args setOffset(int offset) {
      this.offset = offset;
      setOffsetIsSet(true);
      return this;
    }

    public void unsetOffset() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    /** Returns true if field offset is set (has been assigned a value) and false otherwise */
    public boolean isSetOffset() {
      return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID);
    }

    public void setOffsetIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value);
    }

    public boolean isOffsetIsAbsolute() {
      return this.offsetIsAbsolute;
    }

    public scrollCursor_args setOffsetIsAbsolute(boolean offsetIsAbsolute) {
      this.offsetIsAbsolute = offsetIsAbsolute;
      setOffsetIsAbsoluteIsSet(true);
      return this;
    }

    public void unsetOffsetIsAbsolute() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSETISABSOLUTE_ISSET_ID);
    }

    /** Returns true if field offsetIsAbsolute is set (has been assigned a value) and false otherwise */
    public boolean isSetOffsetIsAbsolute() {
      return EncodingUtils.testBit(__isset_bitfield, __OFFSETISABSOLUTE_ISSET_ID);
    }

    public void setOffsetIsAbsoluteIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSETISABSOLUTE_ISSET_ID, value);
    }

    public boolean isFetchReverse() {
      return this.fetchReverse;
    }

    public scrollCursor_args setFetchReverse(boolean fetchReverse) {
      this.fetchReverse = fetchReverse;
      setFetchReverseIsSet(true);
      return this;
    }

    public void unsetFetchReverse() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHREVERSE_ISSET_ID);
    }

    /** Returns true if field fetchReverse is set (has been assigned a value) and false otherwise */
    public boolean isSetFetchReverse() {
      return EncodingUtils.testBit(__isset_bitfield, __FETCHREVERSE_ISSET_ID);
    }

    public void setFetchReverseIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHREVERSE_ISSET_ID, value);
    }

    public int getFetchSize() {
      return this.fetchSize;
    }

    public scrollCursor_args setFetchSize(int fetchSize) {
      this.fetchSize = fetchSize;
      setFetchSizeIsSet(true);
      return this;
    }

    public void unsetFetchSize() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHSIZE_ISSET_ID);
    }

    /** Returns true if field fetchSize is set (has been assigned a value) and false otherwise */
    public boolean isSetFetchSize() {
      return EncodingUtils.testBit(__isset_bitfield, __FETCHSIZE_ISSET_ID);
    }

    public void setFetchSizeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHSIZE_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public scrollCursor_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public scrollCursor_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CURSOR_ID:
        if (value == null) {
          unsetCursorId();
        } else {
          setCursorId((Long)value);
        }
        break;

      case OFFSET:
        if (value == null) {
          unsetOffset();
        } else {
          setOffset((Integer)value);
        }
        break;

      case OFFSET_IS_ABSOLUTE:
        if (value == null) {
          unsetOffsetIsAbsolute();
        } else {
          setOffsetIsAbsolute((Boolean)value);
        }
        break;

      case FETCH_REVERSE:
        if (value == null) {
          unsetFetchReverse();
        } else {
          setFetchReverse((Boolean)value);
        }
        break;

      case FETCH_SIZE:
        if (value == null) {
          unsetFetchSize();
        } else {
          setFetchSize((Integer)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CURSOR_ID:
        return getCursorId();

      case OFFSET:
        return getOffset();

      case OFFSET_IS_ABSOLUTE:
        return isOffsetIsAbsolute();

      case FETCH_REVERSE:
        return isFetchReverse();

      case FETCH_SIZE:
        return getFetchSize();

      case TOKEN:
        return getToken();

      }
      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 CURSOR_ID:
        return isSetCursorId();
      case OFFSET:
        return isSetOffset();
      case OFFSET_IS_ABSOLUTE:
        return isSetOffsetIsAbsolute();
      case FETCH_REVERSE:
        return isSetFetchReverse();
      case FETCH_SIZE:
        return isSetFetchSize();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scrollCursor_args)
        return this.equals((scrollCursor_args)that);
      return false;
    }

    public boolean equals(scrollCursor_args that) {
      if (that == null)
        return false;

      boolean this_present_cursorId = true;
      boolean that_present_cursorId = true;
      if (this_present_cursorId || that_present_cursorId) {
        if (!(this_present_cursorId && that_present_cursorId))
          return false;
        if (this.cursorId != that.cursorId)
          return false;
      }

      boolean this_present_offset = true;
      boolean that_present_offset = true;
      if (this_present_offset || that_present_offset) {
        if (!(this_present_offset && that_present_offset))
          return false;
        if (this.offset != that.offset)
          return false;
      }

      boolean this_present_offsetIsAbsolute = true;
      boolean that_present_offsetIsAbsolute = true;
      if (this_present_offsetIsAbsolute || that_present_offsetIsAbsolute) {
        if (!(this_present_offsetIsAbsolute && that_present_offsetIsAbsolute))
          return false;
        if (this.offsetIsAbsolute != that.offsetIsAbsolute)
          return false;
      }

      boolean this_present_fetchReverse = true;
      boolean that_present_fetchReverse = true;
      if (this_present_fetchReverse || that_present_fetchReverse) {
        if (!(this_present_fetchReverse && that_present_fetchReverse))
          return false;
        if (this.fetchReverse != that.fetchReverse)
          return false;
      }

      boolean this_present_fetchSize = true;
      boolean that_present_fetchSize = true;
      if (this_present_fetchSize || that_present_fetchSize) {
        if (!(this_present_fetchSize && that_present_fetchSize))
          return false;
        if (this.fetchSize != that.fetchSize)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_cursorId = true;
      list.add(present_cursorId);
      if (present_cursorId)
        list.add(cursorId);

      boolean present_offset = true;
      list.add(present_offset);
      if (present_offset)
        list.add(offset);

      boolean present_offsetIsAbsolute = true;
      list.add(present_offsetIsAbsolute);
      if (present_offsetIsAbsolute)
        list.add(offsetIsAbsolute);

      boolean present_fetchReverse = true;
      list.add(present_fetchReverse);
      if (present_fetchReverse)
        list.add(fetchReverse);

      boolean present_fetchSize = true;
      list.add(present_fetchSize);
      if (present_fetchSize)
        list.add(fetchSize);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(scrollCursor_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCursorId()).compareTo(other.isSetCursorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCursorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cursorId, other.cursorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOffset()).compareTo(other.isSetOffset());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOffset()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOffsetIsAbsolute()).compareTo(other.isSetOffsetIsAbsolute());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOffsetIsAbsolute()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offsetIsAbsolute, other.offsetIsAbsolute);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFetchReverse()).compareTo(other.isSetFetchReverse());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFetchReverse()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchReverse, other.fetchReverse);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFetchSize()).compareTo(other.isSetFetchSize());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFetchSize()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchSize, other.fetchSize);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scrollCursor_args(");
      boolean first = true;

      sb.append("cursorId:");
      sb.append(this.cursorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("offset:");
      sb.append(this.offset);
      first = false;
      if (!first) sb.append(", ");
      sb.append("offsetIsAbsolute:");
      sb.append(this.offsetIsAbsolute);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fetchReverse:");
      sb.append(this.fetchReverse);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fetchSize:");
      sb.append(this.fetchSize);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class scrollCursor_argsStandardSchemeFactory implements SchemeFactory {
      public scrollCursor_argsStandardScheme getScheme() {
        return new scrollCursor_argsStandardScheme();
      }
    }

    private static class scrollCursor_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, scrollCursor_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CURSOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.cursorId = iprot.readI64();
                struct.setCursorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // OFFSET
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.offset = iprot.readI32();
                struct.setOffsetIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // OFFSET_IS_ABSOLUTE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.offsetIsAbsolute = iprot.readBool();
                struct.setOffsetIsAbsoluteIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // FETCH_REVERSE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.fetchReverse = iprot.readBool();
                struct.setFetchReverseIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // FETCH_SIZE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.fetchSize = iprot.readI32();
                struct.setFetchSizeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, scrollCursor_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CURSOR_ID_FIELD_DESC);
        oprot.writeI64(struct.cursorId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(OFFSET_FIELD_DESC);
        oprot.writeI32(struct.offset);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(OFFSET_IS_ABSOLUTE_FIELD_DESC);
        oprot.writeBool(struct.offsetIsAbsolute);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FETCH_REVERSE_FIELD_DESC);
        oprot.writeBool(struct.fetchReverse);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FETCH_SIZE_FIELD_DESC);
        oprot.writeI32(struct.fetchSize);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class scrollCursor_argsTupleSchemeFactory implements SchemeFactory {
      public scrollCursor_argsTupleScheme getScheme() {
        return new scrollCursor_argsTupleScheme();
      }
    }

    private static class scrollCursor_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, scrollCursor_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCursorId()) {
          optionals.set(0);
        }
        if (struct.isSetOffset()) {
          optionals.set(1);
        }
        if (struct.isSetOffsetIsAbsolute()) {
          optionals.set(2);
        }
        if (struct.isSetFetchReverse()) {
          optionals.set(3);
        }
        if (struct.isSetFetchSize()) {
          optionals.set(4);
        }
        if (struct.isSetToken()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetCursorId()) {
          oprot.writeI64(struct.cursorId);
        }
        if (struct.isSetOffset()) {
          oprot.writeI32(struct.offset);
        }
        if (struct.isSetOffsetIsAbsolute()) {
          oprot.writeBool(struct.offsetIsAbsolute);
        }
        if (struct.isSetFetchReverse()) {
          oprot.writeBool(struct.fetchReverse);
        }
        if (struct.isSetFetchSize()) {
          oprot.writeI32(struct.fetchSize);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, scrollCursor_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.cursorId = iprot.readI64();
          struct.setCursorIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.offset = iprot.readI32();
          struct.setOffsetIsSet(true);
        }
        if (incoming.get(2)) {
          struct.offsetIsAbsolute = iprot.readBool();
          struct.setOffsetIsAbsoluteIsSet(true);
        }
        if (incoming.get(3)) {
          struct.fetchReverse = iprot.readBool();
          struct.setFetchReverseIsSet(true);
        }
        if (incoming.get(4)) {
          struct.fetchSize = iprot.readI32();
          struct.setFetchSizeIsSet(true);
        }
        if (incoming.get(5)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class scrollCursor_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("scrollCursor_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new scrollCursor_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new scrollCursor_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(scrollCursor_result.class, metaDataMap);
    }

    public scrollCursor_result() {
    }

    public scrollCursor_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public scrollCursor_result(scrollCursor_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public scrollCursor_result deepCopy() {
      return new scrollCursor_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public scrollCursor_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public scrollCursor_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof scrollCursor_result)
        return this.equals((scrollCursor_result)that);
      return false;
    }

    public boolean equals(scrollCursor_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(scrollCursor_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("scrollCursor_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class scrollCursor_resultStandardSchemeFactory implements SchemeFactory {
      public scrollCursor_resultStandardScheme getScheme() {
        return new scrollCursor_resultStandardScheme();
      }
    }

    private static class scrollCursor_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, scrollCursor_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, scrollCursor_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class scrollCursor_resultTupleSchemeFactory implements SchemeFactory {
      public scrollCursor_resultTupleScheme getScheme() {
        return new scrollCursor_resultTupleScheme();
      }
    }

    private static class scrollCursor_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, scrollCursor_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, scrollCursor_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class executeCursorUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeCursorUpdate_args");

    private static final org.apache.thrift.protocol.TField CURSOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cursorId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField OPERATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("operations", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField CHANGED_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("changedRows", org.apache.thrift.protocol.TType.LIST, (short)3);
    private static final org.apache.thrift.protocol.TField CHANGED_COLUMNS_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("changedColumnsList", org.apache.thrift.protocol.TType.LIST, (short)4);
    private static final org.apache.thrift.protocol.TField CHANGED_ROW_INDEXES_FIELD_DESC = new org.apache.thrift.protocol.TField("changedRowIndexes", org.apache.thrift.protocol.TType.LIST, (short)5);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)6);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeCursorUpdate_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeCursorUpdate_argsTupleSchemeFactory());
    }

    public long cursorId; // required
    public List operations; // required
    public List changedRows; // required
    public List> changedColumnsList; // required
    public List changedRowIndexes; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CURSOR_ID((short)1, "cursorId"),
      OPERATIONS((short)2, "operations"),
      CHANGED_ROWS((short)3, "changedRows"),
      CHANGED_COLUMNS_LIST((short)4, "changedColumnsList"),
      CHANGED_ROW_INDEXES((short)5, "changedRowIndexes"),
      TOKEN((short)6, "token");

      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: // CURSOR_ID
            return CURSOR_ID;
          case 2: // OPERATIONS
            return OPERATIONS;
          case 3: // CHANGED_ROWS
            return CHANGED_ROWS;
          case 4: // CHANGED_COLUMNS_LIST
            return CHANGED_COLUMNS_LIST;
          case 5: // CHANGED_ROW_INDEXES
            return CHANGED_ROW_INDEXES;
          case 6: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CURSORID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CURSOR_ID, new org.apache.thrift.meta_data.FieldMetaData("cursorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.OPERATIONS, new org.apache.thrift.meta_data.FieldMetaData("operations", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CursorUpdateOperation.class))));
      tmpMap.put(_Fields.CHANGED_ROWS, new org.apache.thrift.meta_data.FieldMetaData("changedRows", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Row.class))));
      tmpMap.put(_Fields.CHANGED_COLUMNS_LIST, new org.apache.thrift.meta_data.FieldMetaData("changedColumnsList", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
                  new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))));
      tmpMap.put(_Fields.CHANGED_ROW_INDEXES, new org.apache.thrift.meta_data.FieldMetaData("changedRowIndexes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeCursorUpdate_args.class, metaDataMap);
    }

    public executeCursorUpdate_args() {
    }

    public executeCursorUpdate_args(
      long cursorId,
      List operations,
      List changedRows,
      List> changedColumnsList,
      List changedRowIndexes,
      ByteBuffer token)
    {
      this();
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      this.operations = operations;
      this.changedRows = changedRows;
      this.changedColumnsList = changedColumnsList;
      this.changedRowIndexes = changedRowIndexes;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public executeCursorUpdate_args(executeCursorUpdate_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.cursorId = other.cursorId;
      if (other.isSetOperations()) {
        List __this__operations = new ArrayList(other.operations.size());
        for (CursorUpdateOperation other_element : other.operations) {
          __this__operations.add(other_element);
        }
        this.operations = __this__operations;
      }
      if (other.isSetChangedRows()) {
        List __this__changedRows = new ArrayList(other.changedRows.size());
        for (Row other_element : other.changedRows) {
          __this__changedRows.add(new Row(other_element));
        }
        this.changedRows = __this__changedRows;
      }
      if (other.isSetChangedColumnsList()) {
        List> __this__changedColumnsList = new ArrayList>(other.changedColumnsList.size());
        for (List other_element : other.changedColumnsList) {
          List __this__changedColumnsList_copy = new ArrayList(other_element);
          __this__changedColumnsList.add(__this__changedColumnsList_copy);
        }
        this.changedColumnsList = __this__changedColumnsList;
      }
      if (other.isSetChangedRowIndexes()) {
        List __this__changedRowIndexes = new ArrayList(other.changedRowIndexes);
        this.changedRowIndexes = __this__changedRowIndexes;
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public executeCursorUpdate_args deepCopy() {
      return new executeCursorUpdate_args(this);
    }

    @Override
    public void clear() {
      setCursorIdIsSet(false);
      this.cursorId = 0;
      this.operations = null;
      this.changedRows = null;
      this.changedColumnsList = null;
      this.changedRowIndexes = null;
      this.token = null;
    }

    public long getCursorId() {
      return this.cursorId;
    }

    public executeCursorUpdate_args setCursorId(long cursorId) {
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      return this;
    }

    public void unsetCursorId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    /** Returns true if field cursorId is set (has been assigned a value) and false otherwise */
    public boolean isSetCursorId() {
      return EncodingUtils.testBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    public void setCursorIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CURSORID_ISSET_ID, value);
    }

    public int getOperationsSize() {
      return (this.operations == null) ? 0 : this.operations.size();
    }

    public java.util.Iterator getOperationsIterator() {
      return (this.operations == null) ? null : this.operations.iterator();
    }

    public void addToOperations(CursorUpdateOperation elem) {
      if (this.operations == null) {
        this.operations = new ArrayList();
      }
      this.operations.add(elem);
    }

    public List getOperations() {
      return this.operations;
    }

    public executeCursorUpdate_args setOperations(List operations) {
      this.operations = operations;
      return this;
    }

    public void unsetOperations() {
      this.operations = null;
    }

    /** Returns true if field operations is set (has been assigned a value) and false otherwise */
    public boolean isSetOperations() {
      return this.operations != null;
    }

    public void setOperationsIsSet(boolean value) {
      if (!value) {
        this.operations = null;
      }
    }

    public int getChangedRowsSize() {
      return (this.changedRows == null) ? 0 : this.changedRows.size();
    }

    public java.util.Iterator getChangedRowsIterator() {
      return (this.changedRows == null) ? null : this.changedRows.iterator();
    }

    public void addToChangedRows(Row elem) {
      if (this.changedRows == null) {
        this.changedRows = new ArrayList();
      }
      this.changedRows.add(elem);
    }

    public List getChangedRows() {
      return this.changedRows;
    }

    public executeCursorUpdate_args setChangedRows(List changedRows) {
      this.changedRows = changedRows;
      return this;
    }

    public void unsetChangedRows() {
      this.changedRows = null;
    }

    /** Returns true if field changedRows is set (has been assigned a value) and false otherwise */
    public boolean isSetChangedRows() {
      return this.changedRows != null;
    }

    public void setChangedRowsIsSet(boolean value) {
      if (!value) {
        this.changedRows = null;
      }
    }

    public int getChangedColumnsListSize() {
      return (this.changedColumnsList == null) ? 0 : this.changedColumnsList.size();
    }

    public java.util.Iterator> getChangedColumnsListIterator() {
      return (this.changedColumnsList == null) ? null : this.changedColumnsList.iterator();
    }

    public void addToChangedColumnsList(List elem) {
      if (this.changedColumnsList == null) {
        this.changedColumnsList = new ArrayList>();
      }
      this.changedColumnsList.add(elem);
    }

    public List> getChangedColumnsList() {
      return this.changedColumnsList;
    }

    public executeCursorUpdate_args setChangedColumnsList(List> changedColumnsList) {
      this.changedColumnsList = changedColumnsList;
      return this;
    }

    public void unsetChangedColumnsList() {
      this.changedColumnsList = null;
    }

    /** Returns true if field changedColumnsList is set (has been assigned a value) and false otherwise */
    public boolean isSetChangedColumnsList() {
      return this.changedColumnsList != null;
    }

    public void setChangedColumnsListIsSet(boolean value) {
      if (!value) {
        this.changedColumnsList = null;
      }
    }

    public int getChangedRowIndexesSize() {
      return (this.changedRowIndexes == null) ? 0 : this.changedRowIndexes.size();
    }

    public java.util.Iterator getChangedRowIndexesIterator() {
      return (this.changedRowIndexes == null) ? null : this.changedRowIndexes.iterator();
    }

    public void addToChangedRowIndexes(int elem) {
      if (this.changedRowIndexes == null) {
        this.changedRowIndexes = new ArrayList();
      }
      this.changedRowIndexes.add(elem);
    }

    public List getChangedRowIndexes() {
      return this.changedRowIndexes;
    }

    public executeCursorUpdate_args setChangedRowIndexes(List changedRowIndexes) {
      this.changedRowIndexes = changedRowIndexes;
      return this;
    }

    public void unsetChangedRowIndexes() {
      this.changedRowIndexes = null;
    }

    /** Returns true if field changedRowIndexes is set (has been assigned a value) and false otherwise */
    public boolean isSetChangedRowIndexes() {
      return this.changedRowIndexes != null;
    }

    public void setChangedRowIndexesIsSet(boolean value) {
      if (!value) {
        this.changedRowIndexes = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public executeCursorUpdate_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public executeCursorUpdate_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CURSOR_ID:
        if (value == null) {
          unsetCursorId();
        } else {
          setCursorId((Long)value);
        }
        break;

      case OPERATIONS:
        if (value == null) {
          unsetOperations();
        } else {
          setOperations((List)value);
        }
        break;

      case CHANGED_ROWS:
        if (value == null) {
          unsetChangedRows();
        } else {
          setChangedRows((List)value);
        }
        break;

      case CHANGED_COLUMNS_LIST:
        if (value == null) {
          unsetChangedColumnsList();
        } else {
          setChangedColumnsList((List>)value);
        }
        break;

      case CHANGED_ROW_INDEXES:
        if (value == null) {
          unsetChangedRowIndexes();
        } else {
          setChangedRowIndexes((List)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CURSOR_ID:
        return getCursorId();

      case OPERATIONS:
        return getOperations();

      case CHANGED_ROWS:
        return getChangedRows();

      case CHANGED_COLUMNS_LIST:
        return getChangedColumnsList();

      case CHANGED_ROW_INDEXES:
        return getChangedRowIndexes();

      case TOKEN:
        return getToken();

      }
      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 CURSOR_ID:
        return isSetCursorId();
      case OPERATIONS:
        return isSetOperations();
      case CHANGED_ROWS:
        return isSetChangedRows();
      case CHANGED_COLUMNS_LIST:
        return isSetChangedColumnsList();
      case CHANGED_ROW_INDEXES:
        return isSetChangedRowIndexes();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeCursorUpdate_args)
        return this.equals((executeCursorUpdate_args)that);
      return false;
    }

    public boolean equals(executeCursorUpdate_args that) {
      if (that == null)
        return false;

      boolean this_present_cursorId = true;
      boolean that_present_cursorId = true;
      if (this_present_cursorId || that_present_cursorId) {
        if (!(this_present_cursorId && that_present_cursorId))
          return false;
        if (this.cursorId != that.cursorId)
          return false;
      }

      boolean this_present_operations = true && this.isSetOperations();
      boolean that_present_operations = true && that.isSetOperations();
      if (this_present_operations || that_present_operations) {
        if (!(this_present_operations && that_present_operations))
          return false;
        if (!this.operations.equals(that.operations))
          return false;
      }

      boolean this_present_changedRows = true && this.isSetChangedRows();
      boolean that_present_changedRows = true && that.isSetChangedRows();
      if (this_present_changedRows || that_present_changedRows) {
        if (!(this_present_changedRows && that_present_changedRows))
          return false;
        if (!this.changedRows.equals(that.changedRows))
          return false;
      }

      boolean this_present_changedColumnsList = true && this.isSetChangedColumnsList();
      boolean that_present_changedColumnsList = true && that.isSetChangedColumnsList();
      if (this_present_changedColumnsList || that_present_changedColumnsList) {
        if (!(this_present_changedColumnsList && that_present_changedColumnsList))
          return false;
        if (!this.changedColumnsList.equals(that.changedColumnsList))
          return false;
      }

      boolean this_present_changedRowIndexes = true && this.isSetChangedRowIndexes();
      boolean that_present_changedRowIndexes = true && that.isSetChangedRowIndexes();
      if (this_present_changedRowIndexes || that_present_changedRowIndexes) {
        if (!(this_present_changedRowIndexes && that_present_changedRowIndexes))
          return false;
        if (!this.changedRowIndexes.equals(that.changedRowIndexes))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_cursorId = true;
      list.add(present_cursorId);
      if (present_cursorId)
        list.add(cursorId);

      boolean present_operations = true && (isSetOperations());
      list.add(present_operations);
      if (present_operations)
        list.add(operations);

      boolean present_changedRows = true && (isSetChangedRows());
      list.add(present_changedRows);
      if (present_changedRows)
        list.add(changedRows);

      boolean present_changedColumnsList = true && (isSetChangedColumnsList());
      list.add(present_changedColumnsList);
      if (present_changedColumnsList)
        list.add(changedColumnsList);

      boolean present_changedRowIndexes = true && (isSetChangedRowIndexes());
      list.add(present_changedRowIndexes);
      if (present_changedRowIndexes)
        list.add(changedRowIndexes);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeCursorUpdate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCursorId()).compareTo(other.isSetCursorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCursorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cursorId, other.cursorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOperations()).compareTo(other.isSetOperations());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOperations()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operations, other.operations);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetChangedRows()).compareTo(other.isSetChangedRows());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetChangedRows()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.changedRows, other.changedRows);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetChangedColumnsList()).compareTo(other.isSetChangedColumnsList());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetChangedColumnsList()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.changedColumnsList, other.changedColumnsList);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetChangedRowIndexes()).compareTo(other.isSetChangedRowIndexes());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetChangedRowIndexes()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.changedRowIndexes, other.changedRowIndexes);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeCursorUpdate_args(");
      boolean first = true;

      sb.append("cursorId:");
      sb.append(this.cursorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("operations:");
      if (this.operations == null) {
        sb.append("null");
      } else {
        sb.append(this.operations);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("changedRows:");
      if (this.changedRows == null) {
        sb.append("null");
      } else {
        sb.append(this.changedRows);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("changedColumnsList:");
      if (this.changedColumnsList == null) {
        sb.append("null");
      } else {
        sb.append(this.changedColumnsList);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("changedRowIndexes:");
      if (this.changedRowIndexes == null) {
        sb.append("null");
      } else {
        sb.append(this.changedRowIndexes);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeCursorUpdate_argsStandardSchemeFactory implements SchemeFactory {
      public executeCursorUpdate_argsStandardScheme getScheme() {
        return new executeCursorUpdate_argsStandardScheme();
      }
    }

    private static class executeCursorUpdate_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeCursorUpdate_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CURSOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.cursorId = iprot.readI64();
                struct.setCursorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // OPERATIONS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list706 = iprot.readListBegin();
                  struct.operations = new ArrayList(_list706.size);
                  CursorUpdateOperation _elem707;
                  for (int _i708 = 0; _i708 < _list706.size; ++_i708)
                  {
                    _elem707 = io.snappydata.thrift.CursorUpdateOperation.findByValue(iprot.readI32());
                    struct.operations.add(_elem707);
                  }
                  iprot.readListEnd();
                }
                struct.setOperationsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // CHANGED_ROWS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list709 = iprot.readListBegin();
                  struct.changedRows = new ArrayList(_list709.size);
                  Row _elem710;
                  for (int _i711 = 0; _i711 < _list709.size; ++_i711)
                  {
                    _elem710 = new Row();
                    _elem710.read(iprot);
                    struct.changedRows.add(_elem710);
                  }
                  iprot.readListEnd();
                }
                struct.setChangedRowsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // CHANGED_COLUMNS_LIST
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list712 = iprot.readListBegin();
                  struct.changedColumnsList = new ArrayList>(_list712.size);
                  List _elem713;
                  for (int _i714 = 0; _i714 < _list712.size; ++_i714)
                  {
                    {
                      org.apache.thrift.protocol.TList _list715 = iprot.readListBegin();
                      _elem713 = new ArrayList(_list715.size);
                      int _elem716;
                      for (int _i717 = 0; _i717 < _list715.size; ++_i717)
                      {
                        _elem716 = iprot.readI32();
                        _elem713.add(_elem716);
                      }
                      iprot.readListEnd();
                    }
                    struct.changedColumnsList.add(_elem713);
                  }
                  iprot.readListEnd();
                }
                struct.setChangedColumnsListIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // CHANGED_ROW_INDEXES
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list718 = iprot.readListBegin();
                  struct.changedRowIndexes = new ArrayList(_list718.size);
                  int _elem719;
                  for (int _i720 = 0; _i720 < _list718.size; ++_i720)
                  {
                    _elem719 = iprot.readI32();
                    struct.changedRowIndexes.add(_elem719);
                  }
                  iprot.readListEnd();
                }
                struct.setChangedRowIndexesIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeCursorUpdate_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CURSOR_ID_FIELD_DESC);
        oprot.writeI64(struct.cursorId);
        oprot.writeFieldEnd();
        if (struct.operations != null) {
          oprot.writeFieldBegin(OPERATIONS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.operations.size()));
            for (CursorUpdateOperation _iter721 : struct.operations)
            {
              oprot.writeI32(_iter721.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.changedRows != null) {
          oprot.writeFieldBegin(CHANGED_ROWS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.changedRows.size()));
            for (Row _iter722 : struct.changedRows)
            {
              _iter722.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.changedColumnsList != null) {
          oprot.writeFieldBegin(CHANGED_COLUMNS_LIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.changedColumnsList.size()));
            for (List _iter723 : struct.changedColumnsList)
            {
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, _iter723.size()));
                for (int _iter724 : _iter723)
                {
                  oprot.writeI32(_iter724);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.changedRowIndexes != null) {
          oprot.writeFieldBegin(CHANGED_ROW_INDEXES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.changedRowIndexes.size()));
            for (int _iter725 : struct.changedRowIndexes)
            {
              oprot.writeI32(_iter725);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeCursorUpdate_argsTupleSchemeFactory implements SchemeFactory {
      public executeCursorUpdate_argsTupleScheme getScheme() {
        return new executeCursorUpdate_argsTupleScheme();
      }
    }

    private static class executeCursorUpdate_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeCursorUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCursorId()) {
          optionals.set(0);
        }
        if (struct.isSetOperations()) {
          optionals.set(1);
        }
        if (struct.isSetChangedRows()) {
          optionals.set(2);
        }
        if (struct.isSetChangedColumnsList()) {
          optionals.set(3);
        }
        if (struct.isSetChangedRowIndexes()) {
          optionals.set(4);
        }
        if (struct.isSetToken()) {
          optionals.set(5);
        }
        oprot.writeBitSet(optionals, 6);
        if (struct.isSetCursorId()) {
          oprot.writeI64(struct.cursorId);
        }
        if (struct.isSetOperations()) {
          {
            oprot.writeI32(struct.operations.size());
            for (CursorUpdateOperation _iter726 : struct.operations)
            {
              oprot.writeI32(_iter726.getValue());
            }
          }
        }
        if (struct.isSetChangedRows()) {
          {
            oprot.writeI32(struct.changedRows.size());
            for (Row _iter727 : struct.changedRows)
            {
              _iter727.write(oprot);
            }
          }
        }
        if (struct.isSetChangedColumnsList()) {
          {
            oprot.writeI32(struct.changedColumnsList.size());
            for (List _iter728 : struct.changedColumnsList)
            {
              {
                oprot.writeI32(_iter728.size());
                for (int _iter729 : _iter728)
                {
                  oprot.writeI32(_iter729);
                }
              }
            }
          }
        }
        if (struct.isSetChangedRowIndexes()) {
          {
            oprot.writeI32(struct.changedRowIndexes.size());
            for (int _iter730 : struct.changedRowIndexes)
            {
              oprot.writeI32(_iter730);
            }
          }
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeCursorUpdate_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(6);
        if (incoming.get(0)) {
          struct.cursorId = iprot.readI64();
          struct.setCursorIdIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list731 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
            struct.operations = new ArrayList(_list731.size);
            CursorUpdateOperation _elem732;
            for (int _i733 = 0; _i733 < _list731.size; ++_i733)
            {
              _elem732 = io.snappydata.thrift.CursorUpdateOperation.findByValue(iprot.readI32());
              struct.operations.add(_elem732);
            }
          }
          struct.setOperationsIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TList _list734 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.changedRows = new ArrayList(_list734.size);
            Row _elem735;
            for (int _i736 = 0; _i736 < _list734.size; ++_i736)
            {
              _elem735 = new Row();
              _elem735.read(iprot);
              struct.changedRows.add(_elem735);
            }
          }
          struct.setChangedRowsIsSet(true);
        }
        if (incoming.get(3)) {
          {
            org.apache.thrift.protocol.TList _list737 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32());
            struct.changedColumnsList = new ArrayList>(_list737.size);
            List _elem738;
            for (int _i739 = 0; _i739 < _list737.size; ++_i739)
            {
              {
                org.apache.thrift.protocol.TList _list740 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
                _elem738 = new ArrayList(_list740.size);
                int _elem741;
                for (int _i742 = 0; _i742 < _list740.size; ++_i742)
                {
                  _elem741 = iprot.readI32();
                  _elem738.add(_elem741);
                }
              }
              struct.changedColumnsList.add(_elem738);
            }
          }
          struct.setChangedColumnsListIsSet(true);
        }
        if (incoming.get(4)) {
          {
            org.apache.thrift.protocol.TList _list743 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
            struct.changedRowIndexes = new ArrayList(_list743.size);
            int _elem744;
            for (int _i745 = 0; _i745 < _list743.size; ++_i745)
            {
              _elem744 = iprot.readI32();
              struct.changedRowIndexes.add(_elem744);
            }
          }
          struct.setChangedRowIndexesIsSet(true);
        }
        if (incoming.get(5)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class executeCursorUpdate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeCursorUpdate_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new executeCursorUpdate_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeCursorUpdate_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(executeCursorUpdate_result.class, metaDataMap);
    }

    public executeCursorUpdate_result() {
    }

    public executeCursorUpdate_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public executeCursorUpdate_result(executeCursorUpdate_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public executeCursorUpdate_result deepCopy() {
      return new executeCursorUpdate_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public executeCursorUpdate_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeCursorUpdate_result)
        return this.equals((executeCursorUpdate_result)that);
      return false;
    }

    public boolean equals(executeCursorUpdate_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeCursorUpdate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("executeCursorUpdate_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class executeCursorUpdate_resultStandardSchemeFactory implements SchemeFactory {
      public executeCursorUpdate_resultStandardScheme getScheme() {
        return new executeCursorUpdate_resultStandardScheme();
      }
    }

    private static class executeCursorUpdate_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeCursorUpdate_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, executeCursorUpdate_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeCursorUpdate_resultTupleSchemeFactory implements SchemeFactory {
      public executeCursorUpdate_resultTupleScheme getScheme() {
        return new executeCursorUpdate_resultTupleScheme();
      }
    }

    private static class executeCursorUpdate_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeCursorUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeCursorUpdate_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class startXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField TIMEOUT_IN_SECONDS_FIELD_DESC = new org.apache.thrift.protocol.TField("timeoutInSeconds", org.apache.thrift.protocol.TType.I32, (short)3);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.I32, (short)4);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)5);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new startXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new startXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public int timeoutInSeconds; // required
    public int flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      TIMEOUT_IN_SECONDS((short)3, "timeoutInSeconds"),
      FLAGS((short)4, "flags"),
      TOKEN((short)5, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // TIMEOUT_IN_SECONDS
            return TIMEOUT_IN_SECONDS;
          case 4: // FLAGS
            return FLAGS;
          case 5: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __TIMEOUTINSECONDS_ISSET_ID = 1;
    private static final int __FLAGS_ISSET_ID = 2;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.TIMEOUT_IN_SECONDS, new org.apache.thrift.meta_data.FieldMetaData("timeoutInSeconds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startXATransaction_args.class, metaDataMap);
    }

    public startXATransaction_args() {
    }

    public startXATransaction_args(
      long connId,
      TransactionXid xid,
      int timeoutInSeconds,
      int flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.timeoutInSeconds = timeoutInSeconds;
      setTimeoutInSecondsIsSet(true);
      this.flags = flags;
      setFlagsIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public startXATransaction_args(startXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      this.timeoutInSeconds = other.timeoutInSeconds;
      this.flags = other.flags;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public startXATransaction_args deepCopy() {
      return new startXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      setTimeoutInSecondsIsSet(false);
      this.timeoutInSeconds = 0;
      setFlagsIsSet(false);
      this.flags = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public startXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public startXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public int getTimeoutInSeconds() {
      return this.timeoutInSeconds;
    }

    public startXATransaction_args setTimeoutInSeconds(int timeoutInSeconds) {
      this.timeoutInSeconds = timeoutInSeconds;
      setTimeoutInSecondsIsSet(true);
      return this;
    }

    public void unsetTimeoutInSeconds() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOUTINSECONDS_ISSET_ID);
    }

    /** Returns true if field timeoutInSeconds is set (has been assigned a value) and false otherwise */
    public boolean isSetTimeoutInSeconds() {
      return EncodingUtils.testBit(__isset_bitfield, __TIMEOUTINSECONDS_ISSET_ID);
    }

    public void setTimeoutInSecondsIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOUTINSECONDS_ISSET_ID, value);
    }

    public int getFlags() {
      return this.flags;
    }

    public startXATransaction_args setFlags(int flags) {
      this.flags = flags;
      setFlagsIsSet(true);
      return this;
    }

    public void unsetFlags() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FLAGS_ISSET_ID);
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return EncodingUtils.testBit(__isset_bitfield, __FLAGS_ISSET_ID);
    }

    public void setFlagsIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FLAGS_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public startXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public startXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case TIMEOUT_IN_SECONDS:
        if (value == null) {
          unsetTimeoutInSeconds();
        } else {
          setTimeoutInSeconds((Integer)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Integer)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case TIMEOUT_IN_SECONDS:
        return getTimeoutInSeconds();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case TIMEOUT_IN_SECONDS:
        return isSetTimeoutInSeconds();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startXATransaction_args)
        return this.equals((startXATransaction_args)that);
      return false;
    }

    public boolean equals(startXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_timeoutInSeconds = true;
      boolean that_present_timeoutInSeconds = true;
      if (this_present_timeoutInSeconds || that_present_timeoutInSeconds) {
        if (!(this_present_timeoutInSeconds && that_present_timeoutInSeconds))
          return false;
        if (this.timeoutInSeconds != that.timeoutInSeconds)
          return false;
      }

      boolean this_present_flags = true;
      boolean that_present_flags = true;
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (this.flags != that.flags)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_timeoutInSeconds = true;
      list.add(present_timeoutInSeconds);
      if (present_timeoutInSeconds)
        list.add(timeoutInSeconds);

      boolean present_flags = true;
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(startXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTimeoutInSeconds()).compareTo(other.isSetTimeoutInSeconds());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimeoutInSeconds()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeoutInSeconds, other.timeoutInSeconds);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("timeoutInSeconds:");
      sb.append(this.timeoutInSeconds);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      sb.append(this.flags);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class startXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public startXATransaction_argsStandardScheme getScheme() {
        return new startXATransaction_argsStandardScheme();
      }
    }

    private static class startXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, startXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TIMEOUT_IN_SECONDS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.timeoutInSeconds = iprot.readI32();
                struct.setTimeoutInSecondsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.flags = iprot.readI32();
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, startXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(TIMEOUT_IN_SECONDS_FIELD_DESC);
        oprot.writeI32(struct.timeoutInSeconds);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FLAGS_FIELD_DESC);
        oprot.writeI32(struct.flags);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class startXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public startXATransaction_argsTupleScheme getScheme() {
        return new startXATransaction_argsTupleScheme();
      }
    }

    private static class startXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, startXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetTimeoutInSeconds()) {
          optionals.set(2);
        }
        if (struct.isSetFlags()) {
          optionals.set(3);
        }
        if (struct.isSetToken()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetTimeoutInSeconds()) {
          oprot.writeI32(struct.timeoutInSeconds);
        }
        if (struct.isSetFlags()) {
          oprot.writeI32(struct.flags);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, startXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(5);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.timeoutInSeconds = iprot.readI32();
          struct.setTimeoutInSecondsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.flags = iprot.readI32();
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(4)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class startXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startXATransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new startXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new startXATransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startXATransaction_result.class, metaDataMap);
    }

    public startXATransaction_result() {
    }

    public startXATransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public startXATransaction_result(startXATransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public startXATransaction_result deepCopy() {
      return new startXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public startXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof startXATransaction_result)
        return this.equals((startXATransaction_result)that);
      return false;
    }

    public boolean equals(startXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(startXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("startXATransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class startXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public startXATransaction_resultStandardScheme getScheme() {
        return new startXATransaction_resultStandardScheme();
      }
    }

    private static class startXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, startXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, startXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class startXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public startXATransaction_resultTupleScheme getScheme() {
        return new startXATransaction_resultTupleScheme();
      }
    }

    private static class startXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, startXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, startXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class prepareXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareXATransaction_args.class, metaDataMap);
    }

    public prepareXATransaction_args() {
    }

    public prepareXATransaction_args(
      long connId,
      TransactionXid xid,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareXATransaction_args(prepareXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public prepareXATransaction_args deepCopy() {
      return new prepareXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public prepareXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public prepareXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public prepareXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public prepareXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareXATransaction_args)
        return this.equals((prepareXATransaction_args)that);
      return false;
    }

    public boolean equals(prepareXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public prepareXATransaction_argsStandardScheme getScheme() {
        return new prepareXATransaction_argsStandardScheme();
      }
    }

    private static class prepareXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public prepareXATransaction_argsTupleScheme getScheme() {
        return new prepareXATransaction_argsTupleScheme();
      }
    }

    private static class prepareXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class prepareXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("prepareXATransaction_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new prepareXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new prepareXATransaction_resultTupleSchemeFactory());
    }

    public int success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(prepareXATransaction_result.class, metaDataMap);
    }

    public prepareXATransaction_result() {
    }

    public prepareXATransaction_result(
      int success,
      SnappyException error)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public prepareXATransaction_result(prepareXATransaction_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public prepareXATransaction_result deepCopy() {
      return new prepareXATransaction_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.error = null;
    }

    public int getSuccess() {
      return this.success;
    }

    public prepareXATransaction_result setSuccess(int success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public SnappyException getError() {
      return this.error;
    }

    public prepareXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Integer)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof prepareXATransaction_result)
        return this.equals((prepareXATransaction_result)that);
      return false;
    }

    public boolean equals(prepareXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_success = true;
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(prepareXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("prepareXATransaction_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class prepareXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public prepareXATransaction_resultStandardScheme getScheme() {
        return new prepareXATransaction_resultStandardScheme();
      }
    }

    private static class prepareXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, prepareXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.success = iprot.readI32();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, prepareXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeI32(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class prepareXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public prepareXATransaction_resultTupleScheme getScheme() {
        return new prepareXATransaction_resultTupleScheme();
      }
    }

    private static class prepareXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, prepareXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeI32(struct.success);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, prepareXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readI32();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class commitXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("commitXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField ONE_PHASE_FIELD_DESC = new org.apache.thrift.protocol.TField("onePhase", org.apache.thrift.protocol.TType.BOOL, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new commitXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new commitXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public boolean onePhase; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      ONE_PHASE((short)3, "onePhase"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // ONE_PHASE
            return ONE_PHASE;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __ONEPHASE_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.ONE_PHASE, new org.apache.thrift.meta_data.FieldMetaData("onePhase", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitXATransaction_args.class, metaDataMap);
    }

    public commitXATransaction_args() {
    }

    public commitXATransaction_args(
      long connId,
      TransactionXid xid,
      boolean onePhase,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.onePhase = onePhase;
      setOnePhaseIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public commitXATransaction_args(commitXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      this.onePhase = other.onePhase;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public commitXATransaction_args deepCopy() {
      return new commitXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      setOnePhaseIsSet(false);
      this.onePhase = false;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public commitXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public commitXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public boolean isOnePhase() {
      return this.onePhase;
    }

    public commitXATransaction_args setOnePhase(boolean onePhase) {
      this.onePhase = onePhase;
      setOnePhaseIsSet(true);
      return this;
    }

    public void unsetOnePhase() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ONEPHASE_ISSET_ID);
    }

    /** Returns true if field onePhase is set (has been assigned a value) and false otherwise */
    public boolean isSetOnePhase() {
      return EncodingUtils.testBit(__isset_bitfield, __ONEPHASE_ISSET_ID);
    }

    public void setOnePhaseIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ONEPHASE_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public commitXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public commitXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case ONE_PHASE:
        if (value == null) {
          unsetOnePhase();
        } else {
          setOnePhase((Boolean)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case ONE_PHASE:
        return isOnePhase();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case ONE_PHASE:
        return isSetOnePhase();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof commitXATransaction_args)
        return this.equals((commitXATransaction_args)that);
      return false;
    }

    public boolean equals(commitXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_onePhase = true;
      boolean that_present_onePhase = true;
      if (this_present_onePhase || that_present_onePhase) {
        if (!(this_present_onePhase && that_present_onePhase))
          return false;
        if (this.onePhase != that.onePhase)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_onePhase = true;
      list.add(present_onePhase);
      if (present_onePhase)
        list.add(onePhase);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(commitXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetOnePhase()).compareTo(other.isSetOnePhase());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOnePhase()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.onePhase, other.onePhase);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("commitXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("onePhase:");
      sb.append(this.onePhase);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class commitXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public commitXATransaction_argsStandardScheme getScheme() {
        return new commitXATransaction_argsStandardScheme();
      }
    }

    private static class commitXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, commitXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // ONE_PHASE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.onePhase = iprot.readBool();
                struct.setOnePhaseIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, commitXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(ONE_PHASE_FIELD_DESC);
        oprot.writeBool(struct.onePhase);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class commitXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public commitXATransaction_argsTupleScheme getScheme() {
        return new commitXATransaction_argsTupleScheme();
      }
    }

    private static class commitXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, commitXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetOnePhase()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetOnePhase()) {
          oprot.writeBool(struct.onePhase);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, commitXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.onePhase = iprot.readBool();
          struct.setOnePhaseIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class commitXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("commitXATransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new commitXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new commitXATransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(commitXATransaction_result.class, metaDataMap);
    }

    public commitXATransaction_result() {
    }

    public commitXATransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public commitXATransaction_result(commitXATransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public commitXATransaction_result deepCopy() {
      return new commitXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public commitXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof commitXATransaction_result)
        return this.equals((commitXATransaction_result)that);
      return false;
    }

    public boolean equals(commitXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(commitXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("commitXATransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class commitXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public commitXATransaction_resultStandardScheme getScheme() {
        return new commitXATransaction_resultStandardScheme();
      }
    }

    private static class commitXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, commitXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, commitXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class commitXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public commitXATransaction_resultTupleScheme getScheme() {
        return new commitXATransaction_resultTupleScheme();
      }
    }

    private static class commitXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, commitXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, commitXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class rollbackXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rollbackXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new rollbackXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new rollbackXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rollbackXATransaction_args.class, metaDataMap);
    }

    public rollbackXATransaction_args() {
    }

    public rollbackXATransaction_args(
      long connId,
      TransactionXid xid,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public rollbackXATransaction_args(rollbackXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public rollbackXATransaction_args deepCopy() {
      return new rollbackXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public rollbackXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public rollbackXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public rollbackXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public rollbackXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof rollbackXATransaction_args)
        return this.equals((rollbackXATransaction_args)that);
      return false;
    }

    public boolean equals(rollbackXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(rollbackXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("rollbackXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class rollbackXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public rollbackXATransaction_argsStandardScheme getScheme() {
        return new rollbackXATransaction_argsStandardScheme();
      }
    }

    private static class rollbackXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, rollbackXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, rollbackXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class rollbackXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public rollbackXATransaction_argsTupleScheme getScheme() {
        return new rollbackXATransaction_argsTupleScheme();
      }
    }

    private static class rollbackXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, rollbackXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, rollbackXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class rollbackXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("rollbackXATransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new rollbackXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new rollbackXATransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(rollbackXATransaction_result.class, metaDataMap);
    }

    public rollbackXATransaction_result() {
    }

    public rollbackXATransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public rollbackXATransaction_result(rollbackXATransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public rollbackXATransaction_result deepCopy() {
      return new rollbackXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public rollbackXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof rollbackXATransaction_result)
        return this.equals((rollbackXATransaction_result)that);
      return false;
    }

    public boolean equals(rollbackXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(rollbackXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("rollbackXATransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class rollbackXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public rollbackXATransaction_resultStandardScheme getScheme() {
        return new rollbackXATransaction_resultStandardScheme();
      }
    }

    private static class rollbackXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, rollbackXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, rollbackXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class rollbackXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public rollbackXATransaction_resultTupleScheme getScheme() {
        return new rollbackXATransaction_resultTupleScheme();
      }
    }

    private static class rollbackXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, rollbackXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, rollbackXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class forgetXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("forgetXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new forgetXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new forgetXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(forgetXATransaction_args.class, metaDataMap);
    }

    public forgetXATransaction_args() {
    }

    public forgetXATransaction_args(
      long connId,
      TransactionXid xid,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public forgetXATransaction_args(forgetXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public forgetXATransaction_args deepCopy() {
      return new forgetXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public forgetXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public forgetXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public forgetXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public forgetXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof forgetXATransaction_args)
        return this.equals((forgetXATransaction_args)that);
      return false;
    }

    public boolean equals(forgetXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(forgetXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("forgetXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class forgetXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public forgetXATransaction_argsStandardScheme getScheme() {
        return new forgetXATransaction_argsStandardScheme();
      }
    }

    private static class forgetXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, forgetXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, forgetXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class forgetXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public forgetXATransaction_argsTupleScheme getScheme() {
        return new forgetXATransaction_argsTupleScheme();
      }
    }

    private static class forgetXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, forgetXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, forgetXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class forgetXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("forgetXATransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new forgetXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new forgetXATransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(forgetXATransaction_result.class, metaDataMap);
    }

    public forgetXATransaction_result() {
    }

    public forgetXATransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public forgetXATransaction_result(forgetXATransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public forgetXATransaction_result deepCopy() {
      return new forgetXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public forgetXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof forgetXATransaction_result)
        return this.equals((forgetXATransaction_result)that);
      return false;
    }

    public boolean equals(forgetXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(forgetXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("forgetXATransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class forgetXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public forgetXATransaction_resultStandardScheme getScheme() {
        return new forgetXATransaction_resultStandardScheme();
      }
    }

    private static class forgetXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, forgetXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, forgetXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class forgetXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public forgetXATransaction_resultTupleScheme getScheme() {
        return new forgetXATransaction_resultTupleScheme();
      }
    }

    private static class forgetXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, forgetXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, forgetXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class endXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("endXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField XID_FIELD_DESC = new org.apache.thrift.protocol.TField("xid", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField FLAGS_FIELD_DESC = new org.apache.thrift.protocol.TField("flags", org.apache.thrift.protocol.TType.I32, (short)3);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new endXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new endXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public TransactionXid xid; // required
    public int flags; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      XID((short)2, "xid"),
      FLAGS((short)3, "flags"),
      TOKEN((short)4, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // XID
            return XID;
          case 3: // FLAGS
            return FLAGS;
          case 4: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __FLAGS_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.XID, new org.apache.thrift.meta_data.FieldMetaData("xid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class)));
      tmpMap.put(_Fields.FLAGS, new org.apache.thrift.meta_data.FieldMetaData("flags", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(endXATransaction_args.class, metaDataMap);
    }

    public endXATransaction_args() {
    }

    public endXATransaction_args(
      long connId,
      TransactionXid xid,
      int flags,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.xid = xid;
      this.flags = flags;
      setFlagsIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public endXATransaction_args(endXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetXid()) {
        this.xid = new TransactionXid(other.xid);
      }
      this.flags = other.flags;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public endXATransaction_args deepCopy() {
      return new endXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.xid = null;
      setFlagsIsSet(false);
      this.flags = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public endXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public TransactionXid getXid() {
      return this.xid;
    }

    public endXATransaction_args setXid(TransactionXid xid) {
      this.xid = xid;
      return this;
    }

    public void unsetXid() {
      this.xid = null;
    }

    /** Returns true if field xid is set (has been assigned a value) and false otherwise */
    public boolean isSetXid() {
      return this.xid != null;
    }

    public void setXidIsSet(boolean value) {
      if (!value) {
        this.xid = null;
      }
    }

    public int getFlags() {
      return this.flags;
    }

    public endXATransaction_args setFlags(int flags) {
      this.flags = flags;
      setFlagsIsSet(true);
      return this;
    }

    public void unsetFlags() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FLAGS_ISSET_ID);
    }

    /** Returns true if field flags is set (has been assigned a value) and false otherwise */
    public boolean isSetFlags() {
      return EncodingUtils.testBit(__isset_bitfield, __FLAGS_ISSET_ID);
    }

    public void setFlagsIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FLAGS_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public endXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public endXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case XID:
        if (value == null) {
          unsetXid();
        } else {
          setXid((TransactionXid)value);
        }
        break;

      case FLAGS:
        if (value == null) {
          unsetFlags();
        } else {
          setFlags((Integer)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case XID:
        return getXid();

      case FLAGS:
        return getFlags();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case XID:
        return isSetXid();
      case FLAGS:
        return isSetFlags();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof endXATransaction_args)
        return this.equals((endXATransaction_args)that);
      return false;
    }

    public boolean equals(endXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_xid = true && this.isSetXid();
      boolean that_present_xid = true && that.isSetXid();
      if (this_present_xid || that_present_xid) {
        if (!(this_present_xid && that_present_xid))
          return false;
        if (!this.xid.equals(that.xid))
          return false;
      }

      boolean this_present_flags = true;
      boolean that_present_flags = true;
      if (this_present_flags || that_present_flags) {
        if (!(this_present_flags && that_present_flags))
          return false;
        if (this.flags != that.flags)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_xid = true && (isSetXid());
      list.add(present_xid);
      if (present_xid)
        list.add(xid);

      boolean present_flags = true;
      list.add(present_flags);
      if (present_flags)
        list.add(flags);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(endXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXid()).compareTo(other.isSetXid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xid, other.xid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlags()).compareTo(other.isSetFlags());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlags()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flags, other.flags);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("endXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xid:");
      if (this.xid == null) {
        sb.append("null");
      } else {
        sb.append(this.xid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("flags:");
      sb.append(this.flags);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (xid != null) {
        xid.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class endXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public endXATransaction_argsStandardScheme getScheme() {
        return new endXATransaction_argsStandardScheme();
      }
    }

    private static class endXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, endXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // XID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.xid = new TransactionXid();
                struct.xid.read(iprot);
                struct.setXidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // FLAGS
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.flags = iprot.readI32();
                struct.setFlagsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, endXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.xid != null) {
          oprot.writeFieldBegin(XID_FIELD_DESC);
          struct.xid.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(FLAGS_FIELD_DESC);
        oprot.writeI32(struct.flags);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class endXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public endXATransaction_argsTupleScheme getScheme() {
        return new endXATransaction_argsTupleScheme();
      }
    }

    private static class endXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, endXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetXid()) {
          optionals.set(1);
        }
        if (struct.isSetFlags()) {
          optionals.set(2);
        }
        if (struct.isSetToken()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetXid()) {
          struct.xid.write(oprot);
        }
        if (struct.isSetFlags()) {
          oprot.writeI32(struct.flags);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, endXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.xid = new TransactionXid();
          struct.xid.read(iprot);
          struct.setXidIsSet(true);
        }
        if (incoming.get(2)) {
          struct.flags = iprot.readI32();
          struct.setFlagsIsSet(true);
        }
        if (incoming.get(3)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class endXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("endXATransaction_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new endXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new endXATransaction_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(endXATransaction_result.class, metaDataMap);
    }

    public endXATransaction_result() {
    }

    public endXATransaction_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public endXATransaction_result(endXATransaction_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public endXATransaction_result deepCopy() {
      return new endXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public endXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof endXATransaction_result)
        return this.equals((endXATransaction_result)that);
      return false;
    }

    public boolean equals(endXATransaction_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(endXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("endXATransaction_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class endXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public endXATransaction_resultStandardScheme getScheme() {
        return new endXATransaction_resultStandardScheme();
      }
    }

    private static class endXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, endXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, endXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class endXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public endXATransaction_resultTupleScheme getScheme() {
        return new endXATransaction_resultTupleScheme();
      }
    }

    private static class endXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, endXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, endXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class recoverXATransaction_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("recoverXATransaction_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("flag", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new recoverXATransaction_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new recoverXATransaction_argsTupleSchemeFactory());
    }

    public long connId; // required
    public int flag; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      FLAG((short)2, "flag"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // FLAG
            return FLAG;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __FLAG_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FLAG, new org.apache.thrift.meta_data.FieldMetaData("flag", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(recoverXATransaction_args.class, metaDataMap);
    }

    public recoverXATransaction_args() {
    }

    public recoverXATransaction_args(
      long connId,
      int flag,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.flag = flag;
      setFlagIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public recoverXATransaction_args(recoverXATransaction_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.flag = other.flag;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public recoverXATransaction_args deepCopy() {
      return new recoverXATransaction_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setFlagIsSet(false);
      this.flag = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public recoverXATransaction_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public int getFlag() {
      return this.flag;
    }

    public recoverXATransaction_args setFlag(int flag) {
      this.flag = flag;
      setFlagIsSet(true);
      return this;
    }

    public void unsetFlag() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FLAG_ISSET_ID);
    }

    /** Returns true if field flag is set (has been assigned a value) and false otherwise */
    public boolean isSetFlag() {
      return EncodingUtils.testBit(__isset_bitfield, __FLAG_ISSET_ID);
    }

    public void setFlagIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FLAG_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public recoverXATransaction_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public recoverXATransaction_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case FLAG:
        if (value == null) {
          unsetFlag();
        } else {
          setFlag((Integer)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case FLAG:
        return getFlag();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case FLAG:
        return isSetFlag();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof recoverXATransaction_args)
        return this.equals((recoverXATransaction_args)that);
      return false;
    }

    public boolean equals(recoverXATransaction_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_flag = true;
      boolean that_present_flag = true;
      if (this_present_flag || that_present_flag) {
        if (!(this_present_flag && that_present_flag))
          return false;
        if (this.flag != that.flag)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_flag = true;
      list.add(present_flag);
      if (present_flag)
        list.add(flag);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(recoverXATransaction_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFlag()).compareTo(other.isSetFlag());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFlag()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flag, other.flag);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("recoverXATransaction_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("flag:");
      sb.append(this.flag);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class recoverXATransaction_argsStandardSchemeFactory implements SchemeFactory {
      public recoverXATransaction_argsStandardScheme getScheme() {
        return new recoverXATransaction_argsStandardScheme();
      }
    }

    private static class recoverXATransaction_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, recoverXATransaction_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // FLAG
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.flag = iprot.readI32();
                struct.setFlagIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, recoverXATransaction_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(FLAG_FIELD_DESC);
        oprot.writeI32(struct.flag);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class recoverXATransaction_argsTupleSchemeFactory implements SchemeFactory {
      public recoverXATransaction_argsTupleScheme getScheme() {
        return new recoverXATransaction_argsTupleScheme();
      }
    }

    private static class recoverXATransaction_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, recoverXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetFlag()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetFlag()) {
          oprot.writeI32(struct.flag);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, recoverXATransaction_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.flag = iprot.readI32();
          struct.setFlagIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class recoverXATransaction_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("recoverXATransaction_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new recoverXATransaction_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new recoverXATransaction_resultTupleSchemeFactory());
    }

    public List success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TransactionXid.class))));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(recoverXATransaction_result.class, metaDataMap);
    }

    public recoverXATransaction_result() {
    }

    public recoverXATransaction_result(
      List success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public recoverXATransaction_result(recoverXATransaction_result other) {
      if (other.isSetSuccess()) {
        List __this__success = new ArrayList(other.success.size());
        for (TransactionXid other_element : other.success) {
          __this__success.add(new TransactionXid(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public recoverXATransaction_result deepCopy() {
      return new recoverXATransaction_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(TransactionXid elem) {
      if (this.success == null) {
        this.success = new ArrayList();
      }
      this.success.add(elem);
    }

    public List getSuccess() {
      return this.success;
    }

    public recoverXATransaction_result setSuccess(List 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 SnappyException getError() {
      return this.error;
    }

    public recoverXATransaction_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof recoverXATransaction_result)
        return this.equals((recoverXATransaction_result)that);
      return false;
    }

    public boolean equals(recoverXATransaction_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(recoverXATransaction_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("recoverXATransaction_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class recoverXATransaction_resultStandardSchemeFactory implements SchemeFactory {
      public recoverXATransaction_resultStandardScheme getScheme() {
        return new recoverXATransaction_resultStandardScheme();
      }
    }

    private static class recoverXATransaction_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, recoverXATransaction_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list746 = iprot.readListBegin();
                  struct.success = new ArrayList(_list746.size);
                  TransactionXid _elem747;
                  for (int _i748 = 0; _i748 < _list746.size; ++_i748)
                  {
                    _elem747 = new TransactionXid();
                    _elem747.read(iprot);
                    struct.success.add(_elem747);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, recoverXATransaction_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
            for (TransactionXid _iter749 : struct.success)
            {
              _iter749.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class recoverXATransaction_resultTupleSchemeFactory implements SchemeFactory {
      public recoverXATransaction_resultTupleScheme getScheme() {
        return new recoverXATransaction_resultTupleScheme();
      }
    }

    private static class recoverXATransaction_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, recoverXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (TransactionXid _iter750 : struct.success)
            {
              _iter750.write(oprot);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, recoverXATransaction_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list751 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList(_list751.size);
            TransactionXid _elem752;
            for (int _i753 = 0; _i753 < _list751.size; ++_i753)
            {
              _elem752 = new TransactionXid();
              _elem752.read(iprot);
              struct.success.add(_elem752);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getServiceMetaData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getServiceMetaData_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getServiceMetaData_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getServiceMetaData_argsTupleSchemeFactory());
    }

    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      TOKEN((short)2, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServiceMetaData_args.class, metaDataMap);
    }

    public getServiceMetaData_args() {
    }

    public getServiceMetaData_args(
      long connId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public getServiceMetaData_args(getServiceMetaData_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public getServiceMetaData_args deepCopy() {
      return new getServiceMetaData_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public getServiceMetaData_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public getServiceMetaData_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public getServiceMetaData_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getServiceMetaData_args)
        return this.equals((getServiceMetaData_args)that);
      return false;
    }

    public boolean equals(getServiceMetaData_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(getServiceMetaData_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getServiceMetaData_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getServiceMetaData_argsStandardSchemeFactory implements SchemeFactory {
      public getServiceMetaData_argsStandardScheme getScheme() {
        return new getServiceMetaData_argsStandardScheme();
      }
    }

    private static class getServiceMetaData_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getServiceMetaData_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getServiceMetaData_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getServiceMetaData_argsTupleSchemeFactory implements SchemeFactory {
      public getServiceMetaData_argsTupleScheme getScheme() {
        return new getServiceMetaData_argsTupleScheme();
      }
    }

    private static class getServiceMetaData_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getServiceMetaData_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getServiceMetaData_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class getServiceMetaData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getServiceMetaData_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getServiceMetaData_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getServiceMetaData_resultTupleSchemeFactory());
    }

    public ServiceMetaData success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServiceMetaData.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getServiceMetaData_result.class, metaDataMap);
    }

    public getServiceMetaData_result() {
    }

    public getServiceMetaData_result(
      ServiceMetaData success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getServiceMetaData_result(getServiceMetaData_result other) {
      if (other.isSetSuccess()) {
        this.success = new ServiceMetaData(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getServiceMetaData_result deepCopy() {
      return new getServiceMetaData_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public ServiceMetaData getSuccess() {
      return this.success;
    }

    public getServiceMetaData_result setSuccess(ServiceMetaData 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 SnappyException getError() {
      return this.error;
    }

    public getServiceMetaData_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((ServiceMetaData)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getServiceMetaData_result)
        return this.equals((getServiceMetaData_result)that);
      return false;
    }

    public boolean equals(getServiceMetaData_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getServiceMetaData_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getServiceMetaData_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getServiceMetaData_resultStandardSchemeFactory implements SchemeFactory {
      public getServiceMetaData_resultStandardScheme getScheme() {
        return new getServiceMetaData_resultStandardScheme();
      }
    }

    private static class getServiceMetaData_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getServiceMetaData_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new ServiceMetaData();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getServiceMetaData_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getServiceMetaData_resultTupleSchemeFactory implements SchemeFactory {
      public getServiceMetaData_resultTupleScheme getScheme() {
        return new getServiceMetaData_resultTupleScheme();
      }
    }

    private static class getServiceMetaData_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getServiceMetaData_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getServiceMetaData_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new ServiceMetaData();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getSchemaMetaData_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSchemaMetaData_args");

    private static final org.apache.thrift.protocol.TField SCHEMA_CALL_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaCall", org.apache.thrift.protocol.TType.I32, (short)1);
    private static final org.apache.thrift.protocol.TField METADATA_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("metadataArgs", org.apache.thrift.protocol.TType.STRUCT, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getSchemaMetaData_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getSchemaMetaData_argsTupleSchemeFactory());
    }

    /**
     * 
     * @see ServiceMetaDataCall
     */
    public ServiceMetaDataCall schemaCall; // required
    public ServiceMetaDataArgs metadataArgs; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      /**
       * 
       * @see ServiceMetaDataCall
       */
      SCHEMA_CALL((short)1, "schemaCall"),
      METADATA_ARGS((short)2, "metadataArgs");

      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: // SCHEMA_CALL
            return SCHEMA_CALL;
          case 2: // METADATA_ARGS
            return METADATA_ARGS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SCHEMA_CALL, new org.apache.thrift.meta_data.FieldMetaData("schemaCall", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ServiceMetaDataCall.class)));
      tmpMap.put(_Fields.METADATA_ARGS, new org.apache.thrift.meta_data.FieldMetaData("metadataArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServiceMetaDataArgs.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSchemaMetaData_args.class, metaDataMap);
    }

    public getSchemaMetaData_args() {
    }

    public getSchemaMetaData_args(
      ServiceMetaDataCall schemaCall,
      ServiceMetaDataArgs metadataArgs)
    {
      this();
      this.schemaCall = schemaCall;
      this.metadataArgs = metadataArgs;
    }

    /**
     * Performs a deep copy on other.
     */
    public getSchemaMetaData_args(getSchemaMetaData_args other) {
      if (other.isSetSchemaCall()) {
        this.schemaCall = other.schemaCall;
      }
      if (other.isSetMetadataArgs()) {
        this.metadataArgs = new ServiceMetaDataArgs(other.metadataArgs);
      }
    }

    public getSchemaMetaData_args deepCopy() {
      return new getSchemaMetaData_args(this);
    }

    @Override
    public void clear() {
      this.schemaCall = null;
      this.metadataArgs = null;
    }

    /**
     * 
     * @see ServiceMetaDataCall
     */
    public ServiceMetaDataCall getSchemaCall() {
      return this.schemaCall;
    }

    /**
     * 
     * @see ServiceMetaDataCall
     */
    public getSchemaMetaData_args setSchemaCall(ServiceMetaDataCall schemaCall) {
      this.schemaCall = schemaCall;
      return this;
    }

    public void unsetSchemaCall() {
      this.schemaCall = null;
    }

    /** Returns true if field schemaCall is set (has been assigned a value) and false otherwise */
    public boolean isSetSchemaCall() {
      return this.schemaCall != null;
    }

    public void setSchemaCallIsSet(boolean value) {
      if (!value) {
        this.schemaCall = null;
      }
    }

    public ServiceMetaDataArgs getMetadataArgs() {
      return this.metadataArgs;
    }

    public getSchemaMetaData_args setMetadataArgs(ServiceMetaDataArgs metadataArgs) {
      this.metadataArgs = metadataArgs;
      return this;
    }

    public void unsetMetadataArgs() {
      this.metadataArgs = null;
    }

    /** Returns true if field metadataArgs is set (has been assigned a value) and false otherwise */
    public boolean isSetMetadataArgs() {
      return this.metadataArgs != null;
    }

    public void setMetadataArgsIsSet(boolean value) {
      if (!value) {
        this.metadataArgs = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SCHEMA_CALL:
        if (value == null) {
          unsetSchemaCall();
        } else {
          setSchemaCall((ServiceMetaDataCall)value);
        }
        break;

      case METADATA_ARGS:
        if (value == null) {
          unsetMetadataArgs();
        } else {
          setMetadataArgs((ServiceMetaDataArgs)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SCHEMA_CALL:
        return getSchemaCall();

      case METADATA_ARGS:
        return getMetadataArgs();

      }
      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 SCHEMA_CALL:
        return isSetSchemaCall();
      case METADATA_ARGS:
        return isSetMetadataArgs();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSchemaMetaData_args)
        return this.equals((getSchemaMetaData_args)that);
      return false;
    }

    public boolean equals(getSchemaMetaData_args that) {
      if (that == null)
        return false;

      boolean this_present_schemaCall = true && this.isSetSchemaCall();
      boolean that_present_schemaCall = true && that.isSetSchemaCall();
      if (this_present_schemaCall || that_present_schemaCall) {
        if (!(this_present_schemaCall && that_present_schemaCall))
          return false;
        if (!this.schemaCall.equals(that.schemaCall))
          return false;
      }

      boolean this_present_metadataArgs = true && this.isSetMetadataArgs();
      boolean that_present_metadataArgs = true && that.isSetMetadataArgs();
      if (this_present_metadataArgs || that_present_metadataArgs) {
        if (!(this_present_metadataArgs && that_present_metadataArgs))
          return false;
        if (!this.metadataArgs.equals(that.metadataArgs))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_schemaCall = true && (isSetSchemaCall());
      list.add(present_schemaCall);
      if (present_schemaCall)
        list.add(schemaCall.getValue());

      boolean present_metadataArgs = true && (isSetMetadataArgs());
      list.add(present_metadataArgs);
      if (present_metadataArgs)
        list.add(metadataArgs);

      return list.hashCode();
    }

    @Override
    public int compareTo(getSchemaMetaData_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSchemaCall()).compareTo(other.isSetSchemaCall());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSchemaCall()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaCall, other.schemaCall);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetMetadataArgs()).compareTo(other.isSetMetadataArgs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMetadataArgs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadataArgs, other.metadataArgs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSchemaMetaData_args(");
      boolean first = true;

      sb.append("schemaCall:");
      if (this.schemaCall == null) {
        sb.append("null");
      } else {
        sb.append(this.schemaCall);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("metadataArgs:");
      if (this.metadataArgs == null) {
        sb.append("null");
      } else {
        sb.append(this.metadataArgs);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (metadataArgs != null) {
        metadataArgs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getSchemaMetaData_argsStandardSchemeFactory implements SchemeFactory {
      public getSchemaMetaData_argsStandardScheme getScheme() {
        return new getSchemaMetaData_argsStandardScheme();
      }
    }

    private static class getSchemaMetaData_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getSchemaMetaData_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // SCHEMA_CALL
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.schemaCall = io.snappydata.thrift.ServiceMetaDataCall.findByValue(iprot.readI32());
                struct.setSchemaCallIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // METADATA_ARGS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.metadataArgs = new ServiceMetaDataArgs();
                struct.metadataArgs.read(iprot);
                struct.setMetadataArgsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getSchemaMetaData_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.schemaCall != null) {
          oprot.writeFieldBegin(SCHEMA_CALL_FIELD_DESC);
          oprot.writeI32(struct.schemaCall.getValue());
          oprot.writeFieldEnd();
        }
        if (struct.metadataArgs != null) {
          oprot.writeFieldBegin(METADATA_ARGS_FIELD_DESC);
          struct.metadataArgs.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getSchemaMetaData_argsTupleSchemeFactory implements SchemeFactory {
      public getSchemaMetaData_argsTupleScheme getScheme() {
        return new getSchemaMetaData_argsTupleScheme();
      }
    }

    private static class getSchemaMetaData_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getSchemaMetaData_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSchemaCall()) {
          optionals.set(0);
        }
        if (struct.isSetMetadataArgs()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSchemaCall()) {
          oprot.writeI32(struct.schemaCall.getValue());
        }
        if (struct.isSetMetadataArgs()) {
          struct.metadataArgs.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getSchemaMetaData_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.schemaCall = io.snappydata.thrift.ServiceMetaDataCall.findByValue(iprot.readI32());
          struct.setSchemaCallIsSet(true);
        }
        if (incoming.get(1)) {
          struct.metadataArgs = new ServiceMetaDataArgs();
          struct.metadataArgs.read(iprot);
          struct.setMetadataArgsIsSet(true);
        }
      }
    }

  }

  public static class getSchemaMetaData_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSchemaMetaData_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getSchemaMetaData_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getSchemaMetaData_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSchemaMetaData_result.class, metaDataMap);
    }

    public getSchemaMetaData_result() {
    }

    public getSchemaMetaData_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getSchemaMetaData_result(getSchemaMetaData_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getSchemaMetaData_result deepCopy() {
      return new getSchemaMetaData_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public getSchemaMetaData_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public getSchemaMetaData_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSchemaMetaData_result)
        return this.equals((getSchemaMetaData_result)that);
      return false;
    }

    public boolean equals(getSchemaMetaData_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getSchemaMetaData_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSchemaMetaData_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getSchemaMetaData_resultStandardSchemeFactory implements SchemeFactory {
      public getSchemaMetaData_resultStandardScheme getScheme() {
        return new getSchemaMetaData_resultStandardScheme();
      }
    }

    private static class getSchemaMetaData_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getSchemaMetaData_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getSchemaMetaData_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getSchemaMetaData_resultTupleSchemeFactory implements SchemeFactory {
      public getSchemaMetaData_resultTupleScheme getScheme() {
        return new getSchemaMetaData_resultTupleScheme();
      }
    }

    private static class getSchemaMetaData_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getSchemaMetaData_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getSchemaMetaData_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getIndexInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getIndexInfo_args");

    private static final org.apache.thrift.protocol.TField METADATA_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("metadataArgs", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField UNIQUE_FIELD_DESC = new org.apache.thrift.protocol.TField("unique", org.apache.thrift.protocol.TType.BOOL, (short)2);
    private static final org.apache.thrift.protocol.TField APPROXIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("approximate", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getIndexInfo_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getIndexInfo_argsTupleSchemeFactory());
    }

    public ServiceMetaDataArgs metadataArgs; // required
    public boolean unique; // required
    public boolean approximate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      METADATA_ARGS((short)1, "metadataArgs"),
      UNIQUE((short)2, "unique"),
      APPROXIMATE((short)3, "approximate");

      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: // METADATA_ARGS
            return METADATA_ARGS;
          case 2: // UNIQUE
            return UNIQUE;
          case 3: // APPROXIMATE
            return APPROXIMATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __UNIQUE_ISSET_ID = 0;
    private static final int __APPROXIMATE_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.METADATA_ARGS, new org.apache.thrift.meta_data.FieldMetaData("metadataArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServiceMetaDataArgs.class)));
      tmpMap.put(_Fields.UNIQUE, new org.apache.thrift.meta_data.FieldMetaData("unique", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.APPROXIMATE, new org.apache.thrift.meta_data.FieldMetaData("approximate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getIndexInfo_args.class, metaDataMap);
    }

    public getIndexInfo_args() {
    }

    public getIndexInfo_args(
      ServiceMetaDataArgs metadataArgs,
      boolean unique,
      boolean approximate)
    {
      this();
      this.metadataArgs = metadataArgs;
      this.unique = unique;
      setUniqueIsSet(true);
      this.approximate = approximate;
      setApproximateIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getIndexInfo_args(getIndexInfo_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetMetadataArgs()) {
        this.metadataArgs = new ServiceMetaDataArgs(other.metadataArgs);
      }
      this.unique = other.unique;
      this.approximate = other.approximate;
    }

    public getIndexInfo_args deepCopy() {
      return new getIndexInfo_args(this);
    }

    @Override
    public void clear() {
      this.metadataArgs = null;
      setUniqueIsSet(false);
      this.unique = false;
      setApproximateIsSet(false);
      this.approximate = false;
    }

    public ServiceMetaDataArgs getMetadataArgs() {
      return this.metadataArgs;
    }

    public getIndexInfo_args setMetadataArgs(ServiceMetaDataArgs metadataArgs) {
      this.metadataArgs = metadataArgs;
      return this;
    }

    public void unsetMetadataArgs() {
      this.metadataArgs = null;
    }

    /** Returns true if field metadataArgs is set (has been assigned a value) and false otherwise */
    public boolean isSetMetadataArgs() {
      return this.metadataArgs != null;
    }

    public void setMetadataArgsIsSet(boolean value) {
      if (!value) {
        this.metadataArgs = null;
      }
    }

    public boolean isUnique() {
      return this.unique;
    }

    public getIndexInfo_args setUnique(boolean unique) {
      this.unique = unique;
      setUniqueIsSet(true);
      return this;
    }

    public void unsetUnique() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UNIQUE_ISSET_ID);
    }

    /** Returns true if field unique is set (has been assigned a value) and false otherwise */
    public boolean isSetUnique() {
      return EncodingUtils.testBit(__isset_bitfield, __UNIQUE_ISSET_ID);
    }

    public void setUniqueIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UNIQUE_ISSET_ID, value);
    }

    public boolean isApproximate() {
      return this.approximate;
    }

    public getIndexInfo_args setApproximate(boolean approximate) {
      this.approximate = approximate;
      setApproximateIsSet(true);
      return this;
    }

    public void unsetApproximate() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __APPROXIMATE_ISSET_ID);
    }

    /** Returns true if field approximate is set (has been assigned a value) and false otherwise */
    public boolean isSetApproximate() {
      return EncodingUtils.testBit(__isset_bitfield, __APPROXIMATE_ISSET_ID);
    }

    public void setApproximateIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __APPROXIMATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case METADATA_ARGS:
        if (value == null) {
          unsetMetadataArgs();
        } else {
          setMetadataArgs((ServiceMetaDataArgs)value);
        }
        break;

      case UNIQUE:
        if (value == null) {
          unsetUnique();
        } else {
          setUnique((Boolean)value);
        }
        break;

      case APPROXIMATE:
        if (value == null) {
          unsetApproximate();
        } else {
          setApproximate((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case METADATA_ARGS:
        return getMetadataArgs();

      case UNIQUE:
        return isUnique();

      case APPROXIMATE:
        return isApproximate();

      }
      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 METADATA_ARGS:
        return isSetMetadataArgs();
      case UNIQUE:
        return isSetUnique();
      case APPROXIMATE:
        return isSetApproximate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getIndexInfo_args)
        return this.equals((getIndexInfo_args)that);
      return false;
    }

    public boolean equals(getIndexInfo_args that) {
      if (that == null)
        return false;

      boolean this_present_metadataArgs = true && this.isSetMetadataArgs();
      boolean that_present_metadataArgs = true && that.isSetMetadataArgs();
      if (this_present_metadataArgs || that_present_metadataArgs) {
        if (!(this_present_metadataArgs && that_present_metadataArgs))
          return false;
        if (!this.metadataArgs.equals(that.metadataArgs))
          return false;
      }

      boolean this_present_unique = true;
      boolean that_present_unique = true;
      if (this_present_unique || that_present_unique) {
        if (!(this_present_unique && that_present_unique))
          return false;
        if (this.unique != that.unique)
          return false;
      }

      boolean this_present_approximate = true;
      boolean that_present_approximate = true;
      if (this_present_approximate || that_present_approximate) {
        if (!(this_present_approximate && that_present_approximate))
          return false;
        if (this.approximate != that.approximate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_metadataArgs = true && (isSetMetadataArgs());
      list.add(present_metadataArgs);
      if (present_metadataArgs)
        list.add(metadataArgs);

      boolean present_unique = true;
      list.add(present_unique);
      if (present_unique)
        list.add(unique);

      boolean present_approximate = true;
      list.add(present_approximate);
      if (present_approximate)
        list.add(approximate);

      return list.hashCode();
    }

    @Override
    public int compareTo(getIndexInfo_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetMetadataArgs()).compareTo(other.isSetMetadataArgs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMetadataArgs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadataArgs, other.metadataArgs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetUnique()).compareTo(other.isSetUnique());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUnique()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unique, other.unique);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetApproximate()).compareTo(other.isSetApproximate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetApproximate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.approximate, other.approximate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getIndexInfo_args(");
      boolean first = true;

      sb.append("metadataArgs:");
      if (this.metadataArgs == null) {
        sb.append("null");
      } else {
        sb.append(this.metadataArgs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("unique:");
      sb.append(this.unique);
      first = false;
      if (!first) sb.append(", ");
      sb.append("approximate:");
      sb.append(this.approximate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (metadataArgs != null) {
        metadataArgs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getIndexInfo_argsStandardSchemeFactory implements SchemeFactory {
      public getIndexInfo_argsStandardScheme getScheme() {
        return new getIndexInfo_argsStandardScheme();
      }
    }

    private static class getIndexInfo_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getIndexInfo_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // METADATA_ARGS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.metadataArgs = new ServiceMetaDataArgs();
                struct.metadataArgs.read(iprot);
                struct.setMetadataArgsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // UNIQUE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.unique = iprot.readBool();
                struct.setUniqueIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // APPROXIMATE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.approximate = iprot.readBool();
                struct.setApproximateIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getIndexInfo_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.metadataArgs != null) {
          oprot.writeFieldBegin(METADATA_ARGS_FIELD_DESC);
          struct.metadataArgs.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(UNIQUE_FIELD_DESC);
        oprot.writeBool(struct.unique);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(APPROXIMATE_FIELD_DESC);
        oprot.writeBool(struct.approximate);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getIndexInfo_argsTupleSchemeFactory implements SchemeFactory {
      public getIndexInfo_argsTupleScheme getScheme() {
        return new getIndexInfo_argsTupleScheme();
      }
    }

    private static class getIndexInfo_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getIndexInfo_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetMetadataArgs()) {
          optionals.set(0);
        }
        if (struct.isSetUnique()) {
          optionals.set(1);
        }
        if (struct.isSetApproximate()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetMetadataArgs()) {
          struct.metadataArgs.write(oprot);
        }
        if (struct.isSetUnique()) {
          oprot.writeBool(struct.unique);
        }
        if (struct.isSetApproximate()) {
          oprot.writeBool(struct.approximate);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getIndexInfo_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.metadataArgs = new ServiceMetaDataArgs();
          struct.metadataArgs.read(iprot);
          struct.setMetadataArgsIsSet(true);
        }
        if (incoming.get(1)) {
          struct.unique = iprot.readBool();
          struct.setUniqueIsSet(true);
        }
        if (incoming.get(2)) {
          struct.approximate = iprot.readBool();
          struct.setApproximateIsSet(true);
        }
      }
    }

  }

  public static class getIndexInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getIndexInfo_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getIndexInfo_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getIndexInfo_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getIndexInfo_result.class, metaDataMap);
    }

    public getIndexInfo_result() {
    }

    public getIndexInfo_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getIndexInfo_result(getIndexInfo_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getIndexInfo_result deepCopy() {
      return new getIndexInfo_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public getIndexInfo_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public getIndexInfo_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getIndexInfo_result)
        return this.equals((getIndexInfo_result)that);
      return false;
    }

    public boolean equals(getIndexInfo_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getIndexInfo_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getIndexInfo_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getIndexInfo_resultStandardSchemeFactory implements SchemeFactory {
      public getIndexInfo_resultStandardScheme getScheme() {
        return new getIndexInfo_resultStandardScheme();
      }
    }

    private static class getIndexInfo_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getIndexInfo_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getIndexInfo_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getIndexInfo_resultTupleSchemeFactory implements SchemeFactory {
      public getIndexInfo_resultTupleScheme getScheme() {
        return new getIndexInfo_resultTupleScheme();
      }
    }

    private static class getIndexInfo_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getIndexInfo_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getIndexInfo_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getUDTs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUDTs_args");

    private static final org.apache.thrift.protocol.TField METADATA_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("metadataArgs", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getUDTs_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getUDTs_argsTupleSchemeFactory());
    }

    public ServiceMetaDataArgs metadataArgs; // required
    public List types; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      METADATA_ARGS((short)1, "metadataArgs"),
      TYPES((short)2, "types");

      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: // METADATA_ARGS
            return METADATA_ARGS;
          case 2: // TYPES
            return TYPES;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.METADATA_ARGS, new org.apache.thrift.meta_data.FieldMetaData("metadataArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServiceMetaDataArgs.class)));
      tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SnappyType.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUDTs_args.class, metaDataMap);
    }

    public getUDTs_args() {
    }

    public getUDTs_args(
      ServiceMetaDataArgs metadataArgs,
      List types)
    {
      this();
      this.metadataArgs = metadataArgs;
      this.types = types;
    }

    /**
     * Performs a deep copy on other.
     */
    public getUDTs_args(getUDTs_args other) {
      if (other.isSetMetadataArgs()) {
        this.metadataArgs = new ServiceMetaDataArgs(other.metadataArgs);
      }
      if (other.isSetTypes()) {
        List __this__types = new ArrayList(other.types.size());
        for (SnappyType other_element : other.types) {
          __this__types.add(other_element);
        }
        this.types = __this__types;
      }
    }

    public getUDTs_args deepCopy() {
      return new getUDTs_args(this);
    }

    @Override
    public void clear() {
      this.metadataArgs = null;
      this.types = null;
    }

    public ServiceMetaDataArgs getMetadataArgs() {
      return this.metadataArgs;
    }

    public getUDTs_args setMetadataArgs(ServiceMetaDataArgs metadataArgs) {
      this.metadataArgs = metadataArgs;
      return this;
    }

    public void unsetMetadataArgs() {
      this.metadataArgs = null;
    }

    /** Returns true if field metadataArgs is set (has been assigned a value) and false otherwise */
    public boolean isSetMetadataArgs() {
      return this.metadataArgs != null;
    }

    public void setMetadataArgsIsSet(boolean value) {
      if (!value) {
        this.metadataArgs = null;
      }
    }

    public int getTypesSize() {
      return (this.types == null) ? 0 : this.types.size();
    }

    public java.util.Iterator getTypesIterator() {
      return (this.types == null) ? null : this.types.iterator();
    }

    public void addToTypes(SnappyType elem) {
      if (this.types == null) {
        this.types = new ArrayList();
      }
      this.types.add(elem);
    }

    public List getTypes() {
      return this.types;
    }

    public getUDTs_args setTypes(List types) {
      this.types = types;
      return this;
    }

    public void unsetTypes() {
      this.types = null;
    }

    /** Returns true if field types is set (has been assigned a value) and false otherwise */
    public boolean isSetTypes() {
      return this.types != null;
    }

    public void setTypesIsSet(boolean value) {
      if (!value) {
        this.types = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case METADATA_ARGS:
        if (value == null) {
          unsetMetadataArgs();
        } else {
          setMetadataArgs((ServiceMetaDataArgs)value);
        }
        break;

      case TYPES:
        if (value == null) {
          unsetTypes();
        } else {
          setTypes((List)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case METADATA_ARGS:
        return getMetadataArgs();

      case TYPES:
        return getTypes();

      }
      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 METADATA_ARGS:
        return isSetMetadataArgs();
      case TYPES:
        return isSetTypes();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getUDTs_args)
        return this.equals((getUDTs_args)that);
      return false;
    }

    public boolean equals(getUDTs_args that) {
      if (that == null)
        return false;

      boolean this_present_metadataArgs = true && this.isSetMetadataArgs();
      boolean that_present_metadataArgs = true && that.isSetMetadataArgs();
      if (this_present_metadataArgs || that_present_metadataArgs) {
        if (!(this_present_metadataArgs && that_present_metadataArgs))
          return false;
        if (!this.metadataArgs.equals(that.metadataArgs))
          return false;
      }

      boolean this_present_types = true && this.isSetTypes();
      boolean that_present_types = true && that.isSetTypes();
      if (this_present_types || that_present_types) {
        if (!(this_present_types && that_present_types))
          return false;
        if (!this.types.equals(that.types))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_metadataArgs = true && (isSetMetadataArgs());
      list.add(present_metadataArgs);
      if (present_metadataArgs)
        list.add(metadataArgs);

      boolean present_types = true && (isSetTypes());
      list.add(present_types);
      if (present_types)
        list.add(types);

      return list.hashCode();
    }

    @Override
    public int compareTo(getUDTs_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetMetadataArgs()).compareTo(other.isSetMetadataArgs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMetadataArgs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadataArgs, other.metadataArgs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTypes()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, other.types);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getUDTs_args(");
      boolean first = true;

      sb.append("metadataArgs:");
      if (this.metadataArgs == null) {
        sb.append("null");
      } else {
        sb.append(this.metadataArgs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("types:");
      if (this.types == null) {
        sb.append("null");
      } else {
        sb.append(this.types);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (metadataArgs != null) {
        metadataArgs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getUDTs_argsStandardSchemeFactory implements SchemeFactory {
      public getUDTs_argsStandardScheme getScheme() {
        return new getUDTs_argsStandardScheme();
      }
    }

    private static class getUDTs_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUDTs_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // METADATA_ARGS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.metadataArgs = new ServiceMetaDataArgs();
                struct.metadataArgs.read(iprot);
                struct.setMetadataArgsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TYPES
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list754 = iprot.readListBegin();
                  struct.types = new ArrayList(_list754.size);
                  SnappyType _elem755;
                  for (int _i756 = 0; _i756 < _list754.size; ++_i756)
                  {
                    _elem755 = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
                    struct.types.add(_elem755);
                  }
                  iprot.readListEnd();
                }
                struct.setTypesIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getUDTs_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.metadataArgs != null) {
          oprot.writeFieldBegin(METADATA_ARGS_FIELD_DESC);
          struct.metadataArgs.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.types != null) {
          oprot.writeFieldBegin(TYPES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.types.size()));
            for (SnappyType _iter757 : struct.types)
            {
              oprot.writeI32(_iter757.getValue());
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUDTs_argsTupleSchemeFactory implements SchemeFactory {
      public getUDTs_argsTupleScheme getScheme() {
        return new getUDTs_argsTupleScheme();
      }
    }

    private static class getUDTs_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getUDTs_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetMetadataArgs()) {
          optionals.set(0);
        }
        if (struct.isSetTypes()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetMetadataArgs()) {
          struct.metadataArgs.write(oprot);
        }
        if (struct.isSetTypes()) {
          {
            oprot.writeI32(struct.types.size());
            for (SnappyType _iter758 : struct.types)
            {
              oprot.writeI32(_iter758.getValue());
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getUDTs_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.metadataArgs = new ServiceMetaDataArgs();
          struct.metadataArgs.read(iprot);
          struct.setMetadataArgsIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list759 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
            struct.types = new ArrayList(_list759.size);
            SnappyType _elem760;
            for (int _i761 = 0; _i761 < _list759.size; ++_i761)
            {
              _elem760 = io.snappydata.thrift.SnappyType.findByValue(iprot.readI32());
              struct.types.add(_elem760);
            }
          }
          struct.setTypesIsSet(true);
        }
      }
    }

  }

  public static class getUDTs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUDTs_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getUDTs_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getUDTs_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUDTs_result.class, metaDataMap);
    }

    public getUDTs_result() {
    }

    public getUDTs_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getUDTs_result(getUDTs_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getUDTs_result deepCopy() {
      return new getUDTs_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public getUDTs_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public getUDTs_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getUDTs_result)
        return this.equals((getUDTs_result)that);
      return false;
    }

    public boolean equals(getUDTs_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getUDTs_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getUDTs_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getUDTs_resultStandardSchemeFactory implements SchemeFactory {
      public getUDTs_resultStandardScheme getScheme() {
        return new getUDTs_resultStandardScheme();
      }
    }

    private static class getUDTs_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUDTs_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getUDTs_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUDTs_resultTupleSchemeFactory implements SchemeFactory {
      public getUDTs_resultTupleScheme getScheme() {
        return new getUDTs_resultTupleScheme();
      }
    }

    private static class getUDTs_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getUDTs_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getUDTs_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class getBestRowIdentifier_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestRowIdentifier_args");

    private static final org.apache.thrift.protocol.TField METADATA_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("metadataArgs", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField SCOPE_FIELD_DESC = new org.apache.thrift.protocol.TField("scope", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField NULLABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("nullable", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getBestRowIdentifier_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getBestRowIdentifier_argsTupleSchemeFactory());
    }

    public ServiceMetaDataArgs metadataArgs; // required
    public int scope; // required
    public boolean nullable; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      METADATA_ARGS((short)1, "metadataArgs"),
      SCOPE((short)2, "scope"),
      NULLABLE((short)3, "nullable");

      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: // METADATA_ARGS
            return METADATA_ARGS;
          case 2: // SCOPE
            return SCOPE;
          case 3: // NULLABLE
            return NULLABLE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SCOPE_ISSET_ID = 0;
    private static final int __NULLABLE_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.METADATA_ARGS, new org.apache.thrift.meta_data.FieldMetaData("metadataArgs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServiceMetaDataArgs.class)));
      tmpMap.put(_Fields.SCOPE, new org.apache.thrift.meta_data.FieldMetaData("scope", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.NULLABLE, new org.apache.thrift.meta_data.FieldMetaData("nullable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBestRowIdentifier_args.class, metaDataMap);
    }

    public getBestRowIdentifier_args() {
    }

    public getBestRowIdentifier_args(
      ServiceMetaDataArgs metadataArgs,
      int scope,
      boolean nullable)
    {
      this();
      this.metadataArgs = metadataArgs;
      this.scope = scope;
      setScopeIsSet(true);
      this.nullable = nullable;
      setNullableIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getBestRowIdentifier_args(getBestRowIdentifier_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetMetadataArgs()) {
        this.metadataArgs = new ServiceMetaDataArgs(other.metadataArgs);
      }
      this.scope = other.scope;
      this.nullable = other.nullable;
    }

    public getBestRowIdentifier_args deepCopy() {
      return new getBestRowIdentifier_args(this);
    }

    @Override
    public void clear() {
      this.metadataArgs = null;
      setScopeIsSet(false);
      this.scope = 0;
      setNullableIsSet(false);
      this.nullable = false;
    }

    public ServiceMetaDataArgs getMetadataArgs() {
      return this.metadataArgs;
    }

    public getBestRowIdentifier_args setMetadataArgs(ServiceMetaDataArgs metadataArgs) {
      this.metadataArgs = metadataArgs;
      return this;
    }

    public void unsetMetadataArgs() {
      this.metadataArgs = null;
    }

    /** Returns true if field metadataArgs is set (has been assigned a value) and false otherwise */
    public boolean isSetMetadataArgs() {
      return this.metadataArgs != null;
    }

    public void setMetadataArgsIsSet(boolean value) {
      if (!value) {
        this.metadataArgs = null;
      }
    }

    public int getScope() {
      return this.scope;
    }

    public getBestRowIdentifier_args setScope(int scope) {
      this.scope = scope;
      setScopeIsSet(true);
      return this;
    }

    public void unsetScope() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SCOPE_ISSET_ID);
    }

    /** Returns true if field scope is set (has been assigned a value) and false otherwise */
    public boolean isSetScope() {
      return EncodingUtils.testBit(__isset_bitfield, __SCOPE_ISSET_ID);
    }

    public void setScopeIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCOPE_ISSET_ID, value);
    }

    public boolean isNullable() {
      return this.nullable;
    }

    public getBestRowIdentifier_args setNullable(boolean nullable) {
      this.nullable = nullable;
      setNullableIsSet(true);
      return this;
    }

    public void unsetNullable() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NULLABLE_ISSET_ID);
    }

    /** Returns true if field nullable is set (has been assigned a value) and false otherwise */
    public boolean isSetNullable() {
      return EncodingUtils.testBit(__isset_bitfield, __NULLABLE_ISSET_ID);
    }

    public void setNullableIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NULLABLE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case METADATA_ARGS:
        if (value == null) {
          unsetMetadataArgs();
        } else {
          setMetadataArgs((ServiceMetaDataArgs)value);
        }
        break;

      case SCOPE:
        if (value == null) {
          unsetScope();
        } else {
          setScope((Integer)value);
        }
        break;

      case NULLABLE:
        if (value == null) {
          unsetNullable();
        } else {
          setNullable((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case METADATA_ARGS:
        return getMetadataArgs();

      case SCOPE:
        return getScope();

      case NULLABLE:
        return isNullable();

      }
      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 METADATA_ARGS:
        return isSetMetadataArgs();
      case SCOPE:
        return isSetScope();
      case NULLABLE:
        return isSetNullable();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestRowIdentifier_args)
        return this.equals((getBestRowIdentifier_args)that);
      return false;
    }

    public boolean equals(getBestRowIdentifier_args that) {
      if (that == null)
        return false;

      boolean this_present_metadataArgs = true && this.isSetMetadataArgs();
      boolean that_present_metadataArgs = true && that.isSetMetadataArgs();
      if (this_present_metadataArgs || that_present_metadataArgs) {
        if (!(this_present_metadataArgs && that_present_metadataArgs))
          return false;
        if (!this.metadataArgs.equals(that.metadataArgs))
          return false;
      }

      boolean this_present_scope = true;
      boolean that_present_scope = true;
      if (this_present_scope || that_present_scope) {
        if (!(this_present_scope && that_present_scope))
          return false;
        if (this.scope != that.scope)
          return false;
      }

      boolean this_present_nullable = true;
      boolean that_present_nullable = true;
      if (this_present_nullable || that_present_nullable) {
        if (!(this_present_nullable && that_present_nullable))
          return false;
        if (this.nullable != that.nullable)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_metadataArgs = true && (isSetMetadataArgs());
      list.add(present_metadataArgs);
      if (present_metadataArgs)
        list.add(metadataArgs);

      boolean present_scope = true;
      list.add(present_scope);
      if (present_scope)
        list.add(scope);

      boolean present_nullable = true;
      list.add(present_nullable);
      if (present_nullable)
        list.add(nullable);

      return list.hashCode();
    }

    @Override
    public int compareTo(getBestRowIdentifier_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetMetadataArgs()).compareTo(other.isSetMetadataArgs());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMetadataArgs()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metadataArgs, other.metadataArgs);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetScope()).compareTo(other.isSetScope());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetScope()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scope, other.scope);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetNullable()).compareTo(other.isSetNullable());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNullable()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nullable, other.nullable);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestRowIdentifier_args(");
      boolean first = true;

      sb.append("metadataArgs:");
      if (this.metadataArgs == null) {
        sb.append("null");
      } else {
        sb.append(this.metadataArgs);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("scope:");
      sb.append(this.scope);
      first = false;
      if (!first) sb.append(", ");
      sb.append("nullable:");
      sb.append(this.nullable);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (metadataArgs != null) {
        metadataArgs.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getBestRowIdentifier_argsStandardSchemeFactory implements SchemeFactory {
      public getBestRowIdentifier_argsStandardScheme getScheme() {
        return new getBestRowIdentifier_argsStandardScheme();
      }
    }

    private static class getBestRowIdentifier_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getBestRowIdentifier_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // METADATA_ARGS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.metadataArgs = new ServiceMetaDataArgs();
                struct.metadataArgs.read(iprot);
                struct.setMetadataArgsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SCOPE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.scope = iprot.readI32();
                struct.setScopeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // NULLABLE
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.nullable = iprot.readBool();
                struct.setNullableIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getBestRowIdentifier_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.metadataArgs != null) {
          oprot.writeFieldBegin(METADATA_ARGS_FIELD_DESC);
          struct.metadataArgs.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(SCOPE_FIELD_DESC);
        oprot.writeI32(struct.scope);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(NULLABLE_FIELD_DESC);
        oprot.writeBool(struct.nullable);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getBestRowIdentifier_argsTupleSchemeFactory implements SchemeFactory {
      public getBestRowIdentifier_argsTupleScheme getScheme() {
        return new getBestRowIdentifier_argsTupleScheme();
      }
    }

    private static class getBestRowIdentifier_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getBestRowIdentifier_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetMetadataArgs()) {
          optionals.set(0);
        }
        if (struct.isSetScope()) {
          optionals.set(1);
        }
        if (struct.isSetNullable()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetMetadataArgs()) {
          struct.metadataArgs.write(oprot);
        }
        if (struct.isSetScope()) {
          oprot.writeI32(struct.scope);
        }
        if (struct.isSetNullable()) {
          oprot.writeBool(struct.nullable);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getBestRowIdentifier_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.metadataArgs = new ServiceMetaDataArgs();
          struct.metadataArgs.read(iprot);
          struct.setMetadataArgsIsSet(true);
        }
        if (incoming.get(1)) {
          struct.scope = iprot.readI32();
          struct.setScopeIsSet(true);
        }
        if (incoming.get(2)) {
          struct.nullable = iprot.readBool();
          struct.setNullableIsSet(true);
        }
      }
    }

  }

  public static class getBestRowIdentifier_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getBestRowIdentifier_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getBestRowIdentifier_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getBestRowIdentifier_resultTupleSchemeFactory());
    }

    public RowSet success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RowSet.class)));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getBestRowIdentifier_result.class, metaDataMap);
    }

    public getBestRowIdentifier_result() {
    }

    public getBestRowIdentifier_result(
      RowSet success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public getBestRowIdentifier_result(getBestRowIdentifier_result other) {
      if (other.isSetSuccess()) {
        this.success = new RowSet(other.success);
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public getBestRowIdentifier_result deepCopy() {
      return new getBestRowIdentifier_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public RowSet getSuccess() {
      return this.success;
    }

    public getBestRowIdentifier_result setSuccess(RowSet 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 SnappyException getError() {
      return this.error;
    }

    public getBestRowIdentifier_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RowSet)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getBestRowIdentifier_result)
        return this.equals((getBestRowIdentifier_result)that);
      return false;
    }

    public boolean equals(getBestRowIdentifier_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(getBestRowIdentifier_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getBestRowIdentifier_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (success != null) {
        success.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class getBestRowIdentifier_resultStandardSchemeFactory implements SchemeFactory {
      public getBestRowIdentifier_resultStandardScheme getScheme() {
        return new getBestRowIdentifier_resultStandardScheme();
      }
    }

    private static class getBestRowIdentifier_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getBestRowIdentifier_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new RowSet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, getBestRowIdentifier_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getBestRowIdentifier_resultTupleSchemeFactory implements SchemeFactory {
      public getBestRowIdentifier_resultTupleScheme getScheme() {
        return new getBestRowIdentifier_resultTupleScheme();
      }
    }

    private static class getBestRowIdentifier_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getBestRowIdentifier_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getBestRowIdentifier_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new RowSet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class fetchActiveConnections_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchActiveConnections_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new fetchActiveConnections_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new fetchActiveConnections_argsTupleSchemeFactory());
    }

    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      TOKEN((short)2, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchActiveConnections_args.class, metaDataMap);
    }

    public fetchActiveConnections_args() {
    }

    public fetchActiveConnections_args(
      long connId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchActiveConnections_args(fetchActiveConnections_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public fetchActiveConnections_args deepCopy() {
      return new fetchActiveConnections_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public fetchActiveConnections_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public fetchActiveConnections_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public fetchActiveConnections_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchActiveConnections_args)
        return this.equals((fetchActiveConnections_args)that);
      return false;
    }

    public boolean equals(fetchActiveConnections_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(fetchActiveConnections_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchActiveConnections_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class fetchActiveConnections_argsStandardSchemeFactory implements SchemeFactory {
      public fetchActiveConnections_argsStandardScheme getScheme() {
        return new fetchActiveConnections_argsStandardScheme();
      }
    }

    private static class fetchActiveConnections_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchActiveConnections_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, fetchActiveConnections_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchActiveConnections_argsTupleSchemeFactory implements SchemeFactory {
      public fetchActiveConnections_argsTupleScheme getScheme() {
        return new fetchActiveConnections_argsTupleScheme();
      }
    }

    private static class fetchActiveConnections_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchActiveConnections_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchActiveConnections_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class fetchActiveConnections_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchActiveConnections_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new fetchActiveConnections_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new fetchActiveConnections_resultTupleSchemeFactory());
    }

    public List success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ConnectionProperties.class))));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchActiveConnections_result.class, metaDataMap);
    }

    public fetchActiveConnections_result() {
    }

    public fetchActiveConnections_result(
      List success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchActiveConnections_result(fetchActiveConnections_result other) {
      if (other.isSetSuccess()) {
        List __this__success = new ArrayList(other.success.size());
        for (ConnectionProperties other_element : other.success) {
          __this__success.add(new ConnectionProperties(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public fetchActiveConnections_result deepCopy() {
      return new fetchActiveConnections_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(ConnectionProperties elem) {
      if (this.success == null) {
        this.success = new ArrayList();
      }
      this.success.add(elem);
    }

    public List getSuccess() {
      return this.success;
    }

    public fetchActiveConnections_result setSuccess(List 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 SnappyException getError() {
      return this.error;
    }

    public fetchActiveConnections_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchActiveConnections_result)
        return this.equals((fetchActiveConnections_result)that);
      return false;
    }

    public boolean equals(fetchActiveConnections_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(fetchActiveConnections_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchActiveConnections_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class fetchActiveConnections_resultStandardSchemeFactory implements SchemeFactory {
      public fetchActiveConnections_resultStandardScheme getScheme() {
        return new fetchActiveConnections_resultStandardScheme();
      }
    }

    private static class fetchActiveConnections_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchActiveConnections_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list762 = iprot.readListBegin();
                  struct.success = new ArrayList(_list762.size);
                  ConnectionProperties _elem763;
                  for (int _i764 = 0; _i764 < _list762.size; ++_i764)
                  {
                    _elem763 = new ConnectionProperties();
                    _elem763.read(iprot);
                    struct.success.add(_elem763);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, fetchActiveConnections_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
            for (ConnectionProperties _iter765 : struct.success)
            {
              _iter765.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchActiveConnections_resultTupleSchemeFactory implements SchemeFactory {
      public fetchActiveConnections_resultTupleScheme getScheme() {
        return new fetchActiveConnections_resultTupleScheme();
      }
    }

    private static class fetchActiveConnections_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchActiveConnections_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (ConnectionProperties _iter766 : struct.success)
            {
              _iter766.write(oprot);
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchActiveConnections_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list767 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new ArrayList(_list767.size);
            ConnectionProperties _elem768;
            for (int _i769 = 0; _i769 < _list767.size; ++_i769)
            {
              _elem768 = new ConnectionProperties();
              _elem768.read(iprot);
              struct.success.add(_elem768);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class fetchActiveStatements_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchActiveStatements_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new fetchActiveStatements_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new fetchActiveStatements_argsTupleSchemeFactory());
    }

    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      TOKEN((short)2, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchActiveStatements_args.class, metaDataMap);
    }

    public fetchActiveStatements_args() {
    }

    public fetchActiveStatements_args(
      long connId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchActiveStatements_args(fetchActiveStatements_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public fetchActiveStatements_args deepCopy() {
      return new fetchActiveStatements_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public fetchActiveStatements_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public fetchActiveStatements_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public fetchActiveStatements_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchActiveStatements_args)
        return this.equals((fetchActiveStatements_args)that);
      return false;
    }

    public boolean equals(fetchActiveStatements_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(fetchActiveStatements_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchActiveStatements_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class fetchActiveStatements_argsStandardSchemeFactory implements SchemeFactory {
      public fetchActiveStatements_argsStandardScheme getScheme() {
        return new fetchActiveStatements_argsStandardScheme();
      }
    }

    private static class fetchActiveStatements_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchActiveStatements_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, fetchActiveStatements_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchActiveStatements_argsTupleSchemeFactory implements SchemeFactory {
      public fetchActiveStatements_argsTupleScheme getScheme() {
        return new fetchActiveStatements_argsTupleScheme();
      }
    }

    private static class fetchActiveStatements_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchActiveStatements_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchActiveStatements_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class fetchActiveStatements_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("fetchActiveStatements_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new fetchActiveStatements_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new fetchActiveStatements_resultTupleSchemeFactory());
    }

    public Map success; // required
    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchActiveStatements_result.class, metaDataMap);
    }

    public fetchActiveStatements_result() {
    }

    public fetchActiveStatements_result(
      Map success,
      SnappyException error)
    {
      this();
      this.success = success;
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchActiveStatements_result(fetchActiveStatements_result other) {
      if (other.isSetSuccess()) {
        Map __this__success = new HashMap(other.success);
        this.success = __this__success;
      }
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public fetchActiveStatements_result deepCopy() {
      return new fetchActiveStatements_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.error = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public void putToSuccess(long key, String val) {
      if (this.success == null) {
        this.success = new HashMap();
      }
      this.success.put(key, val);
    }

    public Map getSuccess() {
      return this.success;
    }

    public fetchActiveStatements_result setSuccess(Map 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 SnappyException getError() {
      return this.error;
    }

    public fetchActiveStatements_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Map)value);
        }
        break;

      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof fetchActiveStatements_result)
        return this.equals((fetchActiveStatements_result)that);
      return false;
    }

    public boolean equals(fetchActiveStatements_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_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          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_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(fetchActiveStatements_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("fetchActiveStatements_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("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class fetchActiveStatements_resultStandardSchemeFactory implements SchemeFactory {
      public fetchActiveStatements_resultStandardScheme getScheme() {
        return new fetchActiveStatements_resultStandardScheme();
      }
    }

    private static class fetchActiveStatements_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchActiveStatements_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map770 = iprot.readMapBegin();
                  struct.success = new HashMap(2*_map770.size);
                  long _key771;
                  String _val772;
                  for (int _i773 = 0; _i773 < _map770.size; ++_i773)
                  {
                    _key771 = iprot.readI64();
                    _val772 = iprot.readString();
                    struct.success.put(_key771, _val772);
                  }
                  iprot.readMapEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, fetchActiveStatements_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (Map.Entry _iter774 : struct.success.entrySet())
            {
              oprot.writeI64(_iter774.getKey());
              oprot.writeString(_iter774.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchActiveStatements_resultTupleSchemeFactory implements SchemeFactory {
      public fetchActiveStatements_resultTupleScheme getScheme() {
        return new fetchActiveStatements_resultTupleScheme();
      }
    }

    private static class fetchActiveStatements_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchActiveStatements_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetError()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (Map.Entry _iter775 : struct.success.entrySet())
            {
              oprot.writeI64(_iter775.getKey());
              oprot.writeString(_iter775.getValue());
            }
          }
        }
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchActiveStatements_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TMap _map776 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.success = new HashMap(2*_map776.size);
            long _key777;
            String _val778;
            for (int _i779 = 0; _i779 < _map776.size; ++_i779)
            {
              _key777 = iprot.readI64();
              _val778 = iprot.readString();
              struct.success.put(_key777, _val778);
            }
          }
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class cancelStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelStatement_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new cancelStatement_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new cancelStatement_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      TOKEN((short)2, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelStatement_args.class, metaDataMap);
    }

    public cancelStatement_args() {
    }

    public cancelStatement_args(
      long stmtId,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public cancelStatement_args(cancelStatement_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public cancelStatement_args deepCopy() {
      return new cancelStatement_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public cancelStatement_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public cancelStatement_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public cancelStatement_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof cancelStatement_args)
        return this.equals((cancelStatement_args)that);
      return false;
    }

    public boolean equals(cancelStatement_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(cancelStatement_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("cancelStatement_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class cancelStatement_argsStandardSchemeFactory implements SchemeFactory {
      public cancelStatement_argsStandardScheme getScheme() {
        return new cancelStatement_argsStandardScheme();
      }
    }

    private static class cancelStatement_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, cancelStatement_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, cancelStatement_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class cancelStatement_argsTupleSchemeFactory implements SchemeFactory {
      public cancelStatement_argsTupleScheme getScheme() {
        return new cancelStatement_argsTupleScheme();
      }
    }

    private static class cancelStatement_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, cancelStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, cancelStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class cancelStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelStatement_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new cancelStatement_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new cancelStatement_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelStatement_result.class, metaDataMap);
    }

    public cancelStatement_result() {
    }

    public cancelStatement_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public cancelStatement_result(cancelStatement_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public cancelStatement_result deepCopy() {
      return new cancelStatement_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public cancelStatement_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof cancelStatement_result)
        return this.equals((cancelStatement_result)that);
      return false;
    }

    public boolean equals(cancelStatement_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(cancelStatement_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("cancelStatement_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class cancelStatement_resultStandardSchemeFactory implements SchemeFactory {
      public cancelStatement_resultStandardScheme getScheme() {
        return new cancelStatement_resultStandardScheme();
      }
    }

    private static class cancelStatement_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, cancelStatement_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, cancelStatement_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class cancelStatement_resultTupleSchemeFactory implements SchemeFactory {
      public cancelStatement_resultTupleScheme getScheme() {
        return new cancelStatement_resultTupleScheme();
      }
    }

    private static class cancelStatement_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, cancelStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, cancelStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class cancelCurrentStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelCurrentStatement_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new cancelCurrentStatement_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new cancelCurrentStatement_argsTupleSchemeFactory());
    }

    public long connId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      TOKEN((short)2, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelCurrentStatement_args.class, metaDataMap);
    }

    public cancelCurrentStatement_args() {
    }

    public cancelCurrentStatement_args(
      long connId,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public cancelCurrentStatement_args(cancelCurrentStatement_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public cancelCurrentStatement_args deepCopy() {
      return new cancelCurrentStatement_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public cancelCurrentStatement_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public cancelCurrentStatement_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public cancelCurrentStatement_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof cancelCurrentStatement_args)
        return this.equals((cancelCurrentStatement_args)that);
      return false;
    }

    public boolean equals(cancelCurrentStatement_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(cancelCurrentStatement_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("cancelCurrentStatement_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class cancelCurrentStatement_argsStandardSchemeFactory implements SchemeFactory {
      public cancelCurrentStatement_argsStandardScheme getScheme() {
        return new cancelCurrentStatement_argsStandardScheme();
      }
    }

    private static class cancelCurrentStatement_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, cancelCurrentStatement_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, cancelCurrentStatement_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class cancelCurrentStatement_argsTupleSchemeFactory implements SchemeFactory {
      public cancelCurrentStatement_argsTupleScheme getScheme() {
        return new cancelCurrentStatement_argsTupleScheme();
      }
    }

    private static class cancelCurrentStatement_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, cancelCurrentStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, cancelCurrentStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class cancelCurrentStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cancelCurrentStatement_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new cancelCurrentStatement_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new cancelCurrentStatement_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cancelCurrentStatement_result.class, metaDataMap);
    }

    public cancelCurrentStatement_result() {
    }

    public cancelCurrentStatement_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public cancelCurrentStatement_result(cancelCurrentStatement_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public cancelCurrentStatement_result deepCopy() {
      return new cancelCurrentStatement_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public cancelCurrentStatement_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof cancelCurrentStatement_result)
        return this.equals((cancelCurrentStatement_result)that);
      return false;
    }

    public boolean equals(cancelCurrentStatement_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(cancelCurrentStatement_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("cancelCurrentStatement_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class cancelCurrentStatement_resultStandardSchemeFactory implements SchemeFactory {
      public cancelCurrentStatement_resultStandardScheme getScheme() {
        return new cancelCurrentStatement_resultStandardScheme();
      }
    }

    private static class cancelCurrentStatement_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, cancelCurrentStatement_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, cancelCurrentStatement_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class cancelCurrentStatement_resultTupleSchemeFactory implements SchemeFactory {
      public cancelCurrentStatement_resultTupleScheme getScheme() {
        return new cancelCurrentStatement_resultTupleScheme();
      }
    }

    private static class cancelCurrentStatement_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, cancelCurrentStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, cancelCurrentStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class closeResultSet_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeResultSet_args");

    private static final org.apache.thrift.protocol.TField CURSOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cursorId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new closeResultSet_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new closeResultSet_argsTupleSchemeFactory());
    }

    public long cursorId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CURSOR_ID((short)1, "cursorId"),
      TOKEN((short)2, "token");

      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: // CURSOR_ID
            return CURSOR_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CURSORID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CURSOR_ID, new org.apache.thrift.meta_data.FieldMetaData("cursorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeResultSet_args.class, metaDataMap);
    }

    public closeResultSet_args() {
    }

    public closeResultSet_args(
      long cursorId,
      ByteBuffer token)
    {
      this();
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public closeResultSet_args(closeResultSet_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.cursorId = other.cursorId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public closeResultSet_args deepCopy() {
      return new closeResultSet_args(this);
    }

    @Override
    public void clear() {
      setCursorIdIsSet(false);
      this.cursorId = 0;
      this.token = null;
    }

    public long getCursorId() {
      return this.cursorId;
    }

    public closeResultSet_args setCursorId(long cursorId) {
      this.cursorId = cursorId;
      setCursorIdIsSet(true);
      return this;
    }

    public void unsetCursorId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    /** Returns true if field cursorId is set (has been assigned a value) and false otherwise */
    public boolean isSetCursorId() {
      return EncodingUtils.testBit(__isset_bitfield, __CURSORID_ISSET_ID);
    }

    public void setCursorIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CURSORID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public closeResultSet_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public closeResultSet_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CURSOR_ID:
        if (value == null) {
          unsetCursorId();
        } else {
          setCursorId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CURSOR_ID:
        return getCursorId();

      case TOKEN:
        return getToken();

      }
      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 CURSOR_ID:
        return isSetCursorId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof closeResultSet_args)
        return this.equals((closeResultSet_args)that);
      return false;
    }

    public boolean equals(closeResultSet_args that) {
      if (that == null)
        return false;

      boolean this_present_cursorId = true;
      boolean that_present_cursorId = true;
      if (this_present_cursorId || that_present_cursorId) {
        if (!(this_present_cursorId && that_present_cursorId))
          return false;
        if (this.cursorId != that.cursorId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_cursorId = true;
      list.add(present_cursorId);
      if (present_cursorId)
        list.add(cursorId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(closeResultSet_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCursorId()).compareTo(other.isSetCursorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCursorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cursorId, other.cursorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("closeResultSet_args(");
      boolean first = true;

      sb.append("cursorId:");
      sb.append(this.cursorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class closeResultSet_argsStandardSchemeFactory implements SchemeFactory {
      public closeResultSet_argsStandardScheme getScheme() {
        return new closeResultSet_argsStandardScheme();
      }
    }

    private static class closeResultSet_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, closeResultSet_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CURSOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.cursorId = iprot.readI64();
                struct.setCursorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, closeResultSet_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CURSOR_ID_FIELD_DESC);
        oprot.writeI64(struct.cursorId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class closeResultSet_argsTupleSchemeFactory implements SchemeFactory {
      public closeResultSet_argsTupleScheme getScheme() {
        return new closeResultSet_argsTupleScheme();
      }
    }

    private static class closeResultSet_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, closeResultSet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCursorId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetCursorId()) {
          oprot.writeI64(struct.cursorId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, closeResultSet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.cursorId = iprot.readI64();
          struct.setCursorIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class closeResultSet_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeResultSet_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new closeResultSet_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new closeResultSet_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeResultSet_result.class, metaDataMap);
    }

    public closeResultSet_result() {
    }

    public closeResultSet_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public closeResultSet_result(closeResultSet_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public closeResultSet_result deepCopy() {
      return new closeResultSet_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public closeResultSet_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof closeResultSet_result)
        return this.equals((closeResultSet_result)that);
      return false;
    }

    public boolean equals(closeResultSet_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(closeResultSet_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("closeResultSet_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class closeResultSet_resultStandardSchemeFactory implements SchemeFactory {
      public closeResultSet_resultStandardScheme getScheme() {
        return new closeResultSet_resultStandardScheme();
      }
    }

    private static class closeResultSet_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, closeResultSet_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, closeResultSet_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class closeResultSet_resultTupleSchemeFactory implements SchemeFactory {
      public closeResultSet_resultTupleScheme getScheme() {
        return new closeResultSet_resultTupleScheme();
      }
    }

    private static class closeResultSet_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, closeResultSet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, closeResultSet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class closeStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeStatement_args");

    private static final org.apache.thrift.protocol.TField STMT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("stmtId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new closeStatement_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new closeStatement_argsTupleSchemeFactory());
    }

    public long stmtId; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      STMT_ID((short)1, "stmtId"),
      TOKEN((short)2, "token");

      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: // STMT_ID
            return STMT_ID;
          case 2: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __STMTID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.STMT_ID, new org.apache.thrift.meta_data.FieldMetaData("stmtId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeStatement_args.class, metaDataMap);
    }

    public closeStatement_args() {
    }

    public closeStatement_args(
      long stmtId,
      ByteBuffer token)
    {
      this();
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public closeStatement_args(closeStatement_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.stmtId = other.stmtId;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public closeStatement_args deepCopy() {
      return new closeStatement_args(this);
    }

    @Override
    public void clear() {
      setStmtIdIsSet(false);
      this.stmtId = 0;
      this.token = null;
    }

    public long getStmtId() {
      return this.stmtId;
    }

    public closeStatement_args setStmtId(long stmtId) {
      this.stmtId = stmtId;
      setStmtIdIsSet(true);
      return this;
    }

    public void unsetStmtId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    /** Returns true if field stmtId is set (has been assigned a value) and false otherwise */
    public boolean isSetStmtId() {
      return EncodingUtils.testBit(__isset_bitfield, __STMTID_ISSET_ID);
    }

    public void setStmtIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STMTID_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public closeStatement_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public closeStatement_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case STMT_ID:
        if (value == null) {
          unsetStmtId();
        } else {
          setStmtId((Long)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case STMT_ID:
        return getStmtId();

      case TOKEN:
        return getToken();

      }
      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 STMT_ID:
        return isSetStmtId();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof closeStatement_args)
        return this.equals((closeStatement_args)that);
      return false;
    }

    public boolean equals(closeStatement_args that) {
      if (that == null)
        return false;

      boolean this_present_stmtId = true;
      boolean that_present_stmtId = true;
      if (this_present_stmtId || that_present_stmtId) {
        if (!(this_present_stmtId && that_present_stmtId))
          return false;
        if (this.stmtId != that.stmtId)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_stmtId = true;
      list.add(present_stmtId);
      if (present_stmtId)
        list.add(stmtId);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(closeStatement_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetStmtId()).compareTo(other.isSetStmtId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStmtId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stmtId, other.stmtId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("closeStatement_args(");
      boolean first = true;

      sb.append("stmtId:");
      sb.append(this.stmtId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class closeStatement_argsStandardSchemeFactory implements SchemeFactory {
      public closeStatement_argsStandardScheme getScheme() {
        return new closeStatement_argsStandardScheme();
      }
    }

    private static class closeStatement_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, closeStatement_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // STMT_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.stmtId = iprot.readI64();
                struct.setStmtIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, closeStatement_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(STMT_ID_FIELD_DESC);
        oprot.writeI64(struct.stmtId);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class closeStatement_argsTupleSchemeFactory implements SchemeFactory {
      public closeStatement_argsTupleScheme getScheme() {
        return new closeStatement_argsTupleScheme();
      }
    }

    private static class closeStatement_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, closeStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetStmtId()) {
          optionals.set(0);
        }
        if (struct.isSetToken()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetStmtId()) {
          oprot.writeI64(struct.stmtId);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, closeStatement_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.stmtId = iprot.readI64();
          struct.setStmtIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class closeStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeStatement_result");

    private static final org.apache.thrift.protocol.TField ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("error", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new closeStatement_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new closeStatement_resultTupleSchemeFactory());
    }

    public SnappyException error; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ERROR((short)1, "error");

      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: // ERROR
            return ERROR;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ERROR, new org.apache.thrift.meta_data.FieldMetaData("error", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeStatement_result.class, metaDataMap);
    }

    public closeStatement_result() {
    }

    public closeStatement_result(
      SnappyException error)
    {
      this();
      this.error = error;
    }

    /**
     * Performs a deep copy on other.
     */
    public closeStatement_result(closeStatement_result other) {
      if (other.isSetError()) {
        this.error = new SnappyException(other.error);
      }
    }

    public closeStatement_result deepCopy() {
      return new closeStatement_result(this);
    }

    @Override
    public void clear() {
      this.error = null;
    }

    public SnappyException getError() {
      return this.error;
    }

    public closeStatement_result setError(SnappyException error) {
      this.error = error;
      return this;
    }

    public void unsetError() {
      this.error = null;
    }

    /** Returns true if field error is set (has been assigned a value) and false otherwise */
    public boolean isSetError() {
      return this.error != null;
    }

    public void setErrorIsSet(boolean value) {
      if (!value) {
        this.error = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ERROR:
        if (value == null) {
          unsetError();
        } else {
          setError((SnappyException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ERROR:
        return getError();

      }
      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 ERROR:
        return isSetError();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof closeStatement_result)
        return this.equals((closeStatement_result)that);
      return false;
    }

    public boolean equals(closeStatement_result that) {
      if (that == null)
        return false;

      boolean this_present_error = true && this.isSetError();
      boolean that_present_error = true && that.isSetError();
      if (this_present_error || that_present_error) {
        if (!(this_present_error && that_present_error))
          return false;
        if (!this.error.equals(that.error))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_error = true && (isSetError());
      list.add(present_error);
      if (present_error)
        list.add(error);

      return list.hashCode();
    }

    @Override
    public int compareTo(closeStatement_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetError()).compareTo(other.isSetError());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetError()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.error, other.error);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
      }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("closeStatement_result(");
      boolean first = true;

      sb.append("error:");
      if (this.error == null) {
        sb.append("null");
      } else {
        sb.append(this.error);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class closeStatement_resultStandardSchemeFactory implements SchemeFactory {
      public closeStatement_resultStandardScheme getScheme() {
        return new closeStatement_resultStandardScheme();
      }
    }

    private static class closeStatement_resultStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, closeStatement_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ERROR
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.error = new SnappyException();
                struct.error.read(iprot);
                struct.setErrorIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, closeStatement_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.error != null) {
          oprot.writeFieldBegin(ERROR_FIELD_DESC);
          struct.error.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class closeStatement_resultTupleSchemeFactory implements SchemeFactory {
      public closeStatement_resultTupleScheme getScheme() {
        return new closeStatement_resultTupleScheme();
      }
    }

    private static class closeStatement_resultTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, closeStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetError()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetError()) {
          struct.error.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, closeStatement_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.error = new SnappyException();
          struct.error.read(iprot);
          struct.setErrorIsSet(true);
        }
      }
    }

  }

  public static class closeConnection_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeConnection_args");

    private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField CLOSE_SOCKET_FIELD_DESC = new org.apache.thrift.protocol.TField("closeSocket", org.apache.thrift.protocol.TType.BOOL, (short)2);
    private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new closeConnection_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new closeConnection_argsTupleSchemeFactory());
    }

    public long connId; // required
    public boolean closeSocket; // required
    public ByteBuffer token; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      CONN_ID((short)1, "connId"),
      CLOSE_SOCKET((short)2, "closeSocket"),
      TOKEN((short)3, "token");

      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: // CONN_ID
            return CONN_ID;
          case 2: // CLOSE_SOCKET
            return CLOSE_SOCKET;
          case 3: // TOKEN
            return TOKEN;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __CONNID_ISSET_ID = 0;
    private static final int __CLOSESOCKET_ISSET_ID = 1;
    private byte __isset_bitfield = 0;
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.CLOSE_SOCKET, new org.apache.thrift.meta_data.FieldMetaData("closeSocket", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeConnection_args.class, metaDataMap);
    }

    public closeConnection_args() {
    }

    public closeConnection_args(
      long connId,
      boolean closeSocket,
      ByteBuffer token)
    {
      this();
      this.connId = connId;
      setConnIdIsSet(true);
      this.closeSocket = closeSocket;
      setCloseSocketIsSet(true);
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    /**
     * Performs a deep copy on other.
     */
    public closeConnection_args(closeConnection_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.connId = other.connId;
      this.closeSocket = other.closeSocket;
      if (other.isSetToken()) {
        this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
      }
    }

    public closeConnection_args deepCopy() {
      return new closeConnection_args(this);
    }

    @Override
    public void clear() {
      setConnIdIsSet(false);
      this.connId = 0;
      setCloseSocketIsSet(false);
      this.closeSocket = false;
      this.token = null;
    }

    public long getConnId() {
      return this.connId;
    }

    public closeConnection_args setConnId(long connId) {
      this.connId = connId;
      setConnIdIsSet(true);
      return this;
    }

    public void unsetConnId() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    /** Returns true if field connId is set (has been assigned a value) and false otherwise */
    public boolean isSetConnId() {
      return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
    }

    public void setConnIdIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
    }

    public boolean isCloseSocket() {
      return this.closeSocket;
    }

    public closeConnection_args setCloseSocket(boolean closeSocket) {
      this.closeSocket = closeSocket;
      setCloseSocketIsSet(true);
      return this;
    }

    public void unsetCloseSocket() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CLOSESOCKET_ISSET_ID);
    }

    /** Returns true if field closeSocket is set (has been assigned a value) and false otherwise */
    public boolean isSetCloseSocket() {
      return EncodingUtils.testBit(__isset_bitfield, __CLOSESOCKET_ISSET_ID);
    }

    public void setCloseSocketIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CLOSESOCKET_ISSET_ID, value);
    }

    public byte[] getToken() {
      setToken(org.apache.thrift.TBaseHelper.rightSize(token));
      return token == null ? null : token.array();
    }

    public ByteBuffer bufferForToken() {
      return org.apache.thrift.TBaseHelper.copyBinary(token);
    }

    public closeConnection_args setToken(byte[] token) {
      this.token = token == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(token, token.length));
      return this;
    }

    public closeConnection_args setToken(ByteBuffer token) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(token);
      return this;
    }

    public void unsetToken() {
      this.token = null;
    }

    /** Returns true if field token is set (has been assigned a value) and false otherwise */
    public boolean isSetToken() {
      return this.token != null;
    }

    public void setTokenIsSet(boolean value) {
      if (!value) {
        this.token = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CONN_ID:
        if (value == null) {
          unsetConnId();
        } else {
          setConnId((Long)value);
        }
        break;

      case CLOSE_SOCKET:
        if (value == null) {
          unsetCloseSocket();
        } else {
          setCloseSocket((Boolean)value);
        }
        break;

      case TOKEN:
        if (value == null) {
          unsetToken();
        } else {
          setToken((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CONN_ID:
        return getConnId();

      case CLOSE_SOCKET:
        return isCloseSocket();

      case TOKEN:
        return getToken();

      }
      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 CONN_ID:
        return isSetConnId();
      case CLOSE_SOCKET:
        return isSetCloseSocket();
      case TOKEN:
        return isSetToken();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof closeConnection_args)
        return this.equals((closeConnection_args)that);
      return false;
    }

    public boolean equals(closeConnection_args that) {
      if (that == null)
        return false;

      boolean this_present_connId = true;
      boolean that_present_connId = true;
      if (this_present_connId || that_present_connId) {
        if (!(this_present_connId && that_present_connId))
          return false;
        if (this.connId != that.connId)
          return false;
      }

      boolean this_present_closeSocket = true;
      boolean that_present_closeSocket = true;
      if (this_present_closeSocket || that_present_closeSocket) {
        if (!(this_present_closeSocket && that_present_closeSocket))
          return false;
        if (this.closeSocket != that.closeSocket)
          return false;
      }

      boolean this_present_token = true && this.isSetToken();
      boolean that_present_token = true && that.isSetToken();
      if (this_present_token || that_present_token) {
        if (!(this_present_token && that_present_token))
          return false;
        if (!this.token.equals(that.token))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_connId = true;
      list.add(present_connId);
      if (present_connId)
        list.add(connId);

      boolean present_closeSocket = true;
      list.add(present_closeSocket);
      if (present_closeSocket)
        list.add(closeSocket);

      boolean present_token = true && (isSetToken());
      list.add(present_token);
      if (present_token)
        list.add(token);

      return list.hashCode();
    }

    @Override
    public int compareTo(closeConnection_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetConnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCloseSocket()).compareTo(other.isSetCloseSocket());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCloseSocket()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.closeSocket, other.closeSocket);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToken()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("closeConnection_args(");
      boolean first = true;

      sb.append("connId:");
      sb.append(this.connId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("closeSocket:");
      sb.append(this.closeSocket);
      first = false;
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bitfield = 0;
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class closeConnection_argsStandardSchemeFactory implements SchemeFactory {
      public closeConnection_argsStandardScheme getScheme() {
        return new closeConnection_argsStandardScheme();
      }
    }

    private static class closeConnection_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, closeConnection_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // CONN_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.connId = iprot.readI64();
                struct.setConnIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // CLOSE_SOCKET
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.closeSocket = iprot.readBool();
                struct.setCloseSocketIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TOKEN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.token = iprot.readBinary();
                struct.setTokenIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, closeConnection_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
        oprot.writeI64(struct.connId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(CLOSE_SOCKET_FIELD_DESC);
        oprot.writeBool(struct.closeSocket);
        oprot.writeFieldEnd();
        if (struct.token != null) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class closeConnection_argsTupleSchemeFactory implements SchemeFactory {
      public closeConnection_argsTupleScheme getScheme() {
        return new closeConnection_argsTupleScheme();
      }
    }

    private static class closeConnection_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, closeConnection_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetConnId()) {
          optionals.set(0);
        }
        if (struct.isSetCloseSocket()) {
          optionals.set(1);
        }
        if (struct.isSetToken()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetConnId()) {
          oprot.writeI64(struct.connId);
        }
        if (struct.isSetCloseSocket()) {
          oprot.writeBool(struct.closeSocket);
        }
        if (struct.isSetToken()) {
          oprot.writeBinary(struct.token);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, closeConnection_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.connId = iprot.readI64();
          struct.setConnIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.closeSocket = iprot.readBool();
          struct.setCloseSocketIsSet(true);
        }
        if (incoming.get(2)) {
          struct.token = iprot.readBinary();
          struct.setTokenIsSet(true);
        }
      }
    }

  }

  public static class bulkClose_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("bulkClose_args");

    private static final org.apache.thrift.protocol.TField ENTITIES_FIELD_DESC = new org.apache.thrift.protocol.TField("entities", org.apache.thrift.protocol.TType.LIST, (short)1);

    private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new bulkClose_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new bulkClose_argsTupleSchemeFactory());
    }

    public List entities; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ENTITIES((short)1, "entities");

      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: // ENTITIES
            return ENTITIES;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ENTITIES, new org.apache.thrift.meta_data.FieldMetaData("entities", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntityId.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(bulkClose_args.class, metaDataMap);
    }

    public bulkClose_args() {
    }

    public bulkClose_args(
      List entities)
    {
      this();
      this.entities = entities;
    }

    /**
     * Performs a deep copy on other.
     */
    public bulkClose_args(bulkClose_args other) {
      if (other.isSetEntities()) {
        List __this__entities = new ArrayList(other.entities.size());
        for (EntityId other_element : other.entities) {
          __this__entities.add(new EntityId(other_element));
        }
        this.entities = __this__entities;
      }
    }

    public bulkClose_args deepCopy() {
      return new bulkClose_args(this);
    }

    @Override
    public void clear() {
      this.entities = null;
    }

    public int getEntitiesSize() {
      return (this.entities == null) ? 0 : this.entities.size();
    }

    public java.util.Iterator getEntitiesIterator() {
      return (this.entities == null) ? null : this.entities.iterator();
    }

    public void addToEntities(EntityId elem) {
      if (this.entities == null) {
        this.entities = new ArrayList();
      }
      this.entities.add(elem);
    }

    public List getEntities() {
      return this.entities;
    }

    public bulkClose_args setEntities(List entities) {
      this.entities = entities;
      return this;
    }

    public void unsetEntities() {
      this.entities = null;
    }

    /** Returns true if field entities is set (has been assigned a value) and false otherwise */
    public boolean isSetEntities() {
      return this.entities != null;
    }

    public void setEntitiesIsSet(boolean value) {
      if (!value) {
        this.entities = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ENTITIES:
        if (value == null) {
          unsetEntities();
        } else {
          setEntities((List)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ENTITIES:
        return getEntities();

      }
      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 ENTITIES:
        return isSetEntities();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof bulkClose_args)
        return this.equals((bulkClose_args)that);
      return false;
    }

    public boolean equals(bulkClose_args that) {
      if (that == null)
        return false;

      boolean this_present_entities = true && this.isSetEntities();
      boolean that_present_entities = true && that.isSetEntities();
      if (this_present_entities || that_present_entities) {
        if (!(this_present_entities && that_present_entities))
          return false;
        if (!this.entities.equals(that.entities))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List list = new ArrayList();

      boolean present_entities = true && (isSetEntities());
      list.add(present_entities);
      if (present_entities)
        list.add(entities);

      return list.hashCode();
    }

    @Override
    public int compareTo(bulkClose_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetEntities()).compareTo(other.isSetEntities());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEntities()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entities, other.entities);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("bulkClose_args(");
      boolean first = true;

      sb.append("entities:");
      if (this.entities == null) {
        sb.append("null");
      } else {
        sb.append(this.entities);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private static class bulkClose_argsStandardSchemeFactory implements SchemeFactory {
      public bulkClose_argsStandardScheme getScheme() {
        return new bulkClose_argsStandardScheme();
      }
    }

    private static class bulkClose_argsStandardScheme extends StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, bulkClose_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // ENTITIES
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list780 = iprot.readListBegin();
                  struct.entities = new ArrayList(_list780.size);
                  EntityId _elem781;
                  for (int _i782 = 0; _i782 < _list780.size; ++_i782)
                  {
                    _elem781 = new EntityId();
                    _elem781.read(iprot);
                    struct.entities.add(_elem781);
                  }
                  iprot.readListEnd();
                }
                struct.setEntitiesIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, bulkClose_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.entities != null) {
          oprot.writeFieldBegin(ENTITIES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.entities.size()));
            for (EntityId _iter783 : struct.entities)
            {
              _iter783.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class bulkClose_argsTupleSchemeFactory implements SchemeFactory {
      public bulkClose_argsTupleScheme getScheme() {
        return new bulkClose_argsTupleScheme();
      }
    }

    private static class bulkClose_argsTupleScheme extends TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, bulkClose_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetEntities()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetEntities()) {
          {
            oprot.writeI32(struct.entities.size());
            for (EntityId _iter784 : struct.entities)
            {
              _iter784.write(oprot);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, bulkClose_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list785 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.entities = new ArrayList(_list785.size);
            EntityId _elem786;
            for (int _i787 = 0; _i787 < _list785.size; ++_i787)
            {
              _elem786 = new EntityId();
              _elem786.read(iprot);
              struct.entities.add(_elem786);
            }
          }
          struct.setEntitiesIsSet(true);
        }
      }
    }

  }

}