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

org.apache.iotdb.cluster.rpc.thrift.TSDataService Maven / Gradle / Ivy

There is a newer version: 0.13.4
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.iotdb.cluster.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2022-07-31")
public class TSDataService {

  public interface Iface extends RaftService.Iface {

    /**
     * Query a time series without value filter.
     * @return a readerId >= 0 if the query succeeds, otherwise the query fails
     * TODO-Cluster: support query multiple series in a request
     * 
     * 
     * @param request
     */
    public long querySingleSeries(SingleSeriesQueryRequest request) throws org.apache.thrift.TException;

    /**
     * Query mult time series without value filter.
     * @return a readerId >= 0 if the query succeeds, otherwise the query fails
     * 
     * 
     * @param request
     */
    public long queryMultSeries(MultSeriesQueryRequest request) throws org.apache.thrift.TException;

    /**
     * Fetch at max fetchSize time-value pairs using the resultSetId generated by querySingleSeries.
     * @return a ByteBuffer containing the serialized time-value pairs or an empty buffer if there
     * are not more results.
     * 
     * 
     * @param header
     * @param readerId
     */
    public java.nio.ByteBuffer fetchSingleSeries(RaftNode header, long readerId) throws org.apache.thrift.TException;

    /**
     * Fetch mult series at max fetchSize time-value pairs using the resultSetId generated by querySingleSeries.
     * @return a map containing key-value,the serialized time-value pairs or an empty buffer if there
     * are not more results.
     * 
     * 
     * @param header
     * @param readerId
     * @param paths
     */
    public java.util.Map fetchMultSeries(RaftNode header, long readerId, java.util.List paths) throws org.apache.thrift.TException;

    /**
     * Query a time series and generate an IReaderByTimestamp.
     * @return a readerId >= 0 if the query succeeds, otherwise the query fails
     * 
     * 
     * @param request
     */
    public long querySingleSeriesByTimestamp(SingleSeriesQueryRequest request) throws org.apache.thrift.TException;

    /**
     * Fetch values at given timestamps using the resultSetId generated by
     * querySingleSeriesByTimestamp.
     * @return a ByteBuffer containing the serialized value or an empty buffer if there
     * are not more results.
     * 
     * 
     * @param header
     * @param readerId
     * @param timestamps
     */
    public java.nio.ByteBuffer fetchSingleSeriesByTimestamps(RaftNode header, long readerId, java.util.List timestamps) throws org.apache.thrift.TException;

    /**
     * Find the local query established for the remote query and release all its resource.
     * 
     * 
     * @param header
     * @param thisNode
     * @param queryId
     */
    public void endQuery(RaftNode header, Node thisNode, long queryId) throws org.apache.thrift.TException;

    /**
     * Given path patterns (paths with wildcard), return all paths they match.
     * 
     * 
     * @param header
     * @param paths
     * @param withAlias
     */
    public GetAllPathsResult getAllPaths(RaftNode header, java.util.List paths, boolean withAlias) throws org.apache.thrift.TException;

    /**
     * Given path patterns (paths with wildcard), return all devices they match.
     * 
     * 
     * @param header
     * @param path
     * @param isPrefixMatch
     */
    public java.util.Set getAllDevices(RaftNode header, java.util.List path, boolean isPrefixMatch) throws org.apache.thrift.TException;

    /**
     * Get the devices from the header according to the showDevicesPlan
     * 
     * 
     * @param header
     * @param planBinary
     */
    public java.nio.ByteBuffer getDevices(RaftNode header, java.nio.ByteBuffer planBinary) throws org.apache.thrift.TException;

    public java.util.List getNodeList(RaftNode header, java.lang.String path, int nodeLevel) throws org.apache.thrift.TException;

    /**
     * Given path patterns(paths with wildcard), return all children nodes they match
     * 
     * 
     * @param header
     * @param path
     */
    public java.util.Set getChildNodeInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException;

    public java.util.Set getChildNodePathInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException;

    public java.nio.ByteBuffer getAllMeasurementSchema(MeasurementSchemaRequest request) throws org.apache.thrift.TException;

    public java.util.List getAggrResult(GetAggrResultRequest request) throws org.apache.thrift.TException;

    public java.util.List getUnregisteredTimeseries(RaftNode header, java.util.List timeseriesList) throws org.apache.thrift.TException;

    public PullSnapshotResp pullSnapshot(PullSnapshotRequest request) throws org.apache.thrift.TException;

    /**
     * Create a GroupByExecutor for a path, executing the given aggregations.
     * @return the executorId
     * 
     * 
     * @param request
     */
    public long getGroupByExecutor(GroupByRequest request) throws org.apache.thrift.TException;

    /**
     * Fetch the group by result in the interval [startTime, endTime) from the given executor.
     * @return the serialized AggregationResults, each is the result of one of the previously
     * required aggregations, and their orders are the same.
     * 
     * 
     * @param header
     * @param executorId
     * @param startTime
     * @param endTime
     */
    public java.util.List getGroupByResult(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException;

    /**
     * Pull all timeseries schemas prefixed by a given path.
     * 
     * 
     * @param request
     */
    public PullSchemaResp pullTimeSeriesSchema(PullSchemaRequest request) throws org.apache.thrift.TException;

    /**
     * Pull all measurement schemas prefixed by a given path.
     * 
     * 
     * @param request
     */
    public PullSchemaResp pullMeasurementSchema(PullSchemaRequest request) throws org.apache.thrift.TException;

    /**
     * Perform a previous fill and return the timevalue pair in binary.
     * @return a binary TimeValuePair
     * 
     * 
     * @param request
     */
    public java.nio.ByteBuffer previousFill(PreviousFillRequest request) throws org.apache.thrift.TException;

    /**
     * Query the last point of a series.
     * @return a binary TimeValuePair
     * 
     * 
     * @param request
     */
    public java.nio.ByteBuffer last(LastQueryRequest request) throws org.apache.thrift.TException;

    public int getPathCount(RaftNode header, java.util.List pathsToQuery, int level) throws org.apache.thrift.TException;

    public int getDeviceCount(RaftNode header, java.util.List pathsToQuery) throws org.apache.thrift.TException;

    /**
     * During slot transfer, when a member has pulled snapshot from a group, the member will use this
     * method to inform the group that one replica of such slots has been pulled.
     * 
     * 
     * @param header
     * @param slots
     */
    public boolean onSnapshotApplied(RaftNode header, java.util.List slots) throws org.apache.thrift.TException;

    public java.nio.ByteBuffer peekNextNotNullValue(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException;

  }

  public interface AsyncIface extends RaftService .AsyncIface {

    public void querySingleSeries(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void queryMultSeries(MultSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void fetchSingleSeries(RaftNode header, long readerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void fetchMultSeries(RaftNode header, long readerId, java.util.List paths, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void querySingleSeriesByTimestamp(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void fetchSingleSeriesByTimestamps(RaftNode header, long readerId, java.util.List timestamps, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void endQuery(RaftNode header, Node thisNode, long queryId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getAllPaths(RaftNode header, java.util.List paths, boolean withAlias, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getAllDevices(RaftNode header, java.util.List path, boolean isPrefixMatch, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void getDevices(RaftNode header, java.nio.ByteBuffer planBinary, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getNodeList(RaftNode header, java.lang.String path, int nodeLevel, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void getChildNodeInNextLevel(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void getChildNodePathInNextLevel(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void getAllMeasurementSchema(MeasurementSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getAggrResult(GetAggrResultRequest request, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void getUnregisteredTimeseries(RaftNode header, java.util.List timeseriesList, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void pullSnapshot(PullSnapshotRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getGroupByExecutor(GroupByRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getGroupByResult(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException;

    public void pullTimeSeriesSchema(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void pullMeasurementSchema(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void previousFill(PreviousFillRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void last(LastQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getPathCount(RaftNode header, java.util.List pathsToQuery, int level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getDeviceCount(RaftNode header, java.util.List pathsToQuery, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void onSnapshotApplied(RaftNode header, java.util.List slots, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void peekNextNotNullValue(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends RaftService.Client 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 long querySingleSeries(SingleSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      send_querySingleSeries(request);
      return recv_querySingleSeries();
    }

    public void send_querySingleSeries(SingleSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      querySingleSeries_args args = new querySingleSeries_args();
      args.setRequest(request);
      sendBase("querySingleSeries", args);
    }

    public long recv_querySingleSeries() throws org.apache.thrift.TException
    {
      querySingleSeries_result result = new querySingleSeries_result();
      receiveBase(result, "querySingleSeries");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "querySingleSeries failed: unknown result");
    }

    public long queryMultSeries(MultSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      send_queryMultSeries(request);
      return recv_queryMultSeries();
    }

    public void send_queryMultSeries(MultSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      queryMultSeries_args args = new queryMultSeries_args();
      args.setRequest(request);
      sendBase("queryMultSeries", args);
    }

    public long recv_queryMultSeries() throws org.apache.thrift.TException
    {
      queryMultSeries_result result = new queryMultSeries_result();
      receiveBase(result, "queryMultSeries");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryMultSeries failed: unknown result");
    }

    public java.nio.ByteBuffer fetchSingleSeries(RaftNode header, long readerId) throws org.apache.thrift.TException
    {
      send_fetchSingleSeries(header, readerId);
      return recv_fetchSingleSeries();
    }

    public void send_fetchSingleSeries(RaftNode header, long readerId) throws org.apache.thrift.TException
    {
      fetchSingleSeries_args args = new fetchSingleSeries_args();
      args.setHeader(header);
      args.setReaderId(readerId);
      sendBase("fetchSingleSeries", args);
    }

    public java.nio.ByteBuffer recv_fetchSingleSeries() throws org.apache.thrift.TException
    {
      fetchSingleSeries_result result = new fetchSingleSeries_result();
      receiveBase(result, "fetchSingleSeries");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchSingleSeries failed: unknown result");
    }

    public java.util.Map fetchMultSeries(RaftNode header, long readerId, java.util.List paths) throws org.apache.thrift.TException
    {
      send_fetchMultSeries(header, readerId, paths);
      return recv_fetchMultSeries();
    }

    public void send_fetchMultSeries(RaftNode header, long readerId, java.util.List paths) throws org.apache.thrift.TException
    {
      fetchMultSeries_args args = new fetchMultSeries_args();
      args.setHeader(header);
      args.setReaderId(readerId);
      args.setPaths(paths);
      sendBase("fetchMultSeries", args);
    }

    public java.util.Map recv_fetchMultSeries() throws org.apache.thrift.TException
    {
      fetchMultSeries_result result = new fetchMultSeries_result();
      receiveBase(result, "fetchMultSeries");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchMultSeries failed: unknown result");
    }

    public long querySingleSeriesByTimestamp(SingleSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      send_querySingleSeriesByTimestamp(request);
      return recv_querySingleSeriesByTimestamp();
    }

    public void send_querySingleSeriesByTimestamp(SingleSeriesQueryRequest request) throws org.apache.thrift.TException
    {
      querySingleSeriesByTimestamp_args args = new querySingleSeriesByTimestamp_args();
      args.setRequest(request);
      sendBase("querySingleSeriesByTimestamp", args);
    }

    public long recv_querySingleSeriesByTimestamp() throws org.apache.thrift.TException
    {
      querySingleSeriesByTimestamp_result result = new querySingleSeriesByTimestamp_result();
      receiveBase(result, "querySingleSeriesByTimestamp");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "querySingleSeriesByTimestamp failed: unknown result");
    }

    public java.nio.ByteBuffer fetchSingleSeriesByTimestamps(RaftNode header, long readerId, java.util.List timestamps) throws org.apache.thrift.TException
    {
      send_fetchSingleSeriesByTimestamps(header, readerId, timestamps);
      return recv_fetchSingleSeriesByTimestamps();
    }

    public void send_fetchSingleSeriesByTimestamps(RaftNode header, long readerId, java.util.List timestamps) throws org.apache.thrift.TException
    {
      fetchSingleSeriesByTimestamps_args args = new fetchSingleSeriesByTimestamps_args();
      args.setHeader(header);
      args.setReaderId(readerId);
      args.setTimestamps(timestamps);
      sendBase("fetchSingleSeriesByTimestamps", args);
    }

    public java.nio.ByteBuffer recv_fetchSingleSeriesByTimestamps() throws org.apache.thrift.TException
    {
      fetchSingleSeriesByTimestamps_result result = new fetchSingleSeriesByTimestamps_result();
      receiveBase(result, "fetchSingleSeriesByTimestamps");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "fetchSingleSeriesByTimestamps failed: unknown result");
    }

    public void endQuery(RaftNode header, Node thisNode, long queryId) throws org.apache.thrift.TException
    {
      send_endQuery(header, thisNode, queryId);
      recv_endQuery();
    }

    public void send_endQuery(RaftNode header, Node thisNode, long queryId) throws org.apache.thrift.TException
    {
      endQuery_args args = new endQuery_args();
      args.setHeader(header);
      args.setThisNode(thisNode);
      args.setQueryId(queryId);
      sendBase("endQuery", args);
    }

    public void recv_endQuery() throws org.apache.thrift.TException
    {
      endQuery_result result = new endQuery_result();
      receiveBase(result, "endQuery");
      return;
    }

    public GetAllPathsResult getAllPaths(RaftNode header, java.util.List paths, boolean withAlias) throws org.apache.thrift.TException
    {
      send_getAllPaths(header, paths, withAlias);
      return recv_getAllPaths();
    }

    public void send_getAllPaths(RaftNode header, java.util.List paths, boolean withAlias) throws org.apache.thrift.TException
    {
      getAllPaths_args args = new getAllPaths_args();
      args.setHeader(header);
      args.setPaths(paths);
      args.setWithAlias(withAlias);
      sendBase("getAllPaths", args);
    }

    public GetAllPathsResult recv_getAllPaths() throws org.apache.thrift.TException
    {
      getAllPaths_result result = new getAllPaths_result();
      receiveBase(result, "getAllPaths");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPaths failed: unknown result");
    }

    public java.util.Set getAllDevices(RaftNode header, java.util.List path, boolean isPrefixMatch) throws org.apache.thrift.TException
    {
      send_getAllDevices(header, path, isPrefixMatch);
      return recv_getAllDevices();
    }

    public void send_getAllDevices(RaftNode header, java.util.List path, boolean isPrefixMatch) throws org.apache.thrift.TException
    {
      getAllDevices_args args = new getAllDevices_args();
      args.setHeader(header);
      args.setPath(path);
      args.setIsPrefixMatch(isPrefixMatch);
      sendBase("getAllDevices", args);
    }

    public java.util.Set recv_getAllDevices() throws org.apache.thrift.TException
    {
      getAllDevices_result result = new getAllDevices_result();
      receiveBase(result, "getAllDevices");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllDevices failed: unknown result");
    }

    public java.nio.ByteBuffer getDevices(RaftNode header, java.nio.ByteBuffer planBinary) throws org.apache.thrift.TException
    {
      send_getDevices(header, planBinary);
      return recv_getDevices();
    }

    public void send_getDevices(RaftNode header, java.nio.ByteBuffer planBinary) throws org.apache.thrift.TException
    {
      getDevices_args args = new getDevices_args();
      args.setHeader(header);
      args.setPlanBinary(planBinary);
      sendBase("getDevices", args);
    }

    public java.nio.ByteBuffer recv_getDevices() throws org.apache.thrift.TException
    {
      getDevices_result result = new getDevices_result();
      receiveBase(result, "getDevices");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDevices failed: unknown result");
    }

    public java.util.List getNodeList(RaftNode header, java.lang.String path, int nodeLevel) throws org.apache.thrift.TException
    {
      send_getNodeList(header, path, nodeLevel);
      return recv_getNodeList();
    }

    public void send_getNodeList(RaftNode header, java.lang.String path, int nodeLevel) throws org.apache.thrift.TException
    {
      getNodeList_args args = new getNodeList_args();
      args.setHeader(header);
      args.setPath(path);
      args.setNodeLevel(nodeLevel);
      sendBase("getNodeList", args);
    }

    public java.util.List recv_getNodeList() throws org.apache.thrift.TException
    {
      getNodeList_result result = new getNodeList_result();
      receiveBase(result, "getNodeList");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNodeList failed: unknown result");
    }

    public java.util.Set getChildNodeInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException
    {
      send_getChildNodeInNextLevel(header, path);
      return recv_getChildNodeInNextLevel();
    }

    public void send_getChildNodeInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException
    {
      getChildNodeInNextLevel_args args = new getChildNodeInNextLevel_args();
      args.setHeader(header);
      args.setPath(path);
      sendBase("getChildNodeInNextLevel", args);
    }

    public java.util.Set recv_getChildNodeInNextLevel() throws org.apache.thrift.TException
    {
      getChildNodeInNextLevel_result result = new getChildNodeInNextLevel_result();
      receiveBase(result, "getChildNodeInNextLevel");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChildNodeInNextLevel failed: unknown result");
    }

    public java.util.Set getChildNodePathInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException
    {
      send_getChildNodePathInNextLevel(header, path);
      return recv_getChildNodePathInNextLevel();
    }

    public void send_getChildNodePathInNextLevel(RaftNode header, java.lang.String path) throws org.apache.thrift.TException
    {
      getChildNodePathInNextLevel_args args = new getChildNodePathInNextLevel_args();
      args.setHeader(header);
      args.setPath(path);
      sendBase("getChildNodePathInNextLevel", args);
    }

    public java.util.Set recv_getChildNodePathInNextLevel() throws org.apache.thrift.TException
    {
      getChildNodePathInNextLevel_result result = new getChildNodePathInNextLevel_result();
      receiveBase(result, "getChildNodePathInNextLevel");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChildNodePathInNextLevel failed: unknown result");
    }

    public java.nio.ByteBuffer getAllMeasurementSchema(MeasurementSchemaRequest request) throws org.apache.thrift.TException
    {
      send_getAllMeasurementSchema(request);
      return recv_getAllMeasurementSchema();
    }

    public void send_getAllMeasurementSchema(MeasurementSchemaRequest request) throws org.apache.thrift.TException
    {
      getAllMeasurementSchema_args args = new getAllMeasurementSchema_args();
      args.setRequest(request);
      sendBase("getAllMeasurementSchema", args);
    }

    public java.nio.ByteBuffer recv_getAllMeasurementSchema() throws org.apache.thrift.TException
    {
      getAllMeasurementSchema_result result = new getAllMeasurementSchema_result();
      receiveBase(result, "getAllMeasurementSchema");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllMeasurementSchema failed: unknown result");
    }

    public java.util.List getAggrResult(GetAggrResultRequest request) throws org.apache.thrift.TException
    {
      send_getAggrResult(request);
      return recv_getAggrResult();
    }

    public void send_getAggrResult(GetAggrResultRequest request) throws org.apache.thrift.TException
    {
      getAggrResult_args args = new getAggrResult_args();
      args.setRequest(request);
      sendBase("getAggrResult", args);
    }

    public java.util.List recv_getAggrResult() throws org.apache.thrift.TException
    {
      getAggrResult_result result = new getAggrResult_result();
      receiveBase(result, "getAggrResult");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAggrResult failed: unknown result");
    }

    public java.util.List getUnregisteredTimeseries(RaftNode header, java.util.List timeseriesList) throws org.apache.thrift.TException
    {
      send_getUnregisteredTimeseries(header, timeseriesList);
      return recv_getUnregisteredTimeseries();
    }

    public void send_getUnregisteredTimeseries(RaftNode header, java.util.List timeseriesList) throws org.apache.thrift.TException
    {
      getUnregisteredTimeseries_args args = new getUnregisteredTimeseries_args();
      args.setHeader(header);
      args.setTimeseriesList(timeseriesList);
      sendBase("getUnregisteredTimeseries", args);
    }

    public java.util.List recv_getUnregisteredTimeseries() throws org.apache.thrift.TException
    {
      getUnregisteredTimeseries_result result = new getUnregisteredTimeseries_result();
      receiveBase(result, "getUnregisteredTimeseries");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUnregisteredTimeseries failed: unknown result");
    }

    public PullSnapshotResp pullSnapshot(PullSnapshotRequest request) throws org.apache.thrift.TException
    {
      send_pullSnapshot(request);
      return recv_pullSnapshot();
    }

    public void send_pullSnapshot(PullSnapshotRequest request) throws org.apache.thrift.TException
    {
      pullSnapshot_args args = new pullSnapshot_args();
      args.setRequest(request);
      sendBase("pullSnapshot", args);
    }

    public PullSnapshotResp recv_pullSnapshot() throws org.apache.thrift.TException
    {
      pullSnapshot_result result = new pullSnapshot_result();
      receiveBase(result, "pullSnapshot");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pullSnapshot failed: unknown result");
    }

    public long getGroupByExecutor(GroupByRequest request) throws org.apache.thrift.TException
    {
      send_getGroupByExecutor(request);
      return recv_getGroupByExecutor();
    }

    public void send_getGroupByExecutor(GroupByRequest request) throws org.apache.thrift.TException
    {
      getGroupByExecutor_args args = new getGroupByExecutor_args();
      args.setRequest(request);
      sendBase("getGroupByExecutor", args);
    }

    public long recv_getGroupByExecutor() throws org.apache.thrift.TException
    {
      getGroupByExecutor_result result = new getGroupByExecutor_result();
      receiveBase(result, "getGroupByExecutor");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroupByExecutor failed: unknown result");
    }

    public java.util.List getGroupByResult(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException
    {
      send_getGroupByResult(header, executorId, startTime, endTime);
      return recv_getGroupByResult();
    }

    public void send_getGroupByResult(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException
    {
      getGroupByResult_args args = new getGroupByResult_args();
      args.setHeader(header);
      args.setExecutorId(executorId);
      args.setStartTime(startTime);
      args.setEndTime(endTime);
      sendBase("getGroupByResult", args);
    }

    public java.util.List recv_getGroupByResult() throws org.apache.thrift.TException
    {
      getGroupByResult_result result = new getGroupByResult_result();
      receiveBase(result, "getGroupByResult");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGroupByResult failed: unknown result");
    }

    public PullSchemaResp pullTimeSeriesSchema(PullSchemaRequest request) throws org.apache.thrift.TException
    {
      send_pullTimeSeriesSchema(request);
      return recv_pullTimeSeriesSchema();
    }

    public void send_pullTimeSeriesSchema(PullSchemaRequest request) throws org.apache.thrift.TException
    {
      pullTimeSeriesSchema_args args = new pullTimeSeriesSchema_args();
      args.setRequest(request);
      sendBase("pullTimeSeriesSchema", args);
    }

    public PullSchemaResp recv_pullTimeSeriesSchema() throws org.apache.thrift.TException
    {
      pullTimeSeriesSchema_result result = new pullTimeSeriesSchema_result();
      receiveBase(result, "pullTimeSeriesSchema");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pullTimeSeriesSchema failed: unknown result");
    }

    public PullSchemaResp pullMeasurementSchema(PullSchemaRequest request) throws org.apache.thrift.TException
    {
      send_pullMeasurementSchema(request);
      return recv_pullMeasurementSchema();
    }

    public void send_pullMeasurementSchema(PullSchemaRequest request) throws org.apache.thrift.TException
    {
      pullMeasurementSchema_args args = new pullMeasurementSchema_args();
      args.setRequest(request);
      sendBase("pullMeasurementSchema", args);
    }

    public PullSchemaResp recv_pullMeasurementSchema() throws org.apache.thrift.TException
    {
      pullMeasurementSchema_result result = new pullMeasurementSchema_result();
      receiveBase(result, "pullMeasurementSchema");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pullMeasurementSchema failed: unknown result");
    }

    public java.nio.ByteBuffer previousFill(PreviousFillRequest request) throws org.apache.thrift.TException
    {
      send_previousFill(request);
      return recv_previousFill();
    }

    public void send_previousFill(PreviousFillRequest request) throws org.apache.thrift.TException
    {
      previousFill_args args = new previousFill_args();
      args.setRequest(request);
      sendBase("previousFill", args);
    }

    public java.nio.ByteBuffer recv_previousFill() throws org.apache.thrift.TException
    {
      previousFill_result result = new previousFill_result();
      receiveBase(result, "previousFill");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "previousFill failed: unknown result");
    }

    public java.nio.ByteBuffer last(LastQueryRequest request) throws org.apache.thrift.TException
    {
      send_last(request);
      return recv_last();
    }

    public void send_last(LastQueryRequest request) throws org.apache.thrift.TException
    {
      last_args args = new last_args();
      args.setRequest(request);
      sendBase("last", args);
    }

    public java.nio.ByteBuffer recv_last() throws org.apache.thrift.TException
    {
      last_result result = new last_result();
      receiveBase(result, "last");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "last failed: unknown result");
    }

    public int getPathCount(RaftNode header, java.util.List pathsToQuery, int level) throws org.apache.thrift.TException
    {
      send_getPathCount(header, pathsToQuery, level);
      return recv_getPathCount();
    }

    public void send_getPathCount(RaftNode header, java.util.List pathsToQuery, int level) throws org.apache.thrift.TException
    {
      getPathCount_args args = new getPathCount_args();
      args.setHeader(header);
      args.setPathsToQuery(pathsToQuery);
      args.setLevel(level);
      sendBase("getPathCount", args);
    }

    public int recv_getPathCount() throws org.apache.thrift.TException
    {
      getPathCount_result result = new getPathCount_result();
      receiveBase(result, "getPathCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathCount failed: unknown result");
    }

    public int getDeviceCount(RaftNode header, java.util.List pathsToQuery) throws org.apache.thrift.TException
    {
      send_getDeviceCount(header, pathsToQuery);
      return recv_getDeviceCount();
    }

    public void send_getDeviceCount(RaftNode header, java.util.List pathsToQuery) throws org.apache.thrift.TException
    {
      getDeviceCount_args args = new getDeviceCount_args();
      args.setHeader(header);
      args.setPathsToQuery(pathsToQuery);
      sendBase("getDeviceCount", args);
    }

    public int recv_getDeviceCount() throws org.apache.thrift.TException
    {
      getDeviceCount_result result = new getDeviceCount_result();
      receiveBase(result, "getDeviceCount");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDeviceCount failed: unknown result");
    }

    public boolean onSnapshotApplied(RaftNode header, java.util.List slots) throws org.apache.thrift.TException
    {
      send_onSnapshotApplied(header, slots);
      return recv_onSnapshotApplied();
    }

    public void send_onSnapshotApplied(RaftNode header, java.util.List slots) throws org.apache.thrift.TException
    {
      onSnapshotApplied_args args = new onSnapshotApplied_args();
      args.setHeader(header);
      args.setSlots(slots);
      sendBase("onSnapshotApplied", args);
    }

    public boolean recv_onSnapshotApplied() throws org.apache.thrift.TException
    {
      onSnapshotApplied_result result = new onSnapshotApplied_result();
      receiveBase(result, "onSnapshotApplied");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "onSnapshotApplied failed: unknown result");
    }

    public java.nio.ByteBuffer peekNextNotNullValue(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException
    {
      send_peekNextNotNullValue(header, executorId, startTime, endTime);
      return recv_peekNextNotNullValue();
    }

    public void send_peekNextNotNullValue(RaftNode header, long executorId, long startTime, long endTime) throws org.apache.thrift.TException
    {
      peekNextNotNullValue_args args = new peekNextNotNullValue_args();
      args.setHeader(header);
      args.setExecutorId(executorId);
      args.setStartTime(startTime);
      args.setEndTime(endTime);
      sendBase("peekNextNotNullValue", args);
    }

    public java.nio.ByteBuffer recv_peekNextNotNullValue() throws org.apache.thrift.TException
    {
      peekNextNotNullValue_result result = new peekNextNotNullValue_result();
      receiveBase(result, "peekNextNotNullValue");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "peekNextNotNullValue failed: unknown result");
    }

  }
  public static class AsyncClient extends RaftService.AsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void querySingleSeries(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      querySingleSeries_call method_call = new querySingleSeries_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class querySingleSeries_call extends org.apache.thrift.async.TAsyncMethodCall {
      private SingleSeriesQueryRequest request;
      public querySingleSeries_call(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("querySingleSeries", org.apache.thrift.protocol.TMessageType.CALL, 0));
        querySingleSeries_args args = new querySingleSeries_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Long getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_querySingleSeries();
      }
    }

    public void queryMultSeries(MultSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      queryMultSeries_call method_call = new queryMultSeries_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class queryMultSeries_call extends org.apache.thrift.async.TAsyncMethodCall {
      private MultSeriesQueryRequest request;
      public queryMultSeries_call(MultSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryMultSeries", org.apache.thrift.protocol.TMessageType.CALL, 0));
        queryMultSeries_args args = new queryMultSeries_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Long getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_queryMultSeries();
      }
    }

    public void fetchSingleSeries(RaftNode header, long readerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      fetchSingleSeries_call method_call = new fetchSingleSeries_call(header, readerId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class fetchSingleSeries_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private long readerId;
      public fetchSingleSeries_call(RaftNode header, long readerId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.readerId = readerId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchSingleSeries", org.apache.thrift.protocol.TMessageType.CALL, 0));
        fetchSingleSeries_args args = new fetchSingleSeries_args();
        args.setHeader(header);
        args.setReaderId(readerId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_fetchSingleSeries();
      }
    }

    public void fetchMultSeries(RaftNode header, long readerId, java.util.List paths, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      fetchMultSeries_call method_call = new fetchMultSeries_call(header, readerId, paths, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class fetchMultSeries_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private long readerId;
      private java.util.List paths;
      public fetchMultSeries_call(RaftNode header, long readerId, java.util.List paths, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.readerId = readerId;
        this.paths = paths;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchMultSeries", org.apache.thrift.protocol.TMessageType.CALL, 0));
        fetchMultSeries_args args = new fetchMultSeries_args();
        args.setHeader(header);
        args.setReaderId(readerId);
        args.setPaths(paths);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.Map getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_fetchMultSeries();
      }
    }

    public void querySingleSeriesByTimestamp(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      querySingleSeriesByTimestamp_call method_call = new querySingleSeriesByTimestamp_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class querySingleSeriesByTimestamp_call extends org.apache.thrift.async.TAsyncMethodCall {
      private SingleSeriesQueryRequest request;
      public querySingleSeriesByTimestamp_call(SingleSeriesQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("querySingleSeriesByTimestamp", org.apache.thrift.protocol.TMessageType.CALL, 0));
        querySingleSeriesByTimestamp_args args = new querySingleSeriesByTimestamp_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Long getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_querySingleSeriesByTimestamp();
      }
    }

    public void fetchSingleSeriesByTimestamps(RaftNode header, long readerId, java.util.List timestamps, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      fetchSingleSeriesByTimestamps_call method_call = new fetchSingleSeriesByTimestamps_call(header, readerId, timestamps, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class fetchSingleSeriesByTimestamps_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private long readerId;
      private java.util.List timestamps;
      public fetchSingleSeriesByTimestamps_call(RaftNode header, long readerId, java.util.List timestamps, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.readerId = readerId;
        this.timestamps = timestamps;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("fetchSingleSeriesByTimestamps", org.apache.thrift.protocol.TMessageType.CALL, 0));
        fetchSingleSeriesByTimestamps_args args = new fetchSingleSeriesByTimestamps_args();
        args.setHeader(header);
        args.setReaderId(readerId);
        args.setTimestamps(timestamps);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_fetchSingleSeriesByTimestamps();
      }
    }

    public void endQuery(RaftNode header, Node thisNode, long queryId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      endQuery_call method_call = new endQuery_call(header, thisNode, queryId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class endQuery_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private Node thisNode;
      private long queryId;
      public endQuery_call(RaftNode header, Node thisNode, long queryId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.thisNode = thisNode;
        this.queryId = queryId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("endQuery", org.apache.thrift.protocol.TMessageType.CALL, 0));
        endQuery_args args = new endQuery_args();
        args.setHeader(header);
        args.setThisNode(thisNode);
        args.setQueryId(queryId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Void getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return null;
      }
    }

    public void getAllPaths(RaftNode header, java.util.List paths, boolean withAlias, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllPaths_call method_call = new getAllPaths_call(header, paths, withAlias, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllPaths_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private java.util.List paths;
      private boolean withAlias;
      public getAllPaths_call(RaftNode header, java.util.List paths, boolean withAlias, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.paths = paths;
        this.withAlias = withAlias;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPaths", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllPaths_args args = new getAllPaths_args();
        args.setHeader(header);
        args.setPaths(paths);
        args.setWithAlias(withAlias);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public GetAllPathsResult getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllPaths();
      }
    }

    public void getAllDevices(RaftNode header, java.util.List path, boolean isPrefixMatch, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllDevices_call method_call = new getAllDevices_call(header, path, isPrefixMatch, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllDevices_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private java.util.List path;
      private boolean isPrefixMatch;
      public getAllDevices_call(RaftNode header, java.util.List path, boolean isPrefixMatch, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.path = path;
        this.isPrefixMatch = isPrefixMatch;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllDevices", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllDevices_args args = new getAllDevices_args();
        args.setHeader(header);
        args.setPath(path);
        args.setIsPrefixMatch(isPrefixMatch);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.Set getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllDevices();
      }
    }

    public void getDevices(RaftNode header, java.nio.ByteBuffer planBinary, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getDevices_call method_call = new getDevices_call(header, planBinary, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getDevices_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private java.nio.ByteBuffer planBinary;
      public getDevices_call(RaftNode header, java.nio.ByteBuffer planBinary, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.planBinary = planBinary;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDevices", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getDevices_args args = new getDevices_args();
        args.setHeader(header);
        args.setPlanBinary(planBinary);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getDevices();
      }
    }

    public void getNodeList(RaftNode header, java.lang.String path, int nodeLevel, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getNodeList_call method_call = new getNodeList_call(header, path, nodeLevel, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getNodeList_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private java.lang.String path;
      private int nodeLevel;
      public getNodeList_call(RaftNode header, java.lang.String path, int nodeLevel, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.path = path;
        this.nodeLevel = nodeLevel;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNodeList", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getNodeList_args args = new getNodeList_args();
        args.setHeader(header);
        args.setPath(path);
        args.setNodeLevel(nodeLevel);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.List getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getNodeList();
      }
    }

    public void getChildNodeInNextLevel(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getChildNodeInNextLevel_call method_call = new getChildNodeInNextLevel_call(header, path, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getChildNodeInNextLevel_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private java.lang.String path;
      public getChildNodeInNextLevel_call(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.path = path;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getChildNodeInNextLevel", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getChildNodeInNextLevel_args args = new getChildNodeInNextLevel_args();
        args.setHeader(header);
        args.setPath(path);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.Set getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getChildNodeInNextLevel();
      }
    }

    public void getChildNodePathInNextLevel(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getChildNodePathInNextLevel_call method_call = new getChildNodePathInNextLevel_call(header, path, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getChildNodePathInNextLevel_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private java.lang.String path;
      public getChildNodePathInNextLevel_call(RaftNode header, java.lang.String path, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.path = path;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getChildNodePathInNextLevel", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getChildNodePathInNextLevel_args args = new getChildNodePathInNextLevel_args();
        args.setHeader(header);
        args.setPath(path);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.Set getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getChildNodePathInNextLevel();
      }
    }

    public void getAllMeasurementSchema(MeasurementSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAllMeasurementSchema_call method_call = new getAllMeasurementSchema_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAllMeasurementSchema_call extends org.apache.thrift.async.TAsyncMethodCall {
      private MeasurementSchemaRequest request;
      public getAllMeasurementSchema_call(MeasurementSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllMeasurementSchema", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAllMeasurementSchema_args args = new getAllMeasurementSchema_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAllMeasurementSchema();
      }
    }

    public void getAggrResult(GetAggrResultRequest request, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getAggrResult_call method_call = new getAggrResult_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getAggrResult_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private GetAggrResultRequest request;
      public getAggrResult_call(GetAggrResultRequest request, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAggrResult", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getAggrResult_args args = new getAggrResult_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.List getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getAggrResult();
      }
    }

    public void getUnregisteredTimeseries(RaftNode header, java.util.List timeseriesList, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getUnregisteredTimeseries_call method_call = new getUnregisteredTimeseries_call(header, timeseriesList, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getUnregisteredTimeseries_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private java.util.List timeseriesList;
      public getUnregisteredTimeseries_call(RaftNode header, java.util.List timeseriesList, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.timeseriesList = timeseriesList;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUnregisteredTimeseries", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getUnregisteredTimeseries_args args = new getUnregisteredTimeseries_args();
        args.setHeader(header);
        args.setTimeseriesList(timeseriesList);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.List getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getUnregisteredTimeseries();
      }
    }

    public void pullSnapshot(PullSnapshotRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      pullSnapshot_call method_call = new pullSnapshot_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class pullSnapshot_call extends org.apache.thrift.async.TAsyncMethodCall {
      private PullSnapshotRequest request;
      public pullSnapshot_call(PullSnapshotRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pullSnapshot", org.apache.thrift.protocol.TMessageType.CALL, 0));
        pullSnapshot_args args = new pullSnapshot_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public PullSnapshotResp getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_pullSnapshot();
      }
    }

    public void getGroupByExecutor(GroupByRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getGroupByExecutor_call method_call = new getGroupByExecutor_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getGroupByExecutor_call extends org.apache.thrift.async.TAsyncMethodCall {
      private GroupByRequest request;
      public getGroupByExecutor_call(GroupByRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGroupByExecutor", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getGroupByExecutor_args args = new getGroupByExecutor_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Long getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getGroupByExecutor();
      }
    }

    public void getGroupByResult(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getGroupByResult_call method_call = new getGroupByResult_call(header, executorId, startTime, endTime, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getGroupByResult_call extends org.apache.thrift.async.TAsyncMethodCall> {
      private RaftNode header;
      private long executorId;
      private long startTime;
      private long endTime;
      public getGroupByResult_call(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.executorId = executorId;
        this.startTime = startTime;
        this.endTime = endTime;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGroupByResult", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getGroupByResult_args args = new getGroupByResult_args();
        args.setHeader(header);
        args.setExecutorId(executorId);
        args.setStartTime(startTime);
        args.setEndTime(endTime);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.util.List getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getGroupByResult();
      }
    }

    public void pullTimeSeriesSchema(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      pullTimeSeriesSchema_call method_call = new pullTimeSeriesSchema_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class pullTimeSeriesSchema_call extends org.apache.thrift.async.TAsyncMethodCall {
      private PullSchemaRequest request;
      public pullTimeSeriesSchema_call(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pullTimeSeriesSchema", org.apache.thrift.protocol.TMessageType.CALL, 0));
        pullTimeSeriesSchema_args args = new pullTimeSeriesSchema_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public PullSchemaResp getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_pullTimeSeriesSchema();
      }
    }

    public void pullMeasurementSchema(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      pullMeasurementSchema_call method_call = new pullMeasurementSchema_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class pullMeasurementSchema_call extends org.apache.thrift.async.TAsyncMethodCall {
      private PullSchemaRequest request;
      public pullMeasurementSchema_call(PullSchemaRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pullMeasurementSchema", org.apache.thrift.protocol.TMessageType.CALL, 0));
        pullMeasurementSchema_args args = new pullMeasurementSchema_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public PullSchemaResp getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_pullMeasurementSchema();
      }
    }

    public void previousFill(PreviousFillRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      previousFill_call method_call = new previousFill_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class previousFill_call extends org.apache.thrift.async.TAsyncMethodCall {
      private PreviousFillRequest request;
      public previousFill_call(PreviousFillRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("previousFill", org.apache.thrift.protocol.TMessageType.CALL, 0));
        previousFill_args args = new previousFill_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_previousFill();
      }
    }

    public void last(LastQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      last_call method_call = new last_call(request, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class last_call extends org.apache.thrift.async.TAsyncMethodCall {
      private LastQueryRequest request;
      public last_call(LastQueryRequest request, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.request = request;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("last", org.apache.thrift.protocol.TMessageType.CALL, 0));
        last_args args = new last_args();
        args.setRequest(request);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_last();
      }
    }

    public void getPathCount(RaftNode header, java.util.List pathsToQuery, int level, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPathCount_call method_call = new getPathCount_call(header, pathsToQuery, level, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPathCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private java.util.List pathsToQuery;
      private int level;
      public getPathCount_call(RaftNode header, java.util.List pathsToQuery, int level, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.pathsToQuery = pathsToQuery;
        this.level = level;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathCount", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPathCount_args args = new getPathCount_args();
        args.setHeader(header);
        args.setPathsToQuery(pathsToQuery);
        args.setLevel(level);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Integer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPathCount();
      }
    }

    public void getDeviceCount(RaftNode header, java.util.List pathsToQuery, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getDeviceCount_call method_call = new getDeviceCount_call(header, pathsToQuery, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getDeviceCount_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private java.util.List pathsToQuery;
      public getDeviceCount_call(RaftNode header, java.util.List pathsToQuery, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.pathsToQuery = pathsToQuery;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDeviceCount", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getDeviceCount_args args = new getDeviceCount_args();
        args.setHeader(header);
        args.setPathsToQuery(pathsToQuery);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Integer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getDeviceCount();
      }
    }

    public void onSnapshotApplied(RaftNode header, java.util.List slots, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      onSnapshotApplied_call method_call = new onSnapshotApplied_call(header, slots, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class onSnapshotApplied_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private java.util.List slots;
      public onSnapshotApplied_call(RaftNode header, java.util.List slots, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.slots = slots;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("onSnapshotApplied", org.apache.thrift.protocol.TMessageType.CALL, 0));
        onSnapshotApplied_args args = new onSnapshotApplied_args();
        args.setHeader(header);
        args.setSlots(slots);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Boolean getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_onSnapshotApplied();
      }
    }

    public void peekNextNotNullValue(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      peekNextNotNullValue_call method_call = new peekNextNotNullValue_call(header, executorId, startTime, endTime, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class peekNextNotNullValue_call extends org.apache.thrift.async.TAsyncMethodCall {
      private RaftNode header;
      private long executorId;
      private long startTime;
      private long endTime;
      public peekNextNotNullValue_call(RaftNode header, long executorId, long startTime, long endTime, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.header = header;
        this.executorId = executorId;
        this.startTime = startTime;
        this.endTime = endTime;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("peekNextNotNullValue", org.apache.thrift.protocol.TMessageType.CALL, 0));
        peekNextNotNullValue_args args = new peekNextNotNullValue_args();
        args.setHeader(header);
        args.setExecutorId(executorId);
        args.setStartTime(startTime);
        args.setEndTime(endTime);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.nio.ByteBuffer getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_peekNextNotNullValue();
      }
    }

  }

  public static class Processor extends RaftService.Processor implements org.apache.thrift.TProcessor {
    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new java.util.HashMap>()));
    }

    protected Processor(I iface, java.util.Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  java.util.Map> getProcessMap(java.util.Map> processMap) {
      processMap.put("querySingleSeries", new querySingleSeries());
      processMap.put("queryMultSeries", new queryMultSeries());
      processMap.put("fetchSingleSeries", new fetchSingleSeries());
      processMap.put("fetchMultSeries", new fetchMultSeries());
      processMap.put("querySingleSeriesByTimestamp", new querySingleSeriesByTimestamp());
      processMap.put("fetchSingleSeriesByTimestamps", new fetchSingleSeriesByTimestamps());
      processMap.put("endQuery", new endQuery());
      processMap.put("getAllPaths", new getAllPaths());
      processMap.put("getAllDevices", new getAllDevices());
      processMap.put("getDevices", new getDevices());
      processMap.put("getNodeList", new getNodeList());
      processMap.put("getChildNodeInNextLevel", new getChildNodeInNextLevel());
      processMap.put("getChildNodePathInNextLevel", new getChildNodePathInNextLevel());
      processMap.put("getAllMeasurementSchema", new getAllMeasurementSchema());
      processMap.put("getAggrResult", new getAggrResult());
      processMap.put("getUnregisteredTimeseries", new getUnregisteredTimeseries());
      processMap.put("pullSnapshot", new pullSnapshot());
      processMap.put("getGroupByExecutor", new getGroupByExecutor());
      processMap.put("getGroupByResult", new getGroupByResult());
      processMap.put("pullTimeSeriesSchema", new pullTimeSeriesSchema());
      processMap.put("pullMeasurementSchema", new pullMeasurementSchema());
      processMap.put("previousFill", new previousFill());
      processMap.put("last", new last());
      processMap.put("getPathCount", new getPathCount());
      processMap.put("getDeviceCount", new getDeviceCount());
      processMap.put("onSnapshotApplied", new onSnapshotApplied());
      processMap.put("peekNextNotNullValue", new peekNextNotNullValue());
      return processMap;
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public querySingleSeries_result getResult(I iface, querySingleSeries_args args) throws org.apache.thrift.TException {
        querySingleSeries_result result = new querySingleSeries_result();
        result.success = iface.querySingleSeries(args.request);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public queryMultSeries_result getResult(I iface, queryMultSeries_args args) throws org.apache.thrift.TException {
        queryMultSeries_result result = new queryMultSeries_result();
        result.success = iface.queryMultSeries(args.request);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public fetchSingleSeries_result getResult(I iface, fetchSingleSeries_args args) throws org.apache.thrift.TException {
        fetchSingleSeries_result result = new fetchSingleSeries_result();
        result.success = iface.fetchSingleSeries(args.header, args.readerId);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public fetchMultSeries_result getResult(I iface, fetchMultSeries_args args) throws org.apache.thrift.TException {
        fetchMultSeries_result result = new fetchMultSeries_result();
        result.success = iface.fetchMultSeries(args.header, args.readerId, args.paths);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public querySingleSeriesByTimestamp_result getResult(I iface, querySingleSeriesByTimestamp_args args) throws org.apache.thrift.TException {
        querySingleSeriesByTimestamp_result result = new querySingleSeriesByTimestamp_result();
        result.success = iface.querySingleSeriesByTimestamp(args.request);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public fetchSingleSeriesByTimestamps_result getResult(I iface, fetchSingleSeriesByTimestamps_args args) throws org.apache.thrift.TException {
        fetchSingleSeriesByTimestamps_result result = new fetchSingleSeriesByTimestamps_result();
        result.success = iface.fetchSingleSeriesByTimestamps(args.header, args.readerId, args.timestamps);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public endQuery_result getResult(I iface, endQuery_args args) throws org.apache.thrift.TException {
        endQuery_result result = new endQuery_result();
        iface.endQuery(args.header, args.thisNode, args.queryId);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getAllPaths_result getResult(I iface, getAllPaths_args args) throws org.apache.thrift.TException {
        getAllPaths_result result = new getAllPaths_result();
        result.success = iface.getAllPaths(args.header, args.paths, args.withAlias);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getAllDevices_result getResult(I iface, getAllDevices_args args) throws org.apache.thrift.TException {
        getAllDevices_result result = new getAllDevices_result();
        result.success = iface.getAllDevices(args.header, args.path, args.isPrefixMatch);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getDevices_result getResult(I iface, getDevices_args args) throws org.apache.thrift.TException {
        getDevices_result result = new getDevices_result();
        result.success = iface.getDevices(args.header, args.planBinary);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getNodeList_result getResult(I iface, getNodeList_args args) throws org.apache.thrift.TException {
        getNodeList_result result = new getNodeList_result();
        result.success = iface.getNodeList(args.header, args.path, args.nodeLevel);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getChildNodeInNextLevel_result getResult(I iface, getChildNodeInNextLevel_args args) throws org.apache.thrift.TException {
        getChildNodeInNextLevel_result result = new getChildNodeInNextLevel_result();
        result.success = iface.getChildNodeInNextLevel(args.header, args.path);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getChildNodePathInNextLevel_result getResult(I iface, getChildNodePathInNextLevel_args args) throws org.apache.thrift.TException {
        getChildNodePathInNextLevel_result result = new getChildNodePathInNextLevel_result();
        result.success = iface.getChildNodePathInNextLevel(args.header, args.path);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getAllMeasurementSchema_result getResult(I iface, getAllMeasurementSchema_args args) throws org.apache.thrift.TException {
        getAllMeasurementSchema_result result = new getAllMeasurementSchema_result();
        result.success = iface.getAllMeasurementSchema(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getAggrResult_result getResult(I iface, getAggrResult_args args) throws org.apache.thrift.TException {
        getAggrResult_result result = new getAggrResult_result();
        result.success = iface.getAggrResult(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getUnregisteredTimeseries_result getResult(I iface, getUnregisteredTimeseries_args args) throws org.apache.thrift.TException {
        getUnregisteredTimeseries_result result = new getUnregisteredTimeseries_result();
        result.success = iface.getUnregisteredTimeseries(args.header, args.timeseriesList);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public pullSnapshot_result getResult(I iface, pullSnapshot_args args) throws org.apache.thrift.TException {
        pullSnapshot_result result = new pullSnapshot_result();
        result.success = iface.pullSnapshot(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getGroupByExecutor_result getResult(I iface, getGroupByExecutor_args args) throws org.apache.thrift.TException {
        getGroupByExecutor_result result = new getGroupByExecutor_result();
        result.success = iface.getGroupByExecutor(args.request);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getGroupByResult_result getResult(I iface, getGroupByResult_args args) throws org.apache.thrift.TException {
        getGroupByResult_result result = new getGroupByResult_result();
        result.success = iface.getGroupByResult(args.header, args.executorId, args.startTime, args.endTime);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public pullTimeSeriesSchema_result getResult(I iface, pullTimeSeriesSchema_args args) throws org.apache.thrift.TException {
        pullTimeSeriesSchema_result result = new pullTimeSeriesSchema_result();
        result.success = iface.pullTimeSeriesSchema(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public pullMeasurementSchema_result getResult(I iface, pullMeasurementSchema_args args) throws org.apache.thrift.TException {
        pullMeasurementSchema_result result = new pullMeasurementSchema_result();
        result.success = iface.pullMeasurementSchema(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public previousFill_result getResult(I iface, previousFill_args args) throws org.apache.thrift.TException {
        previousFill_result result = new previousFill_result();
        result.success = iface.previousFill(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public last_result getResult(I iface, last_args args) throws org.apache.thrift.TException {
        last_result result = new last_result();
        result.success = iface.last(args.request);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getPathCount_result getResult(I iface, getPathCount_args args) throws org.apache.thrift.TException {
        getPathCount_result result = new getPathCount_result();
        result.success = iface.getPathCount(args.header, args.pathsToQuery, args.level);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public getDeviceCount_result getResult(I iface, getDeviceCount_args args) throws org.apache.thrift.TException {
        getDeviceCount_result result = new getDeviceCount_result();
        result.success = iface.getDeviceCount(args.header, args.pathsToQuery);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public onSnapshotApplied_result getResult(I iface, onSnapshotApplied_args args) throws org.apache.thrift.TException {
        onSnapshotApplied_result result = new onSnapshotApplied_result();
        result.success = iface.onSnapshotApplied(args.header, args.slots);
        result.setSuccessIsSet(true);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public peekNextNotNullValue_result getResult(I iface, peekNextNotNullValue_args args) throws org.apache.thrift.TException {
        peekNextNotNullValue_result result = new peekNextNotNullValue_result();
        result.success = iface.peekNextNotNullValue(args.header, args.executorId, args.startTime, args.endTime);
        return result;
      }
    }

  }

  public static class AsyncProcessor extends RaftService.AsyncProcessor {
    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new java.util.HashMap>()));
    }

    protected AsyncProcessor(I iface, java.util.Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  java.util.Map> getProcessMap(java.util.Map> processMap) {
      processMap.put("querySingleSeries", new querySingleSeries());
      processMap.put("queryMultSeries", new queryMultSeries());
      processMap.put("fetchSingleSeries", new fetchSingleSeries());
      processMap.put("fetchMultSeries", new fetchMultSeries());
      processMap.put("querySingleSeriesByTimestamp", new querySingleSeriesByTimestamp());
      processMap.put("fetchSingleSeriesByTimestamps", new fetchSingleSeriesByTimestamps());
      processMap.put("endQuery", new endQuery());
      processMap.put("getAllPaths", new getAllPaths());
      processMap.put("getAllDevices", new getAllDevices());
      processMap.put("getDevices", new getDevices());
      processMap.put("getNodeList", new getNodeList());
      processMap.put("getChildNodeInNextLevel", new getChildNodeInNextLevel());
      processMap.put("getChildNodePathInNextLevel", new getChildNodePathInNextLevel());
      processMap.put("getAllMeasurementSchema", new getAllMeasurementSchema());
      processMap.put("getAggrResult", new getAggrResult());
      processMap.put("getUnregisteredTimeseries", new getUnregisteredTimeseries());
      processMap.put("pullSnapshot", new pullSnapshot());
      processMap.put("getGroupByExecutor", new getGroupByExecutor());
      processMap.put("getGroupByResult", new getGroupByResult());
      processMap.put("pullTimeSeriesSchema", new pullTimeSeriesSchema());
      processMap.put("pullMeasurementSchema", new pullMeasurementSchema());
      processMap.put("previousFill", new previousFill());
      processMap.put("last", new last());
      processMap.put("getPathCount", new getPathCount());
      processMap.put("getDeviceCount", new getDeviceCount());
      processMap.put("onSnapshotApplied", new onSnapshotApplied());
      processMap.put("peekNextNotNullValue", new peekNextNotNullValue());
      return processMap;
    }

    public static class querySingleSeries extends org.apache.thrift.AsyncProcessFunction {
      public querySingleSeries() {
        super("querySingleSeries");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Long o) {
            querySingleSeries_result result = new querySingleSeries_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            querySingleSeries_result result = new querySingleSeries_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, querySingleSeries_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.querySingleSeries(args.request,resultHandler);
      }
    }

    public static class queryMultSeries extends org.apache.thrift.AsyncProcessFunction {
      public queryMultSeries() {
        super("queryMultSeries");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Long o) {
            queryMultSeries_result result = new queryMultSeries_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            queryMultSeries_result result = new queryMultSeries_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, queryMultSeries_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.queryMultSeries(args.request,resultHandler);
      }
    }

    public static class fetchSingleSeries extends org.apache.thrift.AsyncProcessFunction {
      public fetchSingleSeries() {
        super("fetchSingleSeries");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            fetchSingleSeries_result result = new fetchSingleSeries_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            fetchSingleSeries_result result = new fetchSingleSeries_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, fetchSingleSeries_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.fetchSingleSeries(args.header, args.readerId,resultHandler);
      }
    }

    public static class fetchMultSeries extends org.apache.thrift.AsyncProcessFunction> {
      public fetchMultSeries() {
        super("fetchMultSeries");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.Map o) {
            fetchMultSeries_result result = new fetchMultSeries_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            fetchMultSeries_result result = new fetchMultSeries_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, fetchMultSeries_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.fetchMultSeries(args.header, args.readerId, args.paths,resultHandler);
      }
    }

    public static class querySingleSeriesByTimestamp extends org.apache.thrift.AsyncProcessFunction {
      public querySingleSeriesByTimestamp() {
        super("querySingleSeriesByTimestamp");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Long o) {
            querySingleSeriesByTimestamp_result result = new querySingleSeriesByTimestamp_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            querySingleSeriesByTimestamp_result result = new querySingleSeriesByTimestamp_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, querySingleSeriesByTimestamp_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.querySingleSeriesByTimestamp(args.request,resultHandler);
      }
    }

    public static class fetchSingleSeriesByTimestamps extends org.apache.thrift.AsyncProcessFunction {
      public fetchSingleSeriesByTimestamps() {
        super("fetchSingleSeriesByTimestamps");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            fetchSingleSeriesByTimestamps_result result = new fetchSingleSeriesByTimestamps_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            fetchSingleSeriesByTimestamps_result result = new fetchSingleSeriesByTimestamps_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, fetchSingleSeriesByTimestamps_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.fetchSingleSeriesByTimestamps(args.header, args.readerId, args.timestamps,resultHandler);
      }
    }

    public static class endQuery extends org.apache.thrift.AsyncProcessFunction {
      public endQuery() {
        super("endQuery");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(Void o) {
            endQuery_result result = new endQuery_result();
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            endQuery_result result = new endQuery_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, endQuery_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.endQuery(args.header, args.thisNode, args.queryId,resultHandler);
      }
    }

    public static class getAllPaths extends org.apache.thrift.AsyncProcessFunction {
      public getAllPaths() {
        super("getAllPaths");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(GetAllPathsResult o) {
            getAllPaths_result result = new getAllPaths_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getAllPaths_result result = new getAllPaths_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getAllPaths_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getAllPaths(args.header, args.paths, args.withAlias,resultHandler);
      }
    }

    public static class getAllDevices extends org.apache.thrift.AsyncProcessFunction> {
      public getAllDevices() {
        super("getAllDevices");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.Set o) {
            getAllDevices_result result = new getAllDevices_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getAllDevices_result result = new getAllDevices_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getAllDevices_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getAllDevices(args.header, args.path, args.isPrefixMatch,resultHandler);
      }
    }

    public static class getDevices extends org.apache.thrift.AsyncProcessFunction {
      public getDevices() {
        super("getDevices");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            getDevices_result result = new getDevices_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getDevices_result result = new getDevices_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getDevices_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getDevices(args.header, args.planBinary,resultHandler);
      }
    }

    public static class getNodeList extends org.apache.thrift.AsyncProcessFunction> {
      public getNodeList() {
        super("getNodeList");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.List o) {
            getNodeList_result result = new getNodeList_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getNodeList_result result = new getNodeList_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getNodeList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getNodeList(args.header, args.path, args.nodeLevel,resultHandler);
      }
    }

    public static class getChildNodeInNextLevel extends org.apache.thrift.AsyncProcessFunction> {
      public getChildNodeInNextLevel() {
        super("getChildNodeInNextLevel");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.Set o) {
            getChildNodeInNextLevel_result result = new getChildNodeInNextLevel_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getChildNodeInNextLevel_result result = new getChildNodeInNextLevel_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getChildNodeInNextLevel_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getChildNodeInNextLevel(args.header, args.path,resultHandler);
      }
    }

    public static class getChildNodePathInNextLevel extends org.apache.thrift.AsyncProcessFunction> {
      public getChildNodePathInNextLevel() {
        super("getChildNodePathInNextLevel");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.Set o) {
            getChildNodePathInNextLevel_result result = new getChildNodePathInNextLevel_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getChildNodePathInNextLevel_result result = new getChildNodePathInNextLevel_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getChildNodePathInNextLevel_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getChildNodePathInNextLevel(args.header, args.path,resultHandler);
      }
    }

    public static class getAllMeasurementSchema extends org.apache.thrift.AsyncProcessFunction {
      public getAllMeasurementSchema() {
        super("getAllMeasurementSchema");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            getAllMeasurementSchema_result result = new getAllMeasurementSchema_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getAllMeasurementSchema_result result = new getAllMeasurementSchema_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getAllMeasurementSchema_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getAllMeasurementSchema(args.request,resultHandler);
      }
    }

    public static class getAggrResult extends org.apache.thrift.AsyncProcessFunction> {
      public getAggrResult() {
        super("getAggrResult");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.List o) {
            getAggrResult_result result = new getAggrResult_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getAggrResult_result result = new getAggrResult_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getAggrResult_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getAggrResult(args.request,resultHandler);
      }
    }

    public static class getUnregisteredTimeseries extends org.apache.thrift.AsyncProcessFunction> {
      public getUnregisteredTimeseries() {
        super("getUnregisteredTimeseries");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.List o) {
            getUnregisteredTimeseries_result result = new getUnregisteredTimeseries_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getUnregisteredTimeseries_result result = new getUnregisteredTimeseries_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getUnregisteredTimeseries_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getUnregisteredTimeseries(args.header, args.timeseriesList,resultHandler);
      }
    }

    public static class pullSnapshot extends org.apache.thrift.AsyncProcessFunction {
      public pullSnapshot() {
        super("pullSnapshot");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(PullSnapshotResp o) {
            pullSnapshot_result result = new pullSnapshot_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            pullSnapshot_result result = new pullSnapshot_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, pullSnapshot_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.pullSnapshot(args.request,resultHandler);
      }
    }

    public static class getGroupByExecutor extends org.apache.thrift.AsyncProcessFunction {
      public getGroupByExecutor() {
        super("getGroupByExecutor");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Long o) {
            getGroupByExecutor_result result = new getGroupByExecutor_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getGroupByExecutor_result result = new getGroupByExecutor_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getGroupByExecutor_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getGroupByExecutor(args.request,resultHandler);
      }
    }

    public static class getGroupByResult extends org.apache.thrift.AsyncProcessFunction> {
      public getGroupByResult() {
        super("getGroupByResult");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback>() { 
          public void onComplete(java.util.List o) {
            getGroupByResult_result result = new getGroupByResult_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getGroupByResult_result result = new getGroupByResult_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getGroupByResult_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException {
        iface.getGroupByResult(args.header, args.executorId, args.startTime, args.endTime,resultHandler);
      }
    }

    public static class pullTimeSeriesSchema extends org.apache.thrift.AsyncProcessFunction {
      public pullTimeSeriesSchema() {
        super("pullTimeSeriesSchema");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(PullSchemaResp o) {
            pullTimeSeriesSchema_result result = new pullTimeSeriesSchema_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            pullTimeSeriesSchema_result result = new pullTimeSeriesSchema_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, pullTimeSeriesSchema_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.pullTimeSeriesSchema(args.request,resultHandler);
      }
    }

    public static class pullMeasurementSchema extends org.apache.thrift.AsyncProcessFunction {
      public pullMeasurementSchema() {
        super("pullMeasurementSchema");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(PullSchemaResp o) {
            pullMeasurementSchema_result result = new pullMeasurementSchema_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            pullMeasurementSchema_result result = new pullMeasurementSchema_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, pullMeasurementSchema_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.pullMeasurementSchema(args.request,resultHandler);
      }
    }

    public static class previousFill extends org.apache.thrift.AsyncProcessFunction {
      public previousFill() {
        super("previousFill");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            previousFill_result result = new previousFill_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            previousFill_result result = new previousFill_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, previousFill_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.previousFill(args.request,resultHandler);
      }
    }

    public static class last extends org.apache.thrift.AsyncProcessFunction {
      public last() {
        super("last");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            last_result result = new last_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            last_result result = new last_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, last_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.last(args.request,resultHandler);
      }
    }

    public static class getPathCount extends org.apache.thrift.AsyncProcessFunction {
      public getPathCount() {
        super("getPathCount");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Integer o) {
            getPathCount_result result = new getPathCount_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getPathCount_result result = new getPathCount_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getPathCount_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getPathCount(args.header, args.pathsToQuery, args.level,resultHandler);
      }
    }

    public static class getDeviceCount extends org.apache.thrift.AsyncProcessFunction {
      public getDeviceCount() {
        super("getDeviceCount");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Integer o) {
            getDeviceCount_result result = new getDeviceCount_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            getDeviceCount_result result = new getDeviceCount_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getDeviceCount_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.getDeviceCount(args.header, args.pathsToQuery,resultHandler);
      }
    }

    public static class onSnapshotApplied extends org.apache.thrift.AsyncProcessFunction {
      public onSnapshotApplied() {
        super("onSnapshotApplied");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.lang.Boolean o) {
            onSnapshotApplied_result result = new onSnapshotApplied_result();
            result.success = o;
            result.setSuccessIsSet(true);
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            onSnapshotApplied_result result = new onSnapshotApplied_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, onSnapshotApplied_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.onSnapshotApplied(args.header, args.slots,resultHandler);
      }
    }

    public static class peekNextNotNullValue extends org.apache.thrift.AsyncProcessFunction {
      public peekNextNotNullValue() {
        super("peekNextNotNullValue");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(java.nio.ByteBuffer o) {
            peekNextNotNullValue_result result = new peekNextNotNullValue_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            peekNextNotNullValue_result result = new peekNextNotNullValue_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, peekNextNotNullValue_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.peekNextNotNullValue(args.header, args.executorId, args.startTime, args.endTime,resultHandler);
      }
    }

  }

  public static class querySingleSeries_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("querySingleSeries_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new querySingleSeries_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new querySingleSeries_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable SingleSeriesQueryRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public querySingleSeries_args() {
    }

    public querySingleSeries_args(
      SingleSeriesQueryRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public querySingleSeries_args(querySingleSeries_args other) {
      if (other.isSetRequest()) {
        this.request = new SingleSeriesQueryRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public SingleSeriesQueryRequest getRequest() {
      return this.request;
    }

    public querySingleSeries_args setRequest(@org.apache.thrift.annotation.Nullable SingleSeriesQueryRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((SingleSeriesQueryRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof querySingleSeries_args)
        return this.equals((querySingleSeries_args)that);
      return false;
    }

    public boolean equals(querySingleSeries_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("querySingleSeries_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 querySingleSeries_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeries_argsStandardScheme getScheme() {
        return new querySingleSeries_argsStandardScheme();
      }
    }

    private static class querySingleSeries_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, querySingleSeries_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new SingleSeriesQueryRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, querySingleSeries_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class querySingleSeries_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeries_argsTupleScheme getScheme() {
        return new querySingleSeries_argsTupleScheme();
      }
    }

    private static class querySingleSeries_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, querySingleSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new SingleSeriesQueryRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class querySingleSeries_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("querySingleSeries_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new querySingleSeries_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new querySingleSeries_resultTupleSchemeFactory();

    public long success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(querySingleSeries_result.class, metaDataMap);
    }

    public querySingleSeries_result() {
    }

    public querySingleSeries_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public querySingleSeries_result(querySingleSeries_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public querySingleSeries_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof querySingleSeries_result)
        return this.equals((querySingleSeries_result)that);
      return false;
    }

    public boolean equals(querySingleSeries_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("querySingleSeries_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 querySingleSeries_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeries_resultStandardScheme getScheme() {
        return new querySingleSeries_resultStandardScheme();
      }
    }

    private static class querySingleSeries_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, querySingleSeries_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;
            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, querySingleSeries_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class querySingleSeries_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeries_resultTupleScheme getScheme() {
        return new querySingleSeries_resultTupleScheme();
      }
    }

    private static class querySingleSeries_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, querySingleSeries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class queryMultSeries_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("queryMultSeries_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new queryMultSeries_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new queryMultSeries_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable MultSeriesQueryRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public queryMultSeries_args() {
    }

    public queryMultSeries_args(
      MultSeriesQueryRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public queryMultSeries_args(queryMultSeries_args other) {
      if (other.isSetRequest()) {
        this.request = new MultSeriesQueryRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public MultSeriesQueryRequest getRequest() {
      return this.request;
    }

    public queryMultSeries_args setRequest(@org.apache.thrift.annotation.Nullable MultSeriesQueryRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((MultSeriesQueryRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof queryMultSeries_args)
        return this.equals((queryMultSeries_args)that);
      return false;
    }

    public boolean equals(queryMultSeries_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("queryMultSeries_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 queryMultSeries_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public queryMultSeries_argsStandardScheme getScheme() {
        return new queryMultSeries_argsStandardScheme();
      }
    }

    private static class queryMultSeries_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, queryMultSeries_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new MultSeriesQueryRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, queryMultSeries_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class queryMultSeries_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public queryMultSeries_argsTupleScheme getScheme() {
        return new queryMultSeries_argsTupleScheme();
      }
    }

    private static class queryMultSeries_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, queryMultSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new MultSeriesQueryRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class queryMultSeries_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("queryMultSeries_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new queryMultSeries_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new queryMultSeries_resultTupleSchemeFactory();

    public long success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryMultSeries_result.class, metaDataMap);
    }

    public queryMultSeries_result() {
    }

    public queryMultSeries_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public queryMultSeries_result(queryMultSeries_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public queryMultSeries_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof queryMultSeries_result)
        return this.equals((queryMultSeries_result)that);
      return false;
    }

    public boolean equals(queryMultSeries_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("queryMultSeries_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 queryMultSeries_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public queryMultSeries_resultStandardScheme getScheme() {
        return new queryMultSeries_resultStandardScheme();
      }
    }

    private static class queryMultSeries_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, queryMultSeries_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;
            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, queryMultSeries_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class queryMultSeries_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public queryMultSeries_resultTupleScheme getScheme() {
        return new queryMultSeries_resultTupleScheme();
      }
    }

    private static class queryMultSeries_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, queryMultSeries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchSingleSeries_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("fetchSingleSeries_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField READER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("readerId", org.apache.thrift.protocol.TType.I64, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchSingleSeries_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchSingleSeries_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public long readerId; // 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 {
      HEADER((short)1, "header"),
      READER_ID((short)2, "readerId");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // READER_ID
            return READER_ID;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __READERID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.READER_ID, new org.apache.thrift.meta_data.FieldMetaData("readerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchSingleSeries_args.class, metaDataMap);
    }

    public fetchSingleSeries_args() {
    }

    public fetchSingleSeries_args(
      RaftNode header,
      long readerId)
    {
      this();
      this.header = header;
      this.readerId = readerId;
      setReaderIdIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchSingleSeries_args(fetchSingleSeries_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      this.readerId = other.readerId;
    }

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

    @Override
    public void clear() {
      this.header = null;
      setReaderIdIsSet(false);
      this.readerId = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public fetchSingleSeries_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public long getReaderId() {
      return this.readerId;
    }

    public fetchSingleSeries_args setReaderId(long readerId) {
      this.readerId = readerId;
      setReaderIdIsSet(true);
      return this;
    }

    public void unsetReaderId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    /** Returns true if field readerId is set (has been assigned a value) and false otherwise */
    public boolean isSetReaderId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    public void setReaderIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __READERID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case READER_ID:
        if (value == null) {
          unsetReaderId();
        } else {
          setReaderId((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case READER_ID:
        return getReaderId();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case READER_ID:
        return isSetReaderId();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchSingleSeries_args)
        return this.equals((fetchSingleSeries_args)that);
      return false;
    }

    public boolean equals(fetchSingleSeries_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_readerId = true;
      boolean that_present_readerId = true;
      if (this_present_readerId || that_present_readerId) {
        if (!(this_present_readerId && that_present_readerId))
          return false;
        if (this.readerId != that.readerId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(readerId);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetReaderId(), other.isSetReaderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetReaderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.readerId, other.readerId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchSingleSeries_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("readerId:");
      sb.append(this.readerId);
      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 (header != null) {
        header.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, java.lang.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 fetchSingleSeries_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeries_argsStandardScheme getScheme() {
        return new fetchSingleSeries_argsStandardScheme();
      }
    }

    private static class fetchSingleSeries_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchSingleSeries_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // READER_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.readerId = iprot.readI64();
                struct.setReaderIdIsSet(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, fetchSingleSeries_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(READER_ID_FIELD_DESC);
        oprot.writeI64(struct.readerId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchSingleSeries_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeries_argsTupleScheme getScheme() {
        return new fetchSingleSeries_argsTupleScheme();
      }
    }

    private static class fetchSingleSeries_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetReaderId()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetReaderId()) {
          oprot.writeI64(struct.readerId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.readerId = iprot.readI64();
          struct.setReaderIdIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchSingleSeries_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("fetchSingleSeries_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchSingleSeries_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchSingleSeries_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchSingleSeries_result.class, metaDataMap);
    }

    public fetchSingleSeries_result() {
    }

    public fetchSingleSeries_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchSingleSeries_result(fetchSingleSeries_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public fetchSingleSeries_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public fetchSingleSeries_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchSingleSeries_result)
        return this.equals((fetchSingleSeries_result)that);
      return false;
    }

    public boolean equals(fetchSingleSeries_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchSingleSeries_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 fetchSingleSeries_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeries_resultStandardScheme getScheme() {
        return new fetchSingleSeries_resultStandardScheme();
      }
    }

    private static class fetchSingleSeries_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchSingleSeries_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, fetchSingleSeries_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class fetchSingleSeries_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeries_resultTupleScheme getScheme() {
        return new fetchSingleSeries_resultTupleScheme();
      }
    }

    private static class fetchSingleSeries_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchMultSeries_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("fetchMultSeries_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField READER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("readerId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("paths", org.apache.thrift.protocol.TType.LIST, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchMultSeries_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchMultSeries_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public long readerId; // required
    public @org.apache.thrift.annotation.Nullable java.util.List paths; // 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 {
      HEADER((short)1, "header"),
      READER_ID((short)2, "readerId"),
      PATHS((short)3, "paths");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // READER_ID
            return READER_ID;
          case 3: // PATHS
            return PATHS;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __READERID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.READER_ID, new org.apache.thrift.meta_data.FieldMetaData("readerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.PATHS, new org.apache.thrift.meta_data.FieldMetaData("paths", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchMultSeries_args.class, metaDataMap);
    }

    public fetchMultSeries_args() {
    }

    public fetchMultSeries_args(
      RaftNode header,
      long readerId,
      java.util.List paths)
    {
      this();
      this.header = header;
      this.readerId = readerId;
      setReaderIdIsSet(true);
      this.paths = paths;
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchMultSeries_args(fetchMultSeries_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      this.readerId = other.readerId;
      if (other.isSetPaths()) {
        java.util.List __this__paths = new java.util.ArrayList(other.paths);
        this.paths = __this__paths;
      }
    }

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

    @Override
    public void clear() {
      this.header = null;
      setReaderIdIsSet(false);
      this.readerId = 0;
      this.paths = null;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public fetchMultSeries_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public long getReaderId() {
      return this.readerId;
    }

    public fetchMultSeries_args setReaderId(long readerId) {
      this.readerId = readerId;
      setReaderIdIsSet(true);
      return this;
    }

    public void unsetReaderId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    /** Returns true if field readerId is set (has been assigned a value) and false otherwise */
    public boolean isSetReaderId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    public void setReaderIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __READERID_ISSET_ID, value);
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getPathsIterator() {
      return (this.paths == null) ? null : this.paths.iterator();
    }

    public void addToPaths(java.lang.String elem) {
      if (this.paths == null) {
        this.paths = new java.util.ArrayList();
      }
      this.paths.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getPaths() {
      return this.paths;
    }

    public fetchMultSeries_args setPaths(@org.apache.thrift.annotation.Nullable java.util.List paths) {
      this.paths = paths;
      return this;
    }

    public void unsetPaths() {
      this.paths = null;
    }

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

    public void setPathsIsSet(boolean value) {
      if (!value) {
        this.paths = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case READER_ID:
        if (value == null) {
          unsetReaderId();
        } else {
          setReaderId((java.lang.Long)value);
        }
        break;

      case PATHS:
        if (value == null) {
          unsetPaths();
        } else {
          setPaths((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case READER_ID:
        return getReaderId();

      case PATHS:
        return getPaths();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case READER_ID:
        return isSetReaderId();
      case PATHS:
        return isSetPaths();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchMultSeries_args)
        return this.equals((fetchMultSeries_args)that);
      return false;
    }

    public boolean equals(fetchMultSeries_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_readerId = true;
      boolean that_present_readerId = true;
      if (this_present_readerId || that_present_readerId) {
        if (!(this_present_readerId && that_present_readerId))
          return false;
        if (this.readerId != that.readerId)
          return false;
      }

      boolean this_present_paths = true && this.isSetPaths();
      boolean that_present_paths = true && that.isSetPaths();
      if (this_present_paths || that_present_paths) {
        if (!(this_present_paths && that_present_paths))
          return false;
        if (!this.paths.equals(that.paths))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(readerId);

      hashCode = hashCode * 8191 + ((isSetPaths()) ? 131071 : 524287);
      if (isSetPaths())
        hashCode = hashCode * 8191 + paths.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetReaderId(), other.isSetReaderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetReaderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.readerId, other.readerId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPaths(), other.isSetPaths());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPaths()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paths, other.paths);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchMultSeries_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("readerId:");
      sb.append(this.readerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("paths:");
      if (this.paths == null) {
        sb.append("null");
      } else {
        sb.append(this.paths);
      }
      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 (header != null) {
        header.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, java.lang.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 fetchMultSeries_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchMultSeries_argsStandardScheme getScheme() {
        return new fetchMultSeries_argsStandardScheme();
      }
    }

    private static class fetchMultSeries_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchMultSeries_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // READER_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.readerId = iprot.readI64();
                struct.setReaderIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // PATHS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list206 = iprot.readListBegin();
                  struct.paths = new java.util.ArrayList(_list206.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem207;
                  for (int _i208 = 0; _i208 < _list206.size; ++_i208)
                  {
                    _elem207 = iprot.readString();
                    struct.paths.add(_elem207);
                  }
                  iprot.readListEnd();
                }
                struct.setPathsIsSet(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, fetchMultSeries_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(READER_ID_FIELD_DESC);
        oprot.writeI64(struct.readerId);
        oprot.writeFieldEnd();
        if (struct.paths != null) {
          oprot.writeFieldBegin(PATHS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.paths.size()));
            for (java.lang.String _iter209 : struct.paths)
            {
              oprot.writeString(_iter209);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchMultSeries_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchMultSeries_argsTupleScheme getScheme() {
        return new fetchMultSeries_argsTupleScheme();
      }
    }

    private static class fetchMultSeries_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchMultSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetReaderId()) {
          optionals.set(1);
        }
        if (struct.isSetPaths()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetReaderId()) {
          oprot.writeI64(struct.readerId);
        }
        if (struct.isSetPaths()) {
          {
            oprot.writeI32(struct.paths.size());
            for (java.lang.String _iter210 : struct.paths)
            {
              oprot.writeString(_iter210);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchMultSeries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.readerId = iprot.readI64();
          struct.setReaderIdIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TList _list211 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.paths = new java.util.ArrayList(_list211.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem212;
            for (int _i213 = 0; _i213 < _list211.size; ++_i213)
            {
              _elem212 = iprot.readString();
              struct.paths.add(_elem212);
            }
          }
          struct.setPathsIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchMultSeries_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("fetchMultSeries_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchMultSeries_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchMultSeries_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.Map success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchMultSeries_result.class, metaDataMap);
    }

    public fetchMultSeries_result() {
    }

    public fetchMultSeries_result(
      java.util.Map success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchMultSeries_result(fetchMultSeries_result other) {
      if (other.isSetSuccess()) {
        java.util.Map __this__success = new java.util.HashMap(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    public void putToSuccess(java.lang.String key, java.nio.ByteBuffer val) {
      if (this.success == null) {
        this.success = new java.util.HashMap();
      }
      this.success.put(key, val);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Map getSuccess() {
      return this.success;
    }

    public fetchMultSeries_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.Map)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchMultSeries_result)
        return this.equals((fetchMultSeries_result)that);
      return false;
    }

    public boolean equals(fetchMultSeries_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchMultSeries_result(");
      boolean first = true;

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

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

    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, java.lang.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 fetchMultSeries_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchMultSeries_resultStandardScheme getScheme() {
        return new fetchMultSeries_resultStandardScheme();
      }
    }

    private static class fetchMultSeries_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchMultSeries_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 _map214 = iprot.readMapBegin();
                  struct.success = new java.util.HashMap(2*_map214.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _key215;
                  @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val216;
                  for (int _i217 = 0; _i217 < _map214.size; ++_i217)
                  {
                    _key215 = iprot.readString();
                    _val216 = iprot.readBinary();
                    struct.success.put(_key215, _val216);
                  }
                  iprot.readMapEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, fetchMultSeries_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (java.util.Map.Entry _iter218 : struct.success.entrySet())
            {
              oprot.writeString(_iter218.getKey());
              oprot.writeBinary(_iter218.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchMultSeries_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchMultSeries_resultTupleScheme getScheme() {
        return new fetchMultSeries_resultTupleScheme();
      }
    }

    private static class fetchMultSeries_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchMultSeries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.util.Map.Entry _iter219 : struct.success.entrySet())
            {
              oprot.writeString(_iter219.getKey());
              oprot.writeBinary(_iter219.getValue());
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchMultSeries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TMap _map220 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
            struct.success = new java.util.HashMap(2*_map220.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _key221;
            @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _val222;
            for (int _i223 = 0; _i223 < _map220.size; ++_i223)
            {
              _key221 = iprot.readString();
              _val222 = iprot.readBinary();
              struct.success.put(_key221, _val222);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class querySingleSeriesByTimestamp_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("querySingleSeriesByTimestamp_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new querySingleSeriesByTimestamp_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new querySingleSeriesByTimestamp_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable SingleSeriesQueryRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public querySingleSeriesByTimestamp_args() {
    }

    public querySingleSeriesByTimestamp_args(
      SingleSeriesQueryRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public querySingleSeriesByTimestamp_args(querySingleSeriesByTimestamp_args other) {
      if (other.isSetRequest()) {
        this.request = new SingleSeriesQueryRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public SingleSeriesQueryRequest getRequest() {
      return this.request;
    }

    public querySingleSeriesByTimestamp_args setRequest(@org.apache.thrift.annotation.Nullable SingleSeriesQueryRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((SingleSeriesQueryRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof querySingleSeriesByTimestamp_args)
        return this.equals((querySingleSeriesByTimestamp_args)that);
      return false;
    }

    public boolean equals(querySingleSeriesByTimestamp_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("querySingleSeriesByTimestamp_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 querySingleSeriesByTimestamp_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeriesByTimestamp_argsStandardScheme getScheme() {
        return new querySingleSeriesByTimestamp_argsStandardScheme();
      }
    }

    private static class querySingleSeriesByTimestamp_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, querySingleSeriesByTimestamp_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new SingleSeriesQueryRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, querySingleSeriesByTimestamp_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class querySingleSeriesByTimestamp_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeriesByTimestamp_argsTupleScheme getScheme() {
        return new querySingleSeriesByTimestamp_argsTupleScheme();
      }
    }

    private static class querySingleSeriesByTimestamp_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, querySingleSeriesByTimestamp_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new SingleSeriesQueryRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class querySingleSeriesByTimestamp_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("querySingleSeriesByTimestamp_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new querySingleSeriesByTimestamp_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new querySingleSeriesByTimestamp_resultTupleSchemeFactory();

    public long success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(querySingleSeriesByTimestamp_result.class, metaDataMap);
    }

    public querySingleSeriesByTimestamp_result() {
    }

    public querySingleSeriesByTimestamp_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public querySingleSeriesByTimestamp_result(querySingleSeriesByTimestamp_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public querySingleSeriesByTimestamp_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof querySingleSeriesByTimestamp_result)
        return this.equals((querySingleSeriesByTimestamp_result)that);
      return false;
    }

    public boolean equals(querySingleSeriesByTimestamp_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("querySingleSeriesByTimestamp_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 querySingleSeriesByTimestamp_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeriesByTimestamp_resultStandardScheme getScheme() {
        return new querySingleSeriesByTimestamp_resultStandardScheme();
      }
    }

    private static class querySingleSeriesByTimestamp_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, querySingleSeriesByTimestamp_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;
            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, querySingleSeriesByTimestamp_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class querySingleSeriesByTimestamp_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public querySingleSeriesByTimestamp_resultTupleScheme getScheme() {
        return new querySingleSeriesByTimestamp_resultTupleScheme();
      }
    }

    private static class querySingleSeriesByTimestamp_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, querySingleSeriesByTimestamp_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchSingleSeriesByTimestamps_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("fetchSingleSeriesByTimestamps_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField READER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("readerId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TIMESTAMPS_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamps", org.apache.thrift.protocol.TType.LIST, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchSingleSeriesByTimestamps_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchSingleSeriesByTimestamps_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public long readerId; // required
    public @org.apache.thrift.annotation.Nullable java.util.List timestamps; // 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 {
      HEADER((short)1, "header"),
      READER_ID((short)2, "readerId"),
      TIMESTAMPS((short)3, "timestamps");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // READER_ID
            return READER_ID;
          case 3: // TIMESTAMPS
            return TIMESTAMPS;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __READERID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.READER_ID, new org.apache.thrift.meta_data.FieldMetaData("readerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.TIMESTAMPS, new org.apache.thrift.meta_data.FieldMetaData("timestamps", 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.I64              , "long"))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchSingleSeriesByTimestamps_args.class, metaDataMap);
    }

    public fetchSingleSeriesByTimestamps_args() {
    }

    public fetchSingleSeriesByTimestamps_args(
      RaftNode header,
      long readerId,
      java.util.List timestamps)
    {
      this();
      this.header = header;
      this.readerId = readerId;
      setReaderIdIsSet(true);
      this.timestamps = timestamps;
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchSingleSeriesByTimestamps_args(fetchSingleSeriesByTimestamps_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      this.readerId = other.readerId;
      if (other.isSetTimestamps()) {
        java.util.List __this__timestamps = new java.util.ArrayList(other.timestamps.size());
        for (java.lang.Long other_element : other.timestamps) {
          __this__timestamps.add(other_element);
        }
        this.timestamps = __this__timestamps;
      }
    }

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

    @Override
    public void clear() {
      this.header = null;
      setReaderIdIsSet(false);
      this.readerId = 0;
      this.timestamps = null;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public fetchSingleSeriesByTimestamps_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public long getReaderId() {
      return this.readerId;
    }

    public fetchSingleSeriesByTimestamps_args setReaderId(long readerId) {
      this.readerId = readerId;
      setReaderIdIsSet(true);
      return this;
    }

    public void unsetReaderId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    /** Returns true if field readerId is set (has been assigned a value) and false otherwise */
    public boolean isSetReaderId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __READERID_ISSET_ID);
    }

    public void setReaderIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __READERID_ISSET_ID, value);
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getTimestampsIterator() {
      return (this.timestamps == null) ? null : this.timestamps.iterator();
    }

    public void addToTimestamps(long elem) {
      if (this.timestamps == null) {
        this.timestamps = new java.util.ArrayList();
      }
      this.timestamps.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getTimestamps() {
      return this.timestamps;
    }

    public fetchSingleSeriesByTimestamps_args setTimestamps(@org.apache.thrift.annotation.Nullable java.util.List timestamps) {
      this.timestamps = timestamps;
      return this;
    }

    public void unsetTimestamps() {
      this.timestamps = null;
    }

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

    public void setTimestampsIsSet(boolean value) {
      if (!value) {
        this.timestamps = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case READER_ID:
        if (value == null) {
          unsetReaderId();
        } else {
          setReaderId((java.lang.Long)value);
        }
        break;

      case TIMESTAMPS:
        if (value == null) {
          unsetTimestamps();
        } else {
          setTimestamps((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case READER_ID:
        return getReaderId();

      case TIMESTAMPS:
        return getTimestamps();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case READER_ID:
        return isSetReaderId();
      case TIMESTAMPS:
        return isSetTimestamps();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchSingleSeriesByTimestamps_args)
        return this.equals((fetchSingleSeriesByTimestamps_args)that);
      return false;
    }

    public boolean equals(fetchSingleSeriesByTimestamps_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_readerId = true;
      boolean that_present_readerId = true;
      if (this_present_readerId || that_present_readerId) {
        if (!(this_present_readerId && that_present_readerId))
          return false;
        if (this.readerId != that.readerId)
          return false;
      }

      boolean this_present_timestamps = true && this.isSetTimestamps();
      boolean that_present_timestamps = true && that.isSetTimestamps();
      if (this_present_timestamps || that_present_timestamps) {
        if (!(this_present_timestamps && that_present_timestamps))
          return false;
        if (!this.timestamps.equals(that.timestamps))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(readerId);

      hashCode = hashCode * 8191 + ((isSetTimestamps()) ? 131071 : 524287);
      if (isSetTimestamps())
        hashCode = hashCode * 8191 + timestamps.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetReaderId(), other.isSetReaderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetReaderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.readerId, other.readerId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetTimestamps(), other.isSetTimestamps());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimestamps()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamps, other.timestamps);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchSingleSeriesByTimestamps_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("readerId:");
      sb.append(this.readerId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("timestamps:");
      if (this.timestamps == null) {
        sb.append("null");
      } else {
        sb.append(this.timestamps);
      }
      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 (header != null) {
        header.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, java.lang.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 fetchSingleSeriesByTimestamps_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeriesByTimestamps_argsStandardScheme getScheme() {
        return new fetchSingleSeriesByTimestamps_argsStandardScheme();
      }
    }

    private static class fetchSingleSeriesByTimestamps_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchSingleSeriesByTimestamps_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // READER_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.readerId = iprot.readI64();
                struct.setReaderIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TIMESTAMPS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list224 = iprot.readListBegin();
                  struct.timestamps = new java.util.ArrayList(_list224.size);
                  long _elem225;
                  for (int _i226 = 0; _i226 < _list224.size; ++_i226)
                  {
                    _elem225 = iprot.readI64();
                    struct.timestamps.add(_elem225);
                  }
                  iprot.readListEnd();
                }
                struct.setTimestampsIsSet(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, fetchSingleSeriesByTimestamps_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(READER_ID_FIELD_DESC);
        oprot.writeI64(struct.readerId);
        oprot.writeFieldEnd();
        if (struct.timestamps != null) {
          oprot.writeFieldBegin(TIMESTAMPS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.timestamps.size()));
            for (long _iter227 : struct.timestamps)
            {
              oprot.writeI64(_iter227);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class fetchSingleSeriesByTimestamps_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeriesByTimestamps_argsTupleScheme getScheme() {
        return new fetchSingleSeriesByTimestamps_argsTupleScheme();
      }
    }

    private static class fetchSingleSeriesByTimestamps_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeriesByTimestamps_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetReaderId()) {
          optionals.set(1);
        }
        if (struct.isSetTimestamps()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetReaderId()) {
          oprot.writeI64(struct.readerId);
        }
        if (struct.isSetTimestamps()) {
          {
            oprot.writeI32(struct.timestamps.size());
            for (long _iter228 : struct.timestamps)
            {
              oprot.writeI64(_iter228);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeriesByTimestamps_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.readerId = iprot.readI64();
          struct.setReaderIdIsSet(true);
        }
        if (incoming.get(2)) {
          {
            org.apache.thrift.protocol.TList _list229 = iprot.readListBegin(org.apache.thrift.protocol.TType.I64);
            struct.timestamps = new java.util.ArrayList(_list229.size);
            long _elem230;
            for (int _i231 = 0; _i231 < _list229.size; ++_i231)
            {
              _elem230 = iprot.readI64();
              struct.timestamps.add(_elem230);
            }
          }
          struct.setTimestampsIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class fetchSingleSeriesByTimestamps_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("fetchSingleSeriesByTimestamps_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new fetchSingleSeriesByTimestamps_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new fetchSingleSeriesByTimestamps_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(fetchSingleSeriesByTimestamps_result.class, metaDataMap);
    }

    public fetchSingleSeriesByTimestamps_result() {
    }

    public fetchSingleSeriesByTimestamps_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public fetchSingleSeriesByTimestamps_result(fetchSingleSeriesByTimestamps_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public fetchSingleSeriesByTimestamps_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public fetchSingleSeriesByTimestamps_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof fetchSingleSeriesByTimestamps_result)
        return this.equals((fetchSingleSeriesByTimestamps_result)that);
      return false;
    }

    public boolean equals(fetchSingleSeriesByTimestamps_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("fetchSingleSeriesByTimestamps_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 fetchSingleSeriesByTimestamps_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeriesByTimestamps_resultStandardScheme getScheme() {
        return new fetchSingleSeriesByTimestamps_resultStandardScheme();
      }
    }

    private static class fetchSingleSeriesByTimestamps_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, fetchSingleSeriesByTimestamps_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, fetchSingleSeriesByTimestamps_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class fetchSingleSeriesByTimestamps_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public fetchSingleSeriesByTimestamps_resultTupleScheme getScheme() {
        return new fetchSingleSeriesByTimestamps_resultTupleScheme();
      }
    }

    private static class fetchSingleSeriesByTimestamps_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, fetchSingleSeriesByTimestamps_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class endQuery_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("endQuery_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField THIS_NODE_FIELD_DESC = new org.apache.thrift.protocol.TField("thisNode", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.I64, (short)4);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new endQuery_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new endQuery_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable Node thisNode; // required
    public long queryId; // 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 {
      HEADER((short)1, "header"),
      THIS_NODE((short)3, "thisNode"),
      QUERY_ID((short)4, "queryId");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 3: // THIS_NODE
            return THIS_NODE;
          case 4: // QUERY_ID
            return QUERY_ID;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __QUERYID_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.THIS_NODE, new org.apache.thrift.meta_data.FieldMetaData("thisNode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Node.class)));
      tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(endQuery_args.class, metaDataMap);
    }

    public endQuery_args() {
    }

    public endQuery_args(
      RaftNode header,
      Node thisNode,
      long queryId)
    {
      this();
      this.header = header;
      this.thisNode = thisNode;
      this.queryId = queryId;
      setQueryIdIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public endQuery_args(endQuery_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetThisNode()) {
        this.thisNode = new Node(other.thisNode);
      }
      this.queryId = other.queryId;
    }

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

    @Override
    public void clear() {
      this.header = null;
      this.thisNode = null;
      setQueryIdIsSet(false);
      this.queryId = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public endQuery_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public Node getThisNode() {
      return this.thisNode;
    }

    public endQuery_args setThisNode(@org.apache.thrift.annotation.Nullable Node thisNode) {
      this.thisNode = thisNode;
      return this;
    }

    public void unsetThisNode() {
      this.thisNode = null;
    }

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

    public void setThisNodeIsSet(boolean value) {
      if (!value) {
        this.thisNode = null;
      }
    }

    public long getQueryId() {
      return this.queryId;
    }

    public endQuery_args setQueryId(long queryId) {
      this.queryId = queryId;
      setQueryIdIsSet(true);
      return this;
    }

    public void unsetQueryId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __QUERYID_ISSET_ID);
    }

    /** Returns true if field queryId is set (has been assigned a value) and false otherwise */
    public boolean isSetQueryId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __QUERYID_ISSET_ID);
    }

    public void setQueryIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __QUERYID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case THIS_NODE:
        if (value == null) {
          unsetThisNode();
        } else {
          setThisNode((Node)value);
        }
        break;

      case QUERY_ID:
        if (value == null) {
          unsetQueryId();
        } else {
          setQueryId((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case THIS_NODE:
        return getThisNode();

      case QUERY_ID:
        return getQueryId();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case THIS_NODE:
        return isSetThisNode();
      case QUERY_ID:
        return isSetQueryId();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof endQuery_args)
        return this.equals((endQuery_args)that);
      return false;
    }

    public boolean equals(endQuery_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_thisNode = true && this.isSetThisNode();
      boolean that_present_thisNode = true && that.isSetThisNode();
      if (this_present_thisNode || that_present_thisNode) {
        if (!(this_present_thisNode && that_present_thisNode))
          return false;
        if (!this.thisNode.equals(that.thisNode))
          return false;
      }

      boolean this_present_queryId = true;
      boolean that_present_queryId = true;
      if (this_present_queryId || that_present_queryId) {
        if (!(this_present_queryId && that_present_queryId))
          return false;
        if (this.queryId != that.queryId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetThisNode()) ? 131071 : 524287);
      if (isSetThisNode())
        hashCode = hashCode * 8191 + thisNode.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(queryId);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetThisNode(), other.isSetThisNode());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetThisNode()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.thisNode, other.thisNode);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetQueryId(), other.isSetQueryId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetQueryId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("endQuery_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("thisNode:");
      if (this.thisNode == null) {
        sb.append("null");
      } else {
        sb.append(this.thisNode);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("queryId:");
      sb.append(this.queryId);
      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 (header != null) {
        header.validate();
      }
      if (thisNode != null) {
        thisNode.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, java.lang.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 endQuery_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public endQuery_argsStandardScheme getScheme() {
        return new endQuery_argsStandardScheme();
      }
    }

    private static class endQuery_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, endQuery_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // THIS_NODE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.thisNode = new Node();
                struct.thisNode.read(iprot);
                struct.setThisNodeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // QUERY_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.queryId = iprot.readI64();
                struct.setQueryIdIsSet(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, endQuery_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.thisNode != null) {
          oprot.writeFieldBegin(THIS_NODE_FIELD_DESC);
          struct.thisNode.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(QUERY_ID_FIELD_DESC);
        oprot.writeI64(struct.queryId);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class endQuery_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public endQuery_argsTupleScheme getScheme() {
        return new endQuery_argsTupleScheme();
      }
    }

    private static class endQuery_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, endQuery_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetThisNode()) {
          optionals.set(1);
        }
        if (struct.isSetQueryId()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetThisNode()) {
          struct.thisNode.write(oprot);
        }
        if (struct.isSetQueryId()) {
          oprot.writeI64(struct.queryId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, endQuery_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.thisNode = new Node();
          struct.thisNode.read(iprot);
          struct.setThisNodeIsSet(true);
        }
        if (incoming.get(2)) {
          struct.queryId = iprot.readI64();
          struct.setQueryIdIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class endQuery_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("endQuery_result");


    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new endQuery_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new endQuery_resultTupleSchemeFactory();


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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(endQuery_result.class, metaDataMap);
    }

    public endQuery_result() {
    }

    /**
     * Performs a deep copy on other.
     */
    public endQuery_result(endQuery_result other) {
    }

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

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof endQuery_result)
        return this.equals((endQuery_result)that);
      return false;
    }

    public boolean equals(endQuery_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      return hashCode;
    }

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

      int lastComparison = 0;

      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("endQuery_result(");
      boolean first = true;

      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, java.lang.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 endQuery_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public endQuery_resultStandardScheme getScheme() {
        return new endQuery_resultStandardScheme();
      }
    }

    private static class endQuery_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, endQuery_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) {
            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, endQuery_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class endQuery_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public endQuery_resultTupleScheme getScheme() {
        return new endQuery_resultTupleScheme();
      }
    }

    private static class endQuery_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, endQuery_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, endQuery_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllPaths_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("getAllPaths_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("paths", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField WITH_ALIAS_FIELD_DESC = new org.apache.thrift.protocol.TField("withAlias", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllPaths_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllPaths_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List paths; // required
    public boolean withAlias; // 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 {
      HEADER((short)1, "header"),
      PATHS((short)2, "paths"),
      WITH_ALIAS((short)3, "withAlias");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATHS
            return PATHS;
          case 3: // WITH_ALIAS
            return WITH_ALIAS;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __WITHALIAS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATHS, new org.apache.thrift.meta_data.FieldMetaData("paths", 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.WITH_ALIAS, new org.apache.thrift.meta_data.FieldMetaData("withAlias", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPaths_args.class, metaDataMap);
    }

    public getAllPaths_args() {
    }

    public getAllPaths_args(
      RaftNode header,
      java.util.List paths,
      boolean withAlias)
    {
      this();
      this.header = header;
      this.paths = paths;
      this.withAlias = withAlias;
      setWithAliasIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllPaths_args(getAllPaths_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPaths()) {
        java.util.List __this__paths = new java.util.ArrayList(other.paths);
        this.paths = __this__paths;
      }
      this.withAlias = other.withAlias;
    }

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

    @Override
    public void clear() {
      this.header = null;
      this.paths = null;
      setWithAliasIsSet(false);
      this.withAlias = false;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getAllPaths_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getPathsIterator() {
      return (this.paths == null) ? null : this.paths.iterator();
    }

    public void addToPaths(java.lang.String elem) {
      if (this.paths == null) {
        this.paths = new java.util.ArrayList();
      }
      this.paths.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getPaths() {
      return this.paths;
    }

    public getAllPaths_args setPaths(@org.apache.thrift.annotation.Nullable java.util.List paths) {
      this.paths = paths;
      return this;
    }

    public void unsetPaths() {
      this.paths = null;
    }

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

    public void setPathsIsSet(boolean value) {
      if (!value) {
        this.paths = null;
      }
    }

    public boolean isWithAlias() {
      return this.withAlias;
    }

    public getAllPaths_args setWithAlias(boolean withAlias) {
      this.withAlias = withAlias;
      setWithAliasIsSet(true);
      return this;
    }

    public void unsetWithAlias() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __WITHALIAS_ISSET_ID);
    }

    /** Returns true if field withAlias is set (has been assigned a value) and false otherwise */
    public boolean isSetWithAlias() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __WITHALIAS_ISSET_ID);
    }

    public void setWithAliasIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __WITHALIAS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATHS:
        if (value == null) {
          unsetPaths();
        } else {
          setPaths((java.util.List)value);
        }
        break;

      case WITH_ALIAS:
        if (value == null) {
          unsetWithAlias();
        } else {
          setWithAlias((java.lang.Boolean)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATHS:
        return getPaths();

      case WITH_ALIAS:
        return isWithAlias();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATHS:
        return isSetPaths();
      case WITH_ALIAS:
        return isSetWithAlias();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllPaths_args)
        return this.equals((getAllPaths_args)that);
      return false;
    }

    public boolean equals(getAllPaths_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_paths = true && this.isSetPaths();
      boolean that_present_paths = true && that.isSetPaths();
      if (this_present_paths || that_present_paths) {
        if (!(this_present_paths && that_present_paths))
          return false;
        if (!this.paths.equals(that.paths))
          return false;
      }

      boolean this_present_withAlias = true;
      boolean that_present_withAlias = true;
      if (this_present_withAlias || that_present_withAlias) {
        if (!(this_present_withAlias && that_present_withAlias))
          return false;
        if (this.withAlias != that.withAlias)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPaths()) ? 131071 : 524287);
      if (isSetPaths())
        hashCode = hashCode * 8191 + paths.hashCode();

      hashCode = hashCode * 8191 + ((withAlias) ? 131071 : 524287);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPaths(), other.isSetPaths());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPaths()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paths, other.paths);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetWithAlias(), other.isSetWithAlias());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetWithAlias()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.withAlias, other.withAlias);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllPaths_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("paths:");
      if (this.paths == null) {
        sb.append("null");
      } else {
        sb.append(this.paths);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("withAlias:");
      sb.append(this.withAlias);
      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 (header != null) {
        header.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, java.lang.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 getAllPaths_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllPaths_argsStandardScheme getScheme() {
        return new getAllPaths_argsStandardScheme();
      }
    }

    private static class getAllPaths_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllPaths_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATHS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list232 = iprot.readListBegin();
                  struct.paths = new java.util.ArrayList(_list232.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem233;
                  for (int _i234 = 0; _i234 < _list232.size; ++_i234)
                  {
                    _elem233 = iprot.readString();
                    struct.paths.add(_elem233);
                  }
                  iprot.readListEnd();
                }
                struct.setPathsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // WITH_ALIAS
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.withAlias = iprot.readBool();
                struct.setWithAliasIsSet(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, getAllPaths_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.paths != null) {
          oprot.writeFieldBegin(PATHS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.paths.size()));
            for (java.lang.String _iter235 : struct.paths)
            {
              oprot.writeString(_iter235);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(WITH_ALIAS_FIELD_DESC);
        oprot.writeBool(struct.withAlias);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAllPaths_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllPaths_argsTupleScheme getScheme() {
        return new getAllPaths_argsTupleScheme();
      }
    }

    private static class getAllPaths_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAllPaths_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPaths()) {
          optionals.set(1);
        }
        if (struct.isSetWithAlias()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPaths()) {
          {
            oprot.writeI32(struct.paths.size());
            for (java.lang.String _iter236 : struct.paths)
            {
              oprot.writeString(_iter236);
            }
          }
        }
        if (struct.isSetWithAlias()) {
          oprot.writeBool(struct.withAlias);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllPaths_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list237 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.paths = new java.util.ArrayList(_list237.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem238;
            for (int _i239 = 0; _i239 < _list237.size; ++_i239)
            {
              _elem238 = iprot.readString();
              struct.paths.add(_elem238);
            }
          }
          struct.setPathsIsSet(true);
        }
        if (incoming.get(2)) {
          struct.withAlias = iprot.readBool();
          struct.setWithAliasIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllPaths_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("getAllPaths_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllPaths_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllPaths_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable GetAllPathsResult success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, GetAllPathsResult.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPaths_result.class, metaDataMap);
    }

    public getAllPaths_result() {
    }

    public getAllPaths_result(
      GetAllPathsResult success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllPaths_result(getAllPaths_result other) {
      if (other.isSetSuccess()) {
        this.success = new GetAllPathsResult(other.success);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public GetAllPathsResult getSuccess() {
      return this.success;
    }

    public getAllPaths_result setSuccess(@org.apache.thrift.annotation.Nullable GetAllPathsResult 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((GetAllPathsResult)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllPaths_result)
        return this.equals((getAllPaths_result)that);
      return false;
    }

    public boolean equals(getAllPaths_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllPaths_result(");
      boolean first = true;

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

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

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

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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 getAllPaths_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllPaths_resultStandardScheme getScheme() {
        return new getAllPaths_resultStandardScheme();
      }
    }

    private static class getAllPaths_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllPaths_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 GetAllPathsResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getAllPaths_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getAllPaths_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllPaths_resultTupleScheme getScheme() {
        return new getAllPaths_resultTupleScheme();
      }
    }

    private static class getAllPaths_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllPaths_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new GetAllPathsResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllDevices_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("getAllDevices_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField IS_PREFIX_MATCH_FIELD_DESC = new org.apache.thrift.protocol.TField("isPrefixMatch", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllDevices_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllDevices_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List path; // required
    public boolean isPrefixMatch; // 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 {
      HEADER((short)1, "header"),
      PATH((short)2, "path"),
      IS_PREFIX_MATCH((short)3, "isPrefixMatch");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATH
            return PATH;
          case 3: // IS_PREFIX_MATCH
            return IS_PREFIX_MATCH;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ISPREFIXMATCH_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", 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.IS_PREFIX_MATCH, new org.apache.thrift.meta_data.FieldMetaData("isPrefixMatch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllDevices_args.class, metaDataMap);
    }

    public getAllDevices_args() {
    }

    public getAllDevices_args(
      RaftNode header,
      java.util.List path,
      boolean isPrefixMatch)
    {
      this();
      this.header = header;
      this.path = path;
      this.isPrefixMatch = isPrefixMatch;
      setIsPrefixMatchIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllDevices_args(getAllDevices_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPath()) {
        java.util.List __this__path = new java.util.ArrayList(other.path);
        this.path = __this__path;
      }
      this.isPrefixMatch = other.isPrefixMatch;
    }

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

    @Override
    public void clear() {
      this.header = null;
      this.path = null;
      setIsPrefixMatchIsSet(false);
      this.isPrefixMatch = false;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getAllDevices_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getPathIterator() {
      return (this.path == null) ? null : this.path.iterator();
    }

    public void addToPath(java.lang.String elem) {
      if (this.path == null) {
        this.path = new java.util.ArrayList();
      }
      this.path.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getPath() {
      return this.path;
    }

    public getAllDevices_args setPath(@org.apache.thrift.annotation.Nullable java.util.List path) {
      this.path = path;
      return this;
    }

    public void unsetPath() {
      this.path = null;
    }

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

    public void setPathIsSet(boolean value) {
      if (!value) {
        this.path = null;
      }
    }

    public boolean isIsPrefixMatch() {
      return this.isPrefixMatch;
    }

    public getAllDevices_args setIsPrefixMatch(boolean isPrefixMatch) {
      this.isPrefixMatch = isPrefixMatch;
      setIsPrefixMatchIsSet(true);
      return this;
    }

    public void unsetIsPrefixMatch() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ISPREFIXMATCH_ISSET_ID);
    }

    /** Returns true if field isPrefixMatch is set (has been assigned a value) and false otherwise */
    public boolean isSetIsPrefixMatch() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ISPREFIXMATCH_ISSET_ID);
    }

    public void setIsPrefixMatchIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ISPREFIXMATCH_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATH:
        if (value == null) {
          unsetPath();
        } else {
          setPath((java.util.List)value);
        }
        break;

      case IS_PREFIX_MATCH:
        if (value == null) {
          unsetIsPrefixMatch();
        } else {
          setIsPrefixMatch((java.lang.Boolean)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATH:
        return getPath();

      case IS_PREFIX_MATCH:
        return isIsPrefixMatch();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATH:
        return isSetPath();
      case IS_PREFIX_MATCH:
        return isSetIsPrefixMatch();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllDevices_args)
        return this.equals((getAllDevices_args)that);
      return false;
    }

    public boolean equals(getAllDevices_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_path = true && this.isSetPath();
      boolean that_present_path = true && that.isSetPath();
      if (this_present_path || that_present_path) {
        if (!(this_present_path && that_present_path))
          return false;
        if (!this.path.equals(that.path))
          return false;
      }

      boolean this_present_isPrefixMatch = true;
      boolean that_present_isPrefixMatch = true;
      if (this_present_isPrefixMatch || that_present_isPrefixMatch) {
        if (!(this_present_isPrefixMatch && that_present_isPrefixMatch))
          return false;
        if (this.isPrefixMatch != that.isPrefixMatch)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPath()) ? 131071 : 524287);
      if (isSetPath())
        hashCode = hashCode * 8191 + path.hashCode();

      hashCode = hashCode * 8191 + ((isPrefixMatch) ? 131071 : 524287);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPath(), other.isSetPath());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPath()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetIsPrefixMatch(), other.isSetIsPrefixMatch());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsPrefixMatch()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isPrefixMatch, other.isPrefixMatch);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllDevices_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("path:");
      if (this.path == null) {
        sb.append("null");
      } else {
        sb.append(this.path);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("isPrefixMatch:");
      sb.append(this.isPrefixMatch);
      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 (header != null) {
        header.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, java.lang.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 getAllDevices_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllDevices_argsStandardScheme getScheme() {
        return new getAllDevices_argsStandardScheme();
      }
    }

    private static class getAllDevices_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllDevices_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATH
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list240 = iprot.readListBegin();
                  struct.path = new java.util.ArrayList(_list240.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem241;
                  for (int _i242 = 0; _i242 < _list240.size; ++_i242)
                  {
                    _elem241 = iprot.readString();
                    struct.path.add(_elem241);
                  }
                  iprot.readListEnd();
                }
                struct.setPathIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // IS_PREFIX_MATCH
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.isPrefixMatch = iprot.readBool();
                struct.setIsPrefixMatchIsSet(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, getAllDevices_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.path != null) {
          oprot.writeFieldBegin(PATH_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.path.size()));
            for (java.lang.String _iter243 : struct.path)
            {
              oprot.writeString(_iter243);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(IS_PREFIX_MATCH_FIELD_DESC);
        oprot.writeBool(struct.isPrefixMatch);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAllDevices_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllDevices_argsTupleScheme getScheme() {
        return new getAllDevices_argsTupleScheme();
      }
    }

    private static class getAllDevices_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAllDevices_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPath()) {
          optionals.set(1);
        }
        if (struct.isSetIsPrefixMatch()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPath()) {
          {
            oprot.writeI32(struct.path.size());
            for (java.lang.String _iter244 : struct.path)
            {
              oprot.writeString(_iter244);
            }
          }
        }
        if (struct.isSetIsPrefixMatch()) {
          oprot.writeBool(struct.isPrefixMatch);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllDevices_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list245 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.path = new java.util.ArrayList(_list245.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem246;
            for (int _i247 = 0; _i247 < _list245.size; ++_i247)
            {
              _elem246 = iprot.readString();
              struct.path.add(_elem246);
            }
          }
          struct.setPathIsSet(true);
        }
        if (incoming.get(2)) {
          struct.isPrefixMatch = iprot.readBool();
          struct.setIsPrefixMatchIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllDevices_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("getAllDevices_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllDevices_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllDevices_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.Set success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllDevices_result.class, metaDataMap);
    }

    public getAllDevices_result() {
    }

    public getAllDevices_result(
      java.util.Set success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllDevices_result(getAllDevices_result other) {
      if (other.isSetSuccess()) {
        java.util.Set __this__success = new java.util.HashSet(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.lang.String elem) {
      if (this.success == null) {
        this.success = new java.util.HashSet();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Set getSuccess() {
      return this.success;
    }

    public getAllDevices_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Set 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.Set)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllDevices_result)
        return this.equals((getAllDevices_result)that);
      return false;
    }

    public boolean equals(getAllDevices_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllDevices_result(");
      boolean first = true;

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

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

    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, java.lang.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 getAllDevices_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllDevices_resultStandardScheme getScheme() {
        return new getAllDevices_resultStandardScheme();
      }
    }

    private static class getAllDevices_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllDevices_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.SET) {
                {
                  org.apache.thrift.protocol.TSet _set248 = iprot.readSetBegin();
                  struct.success = new java.util.HashSet(2*_set248.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem249;
                  for (int _i250 = 0; _i250 < _set248.size; ++_i250)
                  {
                    _elem249 = iprot.readString();
                    struct.success.add(_elem249);
                  }
                  iprot.readSetEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getAllDevices_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (java.lang.String _iter251 : struct.success)
            {
              oprot.writeString(_iter251);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAllDevices_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllDevices_resultTupleScheme getScheme() {
        return new getAllDevices_resultTupleScheme();
      }
    }

    private static class getAllDevices_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAllDevices_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.lang.String _iter252 : struct.success)
            {
              oprot.writeString(_iter252);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllDevices_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TSet _set253 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.HashSet(2*_set253.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem254;
            for (int _i255 = 0; _i255 < _set253.size; ++_i255)
            {
              _elem254 = iprot.readString();
              struct.success.add(_elem254);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getDevices_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("getDevices_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PLAN_BINARY_FIELD_DESC = new org.apache.thrift.protocol.TField("planBinary", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getDevices_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getDevices_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer planBinary; // 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 {
      HEADER((short)1, "header"),
      PLAN_BINARY((short)2, "planBinary");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PLAN_BINARY
            return PLAN_BINARY;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PLAN_BINARY, new org.apache.thrift.meta_data.FieldMetaData("planBinary", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDevices_args.class, metaDataMap);
    }

    public getDevices_args() {
    }

    public getDevices_args(
      RaftNode header,
      java.nio.ByteBuffer planBinary)
    {
      this();
      this.header = header;
      this.planBinary = org.apache.thrift.TBaseHelper.copyBinary(planBinary);
    }

    /**
     * Performs a deep copy on other.
     */
    public getDevices_args(getDevices_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPlanBinary()) {
        this.planBinary = org.apache.thrift.TBaseHelper.copyBinary(other.planBinary);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getDevices_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public byte[] getPlanBinary() {
      setPlanBinary(org.apache.thrift.TBaseHelper.rightSize(planBinary));
      return planBinary == null ? null : planBinary.array();
    }

    public java.nio.ByteBuffer bufferForPlanBinary() {
      return org.apache.thrift.TBaseHelper.copyBinary(planBinary);
    }

    public getDevices_args setPlanBinary(byte[] planBinary) {
      this.planBinary = planBinary == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(planBinary.clone());
      return this;
    }

    public getDevices_args setPlanBinary(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer planBinary) {
      this.planBinary = org.apache.thrift.TBaseHelper.copyBinary(planBinary);
      return this;
    }

    public void unsetPlanBinary() {
      this.planBinary = null;
    }

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

    public void setPlanBinaryIsSet(boolean value) {
      if (!value) {
        this.planBinary = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PLAN_BINARY:
        if (value == null) {
          unsetPlanBinary();
        } else {
          if (value instanceof byte[]) {
            setPlanBinary((byte[])value);
          } else {
            setPlanBinary((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PLAN_BINARY:
        return getPlanBinary();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PLAN_BINARY:
        return isSetPlanBinary();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getDevices_args)
        return this.equals((getDevices_args)that);
      return false;
    }

    public boolean equals(getDevices_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_planBinary = true && this.isSetPlanBinary();
      boolean that_present_planBinary = true && that.isSetPlanBinary();
      if (this_present_planBinary || that_present_planBinary) {
        if (!(this_present_planBinary && that_present_planBinary))
          return false;
        if (!this.planBinary.equals(that.planBinary))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPlanBinary()) ? 131071 : 524287);
      if (isSetPlanBinary())
        hashCode = hashCode * 8191 + planBinary.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPlanBinary(), other.isSetPlanBinary());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPlanBinary()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.planBinary, other.planBinary);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getDevices_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("planBinary:");
      if (this.planBinary == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.planBinary, 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 (header != null) {
        header.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, java.lang.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 getDevices_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDevices_argsStandardScheme getScheme() {
        return new getDevices_argsStandardScheme();
      }
    }

    private static class getDevices_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getDevices_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PLAN_BINARY
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.planBinary = iprot.readBinary();
                struct.setPlanBinaryIsSet(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, getDevices_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.planBinary != null) {
          oprot.writeFieldBegin(PLAN_BINARY_FIELD_DESC);
          oprot.writeBinary(struct.planBinary);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getDevices_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDevices_argsTupleScheme getScheme() {
        return new getDevices_argsTupleScheme();
      }
    }

    private static class getDevices_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getDevices_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPlanBinary()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPlanBinary()) {
          oprot.writeBinary(struct.planBinary);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getDevices_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.planBinary = iprot.readBinary();
          struct.setPlanBinaryIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getDevices_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("getDevices_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getDevices_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getDevices_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDevices_result.class, metaDataMap);
    }

    public getDevices_result() {
    }

    public getDevices_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public getDevices_result(getDevices_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public getDevices_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public getDevices_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getDevices_result)
        return this.equals((getDevices_result)that);
      return false;
    }

    public boolean equals(getDevices_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getDevices_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 getDevices_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDevices_resultStandardScheme getScheme() {
        return new getDevices_resultStandardScheme();
      }
    }

    private static class getDevices_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getDevices_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getDevices_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getDevices_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDevices_resultTupleScheme getScheme() {
        return new getDevices_resultTupleScheme();
      }
    }

    private static class getDevices_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getDevices_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getNodeList_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("getNodeList_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField NODE_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeLevel", org.apache.thrift.protocol.TType.I32, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getNodeList_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getNodeList_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String path; // required
    public int nodeLevel; // 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 {
      HEADER((short)1, "header"),
      PATH((short)2, "path"),
      NODE_LEVEL((short)3, "nodeLevel");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATH
            return PATH;
          case 3: // NODE_LEVEL
            return NODE_LEVEL;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __NODELEVEL_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.NODE_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("nodeLevel", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32          , "int")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNodeList_args.class, metaDataMap);
    }

    public getNodeList_args() {
    }

    public getNodeList_args(
      RaftNode header,
      java.lang.String path,
      int nodeLevel)
    {
      this();
      this.header = header;
      this.path = path;
      this.nodeLevel = nodeLevel;
      setNodeLevelIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getNodeList_args(getNodeList_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPath()) {
        this.path = other.path;
      }
      this.nodeLevel = other.nodeLevel;
    }

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

    @Override
    public void clear() {
      this.header = null;
      this.path = null;
      setNodeLevelIsSet(false);
      this.nodeLevel = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getNodeList_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getPath() {
      return this.path;
    }

    public getNodeList_args setPath(@org.apache.thrift.annotation.Nullable java.lang.String path) {
      this.path = path;
      return this;
    }

    public void unsetPath() {
      this.path = null;
    }

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

    public void setPathIsSet(boolean value) {
      if (!value) {
        this.path = null;
      }
    }

    public int getNodeLevel() {
      return this.nodeLevel;
    }

    public getNodeList_args setNodeLevel(int nodeLevel) {
      this.nodeLevel = nodeLevel;
      setNodeLevelIsSet(true);
      return this;
    }

    public void unsetNodeLevel() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NODELEVEL_ISSET_ID);
    }

    /** Returns true if field nodeLevel is set (has been assigned a value) and false otherwise */
    public boolean isSetNodeLevel() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NODELEVEL_ISSET_ID);
    }

    public void setNodeLevelIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NODELEVEL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATH:
        if (value == null) {
          unsetPath();
        } else {
          setPath((java.lang.String)value);
        }
        break;

      case NODE_LEVEL:
        if (value == null) {
          unsetNodeLevel();
        } else {
          setNodeLevel((java.lang.Integer)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATH:
        return getPath();

      case NODE_LEVEL:
        return getNodeLevel();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATH:
        return isSetPath();
      case NODE_LEVEL:
        return isSetNodeLevel();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getNodeList_args)
        return this.equals((getNodeList_args)that);
      return false;
    }

    public boolean equals(getNodeList_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_path = true && this.isSetPath();
      boolean that_present_path = true && that.isSetPath();
      if (this_present_path || that_present_path) {
        if (!(this_present_path && that_present_path))
          return false;
        if (!this.path.equals(that.path))
          return false;
      }

      boolean this_present_nodeLevel = true;
      boolean that_present_nodeLevel = true;
      if (this_present_nodeLevel || that_present_nodeLevel) {
        if (!(this_present_nodeLevel && that_present_nodeLevel))
          return false;
        if (this.nodeLevel != that.nodeLevel)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPath()) ? 131071 : 524287);
      if (isSetPath())
        hashCode = hashCode * 8191 + path.hashCode();

      hashCode = hashCode * 8191 + nodeLevel;

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPath(), other.isSetPath());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPath()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetNodeLevel(), other.isSetNodeLevel());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetNodeLevel()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeLevel, other.nodeLevel);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getNodeList_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("path:");
      if (this.path == null) {
        sb.append("null");
      } else {
        sb.append(this.path);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("nodeLevel:");
      sb.append(this.nodeLevel);
      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 (header != null) {
        header.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, java.lang.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 getNodeList_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getNodeList_argsStandardScheme getScheme() {
        return new getNodeList_argsStandardScheme();
      }
    }

    private static class getNodeList_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getNodeList_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATH
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.path = iprot.readString();
                struct.setPathIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // NODE_LEVEL
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.nodeLevel = iprot.readI32();
                struct.setNodeLevelIsSet(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, getNodeList_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.path != null) {
          oprot.writeFieldBegin(PATH_FIELD_DESC);
          oprot.writeString(struct.path);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(NODE_LEVEL_FIELD_DESC);
        oprot.writeI32(struct.nodeLevel);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getNodeList_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getNodeList_argsTupleScheme getScheme() {
        return new getNodeList_argsTupleScheme();
      }
    }

    private static class getNodeList_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getNodeList_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPath()) {
          optionals.set(1);
        }
        if (struct.isSetNodeLevel()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPath()) {
          oprot.writeString(struct.path);
        }
        if (struct.isSetNodeLevel()) {
          oprot.writeI32(struct.nodeLevel);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getNodeList_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.path = iprot.readString();
          struct.setPathIsSet(true);
        }
        if (incoming.get(2)) {
          struct.nodeLevel = iprot.readI32();
          struct.setNodeLevelIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getNodeList_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("getNodeList_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getNodeList_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getNodeList_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.List success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNodeList_result.class, metaDataMap);
    }

    public getNodeList_result() {
    }

    public getNodeList_result(
      java.util.List success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getNodeList_result(getNodeList_result other) {
      if (other.isSetSuccess()) {
        java.util.List __this__success = new java.util.ArrayList(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.lang.String elem) {
      if (this.success == null) {
        this.success = new java.util.ArrayList();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getSuccess() {
      return this.success;
    }

    public getNodeList_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getNodeList_result)
        return this.equals((getNodeList_result)that);
      return false;
    }

    public boolean equals(getNodeList_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getNodeList_result(");
      boolean first = true;

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

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

    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, java.lang.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 getNodeList_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getNodeList_resultStandardScheme getScheme() {
        return new getNodeList_resultStandardScheme();
      }
    }

    private static class getNodeList_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getNodeList_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 _list256 = iprot.readListBegin();
                  struct.success = new java.util.ArrayList(_list256.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem257;
                  for (int _i258 = 0; _i258 < _list256.size; ++_i258)
                  {
                    _elem257 = iprot.readString();
                    struct.success.add(_elem257);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getNodeList_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.STRING, struct.success.size()));
            for (java.lang.String _iter259 : struct.success)
            {
              oprot.writeString(_iter259);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getNodeList_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getNodeList_resultTupleScheme getScheme() {
        return new getNodeList_resultTupleScheme();
      }
    }

    private static class getNodeList_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getNodeList_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.lang.String _iter260 : struct.success)
            {
              oprot.writeString(_iter260);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getNodeList_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list261 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.ArrayList(_list261.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem262;
            for (int _i263 = 0; _i263 < _list261.size; ++_i263)
            {
              _elem262 = iprot.readString();
              struct.success.add(_elem262);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getChildNodeInNextLevel_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("getChildNodeInNextLevel_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getChildNodeInNextLevel_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getChildNodeInNextLevel_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String path; // 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 {
      HEADER((short)1, "header"),
      PATH((short)2, "path");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATH
            return PATH;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getChildNodeInNextLevel_args.class, metaDataMap);
    }

    public getChildNodeInNextLevel_args() {
    }

    public getChildNodeInNextLevel_args(
      RaftNode header,
      java.lang.String path)
    {
      this();
      this.header = header;
      this.path = path;
    }

    /**
     * Performs a deep copy on other.
     */
    public getChildNodeInNextLevel_args(getChildNodeInNextLevel_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPath()) {
        this.path = other.path;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getChildNodeInNextLevel_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getPath() {
      return this.path;
    }

    public getChildNodeInNextLevel_args setPath(@org.apache.thrift.annotation.Nullable java.lang.String path) {
      this.path = path;
      return this;
    }

    public void unsetPath() {
      this.path = null;
    }

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

    public void setPathIsSet(boolean value) {
      if (!value) {
        this.path = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATH:
        if (value == null) {
          unsetPath();
        } else {
          setPath((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATH:
        return getPath();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATH:
        return isSetPath();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getChildNodeInNextLevel_args)
        return this.equals((getChildNodeInNextLevel_args)that);
      return false;
    }

    public boolean equals(getChildNodeInNextLevel_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_path = true && this.isSetPath();
      boolean that_present_path = true && that.isSetPath();
      if (this_present_path || that_present_path) {
        if (!(this_present_path && that_present_path))
          return false;
        if (!this.path.equals(that.path))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPath()) ? 131071 : 524287);
      if (isSetPath())
        hashCode = hashCode * 8191 + path.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPath(), other.isSetPath());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPath()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getChildNodeInNextLevel_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("path:");
      if (this.path == null) {
        sb.append("null");
      } else {
        sb.append(this.path);
      }
      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 (header != null) {
        header.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, java.lang.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 getChildNodeInNextLevel_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodeInNextLevel_argsStandardScheme getScheme() {
        return new getChildNodeInNextLevel_argsStandardScheme();
      }
    }

    private static class getChildNodeInNextLevel_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChildNodeInNextLevel_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATH
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.path = iprot.readString();
                struct.setPathIsSet(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, getChildNodeInNextLevel_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.path != null) {
          oprot.writeFieldBegin(PATH_FIELD_DESC);
          oprot.writeString(struct.path);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChildNodeInNextLevel_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodeInNextLevel_argsTupleScheme getScheme() {
        return new getChildNodeInNextLevel_argsTupleScheme();
      }
    }

    private static class getChildNodeInNextLevel_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChildNodeInNextLevel_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPath()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPath()) {
          oprot.writeString(struct.path);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChildNodeInNextLevel_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.path = iprot.readString();
          struct.setPathIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getChildNodeInNextLevel_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("getChildNodeInNextLevel_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getChildNodeInNextLevel_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getChildNodeInNextLevel_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.Set success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getChildNodeInNextLevel_result.class, metaDataMap);
    }

    public getChildNodeInNextLevel_result() {
    }

    public getChildNodeInNextLevel_result(
      java.util.Set success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getChildNodeInNextLevel_result(getChildNodeInNextLevel_result other) {
      if (other.isSetSuccess()) {
        java.util.Set __this__success = new java.util.HashSet(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.lang.String elem) {
      if (this.success == null) {
        this.success = new java.util.HashSet();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Set getSuccess() {
      return this.success;
    }

    public getChildNodeInNextLevel_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Set 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.Set)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getChildNodeInNextLevel_result)
        return this.equals((getChildNodeInNextLevel_result)that);
      return false;
    }

    public boolean equals(getChildNodeInNextLevel_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getChildNodeInNextLevel_result(");
      boolean first = true;

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

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

    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, java.lang.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 getChildNodeInNextLevel_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodeInNextLevel_resultStandardScheme getScheme() {
        return new getChildNodeInNextLevel_resultStandardScheme();
      }
    }

    private static class getChildNodeInNextLevel_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChildNodeInNextLevel_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.SET) {
                {
                  org.apache.thrift.protocol.TSet _set264 = iprot.readSetBegin();
                  struct.success = new java.util.HashSet(2*_set264.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem265;
                  for (int _i266 = 0; _i266 < _set264.size; ++_i266)
                  {
                    _elem265 = iprot.readString();
                    struct.success.add(_elem265);
                  }
                  iprot.readSetEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getChildNodeInNextLevel_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (java.lang.String _iter267 : struct.success)
            {
              oprot.writeString(_iter267);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChildNodeInNextLevel_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodeInNextLevel_resultTupleScheme getScheme() {
        return new getChildNodeInNextLevel_resultTupleScheme();
      }
    }

    private static class getChildNodeInNextLevel_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChildNodeInNextLevel_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.lang.String _iter268 : struct.success)
            {
              oprot.writeString(_iter268);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChildNodeInNextLevel_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TSet _set269 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.HashSet(2*_set269.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem270;
            for (int _i271 = 0; _i271 < _set269.size; ++_i271)
            {
              _elem270 = iprot.readString();
              struct.success.add(_elem270);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getChildNodePathInNextLevel_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("getChildNodePathInNextLevel_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getChildNodePathInNextLevel_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getChildNodePathInNextLevel_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String path; // 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 {
      HEADER((short)1, "header"),
      PATH((short)2, "path");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATH
            return PATH;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getChildNodePathInNextLevel_args.class, metaDataMap);
    }

    public getChildNodePathInNextLevel_args() {
    }

    public getChildNodePathInNextLevel_args(
      RaftNode header,
      java.lang.String path)
    {
      this();
      this.header = header;
      this.path = path;
    }

    /**
     * Performs a deep copy on other.
     */
    public getChildNodePathInNextLevel_args(getChildNodePathInNextLevel_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPath()) {
        this.path = other.path;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getChildNodePathInNextLevel_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getPath() {
      return this.path;
    }

    public getChildNodePathInNextLevel_args setPath(@org.apache.thrift.annotation.Nullable java.lang.String path) {
      this.path = path;
      return this;
    }

    public void unsetPath() {
      this.path = null;
    }

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

    public void setPathIsSet(boolean value) {
      if (!value) {
        this.path = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATH:
        if (value == null) {
          unsetPath();
        } else {
          setPath((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATH:
        return getPath();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATH:
        return isSetPath();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getChildNodePathInNextLevel_args)
        return this.equals((getChildNodePathInNextLevel_args)that);
      return false;
    }

    public boolean equals(getChildNodePathInNextLevel_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_path = true && this.isSetPath();
      boolean that_present_path = true && that.isSetPath();
      if (this_present_path || that_present_path) {
        if (!(this_present_path && that_present_path))
          return false;
        if (!this.path.equals(that.path))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPath()) ? 131071 : 524287);
      if (isSetPath())
        hashCode = hashCode * 8191 + path.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPath(), other.isSetPath());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPath()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getChildNodePathInNextLevel_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("path:");
      if (this.path == null) {
        sb.append("null");
      } else {
        sb.append(this.path);
      }
      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 (header != null) {
        header.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, java.lang.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 getChildNodePathInNextLevel_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodePathInNextLevel_argsStandardScheme getScheme() {
        return new getChildNodePathInNextLevel_argsStandardScheme();
      }
    }

    private static class getChildNodePathInNextLevel_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChildNodePathInNextLevel_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATH
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.path = iprot.readString();
                struct.setPathIsSet(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, getChildNodePathInNextLevel_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.path != null) {
          oprot.writeFieldBegin(PATH_FIELD_DESC);
          oprot.writeString(struct.path);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChildNodePathInNextLevel_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodePathInNextLevel_argsTupleScheme getScheme() {
        return new getChildNodePathInNextLevel_argsTupleScheme();
      }
    }

    private static class getChildNodePathInNextLevel_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChildNodePathInNextLevel_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPath()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPath()) {
          oprot.writeString(struct.path);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChildNodePathInNextLevel_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.path = iprot.readString();
          struct.setPathIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getChildNodePathInNextLevel_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("getChildNodePathInNextLevel_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getChildNodePathInNextLevel_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getChildNodePathInNextLevel_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.Set success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SetMetaData(org.apache.thrift.protocol.TType.SET, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getChildNodePathInNextLevel_result.class, metaDataMap);
    }

    public getChildNodePathInNextLevel_result() {
    }

    public getChildNodePathInNextLevel_result(
      java.util.Set success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getChildNodePathInNextLevel_result(getChildNodePathInNextLevel_result other) {
      if (other.isSetSuccess()) {
        java.util.Set __this__success = new java.util.HashSet(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.lang.String elem) {
      if (this.success == null) {
        this.success = new java.util.HashSet();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.Set getSuccess() {
      return this.success;
    }

    public getChildNodePathInNextLevel_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Set 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.Set)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getChildNodePathInNextLevel_result)
        return this.equals((getChildNodePathInNextLevel_result)that);
      return false;
    }

    public boolean equals(getChildNodePathInNextLevel_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getChildNodePathInNextLevel_result(");
      boolean first = true;

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

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

    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, java.lang.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 getChildNodePathInNextLevel_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodePathInNextLevel_resultStandardScheme getScheme() {
        return new getChildNodePathInNextLevel_resultStandardScheme();
      }
    }

    private static class getChildNodePathInNextLevel_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getChildNodePathInNextLevel_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.SET) {
                {
                  org.apache.thrift.protocol.TSet _set272 = iprot.readSetBegin();
                  struct.success = new java.util.HashSet(2*_set272.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem273;
                  for (int _i274 = 0; _i274 < _set272.size; ++_i274)
                  {
                    _elem273 = iprot.readString();
                    struct.success.add(_elem273);
                  }
                  iprot.readSetEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getChildNodePathInNextLevel_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
            for (java.lang.String _iter275 : struct.success)
            {
              oprot.writeString(_iter275);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getChildNodePathInNextLevel_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getChildNodePathInNextLevel_resultTupleScheme getScheme() {
        return new getChildNodePathInNextLevel_resultTupleScheme();
      }
    }

    private static class getChildNodePathInNextLevel_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getChildNodePathInNextLevel_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.lang.String _iter276 : struct.success)
            {
              oprot.writeString(_iter276);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getChildNodePathInNextLevel_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TSet _set277 = iprot.readSetBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.HashSet(2*_set277.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem278;
            for (int _i279 = 0; _i279 < _set277.size; ++_i279)
            {
              _elem278 = iprot.readString();
              struct.success.add(_elem278);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllMeasurementSchema_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("getAllMeasurementSchema_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllMeasurementSchema_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllMeasurementSchema_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable MeasurementSchemaRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public getAllMeasurementSchema_args() {
    }

    public getAllMeasurementSchema_args(
      MeasurementSchemaRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllMeasurementSchema_args(getAllMeasurementSchema_args other) {
      if (other.isSetRequest()) {
        this.request = new MeasurementSchemaRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public MeasurementSchemaRequest getRequest() {
      return this.request;
    }

    public getAllMeasurementSchema_args setRequest(@org.apache.thrift.annotation.Nullable MeasurementSchemaRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((MeasurementSchemaRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllMeasurementSchema_args)
        return this.equals((getAllMeasurementSchema_args)that);
      return false;
    }

    public boolean equals(getAllMeasurementSchema_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllMeasurementSchema_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 getAllMeasurementSchema_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllMeasurementSchema_argsStandardScheme getScheme() {
        return new getAllMeasurementSchema_argsStandardScheme();
      }
    }

    private static class getAllMeasurementSchema_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllMeasurementSchema_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new MeasurementSchemaRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, getAllMeasurementSchema_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getAllMeasurementSchema_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllMeasurementSchema_argsTupleScheme getScheme() {
        return new getAllMeasurementSchema_argsTupleScheme();
      }
    }

    private static class getAllMeasurementSchema_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllMeasurementSchema_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new MeasurementSchemaRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAllMeasurementSchema_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("getAllMeasurementSchema_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAllMeasurementSchema_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAllMeasurementSchema_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllMeasurementSchema_result.class, metaDataMap);
    }

    public getAllMeasurementSchema_result() {
    }

    public getAllMeasurementSchema_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public getAllMeasurementSchema_result(getAllMeasurementSchema_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public getAllMeasurementSchema_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public getAllMeasurementSchema_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAllMeasurementSchema_result)
        return this.equals((getAllMeasurementSchema_result)that);
      return false;
    }

    public boolean equals(getAllMeasurementSchema_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAllMeasurementSchema_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 getAllMeasurementSchema_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllMeasurementSchema_resultStandardScheme getScheme() {
        return new getAllMeasurementSchema_resultStandardScheme();
      }
    }

    private static class getAllMeasurementSchema_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllMeasurementSchema_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getAllMeasurementSchema_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getAllMeasurementSchema_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAllMeasurementSchema_resultTupleScheme getScheme() {
        return new getAllMeasurementSchema_resultTupleScheme();
      }
    }

    private static class getAllMeasurementSchema_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAllMeasurementSchema_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAggrResult_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("getAggrResult_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAggrResult_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAggrResult_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable GetAggrResultRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public getAggrResult_args() {
    }

    public getAggrResult_args(
      GetAggrResultRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAggrResult_args(getAggrResult_args other) {
      if (other.isSetRequest()) {
        this.request = new GetAggrResultRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public GetAggrResultRequest getRequest() {
      return this.request;
    }

    public getAggrResult_args setRequest(@org.apache.thrift.annotation.Nullable GetAggrResultRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((GetAggrResultRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAggrResult_args)
        return this.equals((getAggrResult_args)that);
      return false;
    }

    public boolean equals(getAggrResult_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAggrResult_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 getAggrResult_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAggrResult_argsStandardScheme getScheme() {
        return new getAggrResult_argsStandardScheme();
      }
    }

    private static class getAggrResult_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAggrResult_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new GetAggrResultRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, getAggrResult_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getAggrResult_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAggrResult_argsTupleScheme getScheme() {
        return new getAggrResult_argsTupleScheme();
      }
    }

    private static class getAggrResult_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAggrResult_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new GetAggrResultRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getAggrResult_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("getAggrResult_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getAggrResult_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getAggrResult_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.List success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAggrResult_result.class, metaDataMap);
    }

    public getAggrResult_result() {
    }

    public getAggrResult_result(
      java.util.List success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getAggrResult_result(getAggrResult_result other) {
      if (other.isSetSuccess()) {
        java.util.List __this__success = new java.util.ArrayList(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.nio.ByteBuffer elem) {
      if (this.success == null) {
        this.success = new java.util.ArrayList();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getSuccess() {
      return this.success;
    }

    public getAggrResult_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getAggrResult_result)
        return this.equals((getAggrResult_result)that);
      return false;
    }

    public boolean equals(getAggrResult_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getAggrResult_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 getAggrResult_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAggrResult_resultStandardScheme getScheme() {
        return new getAggrResult_resultStandardScheme();
      }
    }

    private static class getAggrResult_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getAggrResult_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 _list280 = iprot.readListBegin();
                  struct.success = new java.util.ArrayList(_list280.size);
                  @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem281;
                  for (int _i282 = 0; _i282 < _list280.size; ++_i282)
                  {
                    _elem281 = iprot.readBinary();
                    struct.success.add(_elem281);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getAggrResult_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.STRING, struct.success.size()));
            for (java.nio.ByteBuffer _iter283 : struct.success)
            {
              oprot.writeBinary(_iter283);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getAggrResult_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getAggrResult_resultTupleScheme getScheme() {
        return new getAggrResult_resultTupleScheme();
      }
    }

    private static class getAggrResult_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getAggrResult_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.nio.ByteBuffer _iter284 : struct.success)
            {
              oprot.writeBinary(_iter284);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getAggrResult_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list285 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.ArrayList(_list285.size);
            @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem286;
            for (int _i287 = 0; _i287 < _list285.size; ++_i287)
            {
              _elem286 = iprot.readBinary();
              struct.success.add(_elem286);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getUnregisteredTimeseries_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("getUnregisteredTimeseries_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField TIMESERIES_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("timeseriesList", org.apache.thrift.protocol.TType.LIST, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getUnregisteredTimeseries_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getUnregisteredTimeseries_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List timeseriesList; // 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 {
      HEADER((short)1, "header"),
      TIMESERIES_LIST((short)2, "timeseriesList");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // TIMESERIES_LIST
            return TIMESERIES_LIST;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.TIMESERIES_LIST, new org.apache.thrift.meta_data.FieldMetaData("timeseriesList", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUnregisteredTimeseries_args.class, metaDataMap);
    }

    public getUnregisteredTimeseries_args() {
    }

    public getUnregisteredTimeseries_args(
      RaftNode header,
      java.util.List timeseriesList)
    {
      this();
      this.header = header;
      this.timeseriesList = timeseriesList;
    }

    /**
     * Performs a deep copy on other.
     */
    public getUnregisteredTimeseries_args(getUnregisteredTimeseries_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetTimeseriesList()) {
        java.util.List __this__timeseriesList = new java.util.ArrayList(other.timeseriesList);
        this.timeseriesList = __this__timeseriesList;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getUnregisteredTimeseries_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getTimeseriesListIterator() {
      return (this.timeseriesList == null) ? null : this.timeseriesList.iterator();
    }

    public void addToTimeseriesList(java.lang.String elem) {
      if (this.timeseriesList == null) {
        this.timeseriesList = new java.util.ArrayList();
      }
      this.timeseriesList.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getTimeseriesList() {
      return this.timeseriesList;
    }

    public getUnregisteredTimeseries_args setTimeseriesList(@org.apache.thrift.annotation.Nullable java.util.List timeseriesList) {
      this.timeseriesList = timeseriesList;
      return this;
    }

    public void unsetTimeseriesList() {
      this.timeseriesList = null;
    }

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

    public void setTimeseriesListIsSet(boolean value) {
      if (!value) {
        this.timeseriesList = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case TIMESERIES_LIST:
        if (value == null) {
          unsetTimeseriesList();
        } else {
          setTimeseriesList((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case TIMESERIES_LIST:
        return getTimeseriesList();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case TIMESERIES_LIST:
        return isSetTimeseriesList();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getUnregisteredTimeseries_args)
        return this.equals((getUnregisteredTimeseries_args)that);
      return false;
    }

    public boolean equals(getUnregisteredTimeseries_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_timeseriesList = true && this.isSetTimeseriesList();
      boolean that_present_timeseriesList = true && that.isSetTimeseriesList();
      if (this_present_timeseriesList || that_present_timeseriesList) {
        if (!(this_present_timeseriesList && that_present_timeseriesList))
          return false;
        if (!this.timeseriesList.equals(that.timeseriesList))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetTimeseriesList()) ? 131071 : 524287);
      if (isSetTimeseriesList())
        hashCode = hashCode * 8191 + timeseriesList.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetTimeseriesList(), other.isSetTimeseriesList());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTimeseriesList()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeseriesList, other.timeseriesList);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getUnregisteredTimeseries_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("timeseriesList:");
      if (this.timeseriesList == null) {
        sb.append("null");
      } else {
        sb.append(this.timeseriesList);
      }
      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 (header != null) {
        header.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, java.lang.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 getUnregisteredTimeseries_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getUnregisteredTimeseries_argsStandardScheme getScheme() {
        return new getUnregisteredTimeseries_argsStandardScheme();
      }
    }

    private static class getUnregisteredTimeseries_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUnregisteredTimeseries_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // TIMESERIES_LIST
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list288 = iprot.readListBegin();
                  struct.timeseriesList = new java.util.ArrayList(_list288.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem289;
                  for (int _i290 = 0; _i290 < _list288.size; ++_i290)
                  {
                    _elem289 = iprot.readString();
                    struct.timeseriesList.add(_elem289);
                  }
                  iprot.readListEnd();
                }
                struct.setTimeseriesListIsSet(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, getUnregisteredTimeseries_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.timeseriesList != null) {
          oprot.writeFieldBegin(TIMESERIES_LIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.timeseriesList.size()));
            for (java.lang.String _iter291 : struct.timeseriesList)
            {
              oprot.writeString(_iter291);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUnregisteredTimeseries_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getUnregisteredTimeseries_argsTupleScheme getScheme() {
        return new getUnregisteredTimeseries_argsTupleScheme();
      }
    }

    private static class getUnregisteredTimeseries_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getUnregisteredTimeseries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetTimeseriesList()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetTimeseriesList()) {
          {
            oprot.writeI32(struct.timeseriesList.size());
            for (java.lang.String _iter292 : struct.timeseriesList)
            {
              oprot.writeString(_iter292);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getUnregisteredTimeseries_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list293 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.timeseriesList = new java.util.ArrayList(_list293.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem294;
            for (int _i295 = 0; _i295 < _list293.size; ++_i295)
            {
              _elem294 = iprot.readString();
              struct.timeseriesList.add(_elem294);
            }
          }
          struct.setTimeseriesListIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getUnregisteredTimeseries_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("getUnregisteredTimeseries_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getUnregisteredTimeseries_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getUnregisteredTimeseries_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.List success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUnregisteredTimeseries_result.class, metaDataMap);
    }

    public getUnregisteredTimeseries_result() {
    }

    public getUnregisteredTimeseries_result(
      java.util.List success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getUnregisteredTimeseries_result(getUnregisteredTimeseries_result other) {
      if (other.isSetSuccess()) {
        java.util.List __this__success = new java.util.ArrayList(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.lang.String elem) {
      if (this.success == null) {
        this.success = new java.util.ArrayList();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getSuccess() {
      return this.success;
    }

    public getUnregisteredTimeseries_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getUnregisteredTimeseries_result)
        return this.equals((getUnregisteredTimeseries_result)that);
      return false;
    }

    public boolean equals(getUnregisteredTimeseries_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getUnregisteredTimeseries_result(");
      boolean first = true;

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

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

    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, java.lang.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 getUnregisteredTimeseries_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getUnregisteredTimeseries_resultStandardScheme getScheme() {
        return new getUnregisteredTimeseries_resultStandardScheme();
      }
    }

    private static class getUnregisteredTimeseries_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getUnregisteredTimeseries_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 _list296 = iprot.readListBegin();
                  struct.success = new java.util.ArrayList(_list296.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem297;
                  for (int _i298 = 0; _i298 < _list296.size; ++_i298)
                  {
                    _elem297 = iprot.readString();
                    struct.success.add(_elem297);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getUnregisteredTimeseries_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.STRING, struct.success.size()));
            for (java.lang.String _iter299 : struct.success)
            {
              oprot.writeString(_iter299);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getUnregisteredTimeseries_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getUnregisteredTimeseries_resultTupleScheme getScheme() {
        return new getUnregisteredTimeseries_resultTupleScheme();
      }
    }

    private static class getUnregisteredTimeseries_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getUnregisteredTimeseries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.lang.String _iter300 : struct.success)
            {
              oprot.writeString(_iter300);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getUnregisteredTimeseries_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list301 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.ArrayList(_list301.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem302;
            for (int _i303 = 0; _i303 < _list301.size; ++_i303)
            {
              _elem302 = iprot.readString();
              struct.success.add(_elem302);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullSnapshot_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("pullSnapshot_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullSnapshot_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullSnapshot_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSnapshotRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public pullSnapshot_args() {
    }

    public pullSnapshot_args(
      PullSnapshotRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullSnapshot_args(pullSnapshot_args other) {
      if (other.isSetRequest()) {
        this.request = new PullSnapshotRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSnapshotRequest getRequest() {
      return this.request;
    }

    public pullSnapshot_args setRequest(@org.apache.thrift.annotation.Nullable PullSnapshotRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((PullSnapshotRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullSnapshot_args)
        return this.equals((pullSnapshot_args)that);
      return false;
    }

    public boolean equals(pullSnapshot_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullSnapshot_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 pullSnapshot_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullSnapshot_argsStandardScheme getScheme() {
        return new pullSnapshot_argsStandardScheme();
      }
    }

    private static class pullSnapshot_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullSnapshot_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new PullSnapshotRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, pullSnapshot_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullSnapshot_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullSnapshot_argsTupleScheme getScheme() {
        return new pullSnapshot_argsTupleScheme();
      }
    }

    private static class pullSnapshot_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullSnapshot_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new PullSnapshotRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullSnapshot_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("pullSnapshot_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullSnapshot_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullSnapshot_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSnapshotResp success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, PullSnapshotResp.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pullSnapshot_result.class, metaDataMap);
    }

    public pullSnapshot_result() {
    }

    public pullSnapshot_result(
      PullSnapshotResp success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullSnapshot_result(pullSnapshot_result other) {
      if (other.isSetSuccess()) {
        this.success = new PullSnapshotResp(other.success);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSnapshotResp getSuccess() {
      return this.success;
    }

    public pullSnapshot_result setSuccess(@org.apache.thrift.annotation.Nullable PullSnapshotResp 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PullSnapshotResp)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullSnapshot_result)
        return this.equals((pullSnapshot_result)that);
      return false;
    }

    public boolean equals(pullSnapshot_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullSnapshot_result(");
      boolean first = true;

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

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

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

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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 pullSnapshot_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullSnapshot_resultStandardScheme getScheme() {
        return new pullSnapshot_resultStandardScheme();
      }
    }

    private static class pullSnapshot_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullSnapshot_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 PullSnapshotResp();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, pullSnapshot_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullSnapshot_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullSnapshot_resultTupleScheme getScheme() {
        return new pullSnapshot_resultTupleScheme();
      }
    }

    private static class pullSnapshot_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullSnapshot_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new PullSnapshotResp();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getGroupByExecutor_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("getGroupByExecutor_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroupByExecutor_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroupByExecutor_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable GroupByRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public getGroupByExecutor_args() {
    }

    public getGroupByExecutor_args(
      GroupByRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public getGroupByExecutor_args(getGroupByExecutor_args other) {
      if (other.isSetRequest()) {
        this.request = new GroupByRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public GroupByRequest getRequest() {
      return this.request;
    }

    public getGroupByExecutor_args setRequest(@org.apache.thrift.annotation.Nullable GroupByRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((GroupByRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getGroupByExecutor_args)
        return this.equals((getGroupByExecutor_args)that);
      return false;
    }

    public boolean equals(getGroupByExecutor_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroupByExecutor_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 getGroupByExecutor_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByExecutor_argsStandardScheme getScheme() {
        return new getGroupByExecutor_argsStandardScheme();
      }
    }

    private static class getGroupByExecutor_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getGroupByExecutor_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new GroupByRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, getGroupByExecutor_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class getGroupByExecutor_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByExecutor_argsTupleScheme getScheme() {
        return new getGroupByExecutor_argsTupleScheme();
      }
    }

    private static class getGroupByExecutor_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getGroupByExecutor_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new GroupByRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getGroupByExecutor_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("getGroupByExecutor_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroupByExecutor_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroupByExecutor_resultTupleSchemeFactory();

    public long success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGroupByExecutor_result.class, metaDataMap);
    }

    public getGroupByExecutor_result() {
    }

    public getGroupByExecutor_result(
      long success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getGroupByExecutor_result(getGroupByExecutor_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public getGroupByExecutor_result setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getGroupByExecutor_result)
        return this.equals((getGroupByExecutor_result)that);
      return false;
    }

    public boolean equals(getGroupByExecutor_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroupByExecutor_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 getGroupByExecutor_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByExecutor_resultStandardScheme getScheme() {
        return new getGroupByExecutor_resultStandardScheme();
      }
    }

    private static class getGroupByExecutor_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getGroupByExecutor_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;
            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, getGroupByExecutor_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getGroupByExecutor_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByExecutor_resultTupleScheme getScheme() {
        return new getGroupByExecutor_resultTupleScheme();
      }
    }

    private static class getGroupByExecutor_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getGroupByExecutor_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI64();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getGroupByResult_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("getGroupByResult_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField EXECUTOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("executorId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endTime", org.apache.thrift.protocol.TType.I64, (short)5);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroupByResult_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroupByResult_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public long executorId; // required
    public long startTime; // required
    public long endTime; // 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 {
      HEADER((short)1, "header"),
      EXECUTOR_ID((short)3, "executorId"),
      START_TIME((short)4, "startTime"),
      END_TIME((short)5, "endTime");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 3: // EXECUTOR_ID
            return EXECUTOR_ID;
          case 4: // START_TIME
            return START_TIME;
          case 5: // END_TIME
            return END_TIME;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __EXECUTORID_ISSET_ID = 0;
    private static final int __STARTTIME_ISSET_ID = 1;
    private static final int __ENDTIME_ISSET_ID = 2;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.EXECUTOR_ID, new org.apache.thrift.meta_data.FieldMetaData("executorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("endTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGroupByResult_args.class, metaDataMap);
    }

    public getGroupByResult_args() {
    }

    public getGroupByResult_args(
      RaftNode header,
      long executorId,
      long startTime,
      long endTime)
    {
      this();
      this.header = header;
      this.executorId = executorId;
      setExecutorIdIsSet(true);
      this.startTime = startTime;
      setStartTimeIsSet(true);
      this.endTime = endTime;
      setEndTimeIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getGroupByResult_args(getGroupByResult_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      this.executorId = other.executorId;
      this.startTime = other.startTime;
      this.endTime = other.endTime;
    }

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

    @Override
    public void clear() {
      this.header = null;
      setExecutorIdIsSet(false);
      this.executorId = 0;
      setStartTimeIsSet(false);
      this.startTime = 0;
      setEndTimeIsSet(false);
      this.endTime = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getGroupByResult_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public long getExecutorId() {
      return this.executorId;
    }

    public getGroupByResult_args setExecutorId(long executorId) {
      this.executorId = executorId;
      setExecutorIdIsSet(true);
      return this;
    }

    public void unsetExecutorId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTORID_ISSET_ID);
    }

    /** Returns true if field executorId is set (has been assigned a value) and false otherwise */
    public boolean isSetExecutorId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTORID_ISSET_ID);
    }

    public void setExecutorIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTORID_ISSET_ID, value);
    }

    public long getStartTime() {
      return this.startTime;
    }

    public getGroupByResult_args setStartTime(long startTime) {
      this.startTime = startTime;
      setStartTimeIsSet(true);
      return this;
    }

    public void unsetStartTime() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
    }

    /** Returns true if field startTime is set (has been assigned a value) and false otherwise */
    public boolean isSetStartTime() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID);
    }

    public void setStartTimeIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
    }

    public long getEndTime() {
      return this.endTime;
    }

    public getGroupByResult_args setEndTime(long endTime) {
      this.endTime = endTime;
      setEndTimeIsSet(true);
      return this;
    }

    public void unsetEndTime() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID);
    }

    /** Returns true if field endTime is set (has been assigned a value) and false otherwise */
    public boolean isSetEndTime() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID);
    }

    public void setEndTimeIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case EXECUTOR_ID:
        if (value == null) {
          unsetExecutorId();
        } else {
          setExecutorId((java.lang.Long)value);
        }
        break;

      case START_TIME:
        if (value == null) {
          unsetStartTime();
        } else {
          setStartTime((java.lang.Long)value);
        }
        break;

      case END_TIME:
        if (value == null) {
          unsetEndTime();
        } else {
          setEndTime((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case EXECUTOR_ID:
        return getExecutorId();

      case START_TIME:
        return getStartTime();

      case END_TIME:
        return getEndTime();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case EXECUTOR_ID:
        return isSetExecutorId();
      case START_TIME:
        return isSetStartTime();
      case END_TIME:
        return isSetEndTime();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getGroupByResult_args)
        return this.equals((getGroupByResult_args)that);
      return false;
    }

    public boolean equals(getGroupByResult_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_executorId = true;
      boolean that_present_executorId = true;
      if (this_present_executorId || that_present_executorId) {
        if (!(this_present_executorId && that_present_executorId))
          return false;
        if (this.executorId != that.executorId)
          return false;
      }

      boolean this_present_startTime = true;
      boolean that_present_startTime = true;
      if (this_present_startTime || that_present_startTime) {
        if (!(this_present_startTime && that_present_startTime))
          return false;
        if (this.startTime != that.startTime)
          return false;
      }

      boolean this_present_endTime = true;
      boolean that_present_endTime = true;
      if (this_present_endTime || that_present_endTime) {
        if (!(this_present_endTime && that_present_endTime))
          return false;
        if (this.endTime != that.endTime)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(executorId);

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime);

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endTime);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetExecutorId(), other.isSetExecutorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetExecutorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executorId, other.executorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStartTime(), other.isSetStartTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetEndTime(), other.isSetEndTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endTime, other.endTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroupByResult_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("executorId:");
      sb.append(this.executorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("startTime:");
      sb.append(this.startTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endTime:");
      sb.append(this.endTime);
      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 (header != null) {
        header.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, java.lang.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 getGroupByResult_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByResult_argsStandardScheme getScheme() {
        return new getGroupByResult_argsStandardScheme();
      }
    }

    private static class getGroupByResult_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getGroupByResult_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // EXECUTOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.executorId = iprot.readI64();
                struct.setExecutorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // START_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.startTime = iprot.readI64();
                struct.setStartTimeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // END_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.endTime = iprot.readI64();
                struct.setEndTimeIsSet(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, getGroupByResult_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(EXECUTOR_ID_FIELD_DESC);
        oprot.writeI64(struct.executorId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(START_TIME_FIELD_DESC);
        oprot.writeI64(struct.startTime);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(END_TIME_FIELD_DESC);
        oprot.writeI64(struct.endTime);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getGroupByResult_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByResult_argsTupleScheme getScheme() {
        return new getGroupByResult_argsTupleScheme();
      }
    }

    private static class getGroupByResult_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getGroupByResult_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetExecutorId()) {
          optionals.set(1);
        }
        if (struct.isSetStartTime()) {
          optionals.set(2);
        }
        if (struct.isSetEndTime()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetExecutorId()) {
          oprot.writeI64(struct.executorId);
        }
        if (struct.isSetStartTime()) {
          oprot.writeI64(struct.startTime);
        }
        if (struct.isSetEndTime()) {
          oprot.writeI64(struct.endTime);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getGroupByResult_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.executorId = iprot.readI64();
          struct.setExecutorIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.startTime = iprot.readI64();
          struct.setStartTimeIsSet(true);
        }
        if (incoming.get(3)) {
          struct.endTime = iprot.readI64();
          struct.setEndTimeIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getGroupByResult_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("getGroupByResult_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getGroupByResult_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getGroupByResult_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.util.List success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGroupByResult_result.class, metaDataMap);
    }

    public getGroupByResult_result() {
    }

    public getGroupByResult_result(
      java.util.List success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public getGroupByResult_result(getGroupByResult_result other) {
      if (other.isSetSuccess()) {
        java.util.List __this__success = new java.util.ArrayList(other.success);
        this.success = __this__success;
      }
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(java.nio.ByteBuffer elem) {
      if (this.success == null) {
        this.success = new java.util.ArrayList();
      }
      this.success.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getSuccess() {
      return this.success;
    }

    public getGroupByResult_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getGroupByResult_result)
        return this.equals((getGroupByResult_result)that);
      return false;
    }

    public boolean equals(getGroupByResult_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getGroupByResult_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 getGroupByResult_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByResult_resultStandardScheme getScheme() {
        return new getGroupByResult_resultStandardScheme();
      }
    }

    private static class getGroupByResult_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getGroupByResult_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 _list304 = iprot.readListBegin();
                  struct.success = new java.util.ArrayList(_list304.size);
                  @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem305;
                  for (int _i306 = 0; _i306 < _list304.size; ++_i306)
                  {
                    _elem305 = iprot.readBinary();
                    struct.success.add(_elem305);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, getGroupByResult_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.STRING, struct.success.size()));
            for (java.nio.ByteBuffer _iter307 : struct.success)
            {
              oprot.writeBinary(_iter307);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getGroupByResult_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getGroupByResult_resultTupleScheme getScheme() {
        return new getGroupByResult_resultTupleScheme();
      }
    }

    private static class getGroupByResult_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getGroupByResult_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          {
            oprot.writeI32(struct.success.size());
            for (java.nio.ByteBuffer _iter308 : struct.success)
            {
              oprot.writeBinary(_iter308);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getGroupByResult_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TList _list309 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.success = new java.util.ArrayList(_list309.size);
            @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem310;
            for (int _i311 = 0; _i311 < _list309.size; ++_i311)
            {
              _elem310 = iprot.readBinary();
              struct.success.add(_elem310);
            }
          }
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullTimeSeriesSchema_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("pullTimeSeriesSchema_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullTimeSeriesSchema_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullTimeSeriesSchema_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSchemaRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public pullTimeSeriesSchema_args() {
    }

    public pullTimeSeriesSchema_args(
      PullSchemaRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullTimeSeriesSchema_args(pullTimeSeriesSchema_args other) {
      if (other.isSetRequest()) {
        this.request = new PullSchemaRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSchemaRequest getRequest() {
      return this.request;
    }

    public pullTimeSeriesSchema_args setRequest(@org.apache.thrift.annotation.Nullable PullSchemaRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((PullSchemaRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullTimeSeriesSchema_args)
        return this.equals((pullTimeSeriesSchema_args)that);
      return false;
    }

    public boolean equals(pullTimeSeriesSchema_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullTimeSeriesSchema_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 pullTimeSeriesSchema_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullTimeSeriesSchema_argsStandardScheme getScheme() {
        return new pullTimeSeriesSchema_argsStandardScheme();
      }
    }

    private static class pullTimeSeriesSchema_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullTimeSeriesSchema_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new PullSchemaRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, pullTimeSeriesSchema_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullTimeSeriesSchema_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullTimeSeriesSchema_argsTupleScheme getScheme() {
        return new pullTimeSeriesSchema_argsTupleScheme();
      }
    }

    private static class pullTimeSeriesSchema_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullTimeSeriesSchema_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new PullSchemaRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullTimeSeriesSchema_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("pullTimeSeriesSchema_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullTimeSeriesSchema_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullTimeSeriesSchema_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSchemaResp success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, PullSchemaResp.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pullTimeSeriesSchema_result.class, metaDataMap);
    }

    public pullTimeSeriesSchema_result() {
    }

    public pullTimeSeriesSchema_result(
      PullSchemaResp success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullTimeSeriesSchema_result(pullTimeSeriesSchema_result other) {
      if (other.isSetSuccess()) {
        this.success = new PullSchemaResp(other.success);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSchemaResp getSuccess() {
      return this.success;
    }

    public pullTimeSeriesSchema_result setSuccess(@org.apache.thrift.annotation.Nullable PullSchemaResp 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PullSchemaResp)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullTimeSeriesSchema_result)
        return this.equals((pullTimeSeriesSchema_result)that);
      return false;
    }

    public boolean equals(pullTimeSeriesSchema_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullTimeSeriesSchema_result(");
      boolean first = true;

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

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

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

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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 pullTimeSeriesSchema_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullTimeSeriesSchema_resultStandardScheme getScheme() {
        return new pullTimeSeriesSchema_resultStandardScheme();
      }
    }

    private static class pullTimeSeriesSchema_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullTimeSeriesSchema_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 PullSchemaResp();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, pullTimeSeriesSchema_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullTimeSeriesSchema_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullTimeSeriesSchema_resultTupleScheme getScheme() {
        return new pullTimeSeriesSchema_resultTupleScheme();
      }
    }

    private static class pullTimeSeriesSchema_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullTimeSeriesSchema_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new PullSchemaResp();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullMeasurementSchema_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("pullMeasurementSchema_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullMeasurementSchema_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullMeasurementSchema_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSchemaRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public pullMeasurementSchema_args() {
    }

    public pullMeasurementSchema_args(
      PullSchemaRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullMeasurementSchema_args(pullMeasurementSchema_args other) {
      if (other.isSetRequest()) {
        this.request = new PullSchemaRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSchemaRequest getRequest() {
      return this.request;
    }

    public pullMeasurementSchema_args setRequest(@org.apache.thrift.annotation.Nullable PullSchemaRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((PullSchemaRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullMeasurementSchema_args)
        return this.equals((pullMeasurementSchema_args)that);
      return false;
    }

    public boolean equals(pullMeasurementSchema_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullMeasurementSchema_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 pullMeasurementSchema_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullMeasurementSchema_argsStandardScheme getScheme() {
        return new pullMeasurementSchema_argsStandardScheme();
      }
    }

    private static class pullMeasurementSchema_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullMeasurementSchema_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new PullSchemaRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, pullMeasurementSchema_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullMeasurementSchema_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullMeasurementSchema_argsTupleScheme getScheme() {
        return new pullMeasurementSchema_argsTupleScheme();
      }
    }

    private static class pullMeasurementSchema_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullMeasurementSchema_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new PullSchemaRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class pullMeasurementSchema_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("pullMeasurementSchema_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new pullMeasurementSchema_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new pullMeasurementSchema_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PullSchemaResp success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, PullSchemaResp.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pullMeasurementSchema_result.class, metaDataMap);
    }

    public pullMeasurementSchema_result() {
    }

    public pullMeasurementSchema_result(
      PullSchemaResp success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public pullMeasurementSchema_result(pullMeasurementSchema_result other) {
      if (other.isSetSuccess()) {
        this.success = new PullSchemaResp(other.success);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PullSchemaResp getSuccess() {
      return this.success;
    }

    public pullMeasurementSchema_result setSuccess(@org.apache.thrift.annotation.Nullable PullSchemaResp 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PullSchemaResp)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof pullMeasurementSchema_result)
        return this.equals((pullMeasurementSchema_result)that);
      return false;
    }

    public boolean equals(pullMeasurementSchema_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("pullMeasurementSchema_result(");
      boolean first = true;

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

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

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

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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 pullMeasurementSchema_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullMeasurementSchema_resultStandardScheme getScheme() {
        return new pullMeasurementSchema_resultStandardScheme();
      }
    }

    private static class pullMeasurementSchema_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, pullMeasurementSchema_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 PullSchemaResp();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, pullMeasurementSchema_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class pullMeasurementSchema_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public pullMeasurementSchema_resultTupleScheme getScheme() {
        return new pullMeasurementSchema_resultTupleScheme();
      }
    }

    private static class pullMeasurementSchema_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, pullMeasurementSchema_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new PullSchemaResp();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class previousFill_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("previousFill_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new previousFill_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new previousFill_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable PreviousFillRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public previousFill_args() {
    }

    public previousFill_args(
      PreviousFillRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public previousFill_args(previousFill_args other) {
      if (other.isSetRequest()) {
        this.request = new PreviousFillRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public PreviousFillRequest getRequest() {
      return this.request;
    }

    public previousFill_args setRequest(@org.apache.thrift.annotation.Nullable PreviousFillRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((PreviousFillRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof previousFill_args)
        return this.equals((previousFill_args)that);
      return false;
    }

    public boolean equals(previousFill_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("previousFill_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 previousFill_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public previousFill_argsStandardScheme getScheme() {
        return new previousFill_argsStandardScheme();
      }
    }

    private static class previousFill_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, previousFill_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new PreviousFillRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, previousFill_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class previousFill_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public previousFill_argsTupleScheme getScheme() {
        return new previousFill_argsTupleScheme();
      }
    }

    private static class previousFill_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, previousFill_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new PreviousFillRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class previousFill_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("previousFill_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new previousFill_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new previousFill_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(previousFill_result.class, metaDataMap);
    }

    public previousFill_result() {
    }

    public previousFill_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public previousFill_result(previousFill_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public previousFill_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public previousFill_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof previousFill_result)
        return this.equals((previousFill_result)that);
      return false;
    }

    public boolean equals(previousFill_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("previousFill_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 previousFill_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public previousFill_resultStandardScheme getScheme() {
        return new previousFill_resultStandardScheme();
      }
    }

    private static class previousFill_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, previousFill_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, previousFill_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class previousFill_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public previousFill_resultTupleScheme getScheme() {
        return new previousFill_resultTupleScheme();
      }
    }

    private static class previousFill_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, previousFill_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class last_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("last_args");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new last_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new last_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable LastQueryRequest request; // 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 {
      REQUEST((short)1, "request");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // REQUEST
            return REQUEST;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

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

    public last_args() {
    }

    public last_args(
      LastQueryRequest request)
    {
      this();
      this.request = request;
    }

    /**
     * Performs a deep copy on other.
     */
    public last_args(last_args other) {
      if (other.isSetRequest()) {
        this.request = new LastQueryRequest(other.request);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public LastQueryRequest getRequest() {
      return this.request;
    }

    public last_args setRequest(@org.apache.thrift.annotation.Nullable LastQueryRequest request) {
      this.request = request;
      return this;
    }

    public void unsetRequest() {
      this.request = null;
    }

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

    public void setRequestIsSet(boolean value) {
      if (!value) {
        this.request = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case REQUEST:
        if (value == null) {
          unsetRequest();
        } else {
          setRequest((LastQueryRequest)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case REQUEST:
        return getRequest();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case REQUEST:
        return isSetRequest();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof last_args)
        return this.equals((last_args)that);
      return false;
    }

    public boolean equals(last_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_request = true && this.isSetRequest();
      boolean that_present_request = true && that.isSetRequest();
      if (this_present_request || that_present_request) {
        if (!(this_present_request && that_present_request))
          return false;
        if (!this.request.equals(that.request))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetRequest()) ? 131071 : 524287);
      if (isSetRequest())
        hashCode = hashCode * 8191 + request.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetRequest(), other.isSetRequest());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRequest()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("last_args(");
      boolean first = true;

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

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

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new 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, java.lang.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 last_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public last_argsStandardScheme getScheme() {
        return new last_argsStandardScheme();
      }
    }

    private static class last_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, last_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: // REQUEST
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.request = new LastQueryRequest();
                struct.request.read(iprot);
                struct.setRequestIsSet(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, last_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class last_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public last_argsTupleScheme getScheme() {
        return new last_argsTupleScheme();
      }
    }

    private static class last_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, last_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.request = new LastQueryRequest();
          struct.request.read(iprot);
          struct.setRequestIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class last_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("last_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new last_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new last_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(last_result.class, metaDataMap);
    }

    public last_result() {
    }

    public last_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public last_result(last_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public last_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public last_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof last_result)
        return this.equals((last_result)that);
      return false;
    }

    public boolean equals(last_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("last_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 last_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public last_resultStandardScheme getScheme() {
        return new last_resultStandardScheme();
      }
    }

    private static class last_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, last_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, last_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class last_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public last_resultTupleScheme getScheme() {
        return new last_resultTupleScheme();
      }
    }

    private static class last_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, last_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getPathCount_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("getPathCount_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATHS_TO_QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("pathsToQuery", org.apache.thrift.protocol.TType.LIST, (short)2);
    private static final org.apache.thrift.protocol.TField LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("level", org.apache.thrift.protocol.TType.I32, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getPathCount_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getPathCount_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List pathsToQuery; // required
    public int level; // 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 {
      HEADER((short)1, "header"),
      PATHS_TO_QUERY((short)2, "pathsToQuery"),
      LEVEL((short)3, "level");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATHS_TO_QUERY
            return PATHS_TO_QUERY;
          case 3: // LEVEL
            return LEVEL;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __LEVEL_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATHS_TO_QUERY, new org.apache.thrift.meta_data.FieldMetaData("pathsToQuery", 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.LEVEL, new org.apache.thrift.meta_data.FieldMetaData("level", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32          , "int")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathCount_args.class, metaDataMap);
    }

    public getPathCount_args() {
    }

    public getPathCount_args(
      RaftNode header,
      java.util.List pathsToQuery,
      int level)
    {
      this();
      this.header = header;
      this.pathsToQuery = pathsToQuery;
      this.level = level;
      setLevelIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getPathCount_args(getPathCount_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPathsToQuery()) {
        java.util.List __this__pathsToQuery = new java.util.ArrayList(other.pathsToQuery);
        this.pathsToQuery = __this__pathsToQuery;
      }
      this.level = other.level;
    }

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

    @Override
    public void clear() {
      this.header = null;
      this.pathsToQuery = null;
      setLevelIsSet(false);
      this.level = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getPathCount_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getPathsToQueryIterator() {
      return (this.pathsToQuery == null) ? null : this.pathsToQuery.iterator();
    }

    public void addToPathsToQuery(java.lang.String elem) {
      if (this.pathsToQuery == null) {
        this.pathsToQuery = new java.util.ArrayList();
      }
      this.pathsToQuery.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getPathsToQuery() {
      return this.pathsToQuery;
    }

    public getPathCount_args setPathsToQuery(@org.apache.thrift.annotation.Nullable java.util.List pathsToQuery) {
      this.pathsToQuery = pathsToQuery;
      return this;
    }

    public void unsetPathsToQuery() {
      this.pathsToQuery = null;
    }

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

    public void setPathsToQueryIsSet(boolean value) {
      if (!value) {
        this.pathsToQuery = null;
      }
    }

    public int getLevel() {
      return this.level;
    }

    public getPathCount_args setLevel(int level) {
      this.level = level;
      setLevelIsSet(true);
      return this;
    }

    public void unsetLevel() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __LEVEL_ISSET_ID);
    }

    /** Returns true if field level is set (has been assigned a value) and false otherwise */
    public boolean isSetLevel() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __LEVEL_ISSET_ID);
    }

    public void setLevelIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __LEVEL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATHS_TO_QUERY:
        if (value == null) {
          unsetPathsToQuery();
        } else {
          setPathsToQuery((java.util.List)value);
        }
        break;

      case LEVEL:
        if (value == null) {
          unsetLevel();
        } else {
          setLevel((java.lang.Integer)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATHS_TO_QUERY:
        return getPathsToQuery();

      case LEVEL:
        return getLevel();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATHS_TO_QUERY:
        return isSetPathsToQuery();
      case LEVEL:
        return isSetLevel();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getPathCount_args)
        return this.equals((getPathCount_args)that);
      return false;
    }

    public boolean equals(getPathCount_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_pathsToQuery = true && this.isSetPathsToQuery();
      boolean that_present_pathsToQuery = true && that.isSetPathsToQuery();
      if (this_present_pathsToQuery || that_present_pathsToQuery) {
        if (!(this_present_pathsToQuery && that_present_pathsToQuery))
          return false;
        if (!this.pathsToQuery.equals(that.pathsToQuery))
          return false;
      }

      boolean this_present_level = true;
      boolean that_present_level = true;
      if (this_present_level || that_present_level) {
        if (!(this_present_level && that_present_level))
          return false;
        if (this.level != that.level)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPathsToQuery()) ? 131071 : 524287);
      if (isSetPathsToQuery())
        hashCode = hashCode * 8191 + pathsToQuery.hashCode();

      hashCode = hashCode * 8191 + level;

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPathsToQuery(), other.isSetPathsToQuery());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPathsToQuery()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathsToQuery, other.pathsToQuery);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetLevel(), other.isSetLevel());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLevel()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.level, other.level);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getPathCount_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pathsToQuery:");
      if (this.pathsToQuery == null) {
        sb.append("null");
      } else {
        sb.append(this.pathsToQuery);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("level:");
      sb.append(this.level);
      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 (header != null) {
        header.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, java.lang.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 getPathCount_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getPathCount_argsStandardScheme getScheme() {
        return new getPathCount_argsStandardScheme();
      }
    }

    private static class getPathCount_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathCount_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATHS_TO_QUERY
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list312 = iprot.readListBegin();
                  struct.pathsToQuery = new java.util.ArrayList(_list312.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem313;
                  for (int _i314 = 0; _i314 < _list312.size; ++_i314)
                  {
                    _elem313 = iprot.readString();
                    struct.pathsToQuery.add(_elem313);
                  }
                  iprot.readListEnd();
                }
                struct.setPathsToQueryIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // LEVEL
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.level = iprot.readI32();
                struct.setLevelIsSet(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, getPathCount_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.pathsToQuery != null) {
          oprot.writeFieldBegin(PATHS_TO_QUERY_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.pathsToQuery.size()));
            for (java.lang.String _iter315 : struct.pathsToQuery)
            {
              oprot.writeString(_iter315);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(LEVEL_FIELD_DESC);
        oprot.writeI32(struct.level);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getPathCount_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getPathCount_argsTupleScheme getScheme() {
        return new getPathCount_argsTupleScheme();
      }
    }

    private static class getPathCount_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getPathCount_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPathsToQuery()) {
          optionals.set(1);
        }
        if (struct.isSetLevel()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPathsToQuery()) {
          {
            oprot.writeI32(struct.pathsToQuery.size());
            for (java.lang.String _iter316 : struct.pathsToQuery)
            {
              oprot.writeString(_iter316);
            }
          }
        }
        if (struct.isSetLevel()) {
          oprot.writeI32(struct.level);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getPathCount_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list317 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.pathsToQuery = new java.util.ArrayList(_list317.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem318;
            for (int _i319 = 0; _i319 < _list317.size; ++_i319)
            {
              _elem318 = iprot.readString();
              struct.pathsToQuery.add(_elem318);
            }
          }
          struct.setPathsToQueryIsSet(true);
        }
        if (incoming.get(2)) {
          struct.level = iprot.readI32();
          struct.setLevelIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getPathCount_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("getPathCount_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getPathCount_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getPathCount_resultTupleSchemeFactory();

    public int success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "int")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathCount_result.class, metaDataMap);
    }

    public getPathCount_result() {
    }

    public getPathCount_result(
      int success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getPathCount_result(getPathCount_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public getPathCount_result setSuccess(int success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Integer)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getPathCount_result)
        return this.equals((getPathCount_result)that);
      return false;
    }

    public boolean equals(getPathCount_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + success;

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getPathCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 getPathCount_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getPathCount_resultStandardScheme getScheme() {
        return new getPathCount_resultStandardScheme();
      }
    }

    private static class getPathCount_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathCount_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;
            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, getPathCount_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getPathCount_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getPathCount_resultTupleScheme getScheme() {
        return new getPathCount_resultTupleScheme();
      }
    }

    private static class getPathCount_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getPathCount_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI32();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getDeviceCount_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("getDeviceCount_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField PATHS_TO_QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("pathsToQuery", org.apache.thrift.protocol.TType.LIST, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getDeviceCount_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getDeviceCount_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List pathsToQuery; // 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 {
      HEADER((short)1, "header"),
      PATHS_TO_QUERY((short)2, "pathsToQuery");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // PATHS_TO_QUERY
            return PATHS_TO_QUERY;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.PATHS_TO_QUERY, new org.apache.thrift.meta_data.FieldMetaData("pathsToQuery", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDeviceCount_args.class, metaDataMap);
    }

    public getDeviceCount_args() {
    }

    public getDeviceCount_args(
      RaftNode header,
      java.util.List pathsToQuery)
    {
      this();
      this.header = header;
      this.pathsToQuery = pathsToQuery;
    }

    /**
     * Performs a deep copy on other.
     */
    public getDeviceCount_args(getDeviceCount_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetPathsToQuery()) {
        java.util.List __this__pathsToQuery = new java.util.ArrayList(other.pathsToQuery);
        this.pathsToQuery = __this__pathsToQuery;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public getDeviceCount_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getPathsToQueryIterator() {
      return (this.pathsToQuery == null) ? null : this.pathsToQuery.iterator();
    }

    public void addToPathsToQuery(java.lang.String elem) {
      if (this.pathsToQuery == null) {
        this.pathsToQuery = new java.util.ArrayList();
      }
      this.pathsToQuery.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getPathsToQuery() {
      return this.pathsToQuery;
    }

    public getDeviceCount_args setPathsToQuery(@org.apache.thrift.annotation.Nullable java.util.List pathsToQuery) {
      this.pathsToQuery = pathsToQuery;
      return this;
    }

    public void unsetPathsToQuery() {
      this.pathsToQuery = null;
    }

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

    public void setPathsToQueryIsSet(boolean value) {
      if (!value) {
        this.pathsToQuery = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case PATHS_TO_QUERY:
        if (value == null) {
          unsetPathsToQuery();
        } else {
          setPathsToQuery((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case PATHS_TO_QUERY:
        return getPathsToQuery();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case PATHS_TO_QUERY:
        return isSetPathsToQuery();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getDeviceCount_args)
        return this.equals((getDeviceCount_args)that);
      return false;
    }

    public boolean equals(getDeviceCount_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_pathsToQuery = true && this.isSetPathsToQuery();
      boolean that_present_pathsToQuery = true && that.isSetPathsToQuery();
      if (this_present_pathsToQuery || that_present_pathsToQuery) {
        if (!(this_present_pathsToQuery && that_present_pathsToQuery))
          return false;
        if (!this.pathsToQuery.equals(that.pathsToQuery))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetPathsToQuery()) ? 131071 : 524287);
      if (isSetPathsToQuery())
        hashCode = hashCode * 8191 + pathsToQuery.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPathsToQuery(), other.isSetPathsToQuery());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPathsToQuery()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathsToQuery, other.pathsToQuery);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getDeviceCount_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pathsToQuery:");
      if (this.pathsToQuery == null) {
        sb.append("null");
      } else {
        sb.append(this.pathsToQuery);
      }
      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 (header != null) {
        header.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, java.lang.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 getDeviceCount_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDeviceCount_argsStandardScheme getScheme() {
        return new getDeviceCount_argsStandardScheme();
      }
    }

    private static class getDeviceCount_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getDeviceCount_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PATHS_TO_QUERY
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list320 = iprot.readListBegin();
                  struct.pathsToQuery = new java.util.ArrayList(_list320.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _elem321;
                  for (int _i322 = 0; _i322 < _list320.size; ++_i322)
                  {
                    _elem321 = iprot.readString();
                    struct.pathsToQuery.add(_elem321);
                  }
                  iprot.readListEnd();
                }
                struct.setPathsToQueryIsSet(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, getDeviceCount_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.pathsToQuery != null) {
          oprot.writeFieldBegin(PATHS_TO_QUERY_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.pathsToQuery.size()));
            for (java.lang.String _iter323 : struct.pathsToQuery)
            {
              oprot.writeString(_iter323);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getDeviceCount_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDeviceCount_argsTupleScheme getScheme() {
        return new getDeviceCount_argsTupleScheme();
      }
    }

    private static class getDeviceCount_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getDeviceCount_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetPathsToQuery()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetPathsToQuery()) {
          {
            oprot.writeI32(struct.pathsToQuery.size());
            for (java.lang.String _iter324 : struct.pathsToQuery)
            {
              oprot.writeString(_iter324);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getDeviceCount_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list325 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
            struct.pathsToQuery = new java.util.ArrayList(_list325.size);
            @org.apache.thrift.annotation.Nullable java.lang.String _elem326;
            for (int _i327 = 0; _i327 < _list325.size; ++_i327)
            {
              _elem326 = iprot.readString();
              struct.pathsToQuery.add(_elem326);
            }
          }
          struct.setPathsToQueryIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class getDeviceCount_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("getDeviceCount_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getDeviceCount_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getDeviceCount_resultTupleSchemeFactory();

    public int success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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          , "int")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDeviceCount_result.class, metaDataMap);
    }

    public getDeviceCount_result() {
    }

    public getDeviceCount_result(
      int success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public getDeviceCount_result(getDeviceCount_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
    }

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

    public getDeviceCount_result setSuccess(int success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Integer)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof getDeviceCount_result)
        return this.equals((getDeviceCount_result)that);
      return false;
    }

    public boolean equals(getDeviceCount_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + success;

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("getDeviceCount_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 getDeviceCount_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDeviceCount_resultStandardScheme getScheme() {
        return new getDeviceCount_resultStandardScheme();
      }
    }

    private static class getDeviceCount_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getDeviceCount_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;
            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, getDeviceCount_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getDeviceCount_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public getDeviceCount_resultTupleScheme getScheme() {
        return new getDeviceCount_resultTupleScheme();
      }
    }

    private static class getDeviceCount_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getDeviceCount_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readI32();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class onSnapshotApplied_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("onSnapshotApplied_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField SLOTS_FIELD_DESC = new org.apache.thrift.protocol.TField("slots", org.apache.thrift.protocol.TType.LIST, (short)2);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new onSnapshotApplied_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new onSnapshotApplied_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public @org.apache.thrift.annotation.Nullable java.util.List slots; // 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 {
      HEADER((short)1, "header"),
      SLOTS((short)2, "slots");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // SLOTS
            return SLOTS;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.SLOTS, new org.apache.thrift.meta_data.FieldMetaData("slots", 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              , "int"))));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onSnapshotApplied_args.class, metaDataMap);
    }

    public onSnapshotApplied_args() {
    }

    public onSnapshotApplied_args(
      RaftNode header,
      java.util.List slots)
    {
      this();
      this.header = header;
      this.slots = slots;
    }

    /**
     * Performs a deep copy on other.
     */
    public onSnapshotApplied_args(onSnapshotApplied_args other) {
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      if (other.isSetSlots()) {
        java.util.List __this__slots = new java.util.ArrayList(other.slots.size());
        for (java.lang.Integer other_element : other.slots) {
          __this__slots.add(other_element);
        }
        this.slots = __this__slots;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public onSnapshotApplied_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

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

    @org.apache.thrift.annotation.Nullable
    public java.util.Iterator getSlotsIterator() {
      return (this.slots == null) ? null : this.slots.iterator();
    }

    public void addToSlots(int elem) {
      if (this.slots == null) {
        this.slots = new java.util.ArrayList();
      }
      this.slots.add(elem);
    }

    @org.apache.thrift.annotation.Nullable
    public java.util.List getSlots() {
      return this.slots;
    }

    public onSnapshotApplied_args setSlots(@org.apache.thrift.annotation.Nullable java.util.List slots) {
      this.slots = slots;
      return this;
    }

    public void unsetSlots() {
      this.slots = null;
    }

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

    public void setSlotsIsSet(boolean value) {
      if (!value) {
        this.slots = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case SLOTS:
        if (value == null) {
          unsetSlots();
        } else {
          setSlots((java.util.List)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case SLOTS:
        return getSlots();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case SLOTS:
        return isSetSlots();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof onSnapshotApplied_args)
        return this.equals((onSnapshotApplied_args)that);
      return false;
    }

    public boolean equals(onSnapshotApplied_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_slots = true && this.isSetSlots();
      boolean that_present_slots = true && that.isSetSlots();
      if (this_present_slots || that_present_slots) {
        if (!(this_present_slots && that_present_slots))
          return false;
        if (!this.slots.equals(that.slots))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + ((isSetSlots()) ? 131071 : 524287);
      if (isSetSlots())
        hashCode = hashCode * 8191 + slots.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSlots(), other.isSetSlots());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSlots()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.slots, other.slots);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("onSnapshotApplied_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("slots:");
      if (this.slots == null) {
        sb.append("null");
      } else {
        sb.append(this.slots);
      }
      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 (header != null) {
        header.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, java.lang.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 onSnapshotApplied_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public onSnapshotApplied_argsStandardScheme getScheme() {
        return new onSnapshotApplied_argsStandardScheme();
      }
    }

    private static class onSnapshotApplied_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, onSnapshotApplied_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SLOTS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list328 = iprot.readListBegin();
                  struct.slots = new java.util.ArrayList(_list328.size);
                  int _elem329;
                  for (int _i330 = 0; _i330 < _list328.size; ++_i330)
                  {
                    _elem329 = iprot.readI32();
                    struct.slots.add(_elem329);
                  }
                  iprot.readListEnd();
                }
                struct.setSlotsIsSet(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, onSnapshotApplied_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.slots != null) {
          oprot.writeFieldBegin(SLOTS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.slots.size()));
            for (int _iter331 : struct.slots)
            {
              oprot.writeI32(_iter331);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class onSnapshotApplied_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public onSnapshotApplied_argsTupleScheme getScheme() {
        return new onSnapshotApplied_argsTupleScheme();
      }
    }

    private static class onSnapshotApplied_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, onSnapshotApplied_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetSlots()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetSlots()) {
          {
            oprot.writeI32(struct.slots.size());
            for (int _iter332 : struct.slots)
            {
              oprot.writeI32(_iter332);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, onSnapshotApplied_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TList _list333 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
            struct.slots = new java.util.ArrayList(_list333.size);
            int _elem334;
            for (int _i335 = 0; _i335 < _list333.size; ++_i335)
            {
              _elem334 = iprot.readI32();
              struct.slots.add(_elem334);
            }
          }
          struct.setSlotsIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class onSnapshotApplied_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("onSnapshotApplied_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new onSnapshotApplied_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new onSnapshotApplied_resultTupleSchemeFactory();

    public boolean success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(onSnapshotApplied_result.class, metaDataMap);
    }

    public onSnapshotApplied_result() {
    }

    public onSnapshotApplied_result(
      boolean success)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public onSnapshotApplied_result(onSnapshotApplied_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
    }

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

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public onSnapshotApplied_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

    public void unsetSuccess() {
      __isset_bitfield = org.apache.thrift.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 org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Boolean)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof onSnapshotApplied_result)
        return this.equals((onSnapshotApplied_result)that);
      return false;
    }

    public boolean equals(onSnapshotApplied_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("onSnapshotApplied_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

    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, java.lang.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 onSnapshotApplied_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public onSnapshotApplied_resultStandardScheme getScheme() {
        return new onSnapshotApplied_resultStandardScheme();
      }
    }

    private static class onSnapshotApplied_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, onSnapshotApplied_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.success = iprot.readBool();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            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, onSnapshotApplied_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeBool(struct.success);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class onSnapshotApplied_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public onSnapshotApplied_resultTupleScheme getScheme() {
        return new onSnapshotApplied_resultTupleScheme();
      }
    }

    private static class onSnapshotApplied_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, onSnapshotApplied_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBool();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class peekNextNotNullValue_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("peekNextNotNullValue_args");

    private static final org.apache.thrift.protocol.TField HEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("header", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField EXECUTOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("executorId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField END_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("endTime", org.apache.thrift.protocol.TType.I64, (short)4);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new peekNextNotNullValue_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new peekNextNotNullValue_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable RaftNode header; // required
    public long executorId; // required
    public long startTime; // required
    public long endTime; // 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 {
      HEADER((short)1, "header"),
      EXECUTOR_ID((short)2, "executorId"),
      START_TIME((short)3, "startTime"),
      END_TIME((short)4, "endTime");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // HEADER
            return HEADER;
          case 2: // EXECUTOR_ID
            return EXECUTOR_ID;
          case 3: // START_TIME
            return START_TIME;
          case 4: // END_TIME
            return END_TIME;
          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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __EXECUTORID_ISSET_ID = 0;
    private static final int __STARTTIME_ISSET_ID = 1;
    private static final int __ENDTIME_ISSET_ID = 2;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.HEADER, new org.apache.thrift.meta_data.FieldMetaData("header", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RaftNode.class)));
      tmpMap.put(_Fields.EXECUTOR_ID, new org.apache.thrift.meta_data.FieldMetaData("executorId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      tmpMap.put(_Fields.END_TIME, new org.apache.thrift.meta_data.FieldMetaData("endTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64          , "long")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(peekNextNotNullValue_args.class, metaDataMap);
    }

    public peekNextNotNullValue_args() {
    }

    public peekNextNotNullValue_args(
      RaftNode header,
      long executorId,
      long startTime,
      long endTime)
    {
      this();
      this.header = header;
      this.executorId = executorId;
      setExecutorIdIsSet(true);
      this.startTime = startTime;
      setStartTimeIsSet(true);
      this.endTime = endTime;
      setEndTimeIsSet(true);
    }

    /**
     * Performs a deep copy on other.
     */
    public peekNextNotNullValue_args(peekNextNotNullValue_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetHeader()) {
        this.header = new RaftNode(other.header);
      }
      this.executorId = other.executorId;
      this.startTime = other.startTime;
      this.endTime = other.endTime;
    }

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

    @Override
    public void clear() {
      this.header = null;
      setExecutorIdIsSet(false);
      this.executorId = 0;
      setStartTimeIsSet(false);
      this.startTime = 0;
      setEndTimeIsSet(false);
      this.endTime = 0;
    }

    @org.apache.thrift.annotation.Nullable
    public RaftNode getHeader() {
      return this.header;
    }

    public peekNextNotNullValue_args setHeader(@org.apache.thrift.annotation.Nullable RaftNode header) {
      this.header = header;
      return this;
    }

    public void unsetHeader() {
      this.header = null;
    }

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

    public void setHeaderIsSet(boolean value) {
      if (!value) {
        this.header = null;
      }
    }

    public long getExecutorId() {
      return this.executorId;
    }

    public peekNextNotNullValue_args setExecutorId(long executorId) {
      this.executorId = executorId;
      setExecutorIdIsSet(true);
      return this;
    }

    public void unsetExecutorId() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __EXECUTORID_ISSET_ID);
    }

    /** Returns true if field executorId is set (has been assigned a value) and false otherwise */
    public boolean isSetExecutorId() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __EXECUTORID_ISSET_ID);
    }

    public void setExecutorIdIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __EXECUTORID_ISSET_ID, value);
    }

    public long getStartTime() {
      return this.startTime;
    }

    public peekNextNotNullValue_args setStartTime(long startTime) {
      this.startTime = startTime;
      setStartTimeIsSet(true);
      return this;
    }

    public void unsetStartTime() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
    }

    /** Returns true if field startTime is set (has been assigned a value) and false otherwise */
    public boolean isSetStartTime() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID);
    }

    public void setStartTimeIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
    }

    public long getEndTime() {
      return this.endTime;
    }

    public peekNextNotNullValue_args setEndTime(long endTime) {
      this.endTime = endTime;
      setEndTimeIsSet(true);
      return this;
    }

    public void unsetEndTime() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ENDTIME_ISSET_ID);
    }

    /** Returns true if field endTime is set (has been assigned a value) and false otherwise */
    public boolean isSetEndTime() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ENDTIME_ISSET_ID);
    }

    public void setEndTimeIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ENDTIME_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case HEADER:
        if (value == null) {
          unsetHeader();
        } else {
          setHeader((RaftNode)value);
        }
        break;

      case EXECUTOR_ID:
        if (value == null) {
          unsetExecutorId();
        } else {
          setExecutorId((java.lang.Long)value);
        }
        break;

      case START_TIME:
        if (value == null) {
          unsetStartTime();
        } else {
          setStartTime((java.lang.Long)value);
        }
        break;

      case END_TIME:
        if (value == null) {
          unsetEndTime();
        } else {
          setEndTime((java.lang.Long)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case HEADER:
        return getHeader();

      case EXECUTOR_ID:
        return getExecutorId();

      case START_TIME:
        return getStartTime();

      case END_TIME:
        return getEndTime();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case HEADER:
        return isSetHeader();
      case EXECUTOR_ID:
        return isSetExecutorId();
      case START_TIME:
        return isSetStartTime();
      case END_TIME:
        return isSetEndTime();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof peekNextNotNullValue_args)
        return this.equals((peekNextNotNullValue_args)that);
      return false;
    }

    public boolean equals(peekNextNotNullValue_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_header = true && this.isSetHeader();
      boolean that_present_header = true && that.isSetHeader();
      if (this_present_header || that_present_header) {
        if (!(this_present_header && that_present_header))
          return false;
        if (!this.header.equals(that.header))
          return false;
      }

      boolean this_present_executorId = true;
      boolean that_present_executorId = true;
      if (this_present_executorId || that_present_executorId) {
        if (!(this_present_executorId && that_present_executorId))
          return false;
        if (this.executorId != that.executorId)
          return false;
      }

      boolean this_present_startTime = true;
      boolean that_present_startTime = true;
      if (this_present_startTime || that_present_startTime) {
        if (!(this_present_startTime && that_present_startTime))
          return false;
        if (this.startTime != that.startTime)
          return false;
      }

      boolean this_present_endTime = true;
      boolean that_present_endTime = true;
      if (this_present_endTime || that_present_endTime) {
        if (!(this_present_endTime && that_present_endTime))
          return false;
        if (this.endTime != that.endTime)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetHeader()) ? 131071 : 524287);
      if (isSetHeader())
        hashCode = hashCode * 8191 + header.hashCode();

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(executorId);

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime);

      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(endTime);

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetHeader(), other.isSetHeader());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetHeader()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.header, other.header);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetExecutorId(), other.isSetExecutorId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetExecutorId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.executorId, other.executorId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStartTime(), other.isSetStartTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStartTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetEndTime(), other.isSetEndTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEndTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endTime, other.endTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("peekNextNotNullValue_args(");
      boolean first = true;

      sb.append("header:");
      if (this.header == null) {
        sb.append("null");
      } else {
        sb.append(this.header);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("executorId:");
      sb.append(this.executorId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("startTime:");
      sb.append(this.startTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("endTime:");
      sb.append(this.endTime);
      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 (header != null) {
        header.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, java.lang.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 peekNextNotNullValue_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public peekNextNotNullValue_argsStandardScheme getScheme() {
        return new peekNextNotNullValue_argsStandardScheme();
      }
    }

    private static class peekNextNotNullValue_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, peekNextNotNullValue_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: // HEADER
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.header = new RaftNode();
                struct.header.read(iprot);
                struct.setHeaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // EXECUTOR_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.executorId = iprot.readI64();
                struct.setExecutorIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // START_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.startTime = iprot.readI64();
                struct.setStartTimeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // END_TIME
              if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
                struct.endTime = iprot.readI64();
                struct.setEndTimeIsSet(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, peekNextNotNullValue_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.header != null) {
          oprot.writeFieldBegin(HEADER_FIELD_DESC);
          struct.header.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(EXECUTOR_ID_FIELD_DESC);
        oprot.writeI64(struct.executorId);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(START_TIME_FIELD_DESC);
        oprot.writeI64(struct.startTime);
        oprot.writeFieldEnd();
        oprot.writeFieldBegin(END_TIME_FIELD_DESC);
        oprot.writeI64(struct.endTime);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class peekNextNotNullValue_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public peekNextNotNullValue_argsTupleScheme getScheme() {
        return new peekNextNotNullValue_argsTupleScheme();
      }
    }

    private static class peekNextNotNullValue_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, peekNextNotNullValue_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetHeader()) {
          optionals.set(0);
        }
        if (struct.isSetExecutorId()) {
          optionals.set(1);
        }
        if (struct.isSetStartTime()) {
          optionals.set(2);
        }
        if (struct.isSetEndTime()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.isSetHeader()) {
          struct.header.write(oprot);
        }
        if (struct.isSetExecutorId()) {
          oprot.writeI64(struct.executorId);
        }
        if (struct.isSetStartTime()) {
          oprot.writeI64(struct.startTime);
        }
        if (struct.isSetEndTime()) {
          oprot.writeI64(struct.endTime);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, peekNextNotNullValue_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.header = new RaftNode();
          struct.header.read(iprot);
          struct.setHeaderIsSet(true);
        }
        if (incoming.get(1)) {
          struct.executorId = iprot.readI64();
          struct.setExecutorIdIsSet(true);
        }
        if (incoming.get(2)) {
          struct.startTime = iprot.readI64();
          struct.setStartTimeIsSet(true);
        }
        if (incoming.get(3)) {
          struct.endTime = iprot.readI64();
          struct.setEndTimeIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class peekNextNotNullValue_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("peekNextNotNullValue_result");

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

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new peekNextNotNullValue_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new peekNextNotNullValue_resultTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success; // required

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

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByName(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRING          , true)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(peekNextNotNullValue_result.class, metaDataMap);
    }

    public peekNextNotNullValue_result() {
    }

    public peekNextNotNullValue_result(
      java.nio.ByteBuffer success)
    {
      this();
      this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    /**
     * Performs a deep copy on other.
     */
    public peekNextNotNullValue_result(peekNextNotNullValue_result other) {
      if (other.isSetSuccess()) {
        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
      }
    }

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

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

    public byte[] getSuccess() {
      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
      return success == null ? null : success.array();
    }

    public java.nio.ByteBuffer bufferForSuccess() {
      return org.apache.thrift.TBaseHelper.copyBinary(success);
    }

    public peekNextNotNullValue_result setSuccess(byte[] success) {
      this.success = success == null ? (java.nio.ByteBuffer)null     : java.nio.ByteBuffer.wrap(success.clone());
      return this;
    }

    public peekNextNotNullValue_result setSuccess(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer success) {
      this.success = org.apache.thrift.TBaseHelper.copyBinary(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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          if (value instanceof byte[]) {
            setSuccess((byte[])value);
          } else {
            setSuccess((java.nio.ByteBuffer)value);
          }
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

    @Override
    public boolean equals(java.lang.Object that) {
      if (that instanceof peekNextNotNullValue_result)
        return this.equals((peekNextNotNullValue_result)that);
      return false;
    }

    public boolean equals(peekNextNotNullValue_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

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

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

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("peekNextNotNullValue_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.success, 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, java.lang.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 peekNextNotNullValue_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public peekNextNotNullValue_resultStandardScheme getScheme() {
        return new peekNextNotNullValue_resultStandardScheme();
      }
    }

    private static class peekNextNotNullValue_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, peekNextNotNullValue_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.STRING) {
                struct.success = iprot.readBinary();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();

        // 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, peekNextNotNullValue_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class peekNextNotNullValue_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public peekNextNotNullValue_resultTupleScheme getScheme() {
        return new peekNextNotNullValue_resultTupleScheme();
      }
    }

    private static class peekNextNotNullValue_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, peekNextNotNullValue_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = iprot.readBinary();
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

}