Package elephantdb.generated.keyval

Source Code of elephantdb.generated.keyval.ElephantDB$AsyncClient$Factory

/**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*  @generated
*/
package elephantdb.generated.keyval;

import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

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

public class ElephantDB {

  public interface Iface extends elephantdb.generated.ElephantDBShared.Iface {

    public elephantdb.generated.Value get(String domain, ByteBuffer key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException;

    public Map<ByteBuffer,elephantdb.generated.Value> multiGet(String domain, Set<ByteBuffer> key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException;

    public Map<ByteBuffer,elephantdb.generated.Value> directMultiGet(String domain, Set<ByteBuffer> key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException;

  }

  public interface AsyncIface extends elephantdb.generated.ElephantDBShared .AsyncIface {

    public void get(String domain, ByteBuffer key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void multiGet(String domain, Set<ByteBuffer> key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void directMultiGet(String domain, Set<ByteBuffer> key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

  }

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

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

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

    public elephantdb.generated.Value get(String domain, ByteBuffer key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      send_get(domain, key);
      return recv_get();
    }

    public void send_get(String domain, ByteBuffer key) throws org.apache.thrift.TException
    {
      get_args args = new get_args();
      args.set_domain(domain);
      args.set_key(key);
      sendBase("get", args);
    }

    public elephantdb.generated.Value recv_get() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      get_result result = new get_result();
      receiveBase(result, "get");
      if (result.is_set_success()) {
        return result.success;
      }
      if (result.dnfe != null) {
        throw result.dnfe;
      }
      if (result.hde != null) {
        throw result.hde;
      }
      if (result.dnle != null) {
        throw result.dnle;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "get failed: unknown result");
    }

    public Map<ByteBuffer,elephantdb.generated.Value> multiGet(String domain, Set<ByteBuffer> key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      send_multiGet(domain, key);
      return recv_multiGet();
    }

    public void send_multiGet(String domain, Set<ByteBuffer> key) throws org.apache.thrift.TException
    {
      multiGet_args args = new multiGet_args();
      args.set_domain(domain);
      args.set_key(key);
      sendBase("multiGet", args);
    }

    public Map<ByteBuffer,elephantdb.generated.Value> recv_multiGet() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      multiGet_result result = new multiGet_result();
      receiveBase(result, "multiGet");
      if (result.is_set_success()) {
        return result.success;
      }
      if (result.dnfe != null) {
        throw result.dnfe;
      }
      if (result.hde != null) {
        throw result.hde;
      }
      if (result.dnle != null) {
        throw result.dnle;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "multiGet failed: unknown result");
    }

    public Map<ByteBuffer,elephantdb.generated.Value> directMultiGet(String domain, Set<ByteBuffer> key) throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      send_directMultiGet(domain, key);
      return recv_directMultiGet();
    }

    public void send_directMultiGet(String domain, Set<ByteBuffer> key) throws org.apache.thrift.TException
    {
      directMultiGet_args args = new directMultiGet_args();
      args.set_domain(domain);
      args.set_key(key);
      sendBase("directMultiGet", args);
    }

    public Map<ByteBuffer,elephantdb.generated.Value> recv_directMultiGet() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException
    {
      directMultiGet_result result = new directMultiGet_result();
      receiveBase(result, "directMultiGet");
      if (result.is_set_success()) {
        return result.success;
      }
      if (result.dnfe != null) {
        throw result.dnfe;
      }
      if (result.hde != null) {
        throw result.hde;
      }
      if (result.dnle != null) {
        throw result.dnle;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "directMultiGet failed: unknown result");
    }

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

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

    public void get(String domain, ByteBuffer key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      get_call method_call = new get_call(domain, key, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class get_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String domain;
      private ByteBuffer key;
      public get_call(String domain, ByteBuffer key, 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.domain = domain;
        this.key = key;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("get", org.apache.thrift.protocol.TMessageType.CALL, 0));
        get_args args = new get_args();
        args.set_domain(domain);
        args.set_key(key);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public elephantdb.generated.Value getResult() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_get();
      }
    }

    public void multiGet(String domain, Set<ByteBuffer> key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      multiGet_call method_call = new multiGet_call(domain, key, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class multiGet_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String domain;
      private Set<ByteBuffer> key;
      public multiGet_call(String domain, Set<ByteBuffer> key, 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.domain = domain;
        this.key = key;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("multiGet", org.apache.thrift.protocol.TMessageType.CALL, 0));
        multiGet_args args = new multiGet_args();
        args.set_domain(domain);
        args.set_key(key);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Map<ByteBuffer,elephantdb.generated.Value> getResult() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_multiGet();
      }
    }

    public void directMultiGet(String domain, Set<ByteBuffer> key, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      directMultiGet_call method_call = new directMultiGet_call(domain, key, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class directMultiGet_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String domain;
      private Set<ByteBuffer> key;
      public directMultiGet_call(String domain, Set<ByteBuffer> key, 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.domain = domain;
        this.key = key;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("directMultiGet", org.apache.thrift.protocol.TMessageType.CALL, 0));
        directMultiGet_args args = new directMultiGet_args();
        args.set_domain(domain);
        args.set_key(key);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Map<ByteBuffer,elephantdb.generated.Value> getResult() throws elephantdb.generated.DomainNotFoundException, elephantdb.generated.HostsDownException, elephantdb.generated.DomainNotLoadedException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_directMultiGet();
      }
    }

  }

  public static class Processor<I extends Iface> extends elephantdb.generated.ElephantDBShared.Processor<I> implements org.apache.thrift.TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    }

    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("get", new get());
      processMap.put("multiGet", new multiGet());
      processMap.put("directMultiGet", new directMultiGet());
      return processMap;
    }

    public static class get<I extends Iface> extends org.apache.thrift.ProcessFunction<I, get_args> {
      public get() {
        super("get");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public get_result getResult(I iface, get_args args) throws org.apache.thrift.TException {
        get_result result = new get_result();
        try {
          result.success = iface.get(args.domain, args.key);
        } catch (elephantdb.generated.DomainNotFoundException dnfe) {
          result.dnfe = dnfe;
        } catch (elephantdb.generated.HostsDownException hde) {
          result.hde = hde;
        } catch (elephantdb.generated.DomainNotLoadedException dnle) {
          result.dnle = dnle;
        }
        return result;
      }
    }

    public static class multiGet<I extends Iface> extends org.apache.thrift.ProcessFunction<I, multiGet_args> {
      public multiGet() {
        super("multiGet");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public multiGet_result getResult(I iface, multiGet_args args) throws org.apache.thrift.TException {
        multiGet_result result = new multiGet_result();
        try {
          result.success = iface.multiGet(args.domain, args.key);
        } catch (elephantdb.generated.DomainNotFoundException dnfe) {
          result.dnfe = dnfe;
        } catch (elephantdb.generated.HostsDownException hde) {
          result.hde = hde;
        } catch (elephantdb.generated.DomainNotLoadedException dnle) {
          result.dnle = dnle;
        }
        return result;
      }
    }

    public static class directMultiGet<I extends Iface> extends org.apache.thrift.ProcessFunction<I, directMultiGet_args> {
      public directMultiGet() {
        super("directMultiGet");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public directMultiGet_result getResult(I iface, directMultiGet_args args) throws org.apache.thrift.TException {
        directMultiGet_result result = new directMultiGet_result();
        try {
          result.success = iface.directMultiGet(args.domain, args.key);
        } catch (elephantdb.generated.DomainNotFoundException dnfe) {
          result.dnfe = dnfe;
        } catch (elephantdb.generated.HostsDownException hde) {
          result.hde = hde;
        } catch (elephantdb.generated.DomainNotLoadedException dnle) {
          result.dnle = dnle;
        }
        return result;
      }
    }

  }

  public static class AsyncProcessor<I extends AsyncIface> extends elephantdb.generated.ElephantDBShared.AsyncProcessor<I> {
    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
    }

    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      processMap.put("get", new get());
      processMap.put("multiGet", new multiGet());
      processMap.put("directMultiGet", new directMultiGet());
      return processMap;
    }

    public static class get<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, get_args, elephantdb.generated.Value> {
      public get() {
        super("get");
      }

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

      public AsyncMethodCallback<elephantdb.generated.Value> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<elephantdb.generated.Value>() {
          public void onComplete(elephantdb.generated.Value o) {
            get_result result = new get_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            get_result result = new get_result();
            if (e instanceof elephantdb.generated.DomainNotFoundException) {
                        result.dnfe = (elephantdb.generated.DomainNotFoundException) e;
                        result.set_dnfe_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.HostsDownException) {
                        result.hde = (elephantdb.generated.HostsDownException) e;
                        result.set_hde_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.DomainNotLoadedException) {
                        result.dnle = (elephantdb.generated.DomainNotLoadedException) e;
                        result.set_dnle_isSet(true);
                        msg = result;
            }
             else
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, get_args args, org.apache.thrift.async.AsyncMethodCallback<elephantdb.generated.Value> resultHandler) throws TException {
        iface.get(args.domain, args.key,resultHandler);
      }
    }

    public static class multiGet<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, multiGet_args, Map<ByteBuffer,elephantdb.generated.Value>> {
      public multiGet() {
        super("multiGet");
      }

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

      public AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>>() {
          public void onComplete(Map<ByteBuffer,elephantdb.generated.Value> o) {
            multiGet_result result = new multiGet_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            multiGet_result result = new multiGet_result();
            if (e instanceof elephantdb.generated.DomainNotFoundException) {
                        result.dnfe = (elephantdb.generated.DomainNotFoundException) e;
                        result.set_dnfe_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.HostsDownException) {
                        result.hde = (elephantdb.generated.HostsDownException) e;
                        result.set_hde_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.DomainNotLoadedException) {
                        result.dnle = (elephantdb.generated.DomainNotLoadedException) e;
                        result.set_dnle_isSet(true);
                        msg = result;
            }
             else
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, multiGet_args args, org.apache.thrift.async.AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>> resultHandler) throws TException {
        iface.multiGet(args.domain, args.key,resultHandler);
      }
    }

    public static class directMultiGet<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, directMultiGet_args, Map<ByteBuffer,elephantdb.generated.Value>> {
      public directMultiGet() {
        super("directMultiGet");
      }

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

      public AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>>() {
          public void onComplete(Map<ByteBuffer,elephantdb.generated.Value> o) {
            directMultiGet_result result = new directMultiGet_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            directMultiGet_result result = new directMultiGet_result();
            if (e instanceof elephantdb.generated.DomainNotFoundException) {
                        result.dnfe = (elephantdb.generated.DomainNotFoundException) e;
                        result.set_dnfe_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.HostsDownException) {
                        result.hde = (elephantdb.generated.HostsDownException) e;
                        result.set_hde_isSet(true);
                        msg = result;
            }
            else             if (e instanceof elephantdb.generated.DomainNotLoadedException) {
                        result.dnle = (elephantdb.generated.DomainNotLoadedException) e;
                        result.set_dnle_isSet(true);
                        msg = result;
            }
             else
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, directMultiGet_args args, org.apache.thrift.async.AsyncMethodCallback<Map<ByteBuffer,elephantdb.generated.Value>> resultHandler) throws TException {
        iface.directMultiGet(args.domain, args.key,resultHandler);
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRING, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new get_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new get_argsTupleSchemeFactory());
    }

    private String domain; // required
    private ByteBuffer key; // 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 {
      DOMAIN((short)1, "domain"),
      KEY((short)2, "key");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DOMAIN
            return DOMAIN;
          case 2: // KEY
            return KEY;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_args.class, metaDataMap);
    }

    public get_args() {
    }

    public get_args(
      String domain,
      ByteBuffer key)
    {
      this();
      this.domain = domain;
      this.key = key;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public get_args(get_args other) {
      if (other.is_set_domain()) {
        this.domain = other.domain;
      }
      if (other.is_set_key()) {
        this.key = org.apache.thrift.TBaseHelper.copyBinary(other.key);
;
      }
    }

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

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

    public String get_domain() {
      return this.domain;
    }

    public void set_domain(String domain) {
      this.domain = domain;
    }

    public void unset_domain() {
      this.domain = null;
    }

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

    public void set_domain_isSet(boolean value) {
      if (!value) {
        this.domain = null;
      }
    }

    public byte[] get_key() {
      set_key(org.apache.thrift.TBaseHelper.rightSize(key));
      return key == null ? null : key.array();
    }

    public ByteBuffer buffer_for_key() {
      return key;
    }

    public void set_key(byte[] key) {
      set_key(key == null ? (ByteBuffer)null : ByteBuffer.wrap(key));
    }

    public void set_key(ByteBuffer key) {
      this.key = key;
    }

    public void unset_key() {
      this.key = null;
    }

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

    public void set_key_isSet(boolean value) {
      if (!value) {
        this.key = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DOMAIN:
        if (value == null) {
          unset_domain();
        } else {
          set_domain((String)value);
        }
        break;

      case KEY:
        if (value == null) {
          unset_key();
        } else {
          set_key((ByteBuffer)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DOMAIN:
        return get_domain();

      case KEY:
        return get_key();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DOMAIN:
        return is_set_domain();
      case KEY:
        return is_set_key();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_domain = true && this.is_set_domain();
      boolean that_present_domain = true && that.is_set_domain();
      if (this_present_domain || that_present_domain) {
        if (!(this_present_domain && that_present_domain))
          return false;
        if (!this.domain.equals(that.domain))
          return false;
      }

      boolean this_present_key = true && this.is_set_key();
      boolean that_present_key = true && that.is_set_key();
      if (this_present_key || that_present_key) {
        if (!(this_present_key && that_present_key))
          return false;
        if (!this.key.equals(that.key))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_domain = true && (is_set_domain());
      builder.append(present_domain);
      if (present_domain)
        builder.append(domain);

      boolean present_key = true && (is_set_key());
      builder.append(present_key);
      if (present_key)
        builder.append(key);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_domain()).compareTo(other.is_set_domain());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_domain()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_key()).compareTo(other.is_set_key());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_key()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

      sb.append("domain:");
      if (this.domain == null) {
        sb.append("null");
      } else {
        sb.append(this.domain);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("key:");
      if (this.key == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.key, sb);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

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

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        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 get_argsStandardSchemeFactory implements SchemeFactory {
      public get_argsStandardScheme getScheme() {
        return new get_argsStandardScheme();
      }
    }

    private static class get_argsStandardScheme extends StandardScheme<get_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, get_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: // DOMAIN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.domain = iprot.readString();
                struct.set_domain_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // KEY
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.key = iprot.readBinary();
                struct.set_key_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

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

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.domain != null) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          oprot.writeFieldEnd();
        }
        if (struct.key != null) {
          oprot.writeFieldBegin(KEY_FIELD_DESC);
          oprot.writeBinary(struct.key);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class get_argsTupleSchemeFactory implements SchemeFactory {
      public get_argsTupleScheme getScheme() {
        return new get_argsTupleScheme();
      }
    }

    private static class get_argsTupleScheme extends TupleScheme<get_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_domain()) {
          optionals.set(0);
        }
        if (struct.is_set_key()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.is_set_domain()) {
          oprot.writeString(struct.domain);
        }
        if (struct.is_set_key()) {
          oprot.writeBinary(struct.key);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, get_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.domain = iprot.readString();
          struct.set_domain_isSet(true);
        }
        if (incoming.get(1)) {
          struct.key = iprot.readBinary();
          struct.set_key_isSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField DNFE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnfe", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField HDE_FIELD_DESC = new org.apache.thrift.protocol.TField("hde", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField DNLE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnle", org.apache.thrift.protocol.TType.STRUCT, (short)3);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new get_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new get_resultTupleSchemeFactory());
    }

    private elephantdb.generated.Value success; // required
    private elephantdb.generated.DomainNotFoundException dnfe; // required
    private elephantdb.generated.HostsDownException hde; // required
    private elephantdb.generated.DomainNotLoadedException dnle; // 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"),
      DNFE((short)1, "dnfe"),
      HDE((short)2, "hde"),
      DNLE((short)3, "dnle");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // DNFE
            return DNFE;
          case 2: // HDE
            return HDE;
          case 3: // DNLE
            return DNLE;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, elephantdb.generated.Value.class)));
      tmpMap.put(_Fields.DNFE, new org.apache.thrift.meta_data.FieldMetaData("dnfe", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.HDE, new org.apache.thrift.meta_data.FieldMetaData("hde", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DNLE, new org.apache.thrift.meta_data.FieldMetaData("dnle", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(get_result.class, metaDataMap);
    }

    public get_result() {
    }

    public get_result(
      elephantdb.generated.Value success,
      elephantdb.generated.DomainNotFoundException dnfe,
      elephantdb.generated.HostsDownException hde,
      elephantdb.generated.DomainNotLoadedException dnle)
    {
      this();
      this.success = success;
      this.dnfe = dnfe;
      this.hde = hde;
      this.dnle = dnle;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public get_result(get_result other) {
      if (other.is_set_success()) {
        this.success = new elephantdb.generated.Value(other.success);
      }
      if (other.is_set_dnfe()) {
        this.dnfe = new elephantdb.generated.DomainNotFoundException(other.dnfe);
      }
      if (other.is_set_hde()) {
        this.hde = new elephantdb.generated.HostsDownException(other.hde);
      }
      if (other.is_set_dnle()) {
        this.dnle = new elephantdb.generated.DomainNotLoadedException(other.dnle);
      }
    }

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

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

    public elephantdb.generated.Value get_success() {
      return this.success;
    }

    public void set_success(elephantdb.generated.Value success) {
      this.success = success;
    }

    public void unset_success() {
      this.success = null;
    }

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

    public void set_success_isSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public elephantdb.generated.DomainNotFoundException get_dnfe() {
      return this.dnfe;
    }

    public void set_dnfe(elephantdb.generated.DomainNotFoundException dnfe) {
      this.dnfe = dnfe;
    }

    public void unset_dnfe() {
      this.dnfe = null;
    }

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

    public void set_dnfe_isSet(boolean value) {
      if (!value) {
        this.dnfe = null;
      }
    }

    public elephantdb.generated.HostsDownException get_hde() {
      return this.hde;
    }

    public void set_hde(elephantdb.generated.HostsDownException hde) {
      this.hde = hde;
    }

    public void unset_hde() {
      this.hde = null;
    }

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

    public void set_hde_isSet(boolean value) {
      if (!value) {
        this.hde = null;
      }
    }

    public elephantdb.generated.DomainNotLoadedException get_dnle() {
      return this.dnle;
    }

    public void set_dnle(elephantdb.generated.DomainNotLoadedException dnle) {
      this.dnle = dnle;
    }

    public void unset_dnle() {
      this.dnle = null;
    }

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

    public void set_dnle_isSet(boolean value) {
      if (!value) {
        this.dnle = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unset_success();
        } else {
          set_success((elephantdb.generated.Value)value);
        }
        break;

      case DNFE:
        if (value == null) {
          unset_dnfe();
        } else {
          set_dnfe((elephantdb.generated.DomainNotFoundException)value);
        }
        break;

      case HDE:
        if (value == null) {
          unset_hde();
        } else {
          set_hde((elephantdb.generated.HostsDownException)value);
        }
        break;

      case DNLE:
        if (value == null) {
          unset_dnle();
        } else {
          set_dnle((elephantdb.generated.DomainNotLoadedException)value);
        }
        break;

      }
    }

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

      case DNFE:
        return get_dnfe();

      case HDE:
        return get_hde();

      case DNLE:
        return get_dnle();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return is_set_success();
      case DNFE:
        return is_set_dnfe();
      case HDE:
        return is_set_hde();
      case DNLE:
        return is_set_dnle();
      }
      throw new IllegalStateException();
    }

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

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

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

      boolean this_present_dnfe = true && this.is_set_dnfe();
      boolean that_present_dnfe = true && that.is_set_dnfe();
      if (this_present_dnfe || that_present_dnfe) {
        if (!(this_present_dnfe && that_present_dnfe))
          return false;
        if (!this.dnfe.equals(that.dnfe))
          return false;
      }

      boolean this_present_hde = true && this.is_set_hde();
      boolean that_present_hde = true && that.is_set_hde();
      if (this_present_hde || that_present_hde) {
        if (!(this_present_hde && that_present_hde))
          return false;
        if (!this.hde.equals(that.hde))
          return false;
      }

      boolean this_present_dnle = true && this.is_set_dnle();
      boolean that_present_dnle = true && that.is_set_dnle();
      if (this_present_dnle || that_present_dnle) {
        if (!(this_present_dnle && that_present_dnle))
          return false;
        if (!this.dnle.equals(that.dnle))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_success = true && (is_set_success());
      builder.append(present_success);
      if (present_success)
        builder.append(success);

      boolean present_dnfe = true && (is_set_dnfe());
      builder.append(present_dnfe);
      if (present_dnfe)
        builder.append(dnfe);

      boolean present_hde = true && (is_set_hde());
      builder.append(present_hde);
      if (present_hde)
        builder.append(hde);

      boolean present_dnle = true && (is_set_dnle());
      builder.append(present_dnle);
      if (present_dnle)
        builder.append(dnle);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_success()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnfe()).compareTo(other.is_set_dnfe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnfe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnfe, other.dnfe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_hde()).compareTo(other.is_set_hde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_hde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hde, other.hde);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnle()).compareTo(other.is_set_dnle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnle()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnle, other.dnle);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnfe:");
      if (this.dnfe == null) {
        sb.append("null");
      } else {
        sb.append(this.dnfe);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("hde:");
      if (this.hde == null) {
        sb.append("null");
      } else {
        sb.append(this.hde);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnle:");
      if (this.dnle == null) {
        sb.append("null");
      } else {
        sb.append(this.dnle);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

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

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

    private static class get_resultStandardSchemeFactory implements SchemeFactory {
      public get_resultStandardScheme getScheme() {
        return new get_resultStandardScheme();
      }
    }

    private static class get_resultStandardScheme extends StandardScheme<get_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, get_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 elephantdb.generated.Value();
                struct.success.read(iprot);
                struct.set_success_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // DNFE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnfe = new elephantdb.generated.DomainNotFoundException();
                struct.dnfe.read(iprot);
                struct.set_dnfe_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // HDE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.hde = new elephantdb.generated.HostsDownException();
                struct.hde.read(iprot);
                struct.set_hde_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // DNLE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnle = new elephantdb.generated.DomainNotLoadedException();
                struct.dnle.read(iprot);
                struct.set_dnle_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

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

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.dnfe != null) {
          oprot.writeFieldBegin(DNFE_FIELD_DESC);
          struct.dnfe.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.hde != null) {
          oprot.writeFieldBegin(HDE_FIELD_DESC);
          struct.hde.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.dnle != null) {
          oprot.writeFieldBegin(DNLE_FIELD_DESC);
          struct.dnle.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class get_resultTupleSchemeFactory implements SchemeFactory {
      public get_resultTupleScheme getScheme() {
        return new get_resultTupleScheme();
      }
    }

    private static class get_resultTupleScheme extends TupleScheme<get_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_success()) {
          optionals.set(0);
        }
        if (struct.is_set_dnfe()) {
          optionals.set(1);
        }
        if (struct.is_set_hde()) {
          optionals.set(2);
        }
        if (struct.is_set_dnle()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.is_set_success()) {
          struct.success.write(oprot);
        }
        if (struct.is_set_dnfe()) {
          struct.dnfe.write(oprot);
        }
        if (struct.is_set_hde()) {
          struct.hde.write(oprot);
        }
        if (struct.is_set_dnle()) {
          struct.dnle.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, get_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.success = new elephantdb.generated.Value();
          struct.success.read(iprot);
          struct.set_success_isSet(true);
        }
        if (incoming.get(1)) {
          struct.dnfe = new elephantdb.generated.DomainNotFoundException();
          struct.dnfe.read(iprot);
          struct.set_dnfe_isSet(true);
        }
        if (incoming.get(2)) {
          struct.hde = new elephantdb.generated.HostsDownException();
          struct.hde.read(iprot);
          struct.set_hde_isSet(true);
        }
        if (incoming.get(3)) {
          struct.dnle = new elephantdb.generated.DomainNotLoadedException();
          struct.dnle.read(iprot);
          struct.set_dnle_isSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.SET, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new multiGet_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new multiGet_argsTupleSchemeFactory());
    }

    private String domain; // required
    private Set<ByteBuffer> key; // 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 {
      DOMAIN((short)1, "domain"),
      KEY((short)2, "key");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DOMAIN
            return DOMAIN;
          case 2: // KEY
            return KEY;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", 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              , true))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(multiGet_args.class, metaDataMap);
    }

    public multiGet_args() {
    }

    public multiGet_args(
      String domain,
      Set<ByteBuffer> key)
    {
      this();
      this.domain = domain;
      this.key = key;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public multiGet_args(multiGet_args other) {
      if (other.is_set_domain()) {
        this.domain = other.domain;
      }
      if (other.is_set_key()) {
        Set<ByteBuffer> __this__key = new HashSet<ByteBuffer>(other.key);
        this.key = __this__key;
      }
    }

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

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

    public String get_domain() {
      return this.domain;
    }

    public void set_domain(String domain) {
      this.domain = domain;
    }

    public void unset_domain() {
      this.domain = null;
    }

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

    public void set_domain_isSet(boolean value) {
      if (!value) {
        this.domain = null;
      }
    }

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

    public java.util.Iterator<ByteBuffer> get_key_iterator() {
      return (this.key == null) ? null : this.key.iterator();
    }

    public void add_to_key(ByteBuffer elem) {
      if (this.key == null) {
        this.key = new HashSet<ByteBuffer>();
      }
      this.key.add(elem);
    }

    public Set<ByteBuffer> get_key() {
      return this.key;
    }

    public void set_key(Set<ByteBuffer> key) {
      this.key = key;
    }

    public void unset_key() {
      this.key = null;
    }

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

    public void set_key_isSet(boolean value) {
      if (!value) {
        this.key = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DOMAIN:
        if (value == null) {
          unset_domain();
        } else {
          set_domain((String)value);
        }
        break;

      case KEY:
        if (value == null) {
          unset_key();
        } else {
          set_key((Set<ByteBuffer>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DOMAIN:
        return get_domain();

      case KEY:
        return get_key();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DOMAIN:
        return is_set_domain();
      case KEY:
        return is_set_key();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_domain = true && this.is_set_domain();
      boolean that_present_domain = true && that.is_set_domain();
      if (this_present_domain || that_present_domain) {
        if (!(this_present_domain && that_present_domain))
          return false;
        if (!this.domain.equals(that.domain))
          return false;
      }

      boolean this_present_key = true && this.is_set_key();
      boolean that_present_key = true && that.is_set_key();
      if (this_present_key || that_present_key) {
        if (!(this_present_key && that_present_key))
          return false;
        if (!this.key.equals(that.key))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_domain = true && (is_set_domain());
      builder.append(present_domain);
      if (present_domain)
        builder.append(domain);

      boolean present_key = true && (is_set_key());
      builder.append(present_key);
      if (present_key)
        builder.append(key);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_domain()).compareTo(other.is_set_domain());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_domain()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_key()).compareTo(other.is_set_key());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_key()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

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

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

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

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

    private static class multiGet_argsStandardSchemeFactory implements SchemeFactory {
      public multiGet_argsStandardScheme getScheme() {
        return new multiGet_argsStandardScheme();
      }
    }

    private static class multiGet_argsStandardScheme extends StandardScheme<multiGet_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, multiGet_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: // DOMAIN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.domain = iprot.readString();
                struct.set_domain_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // KEY
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin();
                  struct.key = new HashSet<ByteBuffer>(2*_set0.size);
                  for (int _i1 = 0; _i1 < _set0.size; ++_i1)
                  {
                    ByteBuffer _elem2;
                    _elem2 = iprot.readBinary();
                    struct.key.add(_elem2);
                  }
                  iprot.readSetEnd();
                }
                struct.set_key_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

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

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.domain != null) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          oprot.writeFieldEnd();
        }
        if (struct.key != null) {
          oprot.writeFieldBegin(KEY_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.key.size()));
            for (ByteBuffer _iter3 : struct.key)
            {
              oprot.writeBinary(_iter3);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class multiGet_argsTupleSchemeFactory implements SchemeFactory {
      public multiGet_argsTupleScheme getScheme() {
        return new multiGet_argsTupleScheme();
      }
    }

    private static class multiGet_argsTupleScheme extends TupleScheme<multiGet_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, multiGet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_domain()) {
          optionals.set(0);
        }
        if (struct.is_set_key()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.is_set_domain()) {
          oprot.writeString(struct.domain);
        }
        if (struct.is_set_key()) {
          {
            oprot.writeI32(struct.key.size());
            for (ByteBuffer _iter4 : struct.key)
            {
              oprot.writeBinary(_iter4);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, multiGet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.domain = iprot.readString();
          struct.set_domain_isSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TSet _set5 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.key = new HashSet<ByteBuffer>(2*_set5.size);
            for (int _i6 = 0; _i6 < _set5.size; ++_i6)
            {
              ByteBuffer _elem7;
              _elem7 = iprot.readBinary();
              struct.key.add(_elem7);
            }
          }
          struct.set_key_isSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
    private static final org.apache.thrift.protocol.TField DNFE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnfe", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField HDE_FIELD_DESC = new org.apache.thrift.protocol.TField("hde", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField DNLE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnle", org.apache.thrift.protocol.TType.STRUCT, (short)3);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new multiGet_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new multiGet_resultTupleSchemeFactory());
    }

    private Map<ByteBuffer,elephantdb.generated.Value> success; // required
    private elephantdb.generated.DomainNotFoundException dnfe; // required
    private elephantdb.generated.HostsDownException hde; // required
    private elephantdb.generated.DomainNotLoadedException dnle; // 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"),
      DNFE((short)1, "dnfe"),
      HDE((short)2, "hde"),
      DNLE((short)3, "dnle");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // DNFE
            return DNFE;
          case 2: // HDE
            return HDE;
          case 3: // DNLE
            return DNLE;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true),
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, elephantdb.generated.Value.class))));
      tmpMap.put(_Fields.DNFE, new org.apache.thrift.meta_data.FieldMetaData("dnfe", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.HDE, new org.apache.thrift.meta_data.FieldMetaData("hde", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DNLE, new org.apache.thrift.meta_data.FieldMetaData("dnle", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(multiGet_result.class, metaDataMap);
    }

    public multiGet_result() {
    }

    public multiGet_result(
      Map<ByteBuffer,elephantdb.generated.Value> success,
      elephantdb.generated.DomainNotFoundException dnfe,
      elephantdb.generated.HostsDownException hde,
      elephantdb.generated.DomainNotLoadedException dnle)
    {
      this();
      this.success = success;
      this.dnfe = dnfe;
      this.hde = hde;
      this.dnle = dnle;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public multiGet_result(multiGet_result other) {
      if (other.is_set_success()) {
        Map<ByteBuffer,elephantdb.generated.Value> __this__success = new HashMap<ByteBuffer,elephantdb.generated.Value>(other.success.size());
        for (Map.Entry<ByteBuffer, elephantdb.generated.Value> other_element : other.success.entrySet()) {

          ByteBuffer other_element_key = other_element.getKey();
          elephantdb.generated.Value other_element_value = other_element.getValue();

          ByteBuffer __this__success_copy_key = org.apache.thrift.TBaseHelper.copyBinary(other_element_key);
;

          elephantdb.generated.Value __this__success_copy_value = new elephantdb.generated.Value(other_element_value);

          __this__success.put(__this__success_copy_key, __this__success_copy_value);
        }
        this.success = __this__success;
      }
      if (other.is_set_dnfe()) {
        this.dnfe = new elephantdb.generated.DomainNotFoundException(other.dnfe);
      }
      if (other.is_set_hde()) {
        this.hde = new elephantdb.generated.HostsDownException(other.hde);
      }
      if (other.is_set_dnle()) {
        this.dnle = new elephantdb.generated.DomainNotLoadedException(other.dnle);
      }
    }

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

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

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

    public void put_to_success(ByteBuffer key, elephantdb.generated.Value val) {
      if (this.success == null) {
        this.success = new HashMap<ByteBuffer,elephantdb.generated.Value>();
      }
      this.success.put(key, val);
    }

    public Map<ByteBuffer,elephantdb.generated.Value> get_success() {
      return this.success;
    }

    public void set_success(Map<ByteBuffer,elephantdb.generated.Value> success) {
      this.success = success;
    }

    public void unset_success() {
      this.success = null;
    }

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

    public void set_success_isSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public elephantdb.generated.DomainNotFoundException get_dnfe() {
      return this.dnfe;
    }

    public void set_dnfe(elephantdb.generated.DomainNotFoundException dnfe) {
      this.dnfe = dnfe;
    }

    public void unset_dnfe() {
      this.dnfe = null;
    }

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

    public void set_dnfe_isSet(boolean value) {
      if (!value) {
        this.dnfe = null;
      }
    }

    public elephantdb.generated.HostsDownException get_hde() {
      return this.hde;
    }

    public void set_hde(elephantdb.generated.HostsDownException hde) {
      this.hde = hde;
    }

    public void unset_hde() {
      this.hde = null;
    }

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

    public void set_hde_isSet(boolean value) {
      if (!value) {
        this.hde = null;
      }
    }

    public elephantdb.generated.DomainNotLoadedException get_dnle() {
      return this.dnle;
    }

    public void set_dnle(elephantdb.generated.DomainNotLoadedException dnle) {
      this.dnle = dnle;
    }

    public void unset_dnle() {
      this.dnle = null;
    }

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

    public void set_dnle_isSet(boolean value) {
      if (!value) {
        this.dnle = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unset_success();
        } else {
          set_success((Map<ByteBuffer,elephantdb.generated.Value>)value);
        }
        break;

      case DNFE:
        if (value == null) {
          unset_dnfe();
        } else {
          set_dnfe((elephantdb.generated.DomainNotFoundException)value);
        }
        break;

      case HDE:
        if (value == null) {
          unset_hde();
        } else {
          set_hde((elephantdb.generated.HostsDownException)value);
        }
        break;

      case DNLE:
        if (value == null) {
          unset_dnle();
        } else {
          set_dnle((elephantdb.generated.DomainNotLoadedException)value);
        }
        break;

      }
    }

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

      case DNFE:
        return get_dnfe();

      case HDE:
        return get_hde();

      case DNLE:
        return get_dnle();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return is_set_success();
      case DNFE:
        return is_set_dnfe();
      case HDE:
        return is_set_hde();
      case DNLE:
        return is_set_dnle();
      }
      throw new IllegalStateException();
    }

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

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

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

      boolean this_present_dnfe = true && this.is_set_dnfe();
      boolean that_present_dnfe = true && that.is_set_dnfe();
      if (this_present_dnfe || that_present_dnfe) {
        if (!(this_present_dnfe && that_present_dnfe))
          return false;
        if (!this.dnfe.equals(that.dnfe))
          return false;
      }

      boolean this_present_hde = true && this.is_set_hde();
      boolean that_present_hde = true && that.is_set_hde();
      if (this_present_hde || that_present_hde) {
        if (!(this_present_hde && that_present_hde))
          return false;
        if (!this.hde.equals(that.hde))
          return false;
      }

      boolean this_present_dnle = true && this.is_set_dnle();
      boolean that_present_dnle = true && that.is_set_dnle();
      if (this_present_dnle || that_present_dnle) {
        if (!(this_present_dnle && that_present_dnle))
          return false;
        if (!this.dnle.equals(that.dnle))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_success = true && (is_set_success());
      builder.append(present_success);
      if (present_success)
        builder.append(success);

      boolean present_dnfe = true && (is_set_dnfe());
      builder.append(present_dnfe);
      if (present_dnfe)
        builder.append(dnfe);

      boolean present_hde = true && (is_set_hde());
      builder.append(present_hde);
      if (present_hde)
        builder.append(hde);

      boolean present_dnle = true && (is_set_dnle());
      builder.append(present_dnle);
      if (present_dnle)
        builder.append(dnle);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_success()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnfe()).compareTo(other.is_set_dnfe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnfe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnfe, other.dnfe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_hde()).compareTo(other.is_set_hde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_hde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hde, other.hde);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnle()).compareTo(other.is_set_dnle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnle()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnle, other.dnle);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnfe:");
      if (this.dnfe == null) {
        sb.append("null");
      } else {
        sb.append(this.dnfe);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("hde:");
      if (this.hde == null) {
        sb.append("null");
      } else {
        sb.append(this.hde);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnle:");
      if (this.dnle == null) {
        sb.append("null");
      } else {
        sb.append(this.dnle);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

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

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

    private static class multiGet_resultStandardSchemeFactory implements SchemeFactory {
      public multiGet_resultStandardScheme getScheme() {
        return new multiGet_resultStandardScheme();
      }
    }

    private static class multiGet_resultStandardScheme extends StandardScheme<multiGet_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, multiGet_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 _map8 = iprot.readMapBegin();
                  struct.success = new HashMap<ByteBuffer,elephantdb.generated.Value>(2*_map8.size);
                  for (int _i9 = 0; _i9 < _map8.size; ++_i9)
                  {
                    ByteBuffer _key10;
                    elephantdb.generated.Value _val11;
                    _key10 = iprot.readBinary();
                    _val11 = new elephantdb.generated.Value();
                    _val11.read(iprot);
                    struct.success.put(_key10, _val11);
                  }
                  iprot.readMapEnd();
                }
                struct.set_success_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // DNFE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnfe = new elephantdb.generated.DomainNotFoundException();
                struct.dnfe.read(iprot);
                struct.set_dnfe_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // HDE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.hde = new elephantdb.generated.HostsDownException();
                struct.hde.read(iprot);
                struct.set_hde_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // DNLE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnle = new elephantdb.generated.DomainNotLoadedException();
                struct.dnle.read(iprot);
                struct.set_dnle_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, multiGet_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.STRUCT, struct.success.size()));
            for (Map.Entry<ByteBuffer, elephantdb.generated.Value> _iter12 : struct.success.entrySet())
            {
              oprot.writeBinary(_iter12.getKey());
              _iter12.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.dnfe != null) {
          oprot.writeFieldBegin(DNFE_FIELD_DESC);
          struct.dnfe.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.hde != null) {
          oprot.writeFieldBegin(HDE_FIELD_DESC);
          struct.hde.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.dnle != null) {
          oprot.writeFieldBegin(DNLE_FIELD_DESC);
          struct.dnle.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class multiGet_resultTupleSchemeFactory implements SchemeFactory {
      public multiGet_resultTupleScheme getScheme() {
        return new multiGet_resultTupleScheme();
      }
    }

    private static class multiGet_resultTupleScheme extends TupleScheme<multiGet_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, multiGet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_success()) {
          optionals.set(0);
        }
        if (struct.is_set_dnfe()) {
          optionals.set(1);
        }
        if (struct.is_set_hde()) {
          optionals.set(2);
        }
        if (struct.is_set_dnle()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.is_set_success()) {
          {
            oprot.writeI32(struct.success.size());
            for (Map.Entry<ByteBuffer, elephantdb.generated.Value> _iter13 : struct.success.entrySet())
            {
              oprot.writeBinary(_iter13.getKey());
              _iter13.getValue().write(oprot);
            }
          }
        }
        if (struct.is_set_dnfe()) {
          struct.dnfe.write(oprot);
        }
        if (struct.is_set_hde()) {
          struct.hde.write(oprot);
        }
        if (struct.is_set_dnle()) {
          struct.dnle.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, multiGet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new HashMap<ByteBuffer,elephantdb.generated.Value>(2*_map14.size);
            for (int _i15 = 0; _i15 < _map14.size; ++_i15)
            {
              ByteBuffer _key16;
              elephantdb.generated.Value _val17;
              _key16 = iprot.readBinary();
              _val17 = new elephantdb.generated.Value();
              _val17.read(iprot);
              struct.success.put(_key16, _val17);
            }
          }
          struct.set_success_isSet(true);
        }
        if (incoming.get(1)) {
          struct.dnfe = new elephantdb.generated.DomainNotFoundException();
          struct.dnfe.read(iprot);
          struct.set_dnfe_isSet(true);
        }
        if (incoming.get(2)) {
          struct.hde = new elephantdb.generated.HostsDownException();
          struct.hde.read(iprot);
          struct.set_hde_isSet(true);
        }
        if (incoming.get(3)) {
          struct.dnle = new elephantdb.generated.DomainNotLoadedException();
          struct.dnle.read(iprot);
          struct.set_dnle_isSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField DOMAIN_FIELD_DESC = new org.apache.thrift.protocol.TField("domain", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.SET, (short)2);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new directMultiGet_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new directMultiGet_argsTupleSchemeFactory());
    }

    private String domain; // required
    private Set<ByteBuffer> key; // 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 {
      DOMAIN((short)1, "domain"),
      KEY((short)2, "key");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // DOMAIN
            return DOMAIN;
          case 2: // KEY
            return KEY;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.DOMAIN, new org.apache.thrift.meta_data.FieldMetaData("domain", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", 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              , true))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(directMultiGet_args.class, metaDataMap);
    }

    public directMultiGet_args() {
    }

    public directMultiGet_args(
      String domain,
      Set<ByteBuffer> key)
    {
      this();
      this.domain = domain;
      this.key = key;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public directMultiGet_args(directMultiGet_args other) {
      if (other.is_set_domain()) {
        this.domain = other.domain;
      }
      if (other.is_set_key()) {
        Set<ByteBuffer> __this__key = new HashSet<ByteBuffer>(other.key);
        this.key = __this__key;
      }
    }

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

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

    public String get_domain() {
      return this.domain;
    }

    public void set_domain(String domain) {
      this.domain = domain;
    }

    public void unset_domain() {
      this.domain = null;
    }

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

    public void set_domain_isSet(boolean value) {
      if (!value) {
        this.domain = null;
      }
    }

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

    public java.util.Iterator<ByteBuffer> get_key_iterator() {
      return (this.key == null) ? null : this.key.iterator();
    }

    public void add_to_key(ByteBuffer elem) {
      if (this.key == null) {
        this.key = new HashSet<ByteBuffer>();
      }
      this.key.add(elem);
    }

    public Set<ByteBuffer> get_key() {
      return this.key;
    }

    public void set_key(Set<ByteBuffer> key) {
      this.key = key;
    }

    public void unset_key() {
      this.key = null;
    }

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

    public void set_key_isSet(boolean value) {
      if (!value) {
        this.key = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case DOMAIN:
        if (value == null) {
          unset_domain();
        } else {
          set_domain((String)value);
        }
        break;

      case KEY:
        if (value == null) {
          unset_key();
        } else {
          set_key((Set<ByteBuffer>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case DOMAIN:
        return get_domain();

      case KEY:
        return get_key();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case DOMAIN:
        return is_set_domain();
      case KEY:
        return is_set_key();
      }
      throw new IllegalStateException();
    }

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

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

      boolean this_present_domain = true && this.is_set_domain();
      boolean that_present_domain = true && that.is_set_domain();
      if (this_present_domain || that_present_domain) {
        if (!(this_present_domain && that_present_domain))
          return false;
        if (!this.domain.equals(that.domain))
          return false;
      }

      boolean this_present_key = true && this.is_set_key();
      boolean that_present_key = true && that.is_set_key();
      if (this_present_key || that_present_key) {
        if (!(this_present_key && that_present_key))
          return false;
        if (!this.key.equals(that.key))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_domain = true && (is_set_domain());
      builder.append(present_domain);
      if (present_domain)
        builder.append(domain);

      boolean present_key = true && (is_set_key());
      builder.append(present_key);
      if (present_key)
        builder.append(key);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_domain()).compareTo(other.is_set_domain());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_domain()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.domain, other.domain);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_key()).compareTo(other.is_set_key());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_key()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

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

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

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

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

    private static class directMultiGet_argsStandardSchemeFactory implements SchemeFactory {
      public directMultiGet_argsStandardScheme getScheme() {
        return new directMultiGet_argsStandardScheme();
      }
    }

    private static class directMultiGet_argsStandardScheme extends StandardScheme<directMultiGet_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, directMultiGet_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: // DOMAIN
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.domain = iprot.readString();
                struct.set_domain_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // KEY
              if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
                {
                  org.apache.thrift.protocol.TSet _set18 = iprot.readSetBegin();
                  struct.key = new HashSet<ByteBuffer>(2*_set18.size);
                  for (int _i19 = 0; _i19 < _set18.size; ++_i19)
                  {
                    ByteBuffer _elem20;
                    _elem20 = iprot.readBinary();
                    struct.key.add(_elem20);
                  }
                  iprot.readSetEnd();
                }
                struct.set_key_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

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

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.domain != null) {
          oprot.writeFieldBegin(DOMAIN_FIELD_DESC);
          oprot.writeString(struct.domain);
          oprot.writeFieldEnd();
        }
        if (struct.key != null) {
          oprot.writeFieldBegin(KEY_FIELD_DESC);
          {
            oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.key.size()));
            for (ByteBuffer _iter21 : struct.key)
            {
              oprot.writeBinary(_iter21);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class directMultiGet_argsTupleSchemeFactory implements SchemeFactory {
      public directMultiGet_argsTupleScheme getScheme() {
        return new directMultiGet_argsTupleScheme();
      }
    }

    private static class directMultiGet_argsTupleScheme extends TupleScheme<directMultiGet_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, directMultiGet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_domain()) {
          optionals.set(0);
        }
        if (struct.is_set_key()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.is_set_domain()) {
          oprot.writeString(struct.domain);
        }
        if (struct.is_set_key()) {
          {
            oprot.writeI32(struct.key.size());
            for (ByteBuffer _iter22 : struct.key)
            {
              oprot.writeBinary(_iter22);
            }
          }
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, directMultiGet_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.domain = iprot.readString();
          struct.set_domain_isSet(true);
        }
        if (incoming.get(1)) {
          {
            org.apache.thrift.protocol.TSet _set23 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.key = new HashSet<ByteBuffer>(2*_set23.size);
            for (int _i24 = 0; _i24 < _set23.size; ++_i24)
            {
              ByteBuffer _elem25;
              _elem25 = iprot.readBinary();
              struct.key.add(_elem25);
            }
          }
          struct.set_key_isSet(true);
        }
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
    private static final org.apache.thrift.protocol.TField DNFE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnfe", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField HDE_FIELD_DESC = new org.apache.thrift.protocol.TField("hde", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField DNLE_FIELD_DESC = new org.apache.thrift.protocol.TField("dnle", org.apache.thrift.protocol.TType.STRUCT, (short)3);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new directMultiGet_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new directMultiGet_resultTupleSchemeFactory());
    }

    private Map<ByteBuffer,elephantdb.generated.Value> success; // required
    private elephantdb.generated.DomainNotFoundException dnfe; // required
    private elephantdb.generated.HostsDownException hde; // required
    private elephantdb.generated.DomainNotLoadedException dnle; // 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"),
      DNFE((short)1, "dnfe"),
      HDE((short)2, "hde"),
      DNLE((short)3, "dnle");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

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

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // DNFE
            return DNFE;
          case 2: // HDE
            return HDE;
          case 3: // DNLE
            return DNLE;
          default:
            return null;
        }
      }

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

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

      private final short _thriftId;
      private final String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true),
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, elephantdb.generated.Value.class))));
      tmpMap.put(_Fields.DNFE, new org.apache.thrift.meta_data.FieldMetaData("dnfe", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.HDE, new org.apache.thrift.meta_data.FieldMetaData("hde", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      tmpMap.put(_Fields.DNLE, new org.apache.thrift.meta_data.FieldMetaData("dnle", org.apache.thrift.TFieldRequirementType.DEFAULT,
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(directMultiGet_result.class, metaDataMap);
    }

    public directMultiGet_result() {
    }

    public directMultiGet_result(
      Map<ByteBuffer,elephantdb.generated.Value> success,
      elephantdb.generated.DomainNotFoundException dnfe,
      elephantdb.generated.HostsDownException hde,
      elephantdb.generated.DomainNotLoadedException dnle)
    {
      this();
      this.success = success;
      this.dnfe = dnfe;
      this.hde = hde;
      this.dnle = dnle;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public directMultiGet_result(directMultiGet_result other) {
      if (other.is_set_success()) {
        Map<ByteBuffer,elephantdb.generated.Value> __this__success = new HashMap<ByteBuffer,elephantdb.generated.Value>(other.success.size());
        for (Map.Entry<ByteBuffer, elephantdb.generated.Value> other_element : other.success.entrySet()) {

          ByteBuffer other_element_key = other_element.getKey();
          elephantdb.generated.Value other_element_value = other_element.getValue();

          ByteBuffer __this__success_copy_key = org.apache.thrift.TBaseHelper.copyBinary(other_element_key);
;

          elephantdb.generated.Value __this__success_copy_value = new elephantdb.generated.Value(other_element_value);

          __this__success.put(__this__success_copy_key, __this__success_copy_value);
        }
        this.success = __this__success;
      }
      if (other.is_set_dnfe()) {
        this.dnfe = new elephantdb.generated.DomainNotFoundException(other.dnfe);
      }
      if (other.is_set_hde()) {
        this.hde = new elephantdb.generated.HostsDownException(other.hde);
      }
      if (other.is_set_dnle()) {
        this.dnle = new elephantdb.generated.DomainNotLoadedException(other.dnle);
      }
    }

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

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

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

    public void put_to_success(ByteBuffer key, elephantdb.generated.Value val) {
      if (this.success == null) {
        this.success = new HashMap<ByteBuffer,elephantdb.generated.Value>();
      }
      this.success.put(key, val);
    }

    public Map<ByteBuffer,elephantdb.generated.Value> get_success() {
      return this.success;
    }

    public void set_success(Map<ByteBuffer,elephantdb.generated.Value> success) {
      this.success = success;
    }

    public void unset_success() {
      this.success = null;
    }

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

    public void set_success_isSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public elephantdb.generated.DomainNotFoundException get_dnfe() {
      return this.dnfe;
    }

    public void set_dnfe(elephantdb.generated.DomainNotFoundException dnfe) {
      this.dnfe = dnfe;
    }

    public void unset_dnfe() {
      this.dnfe = null;
    }

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

    public void set_dnfe_isSet(boolean value) {
      if (!value) {
        this.dnfe = null;
      }
    }

    public elephantdb.generated.HostsDownException get_hde() {
      return this.hde;
    }

    public void set_hde(elephantdb.generated.HostsDownException hde) {
      this.hde = hde;
    }

    public void unset_hde() {
      this.hde = null;
    }

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

    public void set_hde_isSet(boolean value) {
      if (!value) {
        this.hde = null;
      }
    }

    public elephantdb.generated.DomainNotLoadedException get_dnle() {
      return this.dnle;
    }

    public void set_dnle(elephantdb.generated.DomainNotLoadedException dnle) {
      this.dnle = dnle;
    }

    public void unset_dnle() {
      this.dnle = null;
    }

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

    public void set_dnle_isSet(boolean value) {
      if (!value) {
        this.dnle = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unset_success();
        } else {
          set_success((Map<ByteBuffer,elephantdb.generated.Value>)value);
        }
        break;

      case DNFE:
        if (value == null) {
          unset_dnfe();
        } else {
          set_dnfe((elephantdb.generated.DomainNotFoundException)value);
        }
        break;

      case HDE:
        if (value == null) {
          unset_hde();
        } else {
          set_hde((elephantdb.generated.HostsDownException)value);
        }
        break;

      case DNLE:
        if (value == null) {
          unset_dnle();
        } else {
          set_dnle((elephantdb.generated.DomainNotLoadedException)value);
        }
        break;

      }
    }

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

      case DNFE:
        return get_dnfe();

      case HDE:
        return get_hde();

      case DNLE:
        return get_dnle();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return is_set_success();
      case DNFE:
        return is_set_dnfe();
      case HDE:
        return is_set_hde();
      case DNLE:
        return is_set_dnle();
      }
      throw new IllegalStateException();
    }

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

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

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

      boolean this_present_dnfe = true && this.is_set_dnfe();
      boolean that_present_dnfe = true && that.is_set_dnfe();
      if (this_present_dnfe || that_present_dnfe) {
        if (!(this_present_dnfe && that_present_dnfe))
          return false;
        if (!this.dnfe.equals(that.dnfe))
          return false;
      }

      boolean this_present_hde = true && this.is_set_hde();
      boolean that_present_hde = true && that.is_set_hde();
      if (this_present_hde || that_present_hde) {
        if (!(this_present_hde && that_present_hde))
          return false;
        if (!this.hde.equals(that.hde))
          return false;
      }

      boolean this_present_dnle = true && this.is_set_dnle();
      boolean that_present_dnle = true && that.is_set_dnle();
      if (this_present_dnle || that_present_dnle) {
        if (!(this_present_dnle && that_present_dnle))
          return false;
        if (!this.dnle.equals(that.dnle))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean present_success = true && (is_set_success());
      builder.append(present_success);
      if (present_success)
        builder.append(success);

      boolean present_dnfe = true && (is_set_dnfe());
      builder.append(present_dnfe);
      if (present_dnfe)
        builder.append(dnfe);

      boolean present_hde = true && (is_set_hde());
      builder.append(present_hde);
      if (present_hde)
        builder.append(hde);

      boolean present_dnle = true && (is_set_dnle());
      builder.append(present_dnle);
      if (present_dnle)
        builder.append(dnle);

      return builder.toHashCode();
    }

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

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_success()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnfe()).compareTo(other.is_set_dnfe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnfe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnfe, other.dnfe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_hde()).compareTo(other.is_set_hde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_hde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hde, other.hde);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(is_set_dnle()).compareTo(other.is_set_dnle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (is_set_dnle()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dnle, other.dnle);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

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

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

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

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

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnfe:");
      if (this.dnfe == null) {
        sb.append("null");
      } else {
        sb.append(this.dnfe);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("hde:");
      if (this.hde == null) {
        sb.append("null");
      } else {
        sb.append(this.hde);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("dnle:");
      if (this.dnle == null) {
        sb.append("null");
      } else {
        sb.append(this.dnle);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

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

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

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

    private static class directMultiGet_resultStandardSchemeFactory implements SchemeFactory {
      public directMultiGet_resultStandardScheme getScheme() {
        return new directMultiGet_resultStandardScheme();
      }
    }

    private static class directMultiGet_resultStandardScheme extends StandardScheme<directMultiGet_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, directMultiGet_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 _map26 = iprot.readMapBegin();
                  struct.success = new HashMap<ByteBuffer,elephantdb.generated.Value>(2*_map26.size);
                  for (int _i27 = 0; _i27 < _map26.size; ++_i27)
                  {
                    ByteBuffer _key28;
                    elephantdb.generated.Value _val29;
                    _key28 = iprot.readBinary();
                    _val29 = new elephantdb.generated.Value();
                    _val29.read(iprot);
                    struct.success.put(_key28, _val29);
                  }
                  iprot.readMapEnd();
                }
                struct.set_success_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // DNFE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnfe = new elephantdb.generated.DomainNotFoundException();
                struct.dnfe.read(iprot);
                struct.set_dnfe_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // HDE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.hde = new elephantdb.generated.HostsDownException();
                struct.hde.read(iprot);
                struct.set_hde_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // DNLE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.dnle = new elephantdb.generated.DomainNotLoadedException();
                struct.dnle.read(iprot);
                struct.set_dnle_isSet(true);
              } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
        struct.validate();
      }

      public void write(org.apache.thrift.protocol.TProtocol oprot, directMultiGet_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.STRUCT, struct.success.size()));
            for (Map.Entry<ByteBuffer, elephantdb.generated.Value> _iter30 : struct.success.entrySet())
            {
              oprot.writeBinary(_iter30.getKey());
              _iter30.getValue().write(oprot);
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
        if (struct.dnfe != null) {
          oprot.writeFieldBegin(DNFE_FIELD_DESC);
          struct.dnfe.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.hde != null) {
          oprot.writeFieldBegin(HDE_FIELD_DESC);
          struct.hde.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.dnle != null) {
          oprot.writeFieldBegin(DNLE_FIELD_DESC);
          struct.dnle.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class directMultiGet_resultTupleSchemeFactory implements SchemeFactory {
      public directMultiGet_resultTupleScheme getScheme() {
        return new directMultiGet_resultTupleScheme();
      }
    }

    private static class directMultiGet_resultTupleScheme extends TupleScheme<directMultiGet_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, directMultiGet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.is_set_success()) {
          optionals.set(0);
        }
        if (struct.is_set_dnfe()) {
          optionals.set(1);
        }
        if (struct.is_set_hde()) {
          optionals.set(2);
        }
        if (struct.is_set_dnle()) {
          optionals.set(3);
        }
        oprot.writeBitSet(optionals, 4);
        if (struct.is_set_success()) {
          {
            oprot.writeI32(struct.success.size());
            for (Map.Entry<ByteBuffer, elephantdb.generated.Value> _iter31 : struct.success.entrySet())
            {
              oprot.writeBinary(_iter31.getKey());
              _iter31.getValue().write(oprot);
            }
          }
        }
        if (struct.is_set_dnfe()) {
          struct.dnfe.write(oprot);
        }
        if (struct.is_set_hde()) {
          struct.hde.write(oprot);
        }
        if (struct.is_set_dnle()) {
          struct.dnle.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, directMultiGet_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          {
            org.apache.thrift.protocol.TMap _map32 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
            struct.success = new HashMap<ByteBuffer,elephantdb.generated.Value>(2*_map32.size);
            for (int _i33 = 0; _i33 < _map32.size; ++_i33)
            {
              ByteBuffer _key34;
              elephantdb.generated.Value _val35;
              _key34 = iprot.readBinary();
              _val35 = new elephantdb.generated.Value();
              _val35.read(iprot);
              struct.success.put(_key34, _val35);
            }
          }
          struct.set_success_isSet(true);
        }
        if (incoming.get(1)) {
          struct.dnfe = new elephantdb.generated.DomainNotFoundException();
          struct.dnfe.read(iprot);
          struct.set_dnfe_isSet(true);
        }
        if (incoming.get(2)) {
          struct.hde = new elephantdb.generated.HostsDownException();
          struct.hde.read(iprot);
          struct.set_hde_isSet(true);
        }
        if (incoming.get(3)) {
          struct.dnle = new elephantdb.generated.DomainNotLoadedException();
          struct.dnle.read(iprot);
          struct.set_dnle_isSet(true);
        }
      }
    }

  }

}
TOP

Related Classes of elephantdb.generated.keyval.ElephantDB$AsyncClient$Factory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.