You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/06/07 20:18:59 UTC

[01/50] [abbrv] Finished path children cache

Repository: curator
Updated Branches:
  refs/heads/master de1d38cfc -> 8880417db


http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index aab8a8d..8936004 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -54,6 +54,10 @@ public class CuratorService {
 
     public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException;
 
+    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException;
+
+    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException;
+
     public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException;
 
     public CuratorProjection newCuratorProjection(String connectionName) throws org.apache.thrift.TException;
@@ -86,6 +90,10 @@ public class CuratorService {
 
     public void getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void isLeader(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void newCuratorProjection(String connectionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -328,6 +336,55 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLeaderParticipants failed: unknown result");
     }
 
+    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException
+    {
+      send_getPathChildrenCacheData(projection, cacheProjection);
+      return recv_getPathChildrenCacheData();
+    }
+
+    public void send_getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException
+    {
+      getPathChildrenCacheData_args args = new getPathChildrenCacheData_args();
+      args.setProjection(projection);
+      args.setCacheProjection(cacheProjection);
+      sendBase("getPathChildrenCacheData", args);
+    }
+
+    public List<ChildData> recv_getPathChildrenCacheData() throws org.apache.thrift.TException
+    {
+      getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
+      receiveBase(result, "getPathChildrenCacheData");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheData failed: unknown result");
+    }
+
+    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException
+    {
+      send_getPathChildrenCacheDataForPath(projection, cacheProjection, path);
+      return recv_getPathChildrenCacheDataForPath();
+    }
+
+    public void send_getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException
+    {
+      getPathChildrenCacheDataForPath_args args = new getPathChildrenCacheDataForPath_args();
+      args.setProjection(projection);
+      args.setCacheProjection(cacheProjection);
+      args.setPath(path);
+      sendBase("getPathChildrenCacheDataForPath", args);
+    }
+
+    public ChildData recv_getPathChildrenCacheDataForPath() throws org.apache.thrift.TException
+    {
+      getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
+      receiveBase(result, "getPathChildrenCacheDataForPath");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheDataForPath failed: unknown result");
+    }
+
     public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException
     {
       send_isLeader(projection, leaderProjection);
@@ -785,6 +842,79 @@ public class CuratorService {
       }
     }
 
+    public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getPathChildrenCacheData_call method_call = new getPathChildrenCacheData_call(projection, cacheProjection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getPathChildrenCacheData_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private PathChildrenCacheProjection cacheProjection;
+      public getPathChildrenCacheData_call(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, 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.projection = projection;
+        this.cacheProjection = cacheProjection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathChildrenCacheData", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getPathChildrenCacheData_args args = new getPathChildrenCacheData_args();
+        args.setProjection(projection);
+        args.setCacheProjection(cacheProjection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<ChildData> getResult() throws 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_getPathChildrenCacheData();
+      }
+    }
+
+    public void getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getPathChildrenCacheDataForPath_call method_call = new getPathChildrenCacheDataForPath_call(projection, cacheProjection, path, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getPathChildrenCacheDataForPath_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private PathChildrenCacheProjection cacheProjection;
+      private String path;
+      public getPathChildrenCacheDataForPath_call(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.projection = projection;
+        this.cacheProjection = cacheProjection;
+        this.path = path;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathChildrenCacheDataForPath", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getPathChildrenCacheDataForPath_args args = new getPathChildrenCacheDataForPath_args();
+        args.setProjection(projection);
+        args.setCacheProjection(cacheProjection);
+        args.setPath(path);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public ChildData getResult() throws 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_getPathChildrenCacheDataForPath();
+      }
+    }
+
     public void isLeader(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       isLeader_call method_call = new isLeader_call(projection, leaderProjection, resultHandler, this, ___protocolFactory, ___transport);
@@ -994,6 +1124,8 @@ public class CuratorService {
       processMap.put("getChildren", new getChildren());
       processMap.put("getData", new getData());
       processMap.put("getLeaderParticipants", new getLeaderParticipants());
+      processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
+      processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
       processMap.put("setData", new setData());
@@ -1183,6 +1315,46 @@ public class CuratorService {
       }
     }
 
+    public static class getPathChildrenCacheData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPathChildrenCacheData_args> {
+      public getPathChildrenCacheData() {
+        super("getPathChildrenCacheData");
+      }
+
+      public getPathChildrenCacheData_args getEmptyArgsInstance() {
+        return new getPathChildrenCacheData_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getPathChildrenCacheData_result getResult(I iface, getPathChildrenCacheData_args args) throws org.apache.thrift.TException {
+        getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
+        result.success = iface.getPathChildrenCacheData(args.projection, args.cacheProjection);
+        return result;
+      }
+    }
+
+    public static class getPathChildrenCacheDataForPath<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPathChildrenCacheDataForPath_args> {
+      public getPathChildrenCacheDataForPath() {
+        super("getPathChildrenCacheDataForPath");
+      }
+
+      public getPathChildrenCacheDataForPath_args getEmptyArgsInstance() {
+        return new getPathChildrenCacheDataForPath_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getPathChildrenCacheDataForPath_result getResult(I iface, getPathChildrenCacheDataForPath_args args) throws org.apache.thrift.TException {
+        getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
+        result.success = iface.getPathChildrenCacheDataForPath(args.projection, args.cacheProjection, args.path);
+        return result;
+      }
+    }
+
     public static class isLeader<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isLeader_args> {
       public isLeader() {
         super("isLeader");
@@ -1306,6 +1478,8 @@ public class CuratorService {
       processMap.put("getChildren", new getChildren());
       processMap.put("getData", new getData());
       processMap.put("getLeaderParticipants", new getLeaderParticipants());
+      processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
+      processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
       processMap.put("setData", new setData());
@@ -1772,6 +1946,108 @@ public class CuratorService {
       }
     }
 
+    public static class getPathChildrenCacheData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPathChildrenCacheData_args, List<ChildData>> {
+      public getPathChildrenCacheData() {
+        super("getPathChildrenCacheData");
+      }
+
+      public getPathChildrenCacheData_args getEmptyArgsInstance() {
+        return new getPathChildrenCacheData_args();
+      }
+
+      public AsyncMethodCallback<List<ChildData>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<List<ChildData>>() { 
+          public void onComplete(List<ChildData> o) {
+            getPathChildrenCacheData_result result = new getPathChildrenCacheData_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;
+            getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
+            {
+              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, getPathChildrenCacheData_args args, org.apache.thrift.async.AsyncMethodCallback<List<ChildData>> resultHandler) throws TException {
+        iface.getPathChildrenCacheData(args.projection, args.cacheProjection,resultHandler);
+      }
+    }
+
+    public static class getPathChildrenCacheDataForPath<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPathChildrenCacheDataForPath_args, ChildData> {
+      public getPathChildrenCacheDataForPath() {
+        super("getPathChildrenCacheDataForPath");
+      }
+
+      public getPathChildrenCacheDataForPath_args getEmptyArgsInstance() {
+        return new getPathChildrenCacheDataForPath_args();
+      }
+
+      public AsyncMethodCallback<ChildData> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<ChildData>() { 
+          public void onComplete(ChildData o) {
+            getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_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;
+            getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
+            {
+              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, getPathChildrenCacheDataForPath_args args, org.apache.thrift.async.AsyncMethodCallback<ChildData> resultHandler) throws TException {
+        iface.getPathChildrenCacheDataForPath(args.projection, args.cacheProjection, args.path,resultHandler);
+      }
+    }
+
     public static class isLeader<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isLeader_args, Boolean> {
       public isLeader() {
         super("isLeader");
@@ -9249,6 +9525,1801 @@ public class CuratorService {
 
   }
 
+  public static class getPathChildrenCacheData_args implements org.apache.thrift.TBase<getPathChildrenCacheData_args, getPathChildrenCacheData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField CACHE_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getPathChildrenCacheData_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheData_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public PathChildrenCacheProjection cacheProjection; // 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 {
+      PROJECTION((short)1, "projection"),
+      CACHE_PROJECTION((short)2, "cacheProjection");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // CACHE_PROJECTION
+            return CACHE_PROJECTION;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.CACHE_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("cacheProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheProjection.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_args.class, metaDataMap);
+    }
+
+    public getPathChildrenCacheData_args() {
+    }
+
+    public getPathChildrenCacheData_args(
+      CuratorProjection projection,
+      PathChildrenCacheProjection cacheProjection)
+    {
+      this();
+      this.projection = projection;
+      this.cacheProjection = cacheProjection;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getPathChildrenCacheData_args(getPathChildrenCacheData_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetCacheProjection()) {
+        this.cacheProjection = new PathChildrenCacheProjection(other.cacheProjection);
+      }
+    }
+
+    public getPathChildrenCacheData_args deepCopy() {
+      return new getPathChildrenCacheData_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.cacheProjection = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public getPathChildrenCacheData_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public PathChildrenCacheProjection getCacheProjection() {
+      return this.cacheProjection;
+    }
+
+    public getPathChildrenCacheData_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
+      this.cacheProjection = cacheProjection;
+      return this;
+    }
+
+    public void unsetCacheProjection() {
+      this.cacheProjection = null;
+    }
+
+    /** Returns true if field cacheProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetCacheProjection() {
+      return this.cacheProjection != null;
+    }
+
+    public void setCacheProjectionIsSet(boolean value) {
+      if (!value) {
+        this.cacheProjection = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case CACHE_PROJECTION:
+        if (value == null) {
+          unsetCacheProjection();
+        } else {
+          setCacheProjection((PathChildrenCacheProjection)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case CACHE_PROJECTION:
+        return getCacheProjection();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case CACHE_PROJECTION:
+        return isSetCacheProjection();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getPathChildrenCacheData_args)
+        return this.equals((getPathChildrenCacheData_args)that);
+      return false;
+    }
+
+    public boolean equals(getPathChildrenCacheData_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_cacheProjection = true && this.isSetCacheProjection();
+      boolean that_present_cacheProjection = true && that.isSetCacheProjection();
+      if (this_present_cacheProjection || that_present_cacheProjection) {
+        if (!(this_present_cacheProjection && that_present_cacheProjection))
+          return false;
+        if (!this.cacheProjection.equals(that.cacheProjection))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getPathChildrenCacheData_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetCacheProjection()).compareTo(other.isSetCacheProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetCacheProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cacheProjection, other.cacheProjection);
+        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("getPathChildrenCacheData_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("cacheProjection:");
+      if (this.cacheProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.cacheProjection);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (cacheProjection != null) {
+        cacheProjection.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 getPathChildrenCacheData_argsStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_argsStandardScheme getScheme() {
+        return new getPathChildrenCacheData_argsStandardScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheData_argsStandardScheme extends StandardScheme<getPathChildrenCacheData_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // CACHE_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.cacheProjection = new PathChildrenCacheProjection();
+                struct.cacheProjection.read(iprot);
+                struct.setCacheProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.cacheProjection != null) {
+          oprot.writeFieldBegin(CACHE_PROJECTION_FIELD_DESC);
+          struct.cacheProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getPathChildrenCacheData_argsTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_argsTupleScheme getScheme() {
+        return new getPathChildrenCacheData_argsTupleScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheData_argsTupleScheme extends TupleScheme<getPathChildrenCacheData_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetCacheProjection()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetCacheProjection()) {
+          struct.cacheProjection.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.cacheProjection = new PathChildrenCacheProjection();
+          struct.cacheProjection.read(iprot);
+          struct.setCacheProjectionIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class getPathChildrenCacheData_result implements org.apache.thrift.TBase<getPathChildrenCacheData_result, getPathChildrenCacheData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getPathChildrenCacheData_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheData_resultTupleSchemeFactory());
+    }
+
+    public List<ChildData> success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      private static final 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;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ChildData.class))));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_result.class, metaDataMap);
+    }
+
+    public getPathChildrenCacheData_result() {
+    }
+
+    public getPathChildrenCacheData_result(
+      List<ChildData> success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getPathChildrenCacheData_result(getPathChildrenCacheData_result other) {
+      if (other.isSetSuccess()) {
+        List<ChildData> __this__success = new ArrayList<ChildData>(other.success.size());
+        for (ChildData other_element : other.success) {
+          __this__success.add(new ChildData(other_element));
+        }
+        this.success = __this__success;
+      }
+    }
+
+    public getPathChildrenCacheData_result deepCopy() {
+      return new getPathChildrenCacheData_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public int getSuccessSize() {
+      return (this.success == null) ? 0 : this.success.size();
+    }
+
+    public java.util.Iterator<ChildData> getSuccessIterator() {
+      return (this.success == null) ? null : this.success.iterator();
+    }
+
+    public void addToSuccess(ChildData elem) {
+      if (this.success == null) {
+        this.success = new ArrayList<ChildData>();
+      }
+      this.success.add(elem);
+    }
+
+    public List<ChildData> getSuccess() {
+      return this.success;
+    }
+
+    public getPathChildrenCacheData_result setSuccess(List<ChildData> success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((List<ChildData>)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getPathChildrenCacheData_result)
+        return this.equals((getPathChildrenCacheData_result)that);
+      return false;
+    }
+
+    public boolean equals(getPathChildrenCacheData_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getPathChildrenCacheData_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      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("getPathChildrenCacheData_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getPathChildrenCacheData_resultStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_resultStandardScheme getScheme() {
+        return new getPathChildrenCacheData_resultStandardScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheData_resultStandardScheme extends StandardScheme<getPathChildrenCacheData_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+                {
+                  org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
+                  struct.success = new ArrayList<ChildData>(_list32.size);
+                  for (int _i33 = 0; _i33 < _list32.size; ++_i33)
+                  {
+                    ChildData _elem34;
+                    _elem34 = new ChildData();
+                    _elem34.read(iprot);
+                    struct.success.add(_elem34);
+                  }
+                  iprot.readListEnd();
+                }
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+            for (ChildData _iter35 : struct.success)
+            {
+              _iter35.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getPathChildrenCacheData_resultTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_resultTupleScheme getScheme() {
+        return new getPathChildrenCacheData_resultTupleScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheData_resultTupleScheme extends TupleScheme<getPathChildrenCacheData_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          {
+            oprot.writeI32(struct.success.size());
+            for (ChildData _iter36 : struct.success)
+            {
+              _iter36.write(oprot);
+            }
+          }
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          {
+            org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.success = new ArrayList<ChildData>(_list37.size);
+            for (int _i38 = 0; _i38 < _list37.size; ++_i38)
+            {
+              ChildData _elem39;
+              _elem39 = new ChildData();
+              _elem39.read(iprot);
+              struct.success.add(_elem39);
+            }
+          }
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class getPathChildrenCacheDataForPath_args implements org.apache.thrift.TBase<getPathChildrenCacheDataForPath_args, getPathChildrenCacheDataForPath_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheDataForPath_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheDataForPath_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField CACHE_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getPathChildrenCacheDataForPath_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheDataForPath_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public PathChildrenCacheProjection cacheProjection; // required
+    public String path; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      PROJECTION((short)1, "projection"),
+      CACHE_PROJECTION((short)2, "cacheProjection"),
+      PATH((short)3, "path");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // CACHE_PROJECTION
+            return CACHE_PROJECTION;
+          case 3: // PATH
+            return PATH;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new 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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.CACHE_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("cacheProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheDataForPath_args.class, metaDataMap);
+    }
+
+    public getPathChildrenCacheDataForPath_args() {
+    }
+
+    public getPathChildrenCacheDataForPath_args(
+      CuratorProjection projection,
+      PathChildrenCacheProjection cacheProjection,
+      String path)
+    {
+      this();
+      this.projection = projection;
+      this.cacheProjection = cacheProjection;
+      this.path = path;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getPathChildrenCacheDataForPath_args(getPathChildrenCacheDataForPath_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetCacheProjection()) {
+        this.cacheProjection = new PathChildrenCacheProjection(other.cacheProjection);
+      }
+      if (other.isSetPath()) {
+        this.path = other.path;
+      }
+    }
+
+    public getPathChildrenCacheDataForPath_args deepCopy() {
+      return new getPathChildrenCacheDataForPath_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.cacheProjection = null;
+      this.path = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public getPathChildrenCacheDataForPath_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public PathChildrenCacheProjection getCacheProjection() {
+      return this.cacheProjection;
+    }
+
+    public getPathChildrenCacheDataForPath_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
+      this.cacheProjection = cacheProjection;
+      return this;
+    }
+
+    public void unsetCacheProjection() {
+      this.cacheProjection = null;
+    }
+
+    /** Returns true if field cacheProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetCacheProjection() {
+      return this.cacheProjection != null;
+    }
+
+    public void setCacheProjectionIsSet(boolean value) {
+      if (!value) {
+        this.cacheProjection = null;
+      }
+    }
+
+    public String getPath() {
+      return this.path;
+    }
+
+    public getPathChildrenCacheDataForPath_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
+
+    public void unsetPath() {
+      this.path = null;
+    }
+
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
+
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case CACHE_PROJECTION:
+        if (value == null) {
+          unsetCacheProjection();
+        } else {
+          setCacheProjection((PathChildrenCacheProjection)value);
+        }
+        break;
+
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case CACHE_PROJECTION:
+        return getCacheProjection();
+
+      case PATH:
+        return getPath();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case CACHE_PROJECTION:
+        return isSetCacheProjection();
+      case PATH:
+        return isSetPath();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getPathChildrenCacheDataForPath_args)
+        return this.equals((getPathChildrenCacheDataForPath_args)that);
+      return false;
+    }
+
+    public boolean equals(getPathChildrenCacheDataForPath_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_cacheProjection = true && this.isSetCacheProjection();
+      boolean that_present_cacheProjection = true && that.isSetCacheProjection();
+      if (this_present_cacheProjection || that_present_cacheProjection) {
+        if (!(this_present_cacheProjection && that_present_cacheProjection))
+          return false;
+        if (!this.cacheProjection.equals(that.cacheProjection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getPathChildrenCacheDataForPath_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetCacheProjection()).compareTo(other.isSetCacheProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetCacheProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cacheProjection, other.cacheProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      return 0;
+    }
+
+    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("getPathChildrenCacheDataForPath_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("cacheProjection:");
+      if (this.cacheProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.cacheProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+      if (projection != null) {
+        projection.validate();
+      }
+      if (cacheProjection != null) {
+        cacheProjection.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 getPathChildrenCacheDataForPath_argsStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheDataForPath_argsStandardScheme getScheme() {
+        return new getPathChildrenCacheDataForPath_argsStandardScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheDataForPath_argsStandardScheme extends StandardScheme<getPathChildrenCacheDataForPath_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheDataForPath_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // CACHE_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.cacheProjection = new PathChildrenCacheProjection();
+                struct.cacheProjection.read(iprot);
+                struct.setCacheProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // PATH
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.path = iprot.readString();
+                struct.setPathIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.cacheProjection != null) {
+          oprot.writeFieldBegin(CACHE_PROJECTION_FIELD_DESC);
+          struct.cacheProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.path != null) {
+          oprot.writeFieldBegin(PATH_FIELD_DESC);
+          oprot.writeString(struct.path);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getPathChildrenCacheDataForPath_argsTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheDataForPath_argsTupleScheme getScheme() {
+        return new getPathChildrenCacheDataForPath_argsTupleScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheDataForPath_argsTupleScheme extends TupleScheme<getPathChildrenCacheDataForPath_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetCacheProjection()) {
+          optionals.set(1);
+        }
+        if (struct.isSetPath()) {
+          optionals.set(2);
+        }
+        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetCacheProjection()) {
+          struct.cacheProjection.write(oprot);
+        }
+        if (struct.isSetPath()) {
+          oprot.writeString(struct.path);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(3);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.cacheProjection = new PathChildrenCacheProjection();
+          struct.cacheProjection.read(iprot);
+          struct.setCacheProjectionIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.path = iprot.readString();
+          struct.setPathIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class getPathChildrenCacheDataForPath_result implements org.apache.thrift.TBase<getPathChildrenCacheDataForPath_result, getPathChildrenCacheDataForPath_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheDataForPath_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheDataForPath_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getPathChildrenCacheDataForPath_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheDataForPath_resultTupleSchemeFactory());
+    }
+
+    public ChildData success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      private static final 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;
+          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, ChildData.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheDataForPath_result.class, metaDataMap);
+    }
+
+    public getPathChildrenCacheDataForPath_result() {
+    }
+
+    public getPathChildrenCacheDataForPath_result(
+      ChildData success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getPathChildrenCacheDataForPath_result(getPathChildrenCacheDataForPath_result other) {
+      if (other.isSetSuccess()) {
+        this.success = new ChildData(other.success);
+      }
+    }
+
+    public getPathChildrenCacheDataForPath_result deepCopy() {
+      return new getPathChildrenCacheDataForPath_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public ChildData getSuccess() {
+      return this.success;
+    }
+
+    public getPathChildrenCacheDataForPath_result setSuccess(ChildData success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((ChildData)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getPathChildrenCacheDataForPath_result)
+        return this.equals((getPathChildrenCacheDataForPath_result)that);
+      return false;
+    }
+
+    public boolean equals(getPathChildrenCacheDataForPath_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getPathChildrenCacheDataForPath_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      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("getPathChildrenCacheDataForPath_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+      if (success != null) {
+        success.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 getPathChildrenCacheDataForPath_resultStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheDataForPath_resultStandardScheme getScheme() {
+        return new getPathChildrenCacheDataForPath_resultStandardScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheDataForPath_resultStandardScheme extends StandardScheme<getPathChildrenCacheDataForPath_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheDataForPath_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 ChildData();
+                struct.success.read(iprot);
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          struct.success.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getPathChildrenCacheDataForPath_resultTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheDataForPath_resultTupleScheme getScheme() {
+        return new getPathChildrenCacheDataForPath_resultTupleScheme();
+      }
+    }
+
+    private static class getPathChildrenCacheDataForPath_resultTupleScheme extends TupleScheme<getPathChildrenCacheDataForPath_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          struct.success.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = new ChildData();
+          struct.success.read(iprot);
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
   public static class isLeader_args implements org.apache.thrift.TBase<isLeader_args, isLeader_args._Fields>, java.io.Serializable, Cloneable, Comparable<isLeader_args>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isLeader_args");
 

http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index fe14504..a1c07bd 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -76,11 +76,17 @@ public class TestClient
 
         PathChildrenCacheProjection pathChildrenCacheProjection = client.startPathChildrenCache(curatorProjection, "/a/b", true, false, PathChildrenCacheStartMode.BUILD_INITIAL_CACHE);
 
+        List<ChildData> pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
+        System.out.println("Child data: " + pathChildrenCacheData);
+
         GetChildrenSpec getChildrenSpec = new GetChildrenSpec();
         getChildrenSpec.path = "/a";
         OptionalChildrenList children = client.getChildren(curatorProjection, getChildrenSpec);
         System.out.println("Children: " + children);
 
+        ChildData pathChildrenCacheDataForPath = client.getPathChildrenCacheDataForPath(curatorProjection, pathChildrenCacheProjection, "/a/b/c");
+        System.out.println(pathChildrenCacheDataForPath);
+
         GenericProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
         client.closeGenericProjection(curatorProjection, lockId);
 
@@ -110,5 +116,8 @@ public class TestClient
         System.out.println("isLeader: " + isLeader);
 
         client.closeGenericProjection(curatorProjection, leader.projection.projection);
+
+        pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
+        System.out.println("Child data: " + pathChildrenCacheData);
     }
 }


[23/50] [abbrv] git commit: wip on service discovery

Posted by ra...@apache.org.
wip on service discovery


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b79909a4
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b79909a4
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b79909a4

Branch: refs/heads/master
Commit: b79909a4cb17ac5fe20f12fcd5b8e0761492d1b4
Parents: 87582a9
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 17:23:27 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 17:23:27 2014 -0500

----------------------------------------------------------------------
 .../x/rpc/idl/discovery/DiscoveryInstance.java  |   21 +-
 .../x/rpc/idl/discovery/DiscoveryService.java   |   11 +-
 .../idl/discovery/DiscoveryServiceLowLevel.java |   74 +-
 .../idl/services/CuratorProjectionService.java  |   11 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |    3 +
 .../generated/DiscoveryServiceLowLevel.java     | 3699 +++++++++++++++++-
 6 files changed, 3754 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
index 94e6307..4cd67d6 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
@@ -40,15 +40,18 @@ public class DiscoveryInstance
 
     public DiscoveryInstance(ServiceInstance<byte[]> instance)
     {
-        this.name = instance.getName();
-        this.id = instance.getId();
-        this.address = instance.getAddress();
-        this.port = instance.getPort();
-        this.sslPort = instance.getSslPort();
-        this.payload = instance.getPayload();
-        this.registrationTimeUTC = instance.getRegistrationTimeUTC();
-        this.serviceType = DiscoveryInstanceType.valueOf(instance.getServiceType().name());
-        this.uriSpec = instance.buildUriSpec();
+        if ( instance != null )
+        {
+            this.name = instance.getName();
+            this.id = instance.getId();
+            this.address = instance.getAddress();
+            this.port = instance.getPort();
+            this.sslPort = instance.getSslPort();
+            this.payload = instance.getPayload();
+            this.registrationTimeUTC = instance.getRegistrationTimeUTC();
+            this.serviceType = DiscoveryInstanceType.valueOf(instance.getServiceType().name());
+            this.uriSpec = instance.buildUriSpec();
+        }
     }
 
     public DiscoveryInstance(String name, String id, String address, Integer port, Integer sslPort, byte[] payload, long registrationTimeUTC, DiscoveryInstanceType serviceType, String uriSpec)

http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
index edfc141..5ed9a01 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -3,6 +3,7 @@ package org.apache.curator.x.rpc.idl.discovery;
 import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 import org.apache.curator.x.discovery.DownInstancePolicy;
 import org.apache.curator.x.discovery.ProviderStrategy;
@@ -21,6 +22,7 @@ import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.IOException;
+import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
@@ -159,15 +161,15 @@ public class DiscoveryService
     }
 
     @ThriftMethod
-    public List<DiscoveryInstance> getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
+    public Collection<DiscoveryInstance> getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
     {
         CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
         @SuppressWarnings("unchecked")
         ServiceProvider<byte[]> serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
         try
         {
-            List<ServiceInstance<byte[]>> allInstances = Lists.newArrayList(serviceProvider.getAllInstances());
-            return Lists.transform
+            Collection<ServiceInstance<byte[]>> allInstances = serviceProvider.getAllInstances();
+            return Collections2.transform
             (
                 allInstances,
                 new Function<ServiceInstance<byte[]>, DiscoveryInstance>()
@@ -177,8 +179,7 @@ public class DiscoveryService
                     {
                         return new DiscoveryInstance(instance);
                     }
-                }
-            );
+                });
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
index b08be1d..fa7dbfe 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
@@ -3,26 +3,16 @@ package org.apache.curator.x.rpc.idl.discovery;
 import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.apache.curator.x.discovery.DownInstancePolicy;
-import org.apache.curator.x.discovery.ProviderStrategy;
+import com.google.common.collect.Collections2;
 import org.apache.curator.x.discovery.ServiceDiscovery;
-import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
 import org.apache.curator.x.discovery.ServiceInstance;
-import org.apache.curator.x.discovery.ServiceProvider;
-import org.apache.curator.x.discovery.strategies.RandomStrategy;
-import org.apache.curator.x.discovery.strategies.RoundRobinStrategy;
-import org.apache.curator.x.discovery.strategies.StickyStrategy;
-import org.apache.curator.x.rpc.connections.Closer;
 import org.apache.curator.x.rpc.connections.ConnectionManager;
 import org.apache.curator.x.rpc.connections.CuratorEntry;
 import org.apache.curator.x.rpc.idl.exceptions.RpcException;
 import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
+import java.util.Collection;
 
 @ThriftService
 public class DiscoveryServiceLowLevel
@@ -82,4 +72,64 @@ public class DiscoveryServiceLowLevel
             throw new RpcException(e);
         }
     }
+
+    @ThriftMethod
+    public Collection<String> queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+        try
+        {
+            return serviceDiscovery.queryForNames();
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public DiscoveryInstance queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+        try
+        {
+            return new DiscoveryInstance(serviceDiscovery.queryForInstance(name, id));
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public Collection<DiscoveryInstance> queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+        try
+        {
+            Collection<ServiceInstance<byte[]>> instances = serviceDiscovery.queryForInstances(name);
+            return Collections2.transform
+            (
+                instances,
+                new Function<ServiceInstance<byte[]>, DiscoveryInstance>()
+                {
+                    @Override
+                    public DiscoveryInstance apply(ServiceInstance<byte[]> instance)
+                    {
+                        return new DiscoveryInstance(instance);
+                    }
+                }
+            );
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index b7a1145..d218e7b 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -22,6 +22,7 @@ package org.apache.curator.x.rpc.idl.services;
 import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
 import com.google.common.collect.Lists;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.api.*;
@@ -422,7 +423,7 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
+    public Collection<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
     {
         try
         {
@@ -430,14 +431,18 @@ public class CuratorProjectionService
 
             LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
             Collection<Participant> participants = leaderLatch.getParticipants();
-            return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
+            return Collections2.transform
+            (
+                participants,
+                new Function<Participant, RpcParticipant>()
                 {
                     @Override
                     public RpcParticipant apply(Participant participant)
                     {
                         return new RpcParticipant(participant.getId(), participant.isLeader());
                     }
-                });
+                }
+            );
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 1008b32..11e5edb 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -278,6 +278,9 @@ service DiscoveryService {
 }
 
 service DiscoveryServiceLowLevel {
+  DiscoveryInstance queryForInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string name, 4: string id) throws (1: CuratorException ex1);
+  list<DiscoveryInstance> queryForInstances(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string name) throws (1: CuratorException ex1);
+  list<string> queryForNames(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection) throws (1: CuratorException ex1);
   void registerInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
   void unregisterInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
   void updateInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);


[36/50] [abbrv] git commit: wip on doc

Posted by ra...@apache.org.
wip on doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/e118ad01
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/e118ad01
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/e118ad01

Branch: refs/heads/master
Commit: e118ad01d919afaab64d8fbd98591a95c7ae0f15
Parents: 081bfdb
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 14:28:09 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 14:28:09 2014 -0500

----------------------------------------------------------------------
 .../idl/services/CuratorProjectionService.java  |   23 +-
 .../curator/x/rpc/idl/structs/OptionalData.java |   38 +
 curator-x-rpc/src/main/scripts/apply-thrift.sh  |    3 -
 curator-x-rpc/src/main/thrift/curator.thrift    |    9 +-
 .../src/site/confluence/events.confluence       |    1 -
 .../src/site/confluence/index.confluence        |    4 +
 .../src/site/confluence/reference.confluence    |   29 +
 .../src/site/confluence/usage.confluence        |    4 +
 curator-x-rpc/src/site/site.xml                 |    2 +-
 .../curator/generated/CuratorService.java       | 1164 +++++++++++++++++-
 .../apache/curator/generated/OptionalData.java  |  399 ++++++
 .../org/apache/curator/x/rpc/TestClient.java    |    5 +-
 12 files changed, 1612 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index b9de507..4fcb450 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -185,7 +185,7 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws RpcException
+    public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws RpcException
     {
         try
         {
@@ -211,7 +211,8 @@ public class CuratorProjectionService
             Stat stat = new Stat();
             builder = castBuilder(builder, Statable.class).storingStatIn(stat);
 
-            return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
+            byte[] bytes = (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
+            return new OptionalData(bytes);
         }
         catch ( Exception e )
         {
@@ -220,7 +221,7 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws RpcException
+    public OptionalRpcStat setData(CuratorProjection projection, SetDataSpec spec) throws RpcException
     {
         try
         {
@@ -248,7 +249,7 @@ public class CuratorProjectionService
             }
 
             Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
-            return RpcCuratorEvent.toRpcStat(stat);
+            return new OptionalRpcStat(RpcCuratorEvent.toRpcStat(stat));
         }
         catch ( Exception e )
         {
@@ -333,8 +334,16 @@ public class CuratorProjectionService
     {
         try
         {
-            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-            return entry.closeThing(id);
+            if ( id.equals(projection.id) )
+            {
+                closeCuratorProjection(projection);
+                return true;
+            }
+            else
+            {
+                CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+                return entry.closeThing(id);
+            }
         }
         catch ( Exception e )
         {
@@ -666,7 +675,7 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws RpcException
+    public List<LeaseProjection> acquireSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws RpcException
     {
         try
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java
new file mode 100644
index 0000000..e46c577
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class OptionalData
+{
+    @ThriftField(1)
+    public byte[] data;
+
+    public OptionalData()
+    {
+    }
+
+    public OptionalData(byte[] data)
+    {
+        this.data = data;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/main/scripts/apply-thrift.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/apply-thrift.sh b/curator-x-rpc/src/main/scripts/apply-thrift.sh
index e2a0d85..535765d 100755
--- a/curator-x-rpc/src/main/scripts/apply-thrift.sh
+++ b/curator-x-rpc/src/main/scripts/apply-thrift.sh
@@ -33,7 +33,4 @@ else
     TARGET_DIR="$BASE_DIR/curator-x-rpc/src/test/java"
 fi
 
-mkdir -p "$TARGET_DIR/"
-rm -fr "$TARGET_DIR/"*
-
 thrift -gen $1 -out "$TARGET_DIR" "$BASE_DIR/curator-x-rpc/src/main/thrift/curator.thrift"

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 49b860d..2f46a93 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -105,6 +105,10 @@ struct OptionalChildrenList {
   1: list<string> children;
 }
 
+struct OptionalData {
+  1: binary data;
+}
+
 struct OptionalPath {
   1: string path;
 }
@@ -249,7 +253,7 @@ service CuratorService {
   void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec) throws (1: CuratorException ex1);
   OptionalStat exists(1: CuratorProjection projection, 2: ExistsSpec spec) throws (1: CuratorException ex1);
   OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec) throws (1: CuratorException ex1);
-  binary getData(1: CuratorProjection projection, 2: GetDataSpec spec) throws (1: CuratorException ex1);
+  OptionalData getData(1: CuratorProjection projection, 2: GetDataSpec spec) throws (1: CuratorException ex1);
   list<Participant> getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
   ChildData getNodeCacheData(1: CuratorProjection projection, 2: NodeCacheProjection cacheProjection) throws (1: CuratorException ex1);
   list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection) throws (1: CuratorException ex1);
@@ -257,12 +261,13 @@ service CuratorService {
   bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
   CuratorProjection newCuratorProjection(1: string connectionName) throws (1: CuratorException ex1);
   oneway void pingCuratorProjection(1: CuratorProjection projection);
-  Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec) throws (1: CuratorException ex1);
+  OptionalStat setData(1: CuratorProjection projection, 2: SetDataSpec spec) throws (1: CuratorException ex1);
   LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs) throws (1: CuratorException ex1);
   NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial) throws (1: CuratorException ex1);
   PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode) throws (1: CuratorException ex1);
   PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode) throws (1: CuratorException ex1);
   list<LeaseProjection> startSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases) throws (1: CuratorException ex1);
+  void sync(1: CuratorProjection projection, 2: string path, 3: string asyncContext) throws (1: CuratorException ex1);
 }
 
 service EventService {

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/site/confluence/events.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
index 7eb7fec..ead5206 100644
--- a/curator-x-rpc/src/site/confluence/events.confluence
+++ b/curator-x-rpc/src/site/confluence/events.confluence
@@ -2,7 +2,6 @@
 
 h1. Events
 
-
 h2. Event Loop
 
 In order to receive out\-of\-bounds messages (connection state changes, watcher triggers, etc.) you must have an event loop to recieve

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
index 962a3e1..ffba2de 100644
--- a/curator-x-rpc/src/site/confluence/index.confluence
+++ b/curator-x-rpc/src/site/confluence/index.confluence
@@ -34,3 +34,7 @@ See [[Configuration|configuration.html]] for details on configuring the RPC prox
 h2. Events
 
 See [[Events|events.html]] for details on the Curator RPC event loop and its structure.
+
+h2. Reference
+
+See [[API Reference Page|reference.html]] for the API reference.

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
new file mode 100644
index 0000000..1a41800
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -0,0 +1,29 @@
+[[Curator RPC Proxy|index.html]] / Reference
+
+h1. Reference
+
+h2. CuratorService Reference
+
+||API||Arguments||Return Value||Description||
+|newCuratorProjection|connectionName|CuratorProjection|Allocates a projection to a configured CuratorFramework instance in the RPC server. "connectionName" is the name of a [[configured|configuration.html]] connection.|
+|closeCuratorProjection|CuratorProjection|void|Close a CuratorProjection. Also closes any recipes, etc. create for the projection.|
+|pingCuratorProjection|CuratorProjection|void|Keeps the CuratorProjection from timing out. NOTE: your [[EventService|events.html]] event loop will do this for your.|
+|createNode|CreateSpec|Created path name|Create a ZNode|
+|deleteNode|DeleteSpec|void|Delete a ZNode|
+|getData|GetDataSpec|bytes|Return a ZNode's data|
+|setData|SetDataSpec|Stat|Set a ZNode's data|
+|exists|ExistsSpec|Stat|Check is a ZNode exists|
+|getChildren|GetChildrenSpec|List of nodes|Get the child nodes for a ZNode|
+|sync|path and async context|void|Do a ZooKeeper sync|
+|closeGenericProjection|id|void|Closes any projection|
+|acquireLock|path, maxWaitMs|lock projection|Acquire a lock for the given path. Will wait at most maxWaitMs to acquire the lock. If the acquisition fails, LockProjection.id will be null.|
+|startLeaderSelector|path, participantId, waitForLeadershipMs|LeaderResult|Start a leader selector on the given path. The instance will be assigned the specified participantId. If waitForLeadershipMs is non\-zero, the method will block for that amount of time waiting for leadership.|
+|getLeaderParticipants|leaderProjection|List of Participant|Return the participants in a leader selector|
+|isLeader|leaderProjection|bool|Return true if the specified projection is the current leader|
+|startPathChildrenCache|path, cacheData, dataIsCompressed, startMode|cache projection|Start a PathChildrenCache for the given path. Can optionally cache data, use compressed data.|
+|getPathChildrenCacheData|cacheProjection|List of ChildData|Get all the data for a path cache|
+|getPathChildrenCacheDataForPath|cacheProjection, path|ChildData|Get the data for a single ZNode in a path cache|
+|startNodeCache|path, dataIsCompressed, buildInitial|node cache projection|Start a node cache for the given path. Can optionally use compressed data and build the initial cache.|
+|getNodeCacheData|node cache projection|ChildData|Return the data for the cached node. If the node doesn't exist, the fields of the ChildData object will be null.|
+|startPersistentEphemeralNode|path, data, mode|projection|Start a PersistentEphemeralNode for the given path using the given data and mode.|
+|acquireSemaphore|path, acquireQty, maxWaitMs, maxLeases|List of lease projections|Acquire one or more leases for a semaphore on the given path. acquireQty is the number of leases to acquire. maxWaitMs is the max time to wait to get the leases. maxLeases is the maximum leases to allow for the semaphore. If the number of leases cannot be acquired within the max time, an empty list is returned.|

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index bf9edf1..86befd1 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -107,3 +107,7 @@ if event.type == PATH_CHILDREN_CACHE {
 // when done with the cache, close it
 client.closeGenericProjection(curatorProjection, cacheProjection.id);
 {code}
+
+h2. Reference
+
+See [[API Reference Page|reference.html]] for the API reference.

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/site/site.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/site.xml b/curator-x-rpc/src/site/site.xml
index 1684980..fca1e73 100644
--- a/curator-x-rpc/src/site/site.xml
+++ b/curator-x-rpc/src/site/site.xml
@@ -19,7 +19,7 @@
     under the License.
 
 -->
-<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" name="Curator REST Proxy">
+<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" name="Curator RPC Proxy">
     <body>
         <head>
             <link rel="stylesheet" href="../css/site.css" />

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index e4281d9..6c722c6 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -50,7 +50,7 @@ public class CuratorService {
 
     public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
+    public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
 
     public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
 
@@ -66,7 +66,7 @@ public class CuratorService {
 
     public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
-    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
+    public OptionalStat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
 
     public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws CuratorException, org.apache.thrift.TException;
 
@@ -78,6 +78,8 @@ public class CuratorService {
 
     public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException;
 
+    public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException;
+
   }
 
   public interface AsyncIface {
@@ -124,6 +126,8 @@ public class CuratorService {
 
     public void startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
   }
 
   public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -318,7 +322,7 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChildren failed: unknown result");
     }
 
-    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException
+    public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_getData(projection, spec);
       return recv_getData();
@@ -332,7 +336,7 @@ public class CuratorService {
       sendBase("getData", args);
     }
 
-    public ByteBuffer recv_getData() throws CuratorException, org.apache.thrift.TException
+    public OptionalData recv_getData() throws CuratorException, org.apache.thrift.TException
     {
       getData_result result = new getData_result();
       receiveBase(result, "getData");
@@ -519,7 +523,7 @@ public class CuratorService {
       sendBase("pingCuratorProjection", args);
     }
 
-    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException
+    public OptionalStat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_setData(projection, spec);
       return recv_setData();
@@ -533,7 +537,7 @@ public class CuratorService {
       sendBase("setData", args);
     }
 
-    public Stat recv_setData() throws CuratorException, org.apache.thrift.TException
+    public OptionalStat recv_setData() throws CuratorException, org.apache.thrift.TException
     {
       setData_result result = new setData_result();
       receiveBase(result, "setData");
@@ -693,6 +697,31 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startSemaphore failed: unknown result");
     }
 
+    public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException
+    {
+      send_sync(projection, path, asyncContext);
+      recv_sync();
+    }
+
+    public void send_sync(CuratorProjection projection, String path, String asyncContext) throws org.apache.thrift.TException
+    {
+      sync_args args = new sync_args();
+      args.setProjection(projection);
+      args.setPath(path);
+      args.setAsyncContext(asyncContext);
+      sendBase("sync", args);
+    }
+
+    public void recv_sync() throws CuratorException, org.apache.thrift.TException
+    {
+      sync_result result = new sync_result();
+      receiveBase(result, "sync");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      return;
+    }
+
   }
   public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
     public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -980,7 +1009,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public ByteBuffer getResult() throws CuratorException, org.apache.thrift.TException {
+      public OptionalData getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1256,7 +1285,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public Stat getResult() throws CuratorException, org.apache.thrift.TException {
+      public OptionalStat getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1477,6 +1506,44 @@ public class CuratorService {
       }
     }
 
+    public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      sync_call method_call = new sync_call(projection, path, asyncContext, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class sync_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String path;
+      private String asyncContext;
+      public sync_call(CuratorProjection projection, String path, String asyncContext, 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.projection = projection;
+        this.path = path;
+        this.asyncContext = asyncContext;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sync", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        sync_args args = new sync_args();
+        args.setProjection(projection);
+        args.setPath(path);
+        args.setAsyncContext(asyncContext);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws CuratorException, 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);
+        (new Client(prot)).recv_sync();
+      }
+    }
+
   }
 
   public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -1511,6 +1578,7 @@ public class CuratorService {
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
       processMap.put("startSemaphore", new startSemaphore());
+      processMap.put("sync", new sync());
       return processMap;
     }
 
@@ -2010,6 +2078,30 @@ public class CuratorService {
       }
     }
 
+    public static class sync<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sync_args> {
+      public sync() {
+        super("sync");
+      }
+
+      public sync_args getEmptyArgsInstance() {
+        return new sync_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public sync_result getResult(I iface, sync_args args) throws org.apache.thrift.TException {
+        sync_result result = new sync_result();
+        try {
+          iface.sync(args.projection, args.path, args.asyncContext);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
   }
 
   public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -2044,6 +2136,7 @@ public class CuratorService {
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
       processMap.put("startSemaphore", new startSemaphore());
+      processMap.put("sync", new sync());
       return processMap;
     }
 
@@ -2417,7 +2510,7 @@ public class CuratorService {
       }
     }
 
-    public static class getData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getData_args, ByteBuffer> {
+    public static class getData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getData_args, OptionalData> {
       public getData() {
         super("getData");
       }
@@ -2426,10 +2519,10 @@ public class CuratorService {
         return new getData_args();
       }
 
-      public AsyncMethodCallback<ByteBuffer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<OptionalData> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<ByteBuffer>() { 
-          public void onComplete(ByteBuffer o) {
+        return new AsyncMethodCallback<OptionalData>() { 
+          public void onComplete(OptionalData o) {
             getData_result result = new getData_result();
             result.success = o;
             try {
@@ -2469,7 +2562,7 @@ public class CuratorService {
         return false;
       }
 
-      public void start(I iface, getData_args args, org.apache.thrift.async.AsyncMethodCallback<ByteBuffer> resultHandler) throws TException {
+      public void start(I iface, getData_args args, org.apache.thrift.async.AsyncMethodCallback<OptionalData> resultHandler) throws TException {
         iface.getData(args.projection, args.spec,resultHandler);
       }
     }
@@ -2845,7 +2938,7 @@ public class CuratorService {
       }
     }
 
-    public static class setData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setData_args, Stat> {
+    public static class setData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setData_args, OptionalStat> {
       public setData() {
         super("setData");
       }
@@ -2854,10 +2947,10 @@ public class CuratorService {
         return new setData_args();
       }
 
-      public AsyncMethodCallback<Stat> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<OptionalStat> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<Stat>() { 
-          public void onComplete(Stat o) {
+        return new AsyncMethodCallback<OptionalStat>() { 
+          public void onComplete(OptionalStat o) {
             setData_result result = new setData_result();
             result.success = o;
             try {
@@ -2897,7 +2990,7 @@ public class CuratorService {
         return false;
       }
 
-      public void start(I iface, setData_args args, org.apache.thrift.async.AsyncMethodCallback<Stat> resultHandler) throws TException {
+      public void start(I iface, setData_args args, org.apache.thrift.async.AsyncMethodCallback<OptionalStat> resultHandler) throws TException {
         iface.setData(args.projection, args.spec,resultHandler);
       }
     }
@@ -3187,6 +3280,62 @@ public class CuratorService {
       }
     }
 
+    public static class sync<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sync_args, Void> {
+      public sync() {
+        super("sync");
+      }
+
+      public sync_args getEmptyArgsInstance() {
+        return new sync_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            sync_result result = new sync_result();
+            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;
+            sync_result result = new sync_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, sync_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.sync(args.projection, args.path, args.asyncContext,resultHandler);
+      }
+    }
+
   }
 
   public static class acquireLock_args implements org.apache.thrift.TBase<acquireLock_args, acquireLock_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireLock_args>   {
@@ -9543,7 +9692,7 @@ public class CuratorService {
   public static class getData_result implements org.apache.thrift.TBase<getData_result, getData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getData_result>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getData_result");
 
-    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+    private static final org.apache.thrift.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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
@@ -9552,7 +9701,7 @@ public class CuratorService {
       schemes.put(TupleScheme.class, new getData_resultTupleSchemeFactory());
     }
 
-    public ByteBuffer success; // required
+    public OptionalData success; // required
     public CuratorException ex1; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -9621,7 +9770,7 @@ public class CuratorService {
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalData.class)));
       tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -9632,7 +9781,7 @@ public class CuratorService {
     }
 
     public getData_result(
-      ByteBuffer success,
+      OptionalData success,
       CuratorException ex1)
     {
       this();
@@ -9645,8 +9794,7 @@ public class CuratorService {
      */
     public getData_result(getData_result other) {
       if (other.isSetSuccess()) {
-        this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
-;
+        this.success = new OptionalData(other.success);
       }
       if (other.isSetEx1()) {
         this.ex1 = new CuratorException(other.ex1);
@@ -9663,21 +9811,11 @@ public class CuratorService {
       this.ex1 = null;
     }
 
-    public byte[] getSuccess() {
-      setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
-      return success == null ? null : success.array();
-    }
-
-    public ByteBuffer bufferForSuccess() {
-      return success;
-    }
-
-    public getData_result setSuccess(byte[] success) {
-      setSuccess(success == null ? (ByteBuffer)null : ByteBuffer.wrap(success));
-      return this;
+    public OptionalData getSuccess() {
+      return this.success;
     }
 
-    public getData_result setSuccess(ByteBuffer success) {
+    public getData_result setSuccess(OptionalData success) {
       this.success = success;
       return this;
     }
@@ -9727,7 +9865,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((ByteBuffer)value);
+          setSuccess((OptionalData)value);
         }
         break;
 
@@ -9860,7 +9998,7 @@ public class CuratorService {
       if (this.success == null) {
         sb.append("null");
       } else {
-        org.apache.thrift.TBaseHelper.toString(this.success, sb);
+        sb.append(this.success);
       }
       first = false;
       if (!first) sb.append(", ");
@@ -9878,6 +10016,9 @@ public class CuratorService {
     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 {
@@ -9915,8 +10056,9 @@ public class CuratorService {
           }
           switch (schemeField.id) {
             case 0: // SUCCESS
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-                struct.success = iprot.readBinary();
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.success = new OptionalData();
+                struct.success.read(iprot);
                 struct.setSuccessIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -9948,7 +10090,7 @@ public class CuratorService {
         oprot.writeStructBegin(STRUCT_DESC);
         if (struct.success != null) {
           oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-          oprot.writeBinary(struct.success);
+          struct.success.write(oprot);
           oprot.writeFieldEnd();
         }
         if (struct.ex1 != null) {
@@ -9982,7 +10124,7 @@ public class CuratorService {
         }
         oprot.writeBitSet(optionals, 2);
         if (struct.isSetSuccess()) {
-          oprot.writeBinary(struct.success);
+          struct.success.write(oprot);
         }
         if (struct.isSetEx1()) {
           struct.ex1.write(oprot);
@@ -9994,7 +10136,8 @@ public class CuratorService {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
-          struct.success = iprot.readBinary();
+          struct.success = new OptionalData();
+          struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
         if (incoming.get(1)) {
@@ -16475,7 +16618,7 @@ public class CuratorService {
       schemes.put(TupleScheme.class, new setData_resultTupleSchemeFactory());
     }
 
-    public Stat success; // required
+    public OptionalStat success; // required
     public CuratorException ex1; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -16544,7 +16687,7 @@ public class CuratorService {
     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, Stat.class)));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalStat.class)));
       tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -16555,7 +16698,7 @@ public class CuratorService {
     }
 
     public setData_result(
-      Stat success,
+      OptionalStat success,
       CuratorException ex1)
     {
       this();
@@ -16568,7 +16711,7 @@ public class CuratorService {
      */
     public setData_result(setData_result other) {
       if (other.isSetSuccess()) {
-        this.success = new Stat(other.success);
+        this.success = new OptionalStat(other.success);
       }
       if (other.isSetEx1()) {
         this.ex1 = new CuratorException(other.ex1);
@@ -16585,11 +16728,11 @@ public class CuratorService {
       this.ex1 = null;
     }
 
-    public Stat getSuccess() {
+    public OptionalStat getSuccess() {
       return this.success;
     }
 
-    public setData_result setSuccess(Stat success) {
+    public setData_result setSuccess(OptionalStat success) {
       this.success = success;
       return this;
     }
@@ -16639,7 +16782,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((Stat)value);
+          setSuccess((OptionalStat)value);
         }
         break;
 
@@ -16831,7 +16974,7 @@ public class CuratorService {
           switch (schemeField.id) {
             case 0: // SUCCESS
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.success = new Stat();
+                struct.success = new OptionalStat();
                 struct.success.read(iprot);
                 struct.setSuccessIsSet(true);
               } else { 
@@ -16910,7 +17053,7 @@ public class CuratorService {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
-          struct.success = new Stat();
+          struct.success = new OptionalStat();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
@@ -22784,4 +22927,919 @@ public class CuratorService {
 
   }
 
+  public static class sync_args implements org.apache.thrift.TBase<sync_args, sync_args._Fields>, java.io.Serializable, Cloneable, Comparable<sync_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sync_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField ASYNC_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("asyncContext", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new sync_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new sync_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public String path; // required
+    public String asyncContext; // 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 {
+      PROJECTION((short)1, "projection"),
+      PATH((short)2, "path"),
+      ASYNC_CONTEXT((short)3, "asyncContext");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // PATH
+            return PATH;
+          case 3: // ASYNC_CONTEXT
+            return ASYNC_CONTEXT;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.ASYNC_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("asyncContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sync_args.class, metaDataMap);
+    }
+
+    public sync_args() {
+    }
+
+    public sync_args(
+      CuratorProjection projection,
+      String path,
+      String asyncContext)
+    {
+      this();
+      this.projection = projection;
+      this.path = path;
+      this.asyncContext = asyncContext;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public sync_args(sync_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetPath()) {
+        this.path = other.path;
+      }
+      if (other.isSetAsyncContext()) {
+        this.asyncContext = other.asyncContext;
+      }
+    }
+
+    public sync_args deepCopy() {
+      return new sync_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.path = null;
+      this.asyncContext = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public sync_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public String getPath() {
+      return this.path;
+    }
+
+    public sync_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
+
+    public void unsetPath() {
+      this.path = null;
+    }
+
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
+
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
+      }
+    }
+
+    public String getAsyncContext() {
+      return this.asyncContext;
+    }
+
+    public sync_args setAsyncContext(String asyncContext) {
+      this.asyncContext = asyncContext;
+      return this;
+    }
+
+    public void unsetAsyncContext() {
+      this.asyncContext = null;
+    }
+
+    /** Returns true if field asyncContext is set (has been assigned a value) and false otherwise */
+    public boolean isSetAsyncContext() {
+      return this.asyncContext != null;
+    }
+
+    public void setAsyncContextIsSet(boolean value) {
+      if (!value) {
+        this.asyncContext = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
+
+      case ASYNC_CONTEXT:
+        if (value == null) {
+          unsetAsyncContext();
+        } else {
+          setAsyncContext((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PATH:
+        return getPath();
+
+      case ASYNC_CONTEXT:
+        return getAsyncContext();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PATH:
+        return isSetPath();
+      case ASYNC_CONTEXT:
+        return isSetAsyncContext();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof sync_args)
+        return this.equals((sync_args)that);
+      return false;
+    }
+
+    public boolean equals(sync_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
+          return false;
+      }
+
+      boolean this_present_asyncContext = true && this.isSetAsyncContext();
+      boolean that_present_asyncContext = true && that.isSetAsyncContext();
+      if (this_present_asyncContext || that_present_asyncContext) {
+        if (!(this_present_asyncContext && that_present_asyncContext))
+          return false;
+        if (!this.asyncContext.equals(that.asyncContext))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(sync_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetAsyncContext()).compareTo(other.isSetAsyncContext());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAsyncContext()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.asyncContext, other.asyncContext);
+        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("sync_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("asyncContext:");
+      if (this.asyncContext == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.asyncContext);
+      }
+      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 (projection != null) {
+        projection.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 sync_argsStandardSchemeFactory implements SchemeFactory {
+      public sync_argsStandardScheme getScheme() {
+        return new sync_argsStandardScheme();
+      }
+    }
+
+    private static class sync_argsStandardScheme extends StandardScheme<sync_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, sync_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PATH
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.path = iprot.readString();
+                struct.setPathIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // ASYNC_CONTEXT
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.asyncContext = iprot.readString();
+                struct.setAsyncContextIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, sync_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.path != null) {
+          oprot.writeFieldBegin(PATH_FIELD_DESC);
+          oprot.writeString(struct.path);
+          oprot.writeFieldEnd();
+        }
+        if (struct.asyncContext != null) {
+          oprot.writeFieldBegin(ASYNC_CONTEXT_FIELD_DESC);
+          oprot.writeString(struct.asyncContext);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class sync_argsTupleSchemeFactory implements SchemeFactory {
+      public sync_argsTupleScheme getScheme() {
+        return new sync_argsTupleScheme();
+      }
+    }
+
+    private static class sync_argsTupleScheme extends TupleScheme<sync_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, sync_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetPath()) {
+          optionals.set(1);
+        }
+        if (struct.isSetAsyncContext()) {
+          optionals.set(2);
+        }
+        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetPath()) {
+          oprot.writeString(struct.path);
+        }
+        if (struct.isSetAsyncContext()) {
+          oprot.writeString(struct.asyncContext);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, sync_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(3);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.path = iprot.readString();
+          struct.setPathIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.asyncContext = iprot.readString();
+          struct.setAsyncContextIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class sync_result implements org.apache.thrift.TBase<sync_result, sync_result._Fields>, java.io.Serializable, Cloneable, Comparable<sync_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sync_result");
+
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new sync_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new sync_resultTupleSchemeFactory());
+    }
+
+    public CuratorException ex1; // 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 {
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          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.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(sync_result.class, metaDataMap);
+    }
+
+    public sync_result() {
+    }
+
+    public sync_result(
+      CuratorException ex1)
+    {
+      this();
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public sync_result(sync_result other) {
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public sync_result deepCopy() {
+      return new sync_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.ex1 = null;
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public sync_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case EX1:
+        return getEx1();
+
+      }
+      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 EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof sync_result)
+        return this.equals((sync_result)that);
+      return false;
+    }
+
+    public boolean equals(sync_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(sync_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("sync_result(");
+      boolean first = true;
+
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 sync_resultStandardSchemeFactory implements SchemeFactory {
+      public sync_resultStandardScheme getScheme() {
+        return new sync_resultStandardScheme();
+      }
+    }
+
+    private static class sync_resultStandardScheme extends StandardScheme<sync_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, sync_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, sync_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class sync_resultTupleSchemeFactory implements SchemeFactory {
+      public sync_resultTupleScheme getScheme() {
+        return new sync_resultTupleScheme();
+      }
+    }
+
+    private static class sync_resultTupleScheme extends TupleScheme<sync_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, sync_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetEx1()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, sync_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
+      }
+    }
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java
new file mode 100644
index 0000000..c9b720b
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalData.java
@@ -0,0 +1,399 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 OptionalData implements org.apache.thrift.TBase<OptionalData, OptionalData._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalData> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalData");
+
+  private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new OptionalDataStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new OptionalDataTupleSchemeFactory());
+  }
+
+  public ByteBuffer data; // 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 {
+    DATA((short)1, "data");
+
+    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: // DATA
+          return DATA;
+        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.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", 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(OptionalData.class, metaDataMap);
+  }
+
+  public OptionalData() {
+  }
+
+  public OptionalData(
+    ByteBuffer data)
+  {
+    this();
+    this.data = data;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public OptionalData(OptionalData other) {
+    if (other.isSetData()) {
+      this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
+;
+    }
+  }
+
+  public OptionalData deepCopy() {
+    return new OptionalData(this);
+  }
+
+  @Override
+  public void clear() {
+    this.data = null;
+  }
+
+  public byte[] getData() {
+    setData(org.apache.thrift.TBaseHelper.rightSize(data));
+    return data == null ? null : data.array();
+  }
+
+  public ByteBuffer bufferForData() {
+    return data;
+  }
+
+  public OptionalData setData(byte[] data) {
+    setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
+    return this;
+  }
+
+  public OptionalData setData(ByteBuffer data) {
+    this.data = data;
+    return this;
+  }
+
+  public void unsetData() {
+    this.data = null;
+  }
+
+  /** Returns true if field data is set (has been assigned a value) and false otherwise */
+  public boolean isSetData() {
+    return this.data != null;
+  }
+
+  public void setDataIsSet(boolean value) {
+    if (!value) {
+      this.data = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case DATA:
+      if (value == null) {
+        unsetData();
+      } else {
+        setData((ByteBuffer)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case DATA:
+      return getData();
+
+    }
+    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 DATA:
+      return isSetData();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof OptionalData)
+      return this.equals((OptionalData)that);
+    return false;
+  }
+
+  public boolean equals(OptionalData that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_data = true && this.isSetData();
+    boolean that_present_data = true && that.isSetData();
+    if (this_present_data || that_present_data) {
+      if (!(this_present_data && that_present_data))
+        return false;
+      if (!this.data.equals(that.data))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(OptionalData other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetData()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
+      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("OptionalData(");
+    boolean first = true;
+
+    sb.append("data:");
+    if (this.data == null) {
+      sb.append("null");
+    } else {
+      org.apache.thrift.TBaseHelper.toString(this.data, 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 OptionalDataStandardSchemeFactory implements SchemeFactory {
+    public OptionalDataStandardScheme getScheme() {
+      return new OptionalDataStandardScheme();
+    }
+  }
+
+  private static class OptionalDataStandardScheme extends StandardScheme<OptionalData> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalData 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: // DATA
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.data = iprot.readBinary();
+              struct.setDataIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, OptionalData struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.data != null) {
+        oprot.writeFieldBegin(DATA_FIELD_DESC);
+        oprot.writeBinary(struct.data);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class OptionalDataTupleSchemeFactory implements SchemeFactory {
+    public OptionalDataTupleScheme getScheme() {
+      return new OptionalDataTupleScheme();
+    }
+  }
+
+  private static class OptionalDataTupleScheme extends TupleScheme<OptionalData> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, OptionalData struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetData()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetData()) {
+        oprot.writeBinary(struct.data);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, OptionalData struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.data = iprot.readBinary();
+        struct.setDataIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/e118ad01/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 43a2ffc..931cb8d 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -114,8 +114,9 @@ public class TestClient
         GetDataSpec getDataSpec = new GetDataSpec();
         getDataSpec.watched = true;
         getDataSpec.path = "/a/b/c";
-        ByteBuffer data = client.getData(curatorProjection, getDataSpec);
-        System.out.println("getData: " + new String(data.array()));
+        getDataSpec.asyncContext = "hey";
+        OptionalData optionalData = client.getData(curatorProjection, getDataSpec);
+        System.out.println("getData: " + optionalData);
 
         ExistsSpec existsSpec = new ExistsSpec();
         existsSpec.path = "/a/b/c";


[39/50] [abbrv] git commit: start writing RPC tests

Posted by ra...@apache.org.
start writing RPC tests


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bee07a52
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bee07a52
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bee07a52

Branch: refs/heads/master
Commit: bee07a525682436ce33e7110b8f6688ec1df285f
Parents: f3ec63c
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 16:11:02 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 16:11:02 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/CuratorProjectionServer.java  |  14 +-
 .../java/org/apache/curator/x/rpc/RpcTests.java | 207 +++++++++++++++++++
 2 files changed, 217 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/bee07a52/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index 806f06e..a01f462 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -77,10 +77,7 @@ public class CuratorProjectionServer
             configurationSource = args[0];
         }
 
-        Configuration configuration = new ConfigurationBuilder(configurationSource).build();
-
-        final CuratorProjectionServer server = new CuratorProjectionServer(configuration);
-        server.start();
+        final CuratorProjectionServer server = startServer(configurationSource);
 
         Runnable shutdown = new Runnable()
         {
@@ -94,6 +91,15 @@ public class CuratorProjectionServer
         Runtime.getRuntime().addShutdownHook(hook);
     }
 
+    public static CuratorProjectionServer startServer(String configurationSource) throws Exception
+    {
+        Configuration configuration = new ConfigurationBuilder(configurationSource).build();
+
+        final CuratorProjectionServer server = new CuratorProjectionServer(configuration);
+        server.start();
+        return server;
+    }
+
     public CuratorProjectionServer(Configuration configuration)
     {
         this.configuration = configuration;

http://git-wip-us.apache.org/repos/asf/curator/blob/bee07a52/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
new file mode 100644
index 0000000..5a83b25
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -0,0 +1,207 @@
+package org.apache.curator.x.rpc;
+
+import org.apache.curator.generated.*;
+import org.apache.curator.test.BaseClassForTests;
+import org.apache.curator.test.InstanceSpec;
+import org.apache.curator.test.Timing;
+import org.apache.curator.utils.ThreadUtils;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.node.ArrayNode;
+import org.codehaus.jackson.node.ObjectNode;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import java.nio.ByteBuffer;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class RpcTests extends BaseClassForTests
+{
+    private Timing timing = new Timing();
+    private CuratorProjectionServer thriftServer;
+    private CuratorService.Client curatorServiceClient;
+    private EventService.Client eventServiceClient;
+    private int thriftPort;
+
+    @BeforeMethod
+    @Override
+    public void setup() throws Exception
+    {
+        super.setup();
+
+        ObjectMapper mapper = new ObjectMapper();
+
+        ObjectNode connectionNode = mapper.createObjectNode();
+        connectionNode.put("name", "test");
+        connectionNode.put("connectionString", server.getConnectString());
+
+        ObjectNode thriftNode = mapper.createObjectNode();
+        thriftPort = InstanceSpec.getRandomPort();
+        thriftNode.put("port", thriftPort);
+
+        ArrayNode connections = mapper.createArrayNode();
+        connections.add(connectionNode);
+
+        ObjectNode node = mapper.createObjectNode();
+        node.put("connections", connections);
+        node.put("thrift", thriftNode);
+
+        final String configurationJson = mapper.writeValueAsString(node);
+
+        thriftServer = CuratorProjectionServer.startServer(configurationJson);
+
+        TSocket clientTransport = new TSocket("localhost", thriftPort);
+        clientTransport.setTimeout(timing.connection());
+        clientTransport.open();
+        TProtocol clientProtocol = new TBinaryProtocol(clientTransport);
+        curatorServiceClient = new CuratorService.Client(clientProtocol);
+
+        TSocket eventTransport = new TSocket("localhost", thriftPort);
+        eventTransport.setTimeout(timing.connection());
+        eventTransport.open();
+        TProtocol eventProtocol = new TBinaryProtocol(eventTransport);
+        eventServiceClient = new EventService.Client(eventProtocol);
+
+    }
+
+    @AfterMethod
+    @Override
+    public void teardown() throws Exception
+    {
+        thriftServer.stop();
+
+        super.teardown();
+    }
+
+    @Test
+    public void testBasic() throws Exception
+    {
+        CuratorProjection curatorProjection = curatorServiceClient.newCuratorProjection("test");
+        CreateSpec spec = new CreateSpec();
+        spec.path = "/test";
+        spec.data = ByteBuffer.wrap("value".getBytes());
+        OptionalPath node = curatorServiceClient.createNode(curatorProjection, spec);
+        Assert.assertEquals(node.path, "/test");
+
+        GetDataSpec dataSpec = new GetDataSpec();
+        dataSpec.path = "/test";
+        OptionalData data = curatorServiceClient.getData(curatorProjection, dataSpec);
+        Assert.assertEquals(data.data, ByteBuffer.wrap("value".getBytes()));
+    }
+
+    @Test
+    public void testEvents() throws Exception
+    {
+        final CuratorProjection curatorProjection = curatorServiceClient.newCuratorProjection("test");
+
+        final CountDownLatch connectedLatch = new CountDownLatch(1);
+        final CountDownLatch nodeCreatedLatch = new CountDownLatch(1);
+        Callable<Void> proc = new Callable<Void>()
+        {
+            @Override
+            public Void call() throws Exception
+            {
+                while ( !Thread.currentThread().isInterrupted() )
+                {
+                    CuratorEvent event = eventServiceClient.getNextEvent(curatorProjection);
+                    if ( event.type == CuratorEventType.CONNECTION_CONNECTED )
+                    {
+                        connectedLatch.countDown();
+                    }
+                    else if ( event.type == CuratorEventType.WATCHED )
+                    {
+                        if ( event.watchedEvent.eventType == EventType.NodeCreated )
+                        {
+                            nodeCreatedLatch.countDown();
+                        }
+                    }
+                }
+                return null;
+            }
+        };
+        Future<Void> eventFuture = ThreadUtils.newSingleThreadExecutor("test").submit(proc);
+
+        Assert.assertTrue(timing.awaitLatch(connectedLatch));
+
+        ExistsSpec spec = new ExistsSpec();
+        spec.path = "/test";
+        spec.watched = true;
+        curatorServiceClient.exists(curatorProjection, spec);
+
+        CreateSpec createSpec = new CreateSpec();
+        createSpec.path = "/test";
+        curatorServiceClient.createNode(curatorProjection, createSpec);
+
+        Assert.assertTrue(timing.awaitLatch(nodeCreatedLatch));
+
+        eventFuture.cancel(true);
+    }
+
+    @Test
+    public void testLockMultiThread() throws Exception
+    {
+        final Timing timing = new Timing();
+
+        TSocket clientTransport = new TSocket("localhost", thriftPort);
+        clientTransport.setTimeout(timing.connection());
+        clientTransport.open();
+        TProtocol clientProtocol = new TBinaryProtocol(clientTransport);
+        final CuratorService.Client secondCuratorServiceClient = new CuratorService.Client(clientProtocol);
+        ExecutorService service = ThreadUtils.newFixedThreadPool(2, "test");
+        ExecutorCompletionService<Void> completer = new ExecutorCompletionService<Void>(service);
+
+        final CountDownLatch lockLatch = new CountDownLatch(2);
+        final AtomicBoolean hasTheLock = new AtomicBoolean();
+        for ( int i = 0; i < 2; ++i )
+        {
+            final CuratorService.Client client = (i == 0) ? curatorServiceClient : secondCuratorServiceClient;
+            Callable<Void> proc = new Callable<Void>()
+            {
+                @Override
+                public Void call() throws Exception
+                {
+                    CuratorProjection curatorProjection = client.newCuratorProjection("test");
+                    LockProjection lockProjection = client.acquireLock(curatorProjection, "/lock", timing.forWaiting().milliseconds());
+                    if ( lockProjection.id == null )
+                    {
+                        throw new Exception("Could not acquire lock");
+                    }
+                    try
+                    {
+                        if ( !hasTheLock.compareAndSet(false, true) )
+                        {
+                            throw new Exception("Two lockers");
+                        }
+
+                        timing.sleepABit();
+                    }
+                    finally
+                    {
+                        hasTheLock.set(false);
+                        lockLatch.countDown();
+                        client.closeGenericProjection(curatorProjection, lockProjection.id);
+                    }
+
+                    return null;
+                }
+            };
+            completer.submit(proc);
+        }
+
+        completer.take().get();
+        completer.take().get();
+
+        Assert.assertTrue(timing.awaitLatch(lockLatch));
+
+        service.shutdownNow();
+    }
+}
+


[48/50] [abbrv] git commit: updated

Posted by ra...@apache.org.
updated


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0a558a33
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0a558a33
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0a558a33

Branch: refs/heads/master
Commit: 0a558a337fcceeac117354004e15970c5b2d12a9
Parents: 7016d17
Author: randgalt <ra...@apache.org>
Authored: Tue Jun 3 12:40:26 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue Jun 3 12:40:26 2014 -0500

----------------------------------------------------------------------
 .../src/site/resources/images/topology.png      | Bin 128290 -> 135534 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/0a558a33/curator-x-rpc/src/site/resources/images/topology.png
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/resources/images/topology.png b/curator-x-rpc/src/site/resources/images/topology.png
index 5166848..cec7330 100644
Binary files a/curator-x-rpc/src/site/resources/images/topology.png and b/curator-x-rpc/src/site/resources/images/topology.png differ


[33/50] [abbrv] git commit: wip on doc

Posted by ra...@apache.org.
wip on doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/48b0759b
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/48b0759b
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/48b0759b

Branch: refs/heads/master
Commit: 48b0759b735a889a12f421994f051616b5c62248
Parents: 78460f9
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 12:52:55 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 12:52:55 2014 -0500

----------------------------------------------------------------------
 .../src/site/confluence/deploy.confluence       |   4 +-
 .../src/site/confluence/events.confluence       |   4 +
 .../src/site/confluence/index.confluence        |   6 +-
 .../src/site/confluence/usage.confluence        |  85 +++++++++-
 .../org/apache/curator/x/rpc/TestClient.java    | 167 +++++++++++++++++++
 .../org/apache/curator/x/rpc/TestServer.java    |  34 ++++
 6 files changed, 294 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/site/confluence/deploy.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
index af3b682..8c93cb8 100644
--- a/curator-x-rpc/src/site/confluence/deploy.confluence
+++ b/curator-x-rpc/src/site/confluence/deploy.confluence
@@ -11,13 +11,13 @@ Curator RPC is built as an "uber" Java JAR and can be downloaded from Maven Cent
 java -jar curator-x-rpc-VERSION.jar <argument>
 {noformat}
 
-The argument is either a configuration file or a JSON or YAML string. See [[Configuration|configuration.html]] for details.
+The argument is either a configuration file or a JSON or YAML string. Call without the argument for help text. See [[Configuration|configuration.html]] for details.
 
 h2. Deploying
 
 Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper
 (see the figure below). Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more
-ZooKeeper clusters. The Curator Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by ID.
+ZooKeeper clusters. The Curator Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by name.
 
 How you configure your server to launch depends on your environment and other needs. Here are some suggestions:
 

http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/site/confluence/events.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
new file mode 100644
index 0000000..416b978
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/events.confluence
@@ -0,0 +1,4 @@
+[[Curator RPC Proxy|index.html]] / Events
+
+h1. Events
+

http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
index f29aff9..962a3e1 100644
--- a/curator-x-rpc/src/site/confluence/index.confluence
+++ b/curator-x-rpc/src/site/confluence/index.confluence
@@ -29,4 +29,8 @@ See the [[Usage Page|usage.html]] for details on using the RPC proxy.
 
 h2. Configuration
 
-See the [[Configuration|configuration.html]] for details on configuring the RPC proxy.
+See [[Configuration|configuration.html]] for details on configuring the RPC proxy.
+
+h2. Events
+
+See [[Events|events.html]] for details on the Curator RPC event loop and its structure.

http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index a20c13f..9ddaf97 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -18,10 +18,89 @@ Three Thrift Services are included with the Curator RPC:
 
 ||Service||Description||
 |CuratorService|The main service for accessing the Curator APIs and recipes|
-|EventService|Used to receive out-of-band messages for callbacks, watchers, etc|
+|EventService|Used to receive out\-of\-band messages for callbacks, watchers, etc. See [Events|events.html] for details.|
 |DiscoveryService|Curator's ServiceDiscovery recipe|
 
 h2. Concepts
 
-_Projections - Many of the Curator RPC APIs refer to "projections" (e.g. CuratorProjection). A projection is an id that refers
-to a real object instance inside of the RPC server.
+h4. Projections
+
+Many of the Curator RPC APIs refer to "projections" (e.g. CuratorProjection). A projection is an id that refers
+to a real object instance inside of the RPC server. The projection is a "handle" or "cookie" that directly refers to that instance.
+
+h4. Thrift Client Equals a Thread
+
+It's important to remember that each thrift client is the equivalent of a system thread. i.e. you cannot have multiple outstanding
+calls in multiple threads with a given client. For each thread, you should allocate a separate client. A Thrift Client maps directly
+to a single TCP/IP socket.
+
+h4. Event Loop
+
+You must dedicate a separate thread for getting events via the Curator RPC [EventService|events.html]. Curator will report async results,
+connection state changes, watcher triggers, etc. via this event loop.
+
+h4. CuratorProjection Expiration
+
+If you don't make an API call using a CuratorProjection within the [configured timeout|configuration.html] the projection instance
+will be closed and any open recipes, etc. associated with it will be closed. NOTE: calls to the EventService will cause the
+CuratorProjection to be "touched". So, as long as your event loop is running your CuratorProjection instance will be kept open.
+
+h2. Initialization
+
+After setting up Thrift, create a connection to the CuratorService and the EventService. If you plan on using Curator Discovery, create a connection
+to DiscoveryService. Allocate a CuratorProjection instance and then start a thread watching events for that instance. Here is pseudo code:
+
+{code}
+CuratorService.Client curatorService = new CuratorService.Client()
+EventService.Client eventService = new EventService.Client()
+
+curatorProjection = curatorService.newCuratorProjection(name)
+
+inThread => {
+    while ( isOpen ) {
+        event = eventService.getNextEvent(curatorProjection)
+        ... process event ...
+    }
+}
+{code}
+
+h2. Usage
+
+Once initialized, use recipes/APIs as needed. Here is an example of using the lock recipe:
+
+{code}
+lockId = client.acquireLock(curatorProjection, "/mylock", 10000);
+if lockId.id == null {
+    // lock attempt failed. Throw exception, etc.
+}
+
+// you now own the lock
+
+client.closeGenericProjection(curatorProjection, lockId.id);
+{code}
+
+Here is an example of using the path cache:
+
+{code}
+cacheProjection = client.startPathChildrenCache(curatorProjection, "/path", true, false, BUILD_INITIAL_CACHE)
+
+...
+
+data = client.getPathChildrenCacheDataForPath(curatorProjection, cacheProjection, "/path/child");
+
+...
+
+// in your event loop, you will get events for the cache. e.g.
+event = eventService.getNextEvent(curatorProjection)
+if event.type == PATH_CHILDREN_CACHE {
+    if event.childrenCacheEvent.type == CHILD_UPDATED {
+        // node described by event.childrenCacheEvent.data has changed
+        // event.childrenCacheEvent.cachedPath is the path that was passed to startPathChildrenCache()
+    }
+}
+
+...
+
+// when done with the cache, close it
+client.closeGenericProjection(curatorProjection, cacheProjection.id);
+{code}

http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
new file mode 100644
index 0000000..43a2ffc
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -0,0 +1,167 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc;
+
+import org.apache.curator.generated.*;
+import org.apache.thrift.TException;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.concurrent.Executors;
+
+public class TestClient
+{
+    public static void main(String[] args) throws Exception
+    {
+        TSocket clientTransport = new TSocket("localhost", 8899);
+        clientTransport.open();
+        TProtocol clientProtocol = new TBinaryProtocol(clientTransport);
+        final CuratorService.Client client = new CuratorService.Client(clientProtocol);
+
+        TSocket eventTransport = new TSocket("localhost", 8899);
+        eventTransport.open();
+        TProtocol eventProtocol = new TBinaryProtocol(eventTransport);
+        final EventService.Client serviceClient = new EventService.Client(eventProtocol);
+
+        TSocket discoveryTransport = new TSocket("localhost", 8899);
+        discoveryTransport.open();
+        TProtocol discoveryProtocol = new TBinaryProtocol(discoveryTransport);
+        final DiscoveryService.Client discoveryClient = new DiscoveryService.Client(discoveryProtocol);
+
+        final CuratorProjection curatorProjection = client.newCuratorProjection("test");
+
+        Executors.newSingleThreadExecutor().submit
+        (
+            new Runnable()
+            {
+                @Override
+                public void run()
+                {
+                    try
+                    {
+                        //noinspection InfiniteLoopStatement
+                        for(;;)
+                        {
+                            CuratorEvent nextEvent = serviceClient.getNextEvent(curatorProjection);
+                            System.out.println(nextEvent);
+                        }
+                    }
+                    catch ( TException e )
+                    {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        );
+
+        CreateSpec createSpec = new CreateSpec();
+        createSpec.path = "/this/should/fail";
+        createSpec.data = ByteBuffer.wrap("hey".getBytes());
+        try
+        {
+            client.createNode(curatorProjection, createSpec);
+        }
+        catch ( CuratorException e )
+        {
+            System.out.println("Ex: " + e);
+        }
+
+        createSpec = new CreateSpec();
+        createSpec.path = "/a/b/c";
+        createSpec.creatingParentsIfNeeded = true;
+        createSpec.data = ByteBuffer.wrap("hey".getBytes());
+        OptionalPath path = client.createNode(curatorProjection, createSpec);
+        System.out.println("Path: " + path);
+
+        PathChildrenCacheProjection pathChildrenCacheProjection = client.startPathChildrenCache(curatorProjection, "/a/b", true, false, PathChildrenCacheStartMode.BUILD_INITIAL_CACHE);
+
+        NodeCacheProjection nodeCache = client.startNodeCache(curatorProjection, "/a/b/c", false, true);
+        ChildData nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
+        System.out.println("nodeCacheData: " + nodeCacheData);
+
+        List<ChildData> pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
+        System.out.println("Child data: " + pathChildrenCacheData);
+
+        GetChildrenSpec getChildrenSpec = new GetChildrenSpec();
+        getChildrenSpec.path = "/a";
+        OptionalChildrenList children = client.getChildren(curatorProjection, getChildrenSpec);
+        System.out.println("Children: " + children);
+
+        ChildData pathChildrenCacheDataForPath = client.getPathChildrenCacheDataForPath(curatorProjection, pathChildrenCacheProjection, "/a/b/c");
+        System.out.println(pathChildrenCacheDataForPath);
+
+        LockProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
+        client.closeGenericProjection(curatorProjection, lockId.id);
+
+        GetDataSpec getDataSpec = new GetDataSpec();
+        getDataSpec.watched = true;
+        getDataSpec.path = "/a/b/c";
+        ByteBuffer data = client.getData(curatorProjection, getDataSpec);
+        System.out.println("getData: " + new String(data.array()));
+
+        ExistsSpec existsSpec = new ExistsSpec();
+        existsSpec.path = "/a/b/c";
+        System.out.println("exists: " + client.exists(curatorProjection, existsSpec));
+
+        DeleteSpec deleteSpec = new DeleteSpec();
+        deleteSpec.path = "/a/b/c";
+        client.deleteNode(curatorProjection, deleteSpec);
+
+        System.out.println("exists: " + client.exists(curatorProjection, existsSpec));
+
+        LeaderResult leader = client.startLeaderSelector(curatorProjection, "/leader", "me", 10000);
+        System.out.println("Has Leader: " + leader.hasLeadership);
+
+        List<Participant> leaderParticipants = client.getLeaderParticipants(curatorProjection, leader.projection);
+        System.out.println("Participants: " + leaderParticipants);
+
+        boolean isLeader = client.isLeader(curatorProjection, leader.projection);
+        System.out.println("isLeader: " + isLeader);
+
+        client.closeGenericProjection(curatorProjection, leader.projection.id);
+
+        pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
+        System.out.println("Child data: " + pathChildrenCacheData);
+
+        nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
+        System.out.println("nodeCacheData: " + nodeCacheData);
+
+        PersistentEphemeralNodeProjection node = client.startPersistentEphemeralNode(curatorProjection, "/my/path", ByteBuffer.wrap("hey".getBytes()), PersistentEphemeralNodeMode.EPHEMERAL);
+        existsSpec.path = "/my/path";
+        OptionalStat nodeExists = client.exists(curatorProjection, existsSpec);
+        System.out.println("nodeExists: " + nodeExists);
+        client.closeGenericProjection(curatorProjection, node.id);
+
+        List<LeaseProjection> leaseProjections = client.startSemaphore(curatorProjection, "/semi", 3, 1000, 10);
+        System.out.println("leaseProjections: " + leaseProjections);
+        for ( LeaseProjection leaseProjection : leaseProjections )
+        {
+            client.closeGenericProjection(curatorProjection, leaseProjection.id);
+        }
+
+        DiscoveryInstance yourInstance = discoveryClient.makeDiscoveryInstance("mine", ByteBuffer.wrap(new byte[]{}), 8080);
+        DiscoveryProjection discovery = discoveryClient.startDiscovery(curatorProjection, "/discovery", yourInstance);
+        DiscoveryProviderProjection provider = discoveryClient.startProvider(curatorProjection, discovery, "mine", ProviderStrategyType.ROUND_ROBIN, 1000, 3);
+
+        DiscoveryInstance instance = discoveryClient.getInstance(curatorProjection, provider);
+        System.out.println("Instance: " + instance);
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/48b0759b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
new file mode 100644
index 0000000..3564777
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc;
+
+import com.google.common.io.Resources;
+import org.apache.curator.test.TestingServer;
+import java.nio.charset.Charset;
+
+public class TestServer
+{
+    public static void main(String[] args) throws Exception
+    {
+        new TestingServer(2181);
+
+        String configurationSource = Resources.toString(Resources.getResource("configuration/test.json"), Charset.defaultCharset());
+        CuratorProjectionServer.main(new String[]{configurationSource});
+    }
+}


[27/50] [abbrv] git commit: wip

Posted by ra...@apache.org.
wip


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/09f030e2
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/09f030e2
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/09f030e2

Branch: refs/heads/master
Commit: 09f030e2a368c03599d6305b829db5b10a9d19a2
Parents: a2b0ffd
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 10:46:07 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 10:46:07 2014 -0500

----------------------------------------------------------------------
 .../src/site/confluence/index.confluence        |  14 ++++----
 .../src/site/confluence/index.confluence        |   8 ++---
 .../src/site/confluence/index.confluence        |   2 +-
 .../src/site/confluence/index.confluence        |   2 +-
 .../curator/x/rpc/CuratorProjectionServer.java  |   7 ++++
 .../AuthorizationConfiguration.java             |  18 ++++++++++
 ...dedExponentialBackoffRetryConfiguration.java |  18 ++++++++++
 .../x/rpc/configuration/Configuration.java      |  18 ++++++++++
 .../rpc/configuration/ConfigurationBuilder.java |  18 ++++++++++
 .../configuration/ConnectionConfiguration.java  |  18 ++++++++++
 .../ExponentialBackoffRetryConfiguration.java   |  18 ++++++++++
 .../configuration/RetryNTimesConfiguration.java |  18 ++++++++++
 .../configuration/RetryPolicyConfiguration.java |  18 ++++++++++
 .../curator/x/rpc/connections/Closer.java       |  18 ++++++++++
 .../x/rpc/connections/ConnectionManager.java    |  18 ++++++++++
 .../curator/x/rpc/connections/CuratorEntry.java |  18 ++++++++++
 .../x/rpc/details/RpcBackgroundCallback.java    |  18 ++++++++++
 .../curator/x/rpc/details/RpcWatcher.java       |  18 ++++++++++
 .../x/rpc/idl/discovery/DiscoveryInstance.java  |  18 ++++++++++
 .../idl/discovery/DiscoveryInstanceType.java    |  18 ++++++++++
 .../x/rpc/idl/discovery/DiscoveryService.java   |  18 ++++++++++
 .../idl/discovery/DiscoveryServiceLowLevel.java |  18 ++++++++++
 .../rpc/idl/discovery/ProviderStrategyType.java |  18 ++++++++++
 .../x/rpc/idl/exceptions/ExceptionType.java     |  18 ++++++++++
 .../x/rpc/idl/exceptions/NodeExceptionType.java |  18 ++++++++++
 .../x/rpc/idl/exceptions/RpcException.java      |  18 ++++++++++
 .../idl/exceptions/ZooKeeperExceptionType.java  |  18 ++++++++++
 .../x/rpc/idl/services/EventService.java        |  18 ++++++++++
 .../curator/x/rpc/idl/structs/LeaderEvent.java  |  18 ++++++++++
 .../x/rpc/idl/structs/LeaderProjection.java     |  18 ++++++++++
 .../curator/x/rpc/idl/structs/LeaderResult.java |  18 ++++++++++
 .../x/rpc/idl/structs/LeaseProjection.java      |  18 ++++++++++
 .../x/rpc/idl/structs/LockProjection.java       |  18 ++++++++++
 .../x/rpc/idl/structs/NodeCacheProjection.java  |  18 ++++++++++
 .../x/rpc/idl/structs/OptionalChildrenList.java |  18 ++++++++++
 .../curator/x/rpc/idl/structs/OptionalPath.java |  18 ++++++++++
 .../structs/PathChildrenCacheProjection.java    |  18 ++++++++++
 .../idl/structs/PathChildrenCacheStartMode.java |  18 ++++++++++
 .../PersistentEphemeralNodeProjection.java      |  18 ++++++++++
 .../curator/x/rpc/idl/structs/RpcChildData.java |  18 ++++++++++
 .../x/rpc/idl/structs/RpcParticipant.java       |  18 ++++++++++
 .../idl/structs/RpcPathChildrenCacheEvent.java  |  18 ++++++++++
 .../structs/RpcPathChildrenCacheEventType.java  |  18 ++++++++++
 .../structs/RpcPersistentEphemeralNodeMode.java |  18 ++++++++++
 .../curator/x/rpc/idl/structs/Version.java      |  18 ++++++++++
 .../src/main/resources/curator/help.txt         |  19 +++++++++++
 .../src/site/confluence/index.confluence        |  28 ++++++++++++++++
 .../src/site/resources/images/topology.png      | Bin 0 -> 128290 bytes
 curator-x-rpc/src/site/site.xml                 |  33 +++++++++++++++++++
 .../org/apache/curator/x/rpc/TestServer.java    |  18 ++++++++++
 .../configuration/TestConfigurationBuilder.java |  18 ++++++++++
 src/site/confluence/getting-started.confluence  |   4 +--
 src/site/confluence/index.confluence            |   2 +-
 src/site/site.xml                               |   1 +
 54 files changed, 860 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-client/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-client/src/site/confluence/index.confluence b/curator-client/src/site/confluence/index.confluence
index 7d827db..18e4f94 100644
--- a/curator-client/src/site/confluence/index.confluence
+++ b/curator-client/src/site/confluence/index.confluence
@@ -1,18 +1,18 @@
 h1. Client
 
 h2. IMPORTANT NOTE
-The Curator Client is a low-level API. It is strongly recommended that you use the Curator [[Framework|../curator-framework/index.html]]
+The Curator Client is a low\-level API. It is strongly recommended that you use the Curator [[Framework|../curator-framework/index.html]]
 instead of directly using CuratorZookeeperClient.
 
 h2. Background
 CuratorZookeeperClient is a wrapper around ZooKeeper's Java client that makes client access to ZooKeeper much simpler and
 less error prone. It provides the following features:
 
-* Continuous connection management - ZooKeeper has many caveats regarding connection management (see the ZooKeeper FAQ for
+* Continuous connection management \- ZooKeeper has many caveats regarding connection management (see the ZooKeeper FAQ for
 details). CuratorZookeeperClient takes care of most of them automatically.
 
-* Operation retry utilities - a method for retrying operations is provided
-* Test ZooKeeper server - an in-process, self-contained ZooKeeper test server is provided that can be used for test cases and experimentation
+* Operation retry utilities \- a method for retrying operations is provided
+* Test ZooKeeper server \- an in\-process, self\-contained ZooKeeper test server is provided that can be used for test cases and experimentation
 
 h2. Method Documentation
 ||Method||Description||
@@ -22,7 +22,7 @@ h2. Method Documentation
 |blockUntilConnectedOrTimedOut()|A convenience method that blocks until the initial connection is successful or times out|
 |close()|Close the connection|
 |setRetryPolicy()|Change the retry policy|
-|newRetryLoop()|Allocate a new Retry Loop - see details below|
+|newRetryLoop()|Allocate a new Retry Loop \- see details below|
 
 h2. Retry Loop
 For a variety of reasons, operations on a ZooKeeper cluster can fail. Best practices dictate that these operations should be retried. The Retry Loop mechanism provides the means to do this. <b>Every operation should be wrapped in a retry loop</b>. Here's the canonical usage:
@@ -34,7 +34,7 @@ while ( retryLoop.shouldContinue() )
    {
        // perform your work
        ...
-       // it's important to re-get the ZK instance as there may have been an error and the instance was re-created
+       // it's important to re\-get the ZK instance as there may have been an error and the instance was re\-created
        ZooKeeper      zk = client.getZookeeper();
        retryLoop.markComplete();
    }
@@ -45,7 +45,7 @@ while ( retryLoop.shouldContinue() )
 }
 {code}
 
-The Retry Loop maintains a count of retries and determines if a given error is retry-able. If an operation is a candidate for retrying, the Retry Policy is invoked to determine if the retry should proceed.
+The Retry Loop maintains a count of retries and determines if a given error is retry\-able. If an operation is a candidate for retrying, the Retry Policy is invoked to determine if the retry should proceed.
 
 As a convenience, RetryLoop has a static method that takes a Callable to perform a complete retry loop on. E.g.
 {code}

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-framework/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-framework/src/site/confluence/index.confluence b/curator-framework/src/site/confluence/index.confluence
index 072acff..9b8159d 100644
--- a/curator-framework/src/site/confluence/index.confluence
+++ b/curator-framework/src/site/confluence/index.confluence
@@ -1,6 +1,6 @@
 h1. Framework
 
-The Curator Framework is a high-level API that greatly simplifies using ZooKeeper. It adds many features that build on
+The Curator Framework is a high\-level API that greatly simplifies using ZooKeeper. It adds many features that build on
 ZooKeeper and handles the complexity of managing connections to the ZooKeeper cluster and retrying operations. Some of the features are:
 
 * Automatic connection management:
@@ -19,15 +19,15 @@ ZooKeeper and handles the complexity of managing connections to the ZooKeeper cl
 
 h2. Allocating a Curator Framework Instance
 CuratorFrameworks are allocated using the CuratorFrameworkFactory which provides both factory methods and a builder for
-creating instances. IMPORTANT: CuratorFramework instances are fully thread-safe. You should share one CuratorFramework per
+creating instances. IMPORTANT: CuratorFramework instances are fully thread\-safe. You should share one CuratorFramework per
 ZooKeeper cluster in your application.
 
 The factory methods (newClient()) provide a simplified way of creating an instance. The Builder gives control over all
 parameters. Once you have a CuratorFramework instance, you must call the start() method. At the end of your application, you should call close().
 
 h2. CuratorFramework API
-The CuratorFramework uses a Fluent-style interface. Operations are constructed using builders returned by the CuratorFramework
-instance. When strung together, the methods form sentence-like statements. e.g.
+The CuratorFramework uses a Fluent\-style interface. Operations are constructed using builders returned by the CuratorFramework
+instance. When strung together, the methods form sentence\-like statements. e.g.
 {code}
 client.create().forPath("/head", new byte[0]);
 client.delete().inBackground().forPath("/head");

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-discovery-server/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-discovery-server/src/site/confluence/index.confluence b/curator-x-discovery-server/src/site/confluence/index.confluence
index 2ff1b01..4b1f5b8 100644
--- a/curator-x-discovery-server/src/site/confluence/index.confluence
+++ b/curator-x-discovery-server/src/site/confluence/index.confluence
@@ -1,7 +1,7 @@
 h1. Service Discovery Server
 
 h2. Packaging
-Curator Service Discovery is in its own package in Maven Central: {{curator-x-discovery-server}}
+Curator Service Discovery is in its own package in Maven Central: curator-x-discovery-server
 
 h2. Description
 The Service Discovery Server bridges non-Java or legacy applications with the Curator [[Service Discovery|../curator-x-discovery/index.html]].

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-discovery/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/site/confluence/index.confluence b/curator-x-discovery/src/site/confluence/index.confluence
index 6111fe2..36cf7b9 100644
--- a/curator-x-discovery/src/site/confluence/index.confluence
+++ b/curator-x-discovery/src/site/confluence/index.confluence
@@ -2,7 +2,7 @@ h1. Service Discovery
 
 h2. Packaging
 
-Curator Service Discovery is in its own package in Maven Central: {{curator-x-discovery}}
+Curator Service Discovery is in its own package in Maven Central: curator-x-discovery
 
 h2. What Is a Discovery Service?
 

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index a0f7817..806f06e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -135,5 +135,12 @@ public class CuratorProjectionServer
     {
         URL helpUrl = Resources.getResource("curator/help.txt");
         System.out.println(Resources.toString(helpUrl, Charset.defaultCharset()));
+
+        System.out.println();
+        System.out.println("======= Curator Thrift IDL =======");
+        System.out.println();
+
+        URL idlUrl = Resources.getResource("curator.thrift");
+        System.out.println(Resources.toString(idlUrl, Charset.defaultCharset()));
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
index 3bbc347..d045a80 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 public class AuthorizationConfiguration

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
index 5c582ef..44231b1 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.fasterxml.jackson.annotation.JsonTypeName;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
index 6d567b7..973b6f0 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.facebook.swift.service.ThriftServerConfig;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
index 56b4485..e5cff3e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.fasterxml.jackson.databind.ObjectMapper;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
index 51f12fa..c69fdaa 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
index 7e02592..2c68440 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.fasterxml.jackson.annotation.JsonTypeName;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
index 97b25f2..448bde3 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.fasterxml.jackson.annotation.JsonTypeName;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
index 463e148..d5d1d95 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import com.fasterxml.jackson.annotation.JsonTypeInfo;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
index c59c502..a113879 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.connections;
 
 public interface Closer

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
index 5ee65f4..afcd64e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.connections;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index d157c27..b077a76 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.connections;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
index bda795d..519790c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.details;
 
 import org.apache.curator.framework.CuratorFramework;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
index 3f4591c..6fa5961 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.details;
 
 import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
index 69bfdf8..2547467 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.discovery;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
index ac7cc5d..352a12e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.discovery;
 
 public enum DiscoveryInstanceType

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
index d4a6645..22083d8 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.discovery;
 
 import com.facebook.swift.service.ThriftMethod;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
index 7030931..5ed6b88 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.discovery;
 
 import com.facebook.swift.service.ThriftMethod;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
index 2caf0b0..139e0be 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.discovery;
 
 public enum ProviderStrategyType

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
index 4879c61..adf1206 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.exceptions;
 
 public enum ExceptionType

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
index 4ad2488..f62756e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.exceptions;
 
 public enum NodeExceptionType

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
index f3740db..9032c1c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.exceptions;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
index ca5049b..0ce0c1f 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.exceptions;
 
 public enum ZooKeeperExceptionType

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
index 7b2ef94..74fb320 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.services;
 
 import com.facebook.swift.service.ThriftMethod;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
index 68f3916..ebeabab 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
index 0d12a4c..d9b3fac 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
index 8161ef4..3616f3c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
index 784bcf6..1ab1f18 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
index 9421527..1f88d5e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
index 3a28704..3cf3be0 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
index 6a038bb..44a96f2 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
index 1e48a7d..f2d5f16 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
index a909c83..9dd4f02 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
index 8a5d225..4989183 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 public enum PathChildrenCacheStartMode

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
index f775d8e..40fefff 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
index f7862f7..2cb4462 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
index 7b1dfde..f573b21 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
index 6766e8e..7f243a7 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
index e14284d..72da6d0 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftEnum;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
index 7fedaf9..0e73dd3 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftEnum;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
index cb3fcec..0812cdf 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.idl.structs;
 
 import com.facebook.swift.codec.ThriftField;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/main/resources/curator/help.txt
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/resources/curator/help.txt b/curator-x-rpc/src/main/resources/curator/help.txt
index 53e751f..ad6484f 100644
--- a/curator-x-rpc/src/main/resources/curator/help.txt
+++ b/curator-x-rpc/src/main/resources/curator/help.txt
@@ -1,3 +1,22 @@
+====
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+====
+
 Curator RPC - an RPC server for using Apache Curator APIs and recipes from non JVM languages.
 
 Arguments:

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
new file mode 100644
index 0000000..d8d7185
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/index.confluence
@@ -0,0 +1,28 @@
+h1. Curator RPC Proxy
+
+NOTE: Curator REST Proxy is in its own package in Maven Central: curator\-x\-rpc
+
+The Curator REST module implements a proxy that bridges non-java environments with the Curator framework and recipes. Every major language
+today has a REST library available. With the Curator REST Proxy, you can now take advantage of the Curator framework and its recipes in
+any language or environment.
+
+h2. Building and Packaging
+
+See the [[Building and Packaging Page|build.html]] for details on building and packaging the REST proxy.
+
+h2. Deployment
+
+See the [[Deployment Page|deploy.html]] for details on deploying the REST proxy.
+
+h2. Your REST Client
+
+See the [[REST Client|client.html]] for details on how to write a REST client that interacts with the proxy.
+
+h2. APIs
+
+See the [[APIs Page|apis.html]] for list of available APIs.
+
+h2. Entities
+
+See the [[Entity Descriptions Page|entities.html]] for details on the Entities used in the APIs.
+

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/site/resources/images/topology.png
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/resources/images/topology.png b/curator-x-rpc/src/site/resources/images/topology.png
new file mode 100644
index 0000000..5166848
Binary files /dev/null and b/curator-x-rpc/src/site/resources/images/topology.png differ

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/site/site.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/site.xml b/curator-x-rpc/src/site/site.xml
new file mode 100644
index 0000000..1684980
--- /dev/null
+++ b/curator-x-rpc/src/site/site.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/DECORATION/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.1.0 http://maven.apache.org/xsd/decoration-1.1.0.xsd" name="Curator REST Proxy">
+    <body>
+        <head>
+            <link rel="stylesheet" href="../css/site.css" />
+            <script type="text/javascript">
+                $(function(){
+                $('a[title="Curator RPC Proxy"]').parent().addClass("active");
+                });
+            </script>
+        </head>
+    </body>
+</project>

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
index f64d383..3564777 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc;
 
 import com.google.common.io.Resources;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
index 467af3c..4ecec35 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc.configuration;
 
 import ch.qos.logback.classic.Level;

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/src/site/confluence/getting-started.confluence
----------------------------------------------------------------------
diff --git a/src/site/confluence/getting-started.confluence b/src/site/confluence/getting-started.confluence
index 03a77db..c24b8af 100644
--- a/src/site/confluence/getting-started.confluence
+++ b/src/site/confluence/getting-started.confluence
@@ -9,8 +9,8 @@ h2. Using Curator
 The Curator JARs are available from Maven Central. The various artifacts are listed on the [[main page|index.html]]. Users
 of Maven, Gradle, Ant, etc. can easily include Curator into their build script.
 
-Most users will want to use one of Curator's pre-built recipes. So, the {{curator-recipes}} is the correct artifact to use. If you only
-want a wrapper around ZooKeeper that adds connection management and retry policies, use {{curator-framework}}.
+Most users will want to use one of Curator's pre-built recipes. So, the curator-recipes is the correct artifact to use. If you only
+want a wrapper around ZooKeeper that adds connection management and retry policies, use curator-framework.
 
 h2. Getting a Connection
 

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/src/site/confluence/index.confluence b/src/site/confluence/index.confluence
index b67a6a7..d22b22b 100644
--- a/src/site/confluence/index.confluence
+++ b/src/site/confluence/index.confluence
@@ -22,7 +22,7 @@ h2. Components
 h2. Maven / Artifacts
 
 Curator binaries are published to Maven Central. Curator consists of several artifacts. Which artifacts to use depends on your needs. For
-most users, the only artifact you need is {{curator-recipes}}.
+most users, the only artifact you need is curator-recipes.
 
 ||GroupID/Org||ArtifactID/Name||Description||
 |org.apache.curator|curator-recipes|All of the recipes. Note: this artifact has dependencies on client and framework and, so, Maven (or whatever tool you're using) should pull those in automatically.|

http://git-wip-us.apache.org/repos/asf/curator/blob/09f030e2/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index 8df6a17..6d5f208 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -91,6 +91,7 @@
         <menu name="Extensions" inherit="top">
             <item name="Service Discovery" href="curator-x-discovery/index.html"/>
             <item name="Service Discovery Server" href="curator-x-discovery-server/index.html"/>
+            <item name="Curator RPC Proxy" href="curator-x-rpc/index.html"/>
         </menu>
 
         <menu name="Community" inherit="top">


[13/50] [abbrv] git commit: refactoring

Posted by ra...@apache.org.
refactoring


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8bfaffd2
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8bfaffd2
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8bfaffd2

Branch: refs/heads/master
Commit: 8bfaffd24177bba0431fc765f4b1d560aa58bf71
Parents: 10bf355
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 11:02:06 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 11:02:06 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/CuratorProjectionServer.java  |   4 +-
 .../curator/x/rpc/connections/CuratorEntry.java |   2 +-
 .../x/rpc/details/RpcBackgroundCallback.java    |   6 +-
 .../curator/x/rpc/details/RpcWatcher.java       |   6 +-
 .../curator/x/rpc/idl/event/EventService.java   |  33 --
 .../curator/x/rpc/idl/event/LeaderEvent.java    |  28 -
 .../curator/x/rpc/idl/event/LeaderResult.java   |  25 -
 .../x/rpc/idl/event/OptionalChildrenList.java   |  21 -
 .../curator/x/rpc/idl/event/OptionalPath.java   |  20 -
 .../x/rpc/idl/event/OptionalRpcStat.java        |  38 --
 .../apache/curator/x/rpc/idl/event/RpcAcl.java  |  42 --
 .../curator/x/rpc/idl/event/RpcChildData.java   |  39 --
 .../x/rpc/idl/event/RpcCuratorEvent.java        | 224 -------
 .../x/rpc/idl/event/RpcCuratorEventType.java    |  46 --
 .../curator/x/rpc/idl/event/RpcEventType.java   |  31 -
 .../apache/curator/x/rpc/idl/event/RpcId.java   |  42 --
 .../curator/x/rpc/idl/event/RpcKeeperState.java |  34 --
 .../curator/x/rpc/idl/event/RpcParticipant.java |  24 -
 .../idl/event/RpcPathChildrenCacheEvent.java    |  36 --
 .../event/RpcPathChildrenCacheEventType.java    |  15 -
 .../event/RpcPersistentEphemeralNodeMode.java   |  12 -
 .../apache/curator/x/rpc/idl/event/RpcStat.java |  95 ---
 .../x/rpc/idl/event/RpcWatchedEvent.java        |  54 --
 .../x/rpc/idl/projection/CreateSpec.java        |  62 --
 .../x/rpc/idl/projection/CuratorProjection.java |  39 --
 .../projection/CuratorProjectionService.java    | 592 -------------------
 .../x/rpc/idl/projection/DeleteSpec.java        |  54 --
 .../x/rpc/idl/projection/ExistsSpec.java        |  46 --
 .../x/rpc/idl/projection/GenericProjection.java |  20 -
 .../x/rpc/idl/projection/GetChildrenSpec.java   |  46 --
 .../x/rpc/idl/projection/GetDataSpec.java       |  50 --
 .../x/rpc/idl/projection/LeaderProjection.java  |  20 -
 .../x/rpc/idl/projection/LeaseProjection.java   |  20 -
 .../x/rpc/idl/projection/LockProjection.java    |  20 -
 .../rpc/idl/projection/NodeCacheProjection.java |  20 -
 .../projection/PathChildrenCacheProjection.java |  20 -
 .../projection/PathChildrenCacheStartMode.java  |   8 -
 .../PersistentEphemeralNodeProjection.java      |  20 -
 .../x/rpc/idl/projection/RpcCreateMode.java     |  30 -
 .../x/rpc/idl/projection/SetDataSpec.java       |  58 --
 .../curator/x/rpc/idl/projection/Version.java   |  20 -
 .../idl/services/CuratorProjectionService.java  | 592 +++++++++++++++++++
 .../x/rpc/idl/services/EventService.java        |  34 ++
 .../curator/x/rpc/idl/structs/CreateSpec.java   |  62 ++
 .../x/rpc/idl/structs/CuratorProjection.java    |  39 ++
 .../curator/x/rpc/idl/structs/DeleteSpec.java   |  54 ++
 .../curator/x/rpc/idl/structs/ExistsSpec.java   |  46 ++
 .../x/rpc/idl/structs/GetChildrenSpec.java      |  46 ++
 .../curator/x/rpc/idl/structs/GetDataSpec.java  |  50 ++
 .../curator/x/rpc/idl/structs/LeaderEvent.java  |  28 +
 .../x/rpc/idl/structs/LeaderProjection.java     |  20 +
 .../curator/x/rpc/idl/structs/LeaderResult.java |  24 +
 .../x/rpc/idl/structs/LeaseProjection.java      |  20 +
 .../x/rpc/idl/structs/LockProjection.java       |  20 +
 .../x/rpc/idl/structs/NodeCacheProjection.java  |  20 +
 .../x/rpc/idl/structs/OptionalChildrenList.java |  21 +
 .../curator/x/rpc/idl/structs/OptionalPath.java |  20 +
 .../x/rpc/idl/structs/OptionalRpcStat.java      |  38 ++
 .../structs/PathChildrenCacheProjection.java    |  20 +
 .../idl/structs/PathChildrenCacheStartMode.java |   8 +
 .../PersistentEphemeralNodeProjection.java      |  20 +
 .../curator/x/rpc/idl/structs/RpcAcl.java       |  42 ++
 .../curator/x/rpc/idl/structs/RpcChildData.java |  39 ++
 .../x/rpc/idl/structs/RpcCreateMode.java        |  30 +
 .../x/rpc/idl/structs/RpcCuratorEvent.java      | 224 +++++++
 .../x/rpc/idl/structs/RpcCuratorEventType.java  |  46 ++
 .../curator/x/rpc/idl/structs/RpcEventType.java |  31 +
 .../apache/curator/x/rpc/idl/structs/RpcId.java |  42 ++
 .../x/rpc/idl/structs/RpcKeeperState.java       |  34 ++
 .../x/rpc/idl/structs/RpcParticipant.java       |  24 +
 .../idl/structs/RpcPathChildrenCacheEvent.java  |  36 ++
 .../structs/RpcPathChildrenCacheEventType.java  |  15 +
 .../structs/RpcPersistentEphemeralNodeMode.java |  12 +
 .../curator/x/rpc/idl/structs/RpcStat.java      |  95 +++
 .../x/rpc/idl/structs/RpcWatchedEvent.java      |  54 ++
 .../curator/x/rpc/idl/structs/SetDataSpec.java  |  58 ++
 .../curator/x/rpc/idl/structs/Version.java      |  20 +
 curator-x-rpc/src/main/scripts/generate.sh      |   2 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |  68 +--
 .../curator/generated/CuratorService.java       | 288 +--------
 .../curator/generated/GenericProjection.java    | 388 ------------
 81 files changed, 2031 insertions(+), 2721 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index 0ab490b..78f8eaa 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -30,8 +30,8 @@ import com.google.common.io.Resources;
 import org.apache.curator.x.rpc.configuration.Configuration;
 import org.apache.curator.x.rpc.configuration.ConfigurationBuilder;
 import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.event.EventService;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.services.EventService;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index bb56cfb..d5a6d8a 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -3,7 +3,7 @@ package org.apache.curator.x.rpc.connections;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Queues;
 import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.Closeable;

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
index 22a3fd2..bda795d 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
@@ -3,9 +3,9 @@ package org.apache.curator.x.rpc.details;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.api.BackgroundCallback;
 import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
 
 public class RpcBackgroundCallback implements BackgroundCallback
 {

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
index 55dd866..3f4591c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
@@ -1,8 +1,8 @@
 package org.apache.curator.x.rpc.details;
 
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
 

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
deleted file mode 100644
index 933f3af..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-
-@ThriftService("EventService")
-public class EventService
-{
-    private final ConnectionManager connectionManager;
-    private final long pingTimeMs;
-
-    public EventService(ConnectionManager connectionManager, long pingTimeMs)
-    {
-        this.connectionManager = connectionManager;
-        this.pingTimeMs = pingTimeMs;
-    }
-
-    @ThriftMethod
-    public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws InterruptedException
-    {
-        CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry == null )
-        {
-            // TODO
-            return null;
-        }
-        RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
-        return (event != null) ? event : new RpcCuratorEvent();
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
deleted file mode 100644
index 677c401..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderEvent
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public String participantId;
-
-    @ThriftField(3)
-    public boolean isLeader;
-
-    public LeaderEvent()
-    {
-    }
-
-    public LeaderEvent(String path, String participantId, boolean isLeader)
-    {
-        this.path = path;
-        this.participantId = participantId;
-        this.isLeader = isLeader;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
deleted file mode 100644
index 8666105..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.x.rpc.idl.projection.LeaderProjection;
-
-@ThriftStruct
-public class LeaderResult
-{
-    @ThriftField(1)
-    public LeaderProjection projection;
-
-    @ThriftField(2)
-    public boolean hasLeadership;
-
-    public LeaderResult()
-    {
-    }
-
-    public LeaderResult(LeaderProjection projection, boolean hasLeadership)
-    {
-        this.projection = projection;
-        this.hasLeadership = hasLeadership;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
deleted file mode 100644
index 0f0a928..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import java.util.List;
-
-@ThriftStruct
-public class OptionalChildrenList
-{
-    @ThriftField(1)
-    public List<String> children;
-
-    public OptionalChildrenList()
-    {
-    }
-
-    public OptionalChildrenList(List<String> children)
-    {
-        this.children = children;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
deleted file mode 100644
index 947dd75..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class OptionalPath
-{
-    @ThriftField(1)
-    public String path;
-
-    public OptionalPath()
-    {
-    }
-
-    public OptionalPath(String path)
-    {
-        this.path = path;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
deleted file mode 100644
index 5db40ce..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("OptionalStat")
-public class OptionalRpcStat
-{
-    @ThriftField(1)
-    public RpcStat stat;
-
-    public OptionalRpcStat()
-    {
-    }
-
-    public OptionalRpcStat(RpcStat stat)
-    {
-        this.stat = stat;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
deleted file mode 100644
index b2f1512..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Acl")
-public class RpcAcl
-{
-    @ThriftField(1)
-    public int perms;
-
-    @ThriftField(2)
-    public RpcId id;
-
-    public RpcAcl()
-    {
-    }
-
-    public RpcAcl(int perms, RpcId id)
-    {
-        this.perms = perms;
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
deleted file mode 100644
index e490493..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.ChildData;
-
-@ThriftStruct("ChildData")
-public class RpcChildData
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public RpcStat stat;
-
-    @ThriftField(3)
-    public byte[] data;
-
-    public RpcChildData()
-    {
-    }
-
-    public RpcChildData(ChildData data)
-    {
-        if ( data != null )
-        {
-            this.path = data.getPath();
-            this.stat = RpcCuratorEvent.toRpcStat(data.getStat());
-            this.data = data.getData();
-        }
-    }
-
-    public RpcChildData(String path, RpcStat stat, byte[] data)
-    {
-        this.path = path;
-        this.stat = stat;
-        this.data = data;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
deleted file mode 100644
index 400f8c9..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.data.ACL;
-import org.apache.zookeeper.data.Stat;
-import javax.annotation.Nullable;
-import java.util.List;
-
-@SuppressWarnings("deprecation")
-@ThriftStruct("CuratorEvent")
-public class RpcCuratorEvent
-{
-    @ThriftField(2)
-    public RpcCuratorEventType type;
-
-    @ThriftField(3)
-    public int resultCode;
-
-    @ThriftField(4)
-    public String path;
-
-    @ThriftField(5)
-    public String context;
-
-    @ThriftField(6)
-    public RpcStat stat;
-
-    @ThriftField(7)
-    public byte[] data;
-
-    @ThriftField(8)
-    public String name;
-
-    @ThriftField(9)
-    public List<String> children;
-
-    @ThriftField(10)
-    public List<RpcAcl> aclList;
-
-    @ThriftField(11)
-    public RpcWatchedEvent watchedEvent;
-
-    @ThriftField(12)
-    public LeaderEvent leaderEvent;
-
-    @ThriftField(13)
-    public RpcPathChildrenCacheEvent childrenCacheEvent;
-
-    public RpcCuratorEvent()
-    {
-        this.type = RpcCuratorEventType.PING;
-        this.resultCode = 0;
-        this.path = null;
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = null;
-        this.leaderEvent = null;
-        this.childrenCacheEvent = null;
-    }
-
-    public RpcCuratorEvent(RpcCuratorEventType type, String path)
-    {
-        this.type = type;
-        this.resultCode = 0;
-        this.path = path;
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = null;
-        this.leaderEvent = null;
-        this.childrenCacheEvent = null;
-    }
-
-    public RpcCuratorEvent(RpcPathChildrenCacheEvent childrenCacheEvent)
-    {
-        this.type = RpcCuratorEventType.PATH_CHILDREN_CACHE;
-        this.resultCode = 0;
-        this.path = null;
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = null;
-        this.leaderEvent = null;
-        this.childrenCacheEvent = childrenCacheEvent;
-    }
-
-    public RpcCuratorEvent(CuratorEvent event)
-    {
-        this.type = RpcCuratorEventType.valueOf(event.getType().name());
-        this.resultCode = event.getResultCode();
-        this.path = event.getPath();
-        this.context = (event.getContext() != null) ? String.valueOf(event.getContext()) : null;
-        this.stat = toRpcStat(event.getStat());
-        this.data = event.getData();
-        this.name = event.getName();
-        this.children = event.getChildren();
-        this.aclList = toRpcAclList(event.getACLList());
-        this.watchedEvent = toRpcWatchedEvent(event.getWatchedEvent());
-        this.leaderEvent = null;
-        this.childrenCacheEvent = null;
-    }
-
-    public RpcCuratorEvent(ConnectionState newState)
-    {
-        this.type = RpcCuratorEventType.valueOf(newState.name());
-        this.resultCode = 0;
-        this.path = null;
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = null;
-        this.leaderEvent = null;
-        this.childrenCacheEvent = null;
-    }
-
-    public RpcCuratorEvent(WatchedEvent event)
-    {
-        this.type = RpcCuratorEventType.WATCHED;
-        this.resultCode = 0;
-        this.path = event.getPath();
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = new RpcWatchedEvent(RpcKeeperState.valueOf(event.getState().name()), RpcEventType.valueOf(event.getType().name()), event.getPath());
-        this.leaderEvent = null;
-        this.childrenCacheEvent = null;
-    }
-
-    public RpcCuratorEvent(LeaderEvent event)
-    {
-        this.type = RpcCuratorEventType.LEADER;
-        this.resultCode = 0;
-        this.path = event.path;
-        this.context = null;
-        this.stat = null;
-        this.data = null;
-        this.name = null;
-        this.children = null;
-        this.aclList = null;
-        this.watchedEvent = null;
-        this.leaderEvent = event;
-        this.childrenCacheEvent = null;
-    }
-
-    public static RpcStat toRpcStat(Stat stat)
-    {
-        if ( stat != null )
-        {
-            return new RpcStat(stat);
-        }
-        return null;
-    }
-
-    private List<RpcAcl> toRpcAclList(List<ACL> aclList)
-    {
-        if ( aclList != null )
-        {
-            return Lists.transform
-            (
-                aclList,
-                new Function<ACL, RpcAcl>()
-                {
-                    @Nullable
-                    @Override
-                    public RpcAcl apply(ACL acl)
-                    {
-                        RpcId id = new RpcId(acl.getId().getScheme(), acl.getId().getId());
-                        return new RpcAcl(acl.getPerms(), id);
-                    }
-                }
-            );
-        }
-        return null;
-    }
-
-    private RpcWatchedEvent toRpcWatchedEvent(WatchedEvent watchedEvent)
-    {
-        if ( watchedEvent != null )
-        {
-            return new RpcWatchedEvent(watchedEvent);
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
deleted file mode 100644
index 0bda3d6..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("CuratorEventType")
-public enum RpcCuratorEventType
-{
-    PING,
-    CREATE,
-    DELETE,
-    EXISTS,
-    GET_DATA,
-    SET_DATA,
-    CHILDREN,
-    SYNC,
-    GET_ACL,
-    SET_ACL,
-    WATCHED,
-    CLOSING,
-    CONNECTION_CONNECTED,
-    CONNECTION_SUSPENDED,
-    CONNECTION_RECONNECTED,
-    CONNECTION_LOST,
-    CONNECTION_READ_ONLY,
-    LEADER,
-    PATH_CHILDREN_CACHE,
-    NODE_CACHE
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java
deleted file mode 100644
index b7b5fa3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("EventType")
-public enum RpcEventType
-{
-    None,
-    NodeCreated,
-    NodeDeleted,
-    NodeDataChanged,
-    NodeChildrenChanged
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
deleted file mode 100644
index a86556a..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Id")
-public class RpcId
-{
-    @ThriftField(1)
-    public String scheme;
-
-    @ThriftField(2)
-    public String id;
-
-    public RpcId()
-    {
-    }
-
-    public RpcId(String scheme, String id)
-    {
-        this.scheme = scheme;
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
deleted file mode 100644
index 7d17366..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("KeeperState")
-public enum RpcKeeperState
-{
-    Unknown,
-    Disconnected,
-    NoSyncConnected,
-    SyncConnected,
-    AuthFailed,
-    ConnectedReadOnly,
-    SaslAuthenticated,
-    Expired
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
deleted file mode 100644
index 05a5d85..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Participant")
-public class RpcParticipant
-{
-    @ThriftField(1)
-    public String id;
-
-    @ThriftField(2)
-    public boolean isLeader;
-
-    public RpcParticipant()
-    {
-    }
-
-    public RpcParticipant(String id, boolean isLeader)
-    {
-        this.id = id;
-        this.isLeader = isLeader;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
deleted file mode 100644
index 59be6e2..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-
-@ThriftStruct("PathChildrenCacheEvent")
-public class RpcPathChildrenCacheEvent
-{
-    @ThriftField(1)
-    public String cachedPath;
-
-    @ThriftField(2)
-    public RpcPathChildrenCacheEventType type;
-
-    @ThriftField(3)
-    public RpcChildData data;
-
-    public RpcPathChildrenCacheEvent()
-    {
-    }
-
-    public RpcPathChildrenCacheEvent(String cachedPath, PathChildrenCacheEvent event)
-    {
-        this.cachedPath = cachedPath;
-        type = RpcPathChildrenCacheEventType.valueOf(event.getType().name());
-        data = (event.getData() != null) ? new RpcChildData(event.getData()) : null;
-    }
-
-    public RpcPathChildrenCacheEvent(String cachedPath, RpcPathChildrenCacheEventType type, RpcChildData data)
-    {
-        this.cachedPath = cachedPath;
-        this.type = type;
-        this.data = data;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
deleted file mode 100644
index 4ec5541..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PathChildrenCacheEventType")
-public enum RpcPathChildrenCacheEventType
-{
-    CHILD_ADDED,
-    CHILD_UPDATED,
-    CHILD_REMOVED,
-    CONNECTION_SUSPENDED,
-    CONNECTION_RECONNECTED,
-    CONNECTION_LOST,
-    INITIALIZED
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
deleted file mode 100644
index bda8b4d..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PersistentEphemeralNodeMode")
-public enum RpcPersistentEphemeralNodeMode
-{
-    EPHEMERAL,
-    EPHEMERAL_SEQUENTIAL,
-    PROTECTED_EPHEMERAL,
-    PROTECTED_EPHEMERAL_SEQUENTIAL
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
deleted file mode 100644
index f5d2300..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.data.Stat;
-
-@ThriftStruct("Stat")
-public class RpcStat
-{
-    @ThriftField(1)
-    public long czxid;
-
-    @ThriftField(2)
-    public long mzxid;
-
-    @ThriftField(3)
-    public long ctime;
-
-    @ThriftField(4)
-    public long mtime;
-
-    @ThriftField(5)
-    public int version;
-
-    @ThriftField(6)
-    public int cversion;
-
-    @ThriftField(7)
-    public int aversion;
-
-    @ThriftField(8)
-    public long ephemeralOwner;
-
-    @ThriftField(9)
-    public int dataLength;
-
-    @ThriftField(10)
-    public int numChildren;
-
-    @ThriftField(11)
-    public long pzxid;
-
-    public RpcStat()
-    {
-    }
-
-    public RpcStat(Stat stat)
-    {
-        czxid = stat.getCzxid();
-        mzxid = stat.getMzxid();
-        ctime = stat.getCtime();
-        mtime = stat.getMtime();
-        version = stat.getVersion();
-        cversion = stat.getCversion();
-        aversion = stat.getAversion();
-        ephemeralOwner = stat.getEphemeralOwner();
-        dataLength = stat.getDataLength();
-        numChildren = stat.getNumChildren();
-        pzxid = stat.getPzxid();
-    }
-
-    public RpcStat(long czxid, long mzxid, long ctime, long mtime, int version, int cversion, int aversion, long ephemeralOwner, int dataLength, int numChildren, long pzxid)
-    {
-        this.czxid = czxid;
-        this.mzxid = mzxid;
-        this.ctime = ctime;
-        this.mtime = mtime;
-        this.version = version;
-        this.cversion = cversion;
-        this.aversion = aversion;
-        this.ephemeralOwner = ephemeralOwner;
-        this.dataLength = dataLength;
-        this.numChildren = numChildren;
-        this.pzxid = pzxid;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
deleted file mode 100644
index 11856b3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.WatchedEvent;
-
-@ThriftStruct("WatchedEvent")
-public class RpcWatchedEvent
-{
-    @ThriftField(1)
-    public RpcKeeperState keeperState;
-
-    @ThriftField(2)
-    public RpcEventType eventType;
-
-    @ThriftField(3)
-    public String path;
-
-    public RpcWatchedEvent()
-    {
-    }
-
-    public RpcWatchedEvent(WatchedEvent watchedEvent)
-    {
-        keeperState = RpcKeeperState.valueOf(watchedEvent.getState().name());
-        eventType = RpcEventType.valueOf(watchedEvent.getType().name());
-        path = watchedEvent.getPath();
-    }
-
-    public RpcWatchedEvent(RpcKeeperState keeperState, RpcEventType eventType, String path)
-    {
-        this.keeperState = keeperState;
-        this.eventType = eventType;
-        this.path = path;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
deleted file mode 100644
index 7f156b4..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CreateSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public byte[] data;
-
-    @ThriftField(3)
-    public RpcCreateMode mode;
-
-    @ThriftField(4)
-    public String asyncContext;
-
-    @ThriftField(5)
-    public boolean compressed;
-
-    @ThriftField(6)
-    public boolean creatingParentsIfNeeded;
-
-    @ThriftField(7)
-    public boolean withProtection;
-
-    public CreateSpec()
-    {
-    }
-
-    public CreateSpec(String path, byte[] data, RpcCreateMode mode, String asyncContext, boolean compressed, boolean creatingParentsIfNeeded, boolean withProtection)
-    {
-        this.path = path;
-        this.data = data;
-        this.mode = mode;
-        this.asyncContext = asyncContext;
-        this.compressed = compressed;
-        this.creatingParentsIfNeeded = creatingParentsIfNeeded;
-        this.withProtection = withProtection;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
deleted file mode 100644
index 8ca3847..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftConstructor;
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CuratorProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public CuratorProjection()
-    {
-    }
-
-    public CuratorProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
deleted file mode 100644
index ab9add7..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ /dev/null
@@ -1,592 +0,0 @@
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.api.*;
-import org.apache.curator.framework.recipes.cache.ChildData;
-import org.apache.curator.framework.recipes.cache.NodeCache;
-import org.apache.curator.framework.recipes.cache.NodeCacheListener;
-import org.apache.curator.framework.recipes.cache.PathChildrenCache;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
-import org.apache.curator.framework.recipes.leader.LeaderLatch;
-import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
-import org.apache.curator.framework.recipes.leader.Participant;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2;
-import org.apache.curator.framework.recipes.locks.Lease;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.curator.framework.state.ConnectionStateListener;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.rpc.connections.Closer;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
-import org.apache.curator.x.rpc.details.RpcWatcher;
-import org.apache.curator.x.rpc.idl.event.*;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.data.Stat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-@ThriftService("CuratorService")
-public class CuratorProjectionService
-{
-    private final Logger log = LoggerFactory.getLogger(getClass());
-    private final ConnectionManager connectionManager;
-
-    public CuratorProjectionService(ConnectionManager connectionManager)
-    {
-        this.connectionManager = connectionManager;
-    }
-
-    @ThriftMethod
-    public CuratorProjection newCuratorProjection(String connectionName)
-    {
-        CuratorFramework client = connectionManager.newConnection(connectionName);
-
-        String id = CuratorEntry.newId();
-        client.start();
-        connectionManager.add(id, client);
-        final CuratorProjection projection = new CuratorProjection(id);
-
-        ConnectionStateListener listener = new ConnectionStateListener()
-        {
-            @Override
-            public void stateChanged(CuratorFramework client, ConnectionState newState)
-            {
-                addEvent(projection, new RpcCuratorEvent(newState));
-            }
-        };
-        client.getConnectionStateListenable().addListener(listener);
-
-        return projection;
-    }
-
-    @ThriftMethod(oneway = true)
-    public void closeCuratorProjection(CuratorProjection projection)
-    {
-        CuratorEntry entry = connectionManager.remove(projection.id);
-        if ( entry != null )
-        {
-            entry.close();
-        }
-    }
-
-    @ThriftMethod(oneway = true)
-    public void pingCuratorProjection(CuratorProjection projection)
-    {
-        connectionManager.get(projection.id);
-    }
-
-    @ThriftMethod
-    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.create();
-        if ( spec.creatingParentsIfNeeded )
-        {
-            builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
-        }
-        if ( spec.compressed )
-        {
-            builder = castBuilder(builder, Compressible.class).compressed();
-        }
-        if ( spec.withProtection )
-        {
-            builder = castBuilder(builder, CreateBuilder.class).withProtection();
-        }
-        if ( spec.mode != null )
-        {
-            builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
-        }
-
-        Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
-        return new OptionalPath((path != null) ? String.valueOf(path) : null);
-    }
-
-    @ThriftMethod
-    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.delete();
-        if ( spec.guaranteed )
-        {
-            builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
-        }
-        if ( spec.version != null )
-        {
-            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
-        }
-
-        castBuilder(builder, Pathable.class).forPath(spec.path);
-    }
-
-    @ThriftMethod
-    public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.getData();
-        if ( spec.watched )
-        {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
-
-        if ( spec.decompressed )
-        {
-            builder = castBuilder(builder, Decompressible.class).decompressed();
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
-        }
-
-        Stat stat = new Stat();
-        builder = castBuilder(builder, Statable.class).storingStatIn(stat);
-
-        return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
-    }
-
-    @ThriftMethod
-    public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.setData();
-        if ( spec.watched )
-        {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
-        if ( spec.version != null )
-        {
-            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
-        }
-
-        if ( spec.compressed )
-        {
-            builder = castBuilder(builder, Compressible.class).compressed();
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
-        }
-
-        Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
-        return RpcCuratorEvent.toRpcStat(stat);
-    }
-
-    @ThriftMethod
-    public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.checkExists();
-        if ( spec.watched )
-        {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
-        }
-
-        Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
-        return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
-    }
-
-    @ThriftMethod
-    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws Exception
-    {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.getChildren();
-        if ( spec.watched )
-        {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
-
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
-        }
-
-        @SuppressWarnings("unchecked")
-        List<String> children = (List<String>)castBuilder(builder, Pathable.class).forPath(spec.path);
-        return new OptionalChildrenList(children);
-    }
-
-    @ThriftMethod
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws Exception
-    {
-        CuratorEntry entry = getEntry(curatorProjection);
-        return entry.closeThing(id);
-    }
-
-    @ThriftMethod
-    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-        final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
-        if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
-        {
-            return new LockProjection();
-        }
-
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
-            {
-                if ( lock.isAcquiredInThisProcess() )
-                {
-                    try
-                    {
-                        lock.release();
-                    }
-                    catch ( Exception e )
-                    {
-                        log.error("Could not release left-over lock for path: " + path, e);
-                    }
-                }
-            }
-        };
-        String id = entry.addThing(lock, closer);
-        return new LockProjection(id);
-    }
-
-    @ThriftMethod
-    public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
-        leaderLatch.start();
-
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
-            {
-                try
-                {
-                    leaderLatch.close();
-                }
-                catch ( IOException e )
-                {
-                    log.error("Could not close left-over leader latch for path: " + path, e);
-                }
-            }
-        };
-        String id = entry.addThing(leaderLatch, closer);
-
-        LeaderLatchListener listener = new LeaderLatchListener()
-        {
-            @Override
-            public void isLeader()
-            {
-                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
-            }
-
-            @Override
-            public void notLeader()
-            {
-                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
-            }
-        };
-        leaderLatch.addListener(listener);
-
-        if ( waitForLeadershipMs > 0 )
-        {
-            leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
-        }
-
-        return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
-    }
-
-    @ThriftMethod
-    public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
-        Collection<Participant> participants = leaderLatch.getParticipants();
-        return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
-            {
-                @Override
-                public RpcParticipant apply(Participant participant)
-                {
-                    return new RpcParticipant(participant.getId(), participant.isLeader());
-                }
-            });
-    }
-
-    @ThriftMethod
-    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
-        return leaderLatch.hasLeadership();
-    }
-
-    @ThriftMethod
-    public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws Exception
-    {
-        final CuratorEntry entry = getEntry(projection);
-
-        final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
-        cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
-
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
-            {
-                try
-                {
-                    cache.close();
-                }
-                catch ( IOException e )
-                {
-                    log.error("Could not close left-over PathChildrenCache for path: " + path, e);
-                }
-            }
-        };
-        String id = entry.addThing(cache, closer);
-
-        PathChildrenCacheListener listener = new PathChildrenCacheListener()
-        {
-            @Override
-            public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
-            {
-                entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
-            }
-        };
-        cache.getListenable().addListener(listener);
-
-        return new PathChildrenCacheProjection(id);
-    }
-
-    @ThriftMethod
-    public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
-        return Lists.transform
-        (
-            pathChildrenCache.getCurrentData(),
-            new Function<ChildData, RpcChildData>()
-            {
-                @Override
-                public RpcChildData apply(ChildData childData)
-                {
-                    return new RpcChildData(childData);
-                }
-            }
-        );
-    }
-
-    @ThriftMethod
-    public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
-        return new RpcChildData(pathChildrenCache.getCurrentData(path));
-    }
-
-    @ThriftMethod
-    public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws Exception
-    {
-        final CuratorEntry entry = getEntry(projection);
-
-        final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
-        cache.start(buildInitial);
-
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
-            {
-                try
-                {
-                    cache.close();
-                }
-                catch ( IOException e )
-                {
-                    log.error("Could not close left-over NodeCache for path: " + path, e);
-                }
-            }
-        };
-        String id = entry.addThing(cache, closer);
-
-        NodeCacheListener listener = new NodeCacheListener()
-        {
-            @Override
-            public void nodeChanged() throws Exception
-            {
-                entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
-            }
-        };
-        cache.getListenable().addListener(listener);
-
-        return new NodeCacheProjection(id);
-    }
-
-    @ThriftMethod
-    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
-        return new RpcChildData(nodeCache.getCurrentData());
-    }
-
-    @ThriftMethod
-    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
-        node.start();
-
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
-            {
-                try
-                {
-                    node.close();
-                }
-                catch ( Exception e )
-                {
-                    log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
-                }
-            }
-        };
-        String id = entry.addThing(node, closer);
-        return new PersistentEphemeralNodeProjection(id);
-    }
-
-    @ThriftMethod
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
-        final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
-        if ( leases == null )
-        {
-            return Lists.newArrayList();
-        }
-
-        List<LeaseProjection> leaseProjections = Lists.newArrayList();
-        for ( final Lease lease : leases )
-        {
-            Closer closer = new Closer()
-            {
-                @Override
-                public void close()
-                {
-                    try
-                    {
-                        semaphore.returnLease(lease);
-                    }
-                    catch ( Exception e )
-                    {
-                        log.error("Could not release semaphore leases for path: " + path, e);
-                    }
-                }
-            };
-            leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
-        }
-        return leaseProjections;
-    }
-
-    public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
-    {
-        CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry != null )
-        {
-            entry.addEvent(event);
-        }
-    }
-
-    private CuratorEntry getEntry(CuratorProjection projection) throws Exception
-    {
-        CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry == null )
-        {
-            throw new Exception("No client found with id: " + projection.id);
-        }
-        return entry;
-    }
-
-    private static <T> T castBuilder(Object createBuilder, Class<T> clazz) throws Exception
-    {
-        if ( clazz.isAssignableFrom(createBuilder.getClass()) )
-        {
-            return clazz.cast(createBuilder);
-        }
-        throw new Exception("That operation is not available");
-    }
-
-    private <T> T getThing(CuratorEntry entry, String id, Class<T> clazz)
-    {
-        T thing = entry.getThing(id, clazz);
-        Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
-        return thing;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
deleted file mode 100644
index 0895d75..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class DeleteSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public boolean guaranteed;
-
-    @ThriftField(3)
-    public String asyncContext;
-
-    @ThriftField(4)
-    public boolean compressed;
-
-    @ThriftField(5)
-    public Version version;
-
-    public DeleteSpec()
-    {
-    }
-
-    public DeleteSpec(String path, boolean guaranteed, String asyncContext, boolean compressed, Version version)
-    {
-        this.path = path;
-        this.guaranteed = guaranteed;
-        this.asyncContext = asyncContext;
-        this.compressed = compressed;
-        this.version = version;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java
deleted file mode 100644
index dff67e4..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class ExistsSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public boolean watched;
-
-    @ThriftField(3)
-    public String asyncContext;
-
-    public ExistsSpec()
-    {
-    }
-
-    public ExistsSpec(String path, boolean watched, String asyncContext)
-    {
-        this.path = path;
-        this.watched = watched;
-        this.asyncContext = asyncContext;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
deleted file mode 100644
index cfdc74f..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GenericProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public GenericProjection()
-    {
-    }
-
-    public GenericProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java
deleted file mode 100644
index fe9e4c1..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetChildrenSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public boolean watched;
-
-    @ThriftField(3)
-    public String asyncContext;
-
-    public GetChildrenSpec()
-    {
-    }
-
-    public GetChildrenSpec(String path, boolean watched, String asyncContext)
-    {
-        this.path = path;
-        this.watched = watched;
-        this.asyncContext = asyncContext;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
deleted file mode 100644
index fe5b1ac..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetDataSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public boolean watched;
-
-    @ThriftField(3)
-    public String asyncContext;
-
-    @ThriftField(4)
-    public boolean decompressed;
-
-    public GetDataSpec()
-    {
-    }
-
-    public GetDataSpec(String path, boolean watched, String asyncContext, boolean decompressed)
-    {
-        this.path = path;
-        this.watched = watched;
-        this.asyncContext = asyncContext;
-        this.decompressed = decompressed;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
deleted file mode 100644
index bf66497..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public LeaderProjection()
-    {
-    }
-
-    public LeaderProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
deleted file mode 100644
index 2faa228..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaseProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public LeaseProjection()
-    {
-    }
-
-    public LeaseProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
deleted file mode 100644
index 83bb68b..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LockProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public LockProjection()
-    {
-    }
-
-    public LockProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
deleted file mode 100644
index 7fa8957..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class NodeCacheProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public NodeCacheProjection()
-    {
-    }
-
-    public NodeCacheProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
deleted file mode 100644
index a1ee396..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PathChildrenCacheProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public PathChildrenCacheProjection()
-    {
-    }
-
-    public PathChildrenCacheProjection(String id)
-    {
-        this.id = id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
deleted file mode 100644
index bf695ba..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-public enum PathChildrenCacheStartMode
-{
-    NORMAL,
-    BUILD_INITIAL_CACHE,
-    POST_INITIALIZED_EVENT
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
deleted file mode 100644
index a58d3c3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PersistentEphemeralNodeProjection
-{
-    @ThriftField(1)
-    public String id;
-
-    public PersistentEphemeralNodeProjection()
-    {
-    }
-
-    public PersistentEphemeralNodeProjection(String id)
-    {
-        this.id = id;
-    }
-}


[29/50] [abbrv] git commit: work on packaging and doc

Posted by ra...@apache.org.
work on packaging and doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/73decc76
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/73decc76
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/73decc76

Branch: refs/heads/master
Commit: 73decc76a2c41aba30d8d87b6c6b74e52a6420ec
Parents: cb9d8dd
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 13:20:40 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 13:20:40 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/dependency-reduced-pom.xml        | 102 +++++++++++++++++++
 curator-x-rpc/pom.xml                           |  47 +++++++++
 .../src/main/resources/curator/help.txt         |  19 ----
 .../src/site/confluence/deploy.confluence       |  16 +++
 .../src/site/confluence/index.confluence        |  11 +-
 pom.xml                                         |   9 ++
 6 files changed, 181 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/curator-x-rpc/dependency-reduced-pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/dependency-reduced-pom.xml b/curator-x-rpc/dependency-reduced-pom.xml
new file mode 100644
index 0000000..abb20c7
--- /dev/null
+++ b/curator-x-rpc/dependency-reduced-pom.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>apache-curator</artifactId>
+    <groupId>org.apache.curator</groupId>
+    <version>2.5.1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>curator-x-rpc</artifactId>
+  <version>2.5.1-SNAPSHOT</version>
+  <build>
+    <resources>
+      <resource>
+        <directory>${project.basedir}/src/main/resources</directory>
+        <includes>
+          <include>curator/help.txt</include>
+        </includes>
+      </resource>
+    </resources>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer />
+                <transformer>
+                  <mainClass>org.apache.curator.x.rpc.CuratorProjectionServer</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+        <configuration>
+          <createDependencyReducedPom>true</createDependencyReducedPom>
+          <filters>
+            <filter>
+              <artifact>*:*</artifact>
+              <excludes>
+                <exclude>META-INF/*.SF</exclude>
+                <exclude>META-INF/*.DSA</exclude>
+                <exclude>META-INF/*.RSA</exclude>
+              </excludes>
+            </filter>
+          </filters>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.curator</groupId>
+      <artifactId>curator-test</artifactId>
+      <version>2.5.1-SNAPSHOT</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>log4j-over-slf4j</artifactId>
+          <groupId>org.slf4j</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>slf4j-log4j12</artifactId>
+          <groupId>org.slf4j</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>log4j</artifactId>
+          <groupId>log4j</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>javassist</artifactId>
+          <groupId>org.javassist</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>commons-math</artifactId>
+          <groupId>org.apache.commons</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.testng</groupId>
+      <artifactId>testng</artifactId>
+      <version>6.8.8</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>bsh</artifactId>
+          <groupId>org.beanshell</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>jcommander</artifactId>
+          <groupId>com.beust</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  </dependencies>
+</project>
+

http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/curator-x-rpc/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
index 3f13a81..de9bfb0 100644
--- a/curator-x-rpc/pom.xml
+++ b/curator-x-rpc/pom.xml
@@ -90,4 +90,51 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${project.basedir}/src/main/resources</directory>
+                <includes>
+                    <include>curator/help.txt</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <createDependencyReducedPom>true</createDependencyReducedPom>
+                    <filters>
+                        <filter>
+                            <artifact>*:*</artifact>
+                            <excludes>
+                                <exclude>META-INF/*.SF</exclude>
+                                <exclude>META-INF/*.DSA</exclude>
+                                <exclude>META-INF/*.RSA</exclude>
+                            </excludes>
+                        </filter>
+                    </filters>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>org.apache.curator.x.rpc.CuratorProjectionServer</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/curator-x-rpc/src/main/resources/curator/help.txt
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/resources/curator/help.txt b/curator-x-rpc/src/main/resources/curator/help.txt
index ad6484f..53e751f 100644
--- a/curator-x-rpc/src/main/resources/curator/help.txt
+++ b/curator-x-rpc/src/main/resources/curator/help.txt
@@ -1,22 +1,3 @@
-====
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-====
-
 Curator RPC - an RPC server for using Apache Curator APIs and recipes from non JVM languages.
 
 Arguments:

http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/curator-x-rpc/src/site/confluence/deploy.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
new file mode 100644
index 0000000..20c3ace
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/deploy.confluence
@@ -0,0 +1,16 @@
+[[Curator RPC Proxy|index.html]] / Deployment
+
+h1. Deployment
+
+Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper.
+Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more ZooKeeper clusters. The Curator
+Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by ID.
+
+!images/topology.png!
+
+How you configure your server to launch depends on your environment and other needs. Here are some suggestions:
+
+* [Airlift Launcher|https://github.com/airlift/airlift/tree/master/launcher]
+* [Docker|https://www.docker.io/]
+* [One-JAR|http://one-jar.sourceforge.net/]
+* [Capsule|https://github.com/puniverse/capsule]

http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/curator-x-rpc/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
index d8d7185..ece5769 100644
--- a/curator-x-rpc/src/site/confluence/index.confluence
+++ b/curator-x-rpc/src/site/confluence/index.confluence
@@ -1,10 +1,13 @@
 h1. Curator RPC Proxy
 
-NOTE: Curator REST Proxy is in its own package in Maven Central: curator\-x\-rpc
+NOTE: Curator RPC Proxy is in its own package in Maven Central: curator\-x\-rpc
 
-The Curator REST module implements a proxy that bridges non-java environments with the Curator framework and recipes. Every major language
-today has a REST library available. With the Curator REST Proxy, you can now take advantage of the Curator framework and its recipes in
-any language or environment.
+The Curator RPC module implements a proxy that bridges non-java environments with the Curator framework and recipes. It uses
+[[Apache Thrift|http://thrift.apache.org]] which supports a large set of languages and environments.
+
+h2. Thrift File
+The current Curator RPC Thrift File can be found here: [[https://raw.githubusercontent.com/apache/curator/master/curator-x-rpc/src/main/thrift/curator.thrift]]. Use
+this to generate code for the language/environment you need.
 
 h2. Building and Packaging
 

http://git-wip-us.apache.org/repos/asf/curator/blob/73decc76/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 137155b..ec3e374 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,6 +86,7 @@
         <testng-version>6.8.8</testng-version>
         <swift-version>0.12.0</swift-version>
         <dropwizard-version>0.7.0</dropwizard-version>
+        <maven-shade-plugin-version>2.3</maven-shade-plugin-version>
 
         <!-- OSGi Properties -->
         <osgi.export.package />
@@ -551,6 +552,12 @@
                     <artifactId>apache-rat-plugin</artifactId>
                     <version>${apache-rat-plugin-version}</version>
                 </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-shade-plugin</artifactId>
+                    <version>${maven-shade-plugin-version}</version>
+                </plugin>
             </plugins>
         </pluginManagement>
 
@@ -693,6 +700,7 @@
                     <header>src/etc/header.txt</header>
                     <excludes>
                         <exclude>**/*.confluence</exclude>
+                        <exclude>**/help.txt</exclude>
                         <exclude>**/*.rdf</exclude>
                         <exclude>**/.gitignore</exclude>
                         <exclude>**/.idea/**</exclude>
@@ -736,6 +744,7 @@
                     <excludes>
                         <exclude>**/*.confluence</exclude>
                         <exclude>**/*.rdf</exclude>
+                        <exclude>**/help.txt</exclude>
                         <exclude>**/.gitignore</exclude>
                         <exclude>**/.idea/**</exclude>
                         <exclude>**/DISCLAIMER</exclude>


[35/50] [abbrv] git commit: wip on doc

Posted by ra...@apache.org.
wip on doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/081bfdbe
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/081bfdbe
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/081bfdbe

Branch: refs/heads/master
Commit: 081bfdbe14121db21b5f873519dac7bdf98ee577
Parents: bfc388c
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 13:23:46 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 13:23:46 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/src/site/confluence/events.confluence | 4 +++-
 curator-x-rpc/src/site/confluence/usage.confluence  | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/081bfdbe/curator-x-rpc/src/site/confluence/events.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
index a6df4e8..7eb7fec 100644
--- a/curator-x-rpc/src/site/confluence/events.confluence
+++ b/curator-x-rpc/src/site/confluence/events.confluence
@@ -17,6 +17,8 @@ inThread => {
 }
 {code}
 
+*IMPORTANT:* your event handling should operate as quickly as possible. You should return to calling getNextEvent() as soon as possible.
+
 h2. Schema
 
 h3. CuratorEvent
@@ -38,7 +40,7 @@ h3. CuratorEvent
 h3. CuratorEventType
 
 ||Value||Description||
-|PING|Returned if there no events have been generated within the [[configured|configuration.html]] pingTime|
+|PING|Returned if no events have been generated within the [[configured|configuration.html]] pingTime|
 |CREATE|Async createNode() API completion|
 |DELETE|Async deleteNode() API completion|
 |EXISTS|Async exists() API completion|

http://git-wip-us.apache.org/repos/asf/curator/blob/081bfdbe/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index 9ddaf97..bf9edf1 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -62,6 +62,9 @@ inThread => {
         ... process event ...
     }
 }
+
+... in your application shutdown
+client.closeCuratorProjection(curatorProjection)
 {code}
 
 h2. Usage


[16/50] [abbrv] git commit: initial stab at exception support

Posted by ra...@apache.org.
initial stab at exception support


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/c6229cf2
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c6229cf2
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c6229cf2

Branch: refs/heads/master
Commit: c6229cf2e09424fc57944397c7186fea2db9a1a4
Parents: 8bfaffd
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 11:57:17 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 11:57:17 2014 -0500

----------------------------------------------------------------------
 .../x/rpc/connections/ConnectionManager.java    |    3 +-
 .../curator/x/rpc/connections/CuratorEntry.java |   14 +
 .../x/rpc/idl/exceptions/ExceptionType.java     |    8 +
 .../x/rpc/idl/exceptions/NodeExceptionType.java |    9 +
 .../x/rpc/idl/exceptions/RpcException.java      |   80 +
 .../idl/exceptions/ZooKeeperExceptionType.java  |   22 +
 .../idl/services/CuratorProjectionService.java  |  718 +++--
 .../x/rpc/idl/services/EventService.java        |   17 +-
 curator-x-rpc/src/main/scripts/generate.sh      |    2 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |   57 +-
 .../curator/generated/CuratorException.java     |  736 +++++
 .../curator/generated/CuratorService.java       | 2546 ++++++++++++++++--
 .../apache/curator/generated/EventService.java  |  133 +-
 .../apache/curator/generated/ExceptionType.java |   48 +
 .../curator/generated/NodeExceptionType.java    |   51 +
 .../generated/ZooKeeperExceptionType.java       |   90 +
 .../org/apache/curator/x/rpc/TestClient.java    |   12 +
 17 files changed, 3976 insertions(+), 570 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
index 21fe762..5ee65f4 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
@@ -89,8 +89,7 @@ public class ConnectionManager implements Closeable
     public CuratorFramework newConnection(String name)
     {
         ConnectionConfiguration configuration = connections.get(name);
-        Preconditions.checkNotNull(configuration, "No connection configuration with that name was found: " + name);
-        return configuration.build();
+        return (configuration != null) ? configuration.build() : null;
     }
 
     public void add(String id, CuratorFramework client)

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index d5a6d8a..9e57c6f 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -3,6 +3,10 @@ package org.apache.curator.x.rpc.connections;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Queues;
 import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.api.CuratorEvent;
+import org.apache.curator.x.rpc.idl.exceptions.ExceptionType;
+import org.apache.curator.x.rpc.idl.exceptions.RpcException;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
 import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -82,6 +86,16 @@ public class CuratorEntry implements Closeable
         }
     }
 
+    public static CuratorEntry mustGetEntry(ConnectionManager connectionManager, CuratorProjection projection) throws RpcException
+    {
+        CuratorEntry entry = connectionManager.get(projection.id);
+        if ( entry == null )
+        {
+            throw new RpcException(ExceptionType.GENERAL, null, null, "No CuratorProjection found with the id: " + projection.id);
+        }
+        return entry;
+    }
+
     public CuratorFramework getClient()
     {
         return (state.get() == State.OPEN) ? client : null;

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
new file mode 100644
index 0000000..4879c61
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
@@ -0,0 +1,8 @@
+package org.apache.curator.x.rpc.idl.exceptions;
+
+public enum ExceptionType
+{
+    GENERAL,
+    ZOOKEEPER,
+    NODE
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
new file mode 100644
index 0000000..4ad2488
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
@@ -0,0 +1,9 @@
+package org.apache.curator.x.rpc.idl.exceptions;
+
+public enum NodeExceptionType
+{
+    NONODE,
+    BADVERSION,
+    NODEEXISTS,
+    NOTEMPTY
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
new file mode 100644
index 0000000..f3740db
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
@@ -0,0 +1,80 @@
+package org.apache.curator.x.rpc.idl.exceptions;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import com.facebook.swift.service.ThriftException;
+import org.apache.zookeeper.KeeperException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+@ThriftException(id = 1, type = RpcException.class, name = "CuratorException")
+@ThriftStruct("CuratorException")
+public class RpcException extends Exception
+{
+    @ThriftField(1)
+    public ExceptionType type;
+
+    @ThriftField(2)
+    public ZooKeeperExceptionType zooKeeperException;
+
+    @ThriftField(3)
+    public NodeExceptionType nodeException;
+
+    @ThriftField(4)
+    public String message;
+
+    public RpcException()
+    {
+    }
+
+    public RpcException(Exception e)
+    {
+        this.message = e.getLocalizedMessage();
+        if ( this.message == null )
+        {
+            StringWriter str = new StringWriter();
+            e.printStackTrace(new PrintWriter(str));
+            this.message = str.toString();
+        }
+
+        if ( KeeperException.class.isAssignableFrom(e.getClass()) )
+        {
+            KeeperException keeperException = (KeeperException)e;
+            switch ( keeperException.code() )
+            {
+                default:
+                {
+                    type = ExceptionType.ZOOKEEPER;
+                    zooKeeperException = ZooKeeperExceptionType.valueOf(keeperException.code().name());
+                    nodeException = null;
+                    break;
+                }
+
+                case NONODE:
+                case NODEEXISTS:
+                case NOTEMPTY:
+                case BADVERSION:
+                {
+                    type = ExceptionType.NODE;
+                    zooKeeperException = null;
+                    nodeException = NodeExceptionType.valueOf(keeperException.code().name());
+                    break;
+                }
+            }
+        }
+        else
+        {
+            type = ExceptionType.GENERAL;
+        }
+    }
+
+    public RpcException(ExceptionType type, ZooKeeperExceptionType zooKeeperException, NodeExceptionType nodeException, String message)
+    {
+        this.type = type;
+        this.zooKeeperException = zooKeeperException;
+        this.nodeException = nodeException;
+        this.message = message;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
new file mode 100644
index 0000000..ca5049b
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
@@ -0,0 +1,22 @@
+package org.apache.curator.x.rpc.idl.exceptions;
+
+public enum ZooKeeperExceptionType
+{
+    SYSTEMERROR,
+    RUNTIMEINCONSISTENCY,
+    DATAINCONSISTENCY,
+    CONNECTIONLOSS,
+    MARSHALLINGERROR,
+    UNIMPLEMENTED,
+    OPERATIONTIMEOUT,
+    BADARGUMENTS,
+    APIERROR,
+    NOAUTH,
+    NOCHILDRENFOREPHEMERALS,
+    INVALIDACL,
+    AUTHFAILED,
+    SESSIONEXPIRED,
+    INVALIDCALLBACK,
+    SESSIONMOVED,
+    NOTREADONLY
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index 7e9e9c1..07397ea 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -47,6 +47,8 @@ import org.apache.curator.x.rpc.connections.ConnectionManager;
 import org.apache.curator.x.rpc.connections.CuratorEntry;
 import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
 import org.apache.curator.x.rpc.details.RpcWatcher;
+import org.apache.curator.x.rpc.idl.exceptions.ExceptionType;
+import org.apache.curator.x.rpc.idl.exceptions.RpcException;
 import org.apache.curator.x.rpc.idl.structs.*;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.data.Stat;
@@ -69,9 +71,13 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public CuratorProjection newCuratorProjection(String connectionName)
+    public CuratorProjection newCuratorProjection(String connectionName) throws RpcException
     {
         CuratorFramework client = connectionManager.newConnection(connectionName);
+        if ( client == null )
+        {
+            throw new RpcException(ExceptionType.GENERAL, null, null, "No connection configuration was found with the name: " + connectionName);
+        }
 
         String id = CuratorEntry.newId();
         client.start();
@@ -108,433 +114,513 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws Exception
+    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.create();
-        if ( spec.creatingParentsIfNeeded )
-        {
-            builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
-        }
-        if ( spec.compressed )
-        {
-            builder = castBuilder(builder, Compressible.class).compressed();
-        }
-        if ( spec.withProtection )
-        {
-            builder = castBuilder(builder, CreateBuilder.class).withProtection();
-        }
-        if ( spec.mode != null )
+        try
         {
-            builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
-        }
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
 
-        if ( spec.asyncContext != null )
+            Object builder = client.create();
+            if ( spec.creatingParentsIfNeeded )
+            {
+                builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
+            }
+            if ( spec.compressed )
+            {
+                builder = castBuilder(builder, Compressible.class).compressed();
+            }
+            if ( spec.withProtection )
+            {
+                builder = castBuilder(builder, CreateBuilder.class).withProtection();
+            }
+            if ( spec.mode != null )
+            {
+                builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
+            }
+
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+            }
+
+            Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
+            return new OptionalPath((path != null) ? String.valueOf(path) : null);
+        }
+        catch ( Exception e )
         {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+            throw new RpcException(e);
         }
-
-        Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
-        return new OptionalPath((path != null) ? String.valueOf(path) : null);
     }
 
     @ThriftMethod
-    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws Exception
+    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.delete();
-        if ( spec.guaranteed )
+        try
         {
-            builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
-        }
-        if ( spec.version != null )
-        {
-            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
-        }
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
+
+            Object builder = client.delete();
+            if ( spec.guaranteed )
+            {
+                builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
+            }
+            if ( spec.version != null )
+            {
+                builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
+            }
 
-        if ( spec.asyncContext != null )
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+            }
+
+            castBuilder(builder, Pathable.class).forPath(spec.path);
+        }
+        catch ( Exception e )
         {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+            throw new RpcException(e);
         }
-
-        castBuilder(builder, Pathable.class).forPath(spec.path);
     }
 
     @ThriftMethod
-    public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws Exception
+    public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.getData();
-        if ( spec.watched )
+        try
         {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
 
-        if ( spec.decompressed )
-        {
-            builder = castBuilder(builder, Decompressible.class).decompressed();
-        }
+            Object builder = client.getData();
+            if ( spec.watched )
+            {
+                builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            }
 
-        if ( spec.asyncContext != null )
-        {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
-        }
+            if ( spec.decompressed )
+            {
+                builder = castBuilder(builder, Decompressible.class).decompressed();
+            }
+
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            }
 
-        Stat stat = new Stat();
-        builder = castBuilder(builder, Statable.class).storingStatIn(stat);
+            Stat stat = new Stat();
+            builder = castBuilder(builder, Statable.class).storingStatIn(stat);
 
-        return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
+            return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws Exception
+    public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.setData();
-        if ( spec.watched )
+        try
         {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
+
+            Object builder = client.setData();
+            if ( spec.watched )
+            {
+                builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            }
+            if ( spec.version != null )
+            {
+                builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
+            }
+
+            if ( spec.compressed )
+            {
+                builder = castBuilder(builder, Compressible.class).compressed();
+            }
+
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            }
+
+            Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
+            return RpcCuratorEvent.toRpcStat(stat);
         }
-        if ( spec.version != null )
+        catch ( Exception e )
         {
-            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
+            throw new RpcException(e);
         }
+    }
 
-        if ( spec.compressed )
+    @ThriftMethod
+    public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws RpcException
+    {
+        try
         {
-            builder = castBuilder(builder, Compressible.class).compressed();
-        }
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
+
+            Object builder = client.checkExists();
+            if ( spec.watched )
+            {
+                builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            }
 
-        if ( spec.asyncContext != null )
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            }
+
+            Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
+            return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
+        }
+        catch ( Exception e )
         {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            throw new RpcException(e);
         }
-
-        Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
-        return RpcCuratorEvent.toRpcStat(stat);
     }
 
     @ThriftMethod
-    public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws Exception
+    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.checkExists();
-        if ( spec.watched )
+        try
         {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
-        }
+            CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
 
-        if ( spec.asyncContext != null )
+            Object builder = client.getChildren();
+            if ( spec.watched )
+            {
+                builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            }
+
+            if ( spec.asyncContext != null )
+            {
+                BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+                builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            }
+
+            @SuppressWarnings("unchecked")
+            List<String> children = (List<String>)castBuilder(builder, Pathable.class).forPath(spec.path);
+            return new OptionalChildrenList(children);
+        }
+        catch ( Exception e )
         {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            throw new RpcException(e);
         }
-
-        Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
-        return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
     }
 
     @ThriftMethod
-    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws Exception
+    public boolean closeGenericProjection(CuratorProjection projection, String id) throws RpcException
     {
-        CuratorFramework client = getEntry(projection).getClient();
-
-        Object builder = client.getChildren();
-        if ( spec.watched )
+        try
         {
-            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            return entry.closeThing(id);
         }
-
-        if ( spec.asyncContext != null )
+        catch ( Exception e )
         {
-            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
-            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+            throw new RpcException(e);
         }
-
-        @SuppressWarnings("unchecked")
-        List<String> children = (List<String>)castBuilder(builder, Pathable.class).forPath(spec.path);
-        return new OptionalChildrenList(children);
     }
 
     @ThriftMethod
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws Exception
+    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws RpcException
     {
-        CuratorEntry entry = getEntry(curatorProjection);
-        return entry.closeThing(id);
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
+            if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
+            {
+                return new LockProjection();
+            }
+
+            Closer closer = new Closer()
+            {
+                @Override
+                public void close()
+                {
+                    if ( lock.isAcquiredInThisProcess() )
+                    {
+                        try
+                        {
+                            lock.release();
+                        }
+                        catch ( Exception e )
+                        {
+                            log.error("Could not release left-over lock for path: " + path, e);
+                        }
+                    }
+                }
+            };
+            String id = entry.addThing(lock, closer);
+            return new LockProjection(id);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
+    public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
-        final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
-        if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
+        try
         {
-            return new LockProjection();
-        }
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
+            final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
+            leaderLatch.start();
+
+            Closer closer = new Closer()
             {
-                if ( lock.isAcquiredInThisProcess() )
+                @Override
+                public void close()
                 {
                     try
                     {
-                        lock.release();
+                        leaderLatch.close();
                     }
-                    catch ( Exception e )
+                    catch ( IOException e )
                     {
-                        log.error("Could not release left-over lock for path: " + path, e);
+                        log.error("Could not close left-over leader latch for path: " + path, e);
                     }
                 }
-            }
-        };
-        String id = entry.addThing(lock, closer);
-        return new LockProjection(id);
-    }
-
-    @ThriftMethod
-    public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
-        leaderLatch.start();
+            };
+            String id = entry.addThing(leaderLatch, closer);
 
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
+            LeaderLatchListener listener = new LeaderLatchListener()
             {
-                try
+                @Override
+                public void isLeader()
                 {
-                    leaderLatch.close();
+                    addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
                 }
-                catch ( IOException e )
+
+                @Override
+                public void notLeader()
                 {
-                    log.error("Could not close left-over leader latch for path: " + path, e);
+                    addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
                 }
-            }
-        };
-        String id = entry.addThing(leaderLatch, closer);
-
-        LeaderLatchListener listener = new LeaderLatchListener()
-        {
-            @Override
-            public void isLeader()
-            {
-                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
-            }
+            };
+            leaderLatch.addListener(listener);
 
-            @Override
-            public void notLeader()
+            if ( waitForLeadershipMs > 0 )
             {
-                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
+                leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
             }
-        };
-        leaderLatch.addListener(listener);
 
-        if ( waitForLeadershipMs > 0 )
+            return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
+        }
+        catch ( Exception e )
         {
-            leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
+            throw new RpcException(e);
         }
-
-        return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
     }
 
     @ThriftMethod
-    public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
+    public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
-        Collection<Participant> participants = leaderLatch.getParticipants();
-        return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
-            {
-                @Override
-                public RpcParticipant apply(Participant participant)
+            LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+            Collection<Participant> participants = leaderLatch.getParticipants();
+            return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
                 {
-                    return new RpcParticipant(participant.getId(), participant.isLeader());
-                }
-            });
+                    @Override
+                    public RpcParticipant apply(Participant participant)
+                    {
+                        return new RpcParticipant(participant.getId(), participant.isLeader());
+                    }
+                });
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
+    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
-        return leaderLatch.hasLeadership();
+            LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+            return leaderLatch.hasLeadership();
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws Exception
+    public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws RpcException
     {
-        final CuratorEntry entry = getEntry(projection);
+        try
+        {
+            final CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
-        cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
+            final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
+            cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
 
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
+            Closer closer = new Closer()
             {
-                try
+                @Override
+                public void close()
                 {
-                    cache.close();
+                    try
+                    {
+                        cache.close();
+                    }
+                    catch ( IOException e )
+                    {
+                        log.error("Could not close left-over PathChildrenCache for path: " + path, e);
+                    }
                 }
-                catch ( IOException e )
+            };
+            String id = entry.addThing(cache, closer);
+
+            PathChildrenCacheListener listener = new PathChildrenCacheListener()
+            {
+                @Override
+                public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws RpcException
                 {
-                    log.error("Could not close left-over PathChildrenCache for path: " + path, e);
+                    entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
                 }
-            }
-        };
-        String id = entry.addThing(cache, closer);
+            };
+            cache.getListenable().addListener(listener);
 
-        PathChildrenCacheListener listener = new PathChildrenCacheListener()
+            return new PathChildrenCacheProjection(id);
+        }
+        catch ( Exception e )
         {
-            @Override
-            public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
-            {
-                entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
-            }
-        };
-        cache.getListenable().addListener(listener);
-
-        return new PathChildrenCacheProjection(id);
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws Exception
+    public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
-        return Lists.transform
-        (
-            pathChildrenCache.getCurrentData(),
-            new Function<ChildData, RpcChildData>()
-            {
-                @Override
-                public RpcChildData apply(ChildData childData)
+            PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+            return Lists.transform
+            (
+                pathChildrenCache.getCurrentData(),
+                new Function<ChildData, RpcChildData>()
                 {
-                    return new RpcChildData(childData);
+                    @Override
+                    public RpcChildData apply(ChildData childData)
+                    {
+                        return new RpcChildData(childData);
+                    }
                 }
-            }
-        );
+            );
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws Exception
+    public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
-        return new RpcChildData(pathChildrenCache.getCurrentData(path));
+            PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+            return new RpcChildData(pathChildrenCache.getCurrentData(path));
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws Exception
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws RpcException
     {
-        final CuratorEntry entry = getEntry(projection);
+        try
+        {
+            final CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
-        cache.start(buildInitial);
+            final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
+            cache.start(buildInitial);
 
-        Closer closer = new Closer()
-        {
-            @Override
-            public void close()
+            Closer closer = new Closer()
             {
-                try
+                @Override
+                public void close()
                 {
-                    cache.close();
+                    try
+                    {
+                        cache.close();
+                    }
+                    catch ( IOException e )
+                    {
+                        log.error("Could not close left-over NodeCache for path: " + path, e);
+                    }
                 }
-                catch ( IOException e )
+            };
+            String id = entry.addThing(cache, closer);
+
+            NodeCacheListener listener = new NodeCacheListener()
+            {
+                @Override
+                public void nodeChanged()
                 {
-                    log.error("Could not close left-over NodeCache for path: " + path, e);
+                    entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
                 }
-            }
-        };
-        String id = entry.addThing(cache, closer);
+            };
+            cache.getListenable().addListener(listener);
 
-        NodeCacheListener listener = new NodeCacheListener()
+            return new NodeCacheProjection(id);
+        }
+        catch ( Exception e )
         {
-            @Override
-            public void nodeChanged() throws Exception
-            {
-                entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
-            }
-        };
-        cache.getListenable().addListener(listener);
-
-        return new NodeCacheProjection(id);
-    }
-
-    @ThriftMethod
-    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
-    {
-        CuratorEntry entry = getEntry(projection);
-
-        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
-        return new RpcChildData(nodeCache.getCurrentData());
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
+    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
-
-        final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
-        node.start();
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-        Closer closer = new Closer()
+            NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
+            return new RpcChildData(nodeCache.getCurrentData());
+        }
+        catch ( Exception e )
         {
-            @Override
-            public void close()
-            {
-                try
-                {
-                    node.close();
-                }
-                catch ( Exception e )
-                {
-                    log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
-                }
-            }
-        };
-        String id = entry.addThing(node, closer);
-        return new PersistentEphemeralNodeProjection(id);
+            throw new RpcException(e);
+        }
     }
 
     @ThriftMethod
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws Exception
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws RpcException
     {
-        CuratorEntry entry = getEntry(projection);
-
-        final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
-        final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
-        if ( leases == null )
+        try
         {
-            return Lists.newArrayList();
-        }
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+
+            final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
+            node.start();
 
-        List<LeaseProjection> leaseProjections = Lists.newArrayList();
-        for ( final Lease lease : leases )
-        {
             Closer closer = new Closer()
             {
                 @Override
@@ -542,36 +628,72 @@ public class CuratorProjectionService
                 {
                     try
                     {
-                        semaphore.returnLease(lease);
+                        node.close();
                     }
                     catch ( Exception e )
                     {
-                        log.error("Could not release semaphore leases for path: " + path, e);
+                        log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
                     }
                 }
             };
-            leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
+            String id = entry.addThing(node, closer);
+            return new PersistentEphemeralNodeProjection(id);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
         }
-        return leaseProjections;
     }
 
-    public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
+    @ThriftMethod
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws RpcException
     {
-        CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry != null )
+        try
         {
-            entry.addEvent(event);
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+
+            final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
+            final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
+            if ( leases == null )
+            {
+                return Lists.newArrayList();
+            }
+
+            List<LeaseProjection> leaseProjections = Lists.newArrayList();
+            for ( final Lease lease : leases )
+            {
+                Closer closer = new Closer()
+                {
+                    @Override
+                    public void close()
+                    {
+                        try
+                        {
+                            semaphore.returnLease(lease);
+                        }
+                        catch ( Exception e )
+                        {
+                            log.error("Could not release semaphore leases for path: " + path, e);
+                        }
+                    }
+                };
+                leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
+            }
+            return leaseProjections;
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
         }
     }
 
-    private CuratorEntry getEntry(CuratorProjection projection) throws Exception
+    public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
     {
         CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry == null )
+        if ( entry != null )
         {
-            throw new Exception("No client found with id: " + projection.id);
+            entry.addEvent(event);
         }
-        return entry;
     }
 
     private static <T> T castBuilder(Object createBuilder, Class<T> clazz) throws Exception

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
index c10c5df..7b2ef94 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
@@ -4,6 +4,7 @@ import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import org.apache.curator.x.rpc.connections.CuratorEntry;
 import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.idl.exceptions.RpcException;
 import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
 import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
 
@@ -20,15 +21,17 @@ public class EventService
     }
 
     @ThriftMethod
-    public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws InterruptedException
+    public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws RpcException
     {
-        CuratorEntry entry = connectionManager.get(projection.id);
-        if ( entry == null )
+        try
         {
-            // TODO
-            return null;
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
+            return (event != null) ? event : new RpcCuratorEvent();
+        }
+        catch ( InterruptedException e )
+        {
+            throw new RpcException(e);
         }
-        RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
-        return (event != null) ? event : new RpcCuratorEvent();
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/scripts/generate.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
index de5e21c..684d8f5 100755
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ b/curator-x-rpc/src/main/scripts/generate.sh
@@ -31,7 +31,7 @@ RPC_PATH="$BASE_DIR/curator-x-rpc/target/classes"
 
 CLASSES=""
 
-for p in services structs; do
+for p in services structs exceptions; do
     for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/$p/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`; do
         if [[ $f != *[\$]* ]]; then
             CLASSES="$CLASSES org.apache.curator.x.rpc.idl.$p.$f";

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 7917a32..4de5cff 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -31,6 +31,18 @@ enum PersistentEphemeralNodeMode {
   EPHEMERAL, EPHEMERAL_SEQUENTIAL, PROTECTED_EPHEMERAL, PROTECTED_EPHEMERAL_SEQUENTIAL
 }
 
+enum ExceptionType {
+  GENERAL, ZOOKEEPER, NODE
+}
+
+enum NodeExceptionType {
+  NONODE, BADVERSION, NODEEXISTS, NOTEMPTY
+}
+
+enum ZooKeeperExceptionType {
+  SYSTEMERROR, RUNTIMEINCONSISTENCY, DATAINCONSISTENCY, CONNECTIONLOSS, MARSHALLINGERROR, UNIMPLEMENTED, OPERATIONTIMEOUT, BADARGUMENTS, APIERROR, NOAUTH, NOCHILDRENFOREPHEMERALS, INVALIDACL, AUTHFAILED, SESSIONEXPIRED, INVALIDCALLBACK, SESSIONMOVED, NOTREADONLY
+}
+
 struct CuratorProjection {
   1: string id;
 }
@@ -179,6 +191,13 @@ struct SetDataSpec {
   6: binary data;
 }
 
+exception CuratorException {
+  1: ExceptionType type;
+  2: ZooKeeperExceptionType zooKeeperException;
+  3: NodeExceptionType nodeException;
+  4: string message;
+}
+
 struct CuratorEvent {
   2: CuratorEventType type;
   3: i32 resultCode;
@@ -195,29 +214,29 @@ struct CuratorEvent {
 }
 
 service CuratorService {
-  LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs);
+  LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs) throws (1: CuratorException ex1);
   oneway void closeCuratorProjection(1: CuratorProjection projection);
-  bool closeGenericProjection(1: CuratorProjection curatorProjection, 2: string id);
-  OptionalPath createNode(1: CuratorProjection projection, 2: CreateSpec spec);
-  void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec);
-  OptionalStat exists(1: CuratorProjection projection, 2: ExistsSpec spec);
-  OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec);
-  binary getData(1: CuratorProjection projection, 2: GetDataSpec spec);
-  list<Participant> getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
-  ChildData getNodeCacheData(1: CuratorProjection projection, 2: NodeCacheProjection cacheProjection);
-  list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection);
-  ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path);
-  bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
+  bool closeGenericProjection(1: CuratorProjection projection, 2: string id) throws (1: CuratorException ex1);
+  OptionalPath createNode(1: CuratorProjection projection, 2: CreateSpec spec) throws (1: CuratorException ex1);
+  void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec) throws (1: CuratorException ex1);
+  OptionalStat exists(1: CuratorProjection projection, 2: ExistsSpec spec) throws (1: CuratorException ex1);
+  OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec) throws (1: CuratorException ex1);
+  binary getData(1: CuratorProjection projection, 2: GetDataSpec spec) throws (1: CuratorException ex1);
+  list<Participant> getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
+  ChildData getNodeCacheData(1: CuratorProjection projection, 2: NodeCacheProjection cacheProjection) throws (1: CuratorException ex1);
+  list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection) throws (1: CuratorException ex1);
+  ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path) throws (1: CuratorException ex1);
+  bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
   CuratorProjection newCuratorProjection(1: string connectionName);
   oneway void pingCuratorProjection(1: CuratorProjection projection);
-  Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec);
-  LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs);
-  NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial);
-  PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode);
-  PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode);
-  list<LeaseProjection> startSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases);
+  Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec) throws (1: CuratorException ex1);
+  LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs) throws (1: CuratorException ex1);
+  NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial) throws (1: CuratorException ex1);
+  PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode) throws (1: CuratorException ex1);
+  PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode) throws (1: CuratorException ex1);
+  list<LeaseProjection> startSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases) throws (1: CuratorException ex1);
 }
 
 service EventService {
-  CuratorEvent getNextEvent(1: CuratorProjection projection);
+  CuratorEvent getNextEvent(1: CuratorProjection projection) throws (1: CuratorException ex1);
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java
new file mode 100644
index 0000000..b397813
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java
@@ -0,0 +1,736 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 CuratorException extends TException implements org.apache.thrift.TBase<CuratorException, CuratorException._Fields>, java.io.Serializable, Cloneable, Comparable<CuratorException> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CuratorException");
+
+  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
+  private static final org.apache.thrift.protocol.TField ZOO_KEEPER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("zooKeeperException", org.apache.thrift.protocol.TType.I32, (short)2);
+  private static final org.apache.thrift.protocol.TField NODE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeException", org.apache.thrift.protocol.TType.I32, (short)3);
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)4);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new CuratorExceptionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new CuratorExceptionTupleSchemeFactory());
+  }
+
+  /**
+   * 
+   * @see ExceptionType
+   */
+  public ExceptionType type; // required
+  /**
+   * 
+   * @see ZooKeeperExceptionType
+   */
+  public ZooKeeperExceptionType zooKeeperException; // required
+  /**
+   * 
+   * @see NodeExceptionType
+   */
+  public NodeExceptionType nodeException; // required
+  public String message; // required
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    /**
+     * 
+     * @see ExceptionType
+     */
+    TYPE((short)1, "type"),
+    /**
+     * 
+     * @see ZooKeeperExceptionType
+     */
+    ZOO_KEEPER_EXCEPTION((short)2, "zooKeeperException"),
+    /**
+     * 
+     * @see NodeExceptionType
+     */
+    NODE_EXCEPTION((short)3, "nodeException"),
+    MESSAGE((short)4, "message");
+
+    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: // TYPE
+          return TYPE;
+        case 2: // ZOO_KEEPER_EXCEPTION
+          return ZOO_KEEPER_EXCEPTION;
+        case 3: // NODE_EXCEPTION
+          return NODE_EXCEPTION;
+        case 4: // MESSAGE
+          return MESSAGE;
+        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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ExceptionType.class)));
+    tmpMap.put(_Fields.ZOO_KEEPER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("zooKeeperException", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ZooKeeperExceptionType.class)));
+    tmpMap.put(_Fields.NODE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("nodeException", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, NodeExceptionType.class)));
+    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CuratorException.class, metaDataMap);
+  }
+
+  public CuratorException() {
+  }
+
+  public CuratorException(
+    ExceptionType type,
+    ZooKeeperExceptionType zooKeeperException,
+    NodeExceptionType nodeException,
+    String message)
+  {
+    this();
+    this.type = type;
+    this.zooKeeperException = zooKeeperException;
+    this.nodeException = nodeException;
+    this.message = message;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CuratorException(CuratorException other) {
+    if (other.isSetType()) {
+      this.type = other.type;
+    }
+    if (other.isSetZooKeeperException()) {
+      this.zooKeeperException = other.zooKeeperException;
+    }
+    if (other.isSetNodeException()) {
+      this.nodeException = other.nodeException;
+    }
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+  }
+
+  public CuratorException deepCopy() {
+    return new CuratorException(this);
+  }
+
+  @Override
+  public void clear() {
+    this.type = null;
+    this.zooKeeperException = null;
+    this.nodeException = null;
+    this.message = null;
+  }
+
+  /**
+   * 
+   * @see ExceptionType
+   */
+  public ExceptionType getType() {
+    return this.type;
+  }
+
+  /**
+   * 
+   * @see ExceptionType
+   */
+  public CuratorException setType(ExceptionType type) {
+    this.type = type;
+    return this;
+  }
+
+  public void unsetType() {
+    this.type = null;
+  }
+
+  /** Returns true if field type is set (has been assigned a value) and false otherwise */
+  public boolean isSetType() {
+    return this.type != null;
+  }
+
+  public void setTypeIsSet(boolean value) {
+    if (!value) {
+      this.type = null;
+    }
+  }
+
+  /**
+   * 
+   * @see ZooKeeperExceptionType
+   */
+  public ZooKeeperExceptionType getZooKeeperException() {
+    return this.zooKeeperException;
+  }
+
+  /**
+   * 
+   * @see ZooKeeperExceptionType
+   */
+  public CuratorException setZooKeeperException(ZooKeeperExceptionType zooKeeperException) {
+    this.zooKeeperException = zooKeeperException;
+    return this;
+  }
+
+  public void unsetZooKeeperException() {
+    this.zooKeeperException = null;
+  }
+
+  /** Returns true if field zooKeeperException is set (has been assigned a value) and false otherwise */
+  public boolean isSetZooKeeperException() {
+    return this.zooKeeperException != null;
+  }
+
+  public void setZooKeeperExceptionIsSet(boolean value) {
+    if (!value) {
+      this.zooKeeperException = null;
+    }
+  }
+
+  /**
+   * 
+   * @see NodeExceptionType
+   */
+  public NodeExceptionType getNodeException() {
+    return this.nodeException;
+  }
+
+  /**
+   * 
+   * @see NodeExceptionType
+   */
+  public CuratorException setNodeException(NodeExceptionType nodeException) {
+    this.nodeException = nodeException;
+    return this;
+  }
+
+  public void unsetNodeException() {
+    this.nodeException = null;
+  }
+
+  /** Returns true if field nodeException is set (has been assigned a value) and false otherwise */
+  public boolean isSetNodeException() {
+    return this.nodeException != null;
+  }
+
+  public void setNodeExceptionIsSet(boolean value) {
+    if (!value) {
+      this.nodeException = null;
+    }
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public CuratorException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case TYPE:
+      if (value == null) {
+        unsetType();
+      } else {
+        setType((ExceptionType)value);
+      }
+      break;
+
+    case ZOO_KEEPER_EXCEPTION:
+      if (value == null) {
+        unsetZooKeeperException();
+      } else {
+        setZooKeeperException((ZooKeeperExceptionType)value);
+      }
+      break;
+
+    case NODE_EXCEPTION:
+      if (value == null) {
+        unsetNodeException();
+      } else {
+        setNodeException((NodeExceptionType)value);
+      }
+      break;
+
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case TYPE:
+      return getType();
+
+    case ZOO_KEEPER_EXCEPTION:
+      return getZooKeeperException();
+
+    case NODE_EXCEPTION:
+      return getNodeException();
+
+    case MESSAGE:
+      return getMessage();
+
+    }
+    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 TYPE:
+      return isSetType();
+    case ZOO_KEEPER_EXCEPTION:
+      return isSetZooKeeperException();
+    case NODE_EXCEPTION:
+      return isSetNodeException();
+    case MESSAGE:
+      return isSetMessage();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof CuratorException)
+      return this.equals((CuratorException)that);
+    return false;
+  }
+
+  public boolean equals(CuratorException that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_type = true && this.isSetType();
+    boolean that_present_type = true && that.isSetType();
+    if (this_present_type || that_present_type) {
+      if (!(this_present_type && that_present_type))
+        return false;
+      if (!this.type.equals(that.type))
+        return false;
+    }
+
+    boolean this_present_zooKeeperException = true && this.isSetZooKeeperException();
+    boolean that_present_zooKeeperException = true && that.isSetZooKeeperException();
+    if (this_present_zooKeeperException || that_present_zooKeeperException) {
+      if (!(this_present_zooKeeperException && that_present_zooKeeperException))
+        return false;
+      if (!this.zooKeeperException.equals(that.zooKeeperException))
+        return false;
+    }
+
+    boolean this_present_nodeException = true && this.isSetNodeException();
+    boolean that_present_nodeException = true && that.isSetNodeException();
+    if (this_present_nodeException || that_present_nodeException) {
+      if (!(this_present_nodeException && that_present_nodeException))
+        return false;
+      if (!this.nodeException.equals(that.nodeException))
+        return false;
+    }
+
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CuratorException other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetZooKeeperException()).compareTo(other.isSetZooKeeperException());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetZooKeeperException()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.zooKeeperException, other.zooKeeperException);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetNodeException()).compareTo(other.isSetNodeException());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetNodeException()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeException, other.nodeException);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
+      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("CuratorException(");
+    boolean first = true;
+
+    sb.append("type:");
+    if (this.type == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.type);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("zooKeeperException:");
+    if (this.zooKeeperException == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.zooKeeperException);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("nodeException:");
+    if (this.nodeException == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.nodeException);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    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 CuratorExceptionStandardSchemeFactory implements SchemeFactory {
+    public CuratorExceptionStandardScheme getScheme() {
+      return new CuratorExceptionStandardScheme();
+    }
+  }
+
+  private static class CuratorExceptionStandardScheme extends StandardScheme<CuratorException> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, CuratorException 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: // TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.type = ExceptionType.findByValue(iprot.readI32());
+              struct.setTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // ZOO_KEEPER_EXCEPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.zooKeeperException = ZooKeeperExceptionType.findByValue(iprot.readI32());
+              struct.setZooKeeperExceptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // NODE_EXCEPTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.nodeException = NodeExceptionType.findByValue(iprot.readI32());
+              struct.setNodeExceptionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // MESSAGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.message = iprot.readString();
+              struct.setMessageIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, CuratorException struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.type != null) {
+        oprot.writeFieldBegin(TYPE_FIELD_DESC);
+        oprot.writeI32(struct.type.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.zooKeeperException != null) {
+        oprot.writeFieldBegin(ZOO_KEEPER_EXCEPTION_FIELD_DESC);
+        oprot.writeI32(struct.zooKeeperException.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.nodeException != null) {
+        oprot.writeFieldBegin(NODE_EXCEPTION_FIELD_DESC);
+        oprot.writeI32(struct.nodeException.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.message != null) {
+        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+        oprot.writeString(struct.message);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class CuratorExceptionTupleSchemeFactory implements SchemeFactory {
+    public CuratorExceptionTupleScheme getScheme() {
+      return new CuratorExceptionTupleScheme();
+    }
+  }
+
+  private static class CuratorExceptionTupleScheme extends TupleScheme<CuratorException> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, CuratorException struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetType()) {
+        optionals.set(0);
+      }
+      if (struct.isSetZooKeeperException()) {
+        optionals.set(1);
+      }
+      if (struct.isSetNodeException()) {
+        optionals.set(2);
+      }
+      if (struct.isSetMessage()) {
+        optionals.set(3);
+      }
+      oprot.writeBitSet(optionals, 4);
+      if (struct.isSetType()) {
+        oprot.writeI32(struct.type.getValue());
+      }
+      if (struct.isSetZooKeeperException()) {
+        oprot.writeI32(struct.zooKeeperException.getValue());
+      }
+      if (struct.isSetNodeException()) {
+        oprot.writeI32(struct.nodeException.getValue());
+      }
+      if (struct.isSetMessage()) {
+        oprot.writeString(struct.message);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, CuratorException struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(4);
+      if (incoming.get(0)) {
+        struct.type = ExceptionType.findByValue(iprot.readI32());
+        struct.setTypeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.zooKeeperException = ZooKeeperExceptionType.findByValue(iprot.readI32());
+        struct.setZooKeeperExceptionIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.nodeException = NodeExceptionType.findByValue(iprot.readI32());
+        struct.setNodeExceptionIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.message = iprot.readString();
+        struct.setMessageIsSet(true);
+      }
+    }
+  }
+
+}
+


[05/50] [abbrv] git commit: node cache support

Posted by ra...@apache.org.
node cache support


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/985c9ed0
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/985c9ed0
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/985c9ed0

Branch: refs/heads/master
Commit: 985c9ed008a77d179066f9873716636fff4be959
Parents: 6f9a9ab
Author: randgalt <ra...@apache.org>
Authored: Thu May 29 16:17:46 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu May 29 16:17:46 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/connections/CuratorEntry.java |   12 +-
 .../x/rpc/idl/event/RpcCuratorEvent.java        |   16 +
 .../x/rpc/idl/event/RpcCuratorEventType.java    |    3 +-
 .../projection/CuratorProjectionService.java    |   55 +-
 .../rpc/idl/projection/NodeCacheProjection.java |   20 +
 curator-x-rpc/src/main/thrift/curator.thrift    |    8 +-
 .../curator/generated/CuratorEventType.java     |    5 +-
 .../curator/generated/CuratorService.java       | 3893 ++++++++++++++----
 .../curator/generated/NodeCacheProjection.java  |  393 ++
 .../org/apache/curator/x/rpc/TestClient.java    |    7 +
 10 files changed, 3509 insertions(+), 903 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index 1ecd795..2613ad0 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -98,12 +98,6 @@ public class CuratorEntry implements Closeable
         return UUID.randomUUID().toString();
     }
 
-    public <T> String addThing(String id, T thing, Closer<T> closer)
-    {
-        things.put(id, new Entry(thing, closer));
-        return id;
-    }
-
     public <T> T getThing(String id, Class<T> clazz)
     {
         Entry entry = (id != null) ? things.get(id) : null;
@@ -121,6 +115,12 @@ public class CuratorEntry implements Closeable
         return false;
     }
 
+    private <T> String addThing(String id, T thing, Closer<T> closer)
+    {
+        things.put(id, new Entry(thing, closer));
+        return id;
+    }
+
     private <T> T cast(Class<T> clazz, Entry entry)
     {
         if ( entry != null )

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
index aacf076..400f8c9 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
@@ -86,6 +86,22 @@ public class RpcCuratorEvent
         this.childrenCacheEvent = null;
     }
 
+    public RpcCuratorEvent(RpcCuratorEventType type, String path)
+    {
+        this.type = type;
+        this.resultCode = 0;
+        this.path = path;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
     public RpcCuratorEvent(RpcPathChildrenCacheEvent childrenCacheEvent)
     {
         this.type = RpcCuratorEventType.PATH_CHILDREN_CACHE;

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
index eee5929..0bda3d6 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
@@ -41,5 +41,6 @@ public enum RpcCuratorEventType
     CONNECTION_LOST,
     CONNECTION_READ_ONLY,
     LEADER,
-    PATH_CHILDREN_CACHE
+    PATH_CHILDREN_CACHE,
+    NODE_CACHE
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index 8b41353..a870447 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -27,6 +27,8 @@ import com.google.common.collect.Lists;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.api.*;
 import org.apache.curator.framework.recipes.cache.ChildData;
+import org.apache.curator.framework.recipes.cache.NodeCache;
+import org.apache.curator.framework.recipes.cache.NodeCacheListener;
 import org.apache.curator.framework.recipes.cache.PathChildrenCache;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
@@ -316,8 +318,7 @@ public class CuratorProjectionService
                 }
             }
         };
-        final String id = CuratorEntry.newId();
-        entry.addThing(id, leaderLatch, closer);
+        String id = entry.addThing(leaderLatch, closer);
 
         LeaderLatchListener listener = new LeaderLatchListener()
         {
@@ -393,8 +394,7 @@ public class CuratorProjectionService
                 }
             }
         };
-        final String id = CuratorEntry.newId();
-        entry.addThing(id, cache, closer);
+        String id = entry.addThing(cache, closer);
 
         PathChildrenCacheListener listener = new PathChildrenCacheListener()
         {
@@ -438,6 +438,53 @@ public class CuratorProjectionService
         return new RpcChildData(pathChildrenCache.getCurrentData(path));
     }
 
+    @ThriftMethod
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws Exception
+    {
+        final CuratorEntry entry = getEntry(projection);
+
+        final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
+        cache.start(buildInitial);
+
+        Closer<NodeCache> closer = new Closer<NodeCache>()
+        {
+            @Override
+            public void close(NodeCache cache)
+            {
+                try
+                {
+                    cache.close();
+                }
+                catch ( IOException e )
+                {
+                    log.error("Could not close left-over NodeCache for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(cache, closer);
+
+        NodeCacheListener listener = new NodeCacheListener()
+        {
+            @Override
+            public void nodeChanged() throws Exception
+            {
+                entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
+            }
+        };
+        cache.getListenable().addListener(listener);
+
+        return new NodeCacheProjection(new GenericProjection(id));
+    }
+
+    @ThriftMethod
+    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
+    {
+        final CuratorEntry entry = getEntry(projection);
+
+        NodeCache nodeCache = getThing(entry, cacheProjection.projection.id, NodeCache.class);
+        return new RpcChildData(nodeCache.getCurrentData());
+    }
+
     public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
     {
         CuratorEntry entry = connectionManager.get(projection.id);

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
new file mode 100644
index 0000000..43d1138
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.projection;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class NodeCacheProjection
+{
+    @ThriftField(1)
+    public GenericProjection projection;
+
+    public NodeCacheProjection()
+    {
+    }
+
+    public NodeCacheProjection(GenericProjection projection)
+    {
+        this.projection = projection;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 2b5e115..6ed104d 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -12,7 +12,7 @@ enum CreateMode {
 }
 
 enum CuratorEventType {
-  PING, CREATE, DELETE, EXISTS, GET_DATA, SET_DATA, CHILDREN, SYNC, GET_ACL, SET_ACL, WATCHED, CLOSING, CONNECTION_CONNECTED, CONNECTION_SUSPENDED, CONNECTION_RECONNECTED, CONNECTION_LOST, CONNECTION_READ_ONLY, LEADER, PATH_CHILDREN_CACHE
+  PING, CREATE, DELETE, EXISTS, GET_DATA, SET_DATA, CHILDREN, SYNC, GET_ACL, SET_ACL, WATCHED, CLOSING, CONNECTION_CONNECTED, CONNECTION_SUSPENDED, CONNECTION_RECONNECTED, CONNECTION_LOST, CONNECTION_READ_ONLY, LEADER, PATH_CHILDREN_CACHE, NODE_CACHE
 }
 
 enum EventType {
@@ -58,6 +58,10 @@ struct LeaderProjection {
   1: GenericProjection projection;
 }
 
+struct NodeCacheProjection {
+  1: GenericProjection projection;
+}
+
 struct PathChildrenCacheProjection {
   1: GenericProjection projection;
 }
@@ -188,12 +192,14 @@ service CuratorService {
   OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec);
   binary getData(1: CuratorProjection projection, 2: GetDataSpec spec);
   list<Participant> getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
+  ChildData getNodeCacheData(1: CuratorProjection projection, 2: NodeCacheProjection cacheProjection);
   list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection);
   ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path);
   bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
   CuratorProjection newCuratorProjection(1: string connectionName);
   Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec);
   LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs);
+  NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial);
   PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode);
 }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
index 46c57ae..08013ec 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
@@ -30,7 +30,8 @@ public enum CuratorEventType implements org.apache.thrift.TEnum {
   CONNECTION_LOST(15),
   CONNECTION_READ_ONLY(16),
   LEADER(17),
-  PATH_CHILDREN_CACHE(18);
+  PATH_CHILDREN_CACHE(18),
+  NODE_CACHE(19);
 
   private final int value;
 
@@ -89,6 +90,8 @@ public enum CuratorEventType implements org.apache.thrift.TEnum {
         return LEADER;
       case 18:
         return PATH_CHILDREN_CACHE;
+      case 19:
+        return NODE_CACHE;
       default:
         return null;
     }


[22/50] [abbrv] wip on service discovery

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/b79909a4/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
index a082b33..169192e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
@@ -36,6 +36,12 @@ public class DiscoveryServiceLowLevel {
 
   public interface Iface {
 
+    public DiscoveryInstance queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id) throws CuratorException, org.apache.thrift.TException;
+
+    public List<DiscoveryInstance> queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name) throws CuratorException, org.apache.thrift.TException;
+
+    public List<String> queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection) throws CuratorException, org.apache.thrift.TException;
+
     public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException;
 
     public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException;
@@ -46,6 +52,12 @@ public class DiscoveryServiceLowLevel {
 
   public interface AsyncIface {
 
+    public void queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -74,6 +86,90 @@ public class DiscoveryServiceLowLevel {
       super(iprot, oprot);
     }
 
+    public DiscoveryInstance queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id) throws CuratorException, org.apache.thrift.TException
+    {
+      send_queryForInstance(projection, discoveryProjection, name, id);
+      return recv_queryForInstance();
+    }
+
+    public void send_queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id) throws org.apache.thrift.TException
+    {
+      queryForInstance_args args = new queryForInstance_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setName(name);
+      args.setId(id);
+      sendBase("queryForInstance", args);
+    }
+
+    public DiscoveryInstance recv_queryForInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      queryForInstance_result result = new queryForInstance_result();
+      receiveBase(result, "queryForInstance");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryForInstance failed: unknown result");
+    }
+
+    public List<DiscoveryInstance> queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name) throws CuratorException, org.apache.thrift.TException
+    {
+      send_queryForInstances(projection, discoveryProjection, name);
+      return recv_queryForInstances();
+    }
+
+    public void send_queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name) throws org.apache.thrift.TException
+    {
+      queryForInstances_args args = new queryForInstances_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setName(name);
+      sendBase("queryForInstances", args);
+    }
+
+    public List<DiscoveryInstance> recv_queryForInstances() throws CuratorException, org.apache.thrift.TException
+    {
+      queryForInstances_result result = new queryForInstances_result();
+      receiveBase(result, "queryForInstances");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryForInstances failed: unknown result");
+    }
+
+    public List<String> queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection) throws CuratorException, org.apache.thrift.TException
+    {
+      send_queryForNames(projection, discoveryProjection);
+      return recv_queryForNames();
+    }
+
+    public void send_queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection) throws org.apache.thrift.TException
+    {
+      queryForNames_args args = new queryForNames_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      sendBase("queryForNames", args);
+    }
+
+    public List<String> recv_queryForNames() throws CuratorException, org.apache.thrift.TException
+    {
+      queryForNames_result result = new queryForNames_result();
+      receiveBase(result, "queryForNames");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryForNames failed: unknown result");
+    }
+
     public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException
     {
       send_registerInstance(projection, discoveryProjection, instance);
@@ -167,6 +263,120 @@ public class DiscoveryServiceLowLevel {
       super(protocolFactory, clientManager, transport);
     }
 
+    public void queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      queryForInstance_call method_call = new queryForInstance_call(projection, discoveryProjection, name, id, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class queryForInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private String name;
+      private String id;
+      public queryForInstance_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.name = name;
+        this.id = id;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryForInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        queryForInstance_args args = new queryForInstance_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setName(name);
+        args.setId(id);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public DiscoveryInstance getResult() throws CuratorException, 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_queryForInstance();
+      }
+    }
+
+    public void queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      queryForInstances_call method_call = new queryForInstances_call(projection, discoveryProjection, name, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class queryForInstances_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private String name;
+      public queryForInstances_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.name = name;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryForInstances", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        queryForInstances_args args = new queryForInstances_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setName(name);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<DiscoveryInstance> getResult() throws CuratorException, 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_queryForInstances();
+      }
+    }
+
+    public void queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      queryForNames_call method_call = new queryForNames_call(projection, discoveryProjection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class queryForNames_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      public queryForNames_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryForNames", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        queryForNames_args args = new queryForNames_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<String> getResult() throws CuratorException, 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_queryForNames();
+      }
+    }
+
     public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       registerInstance_call method_call = new registerInstance_call(projection, discoveryProjection, instance, resultHandler, this, ___protocolFactory, ___transport);
@@ -294,12 +504,87 @@ public class DiscoveryServiceLowLevel {
     }
 
     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("queryForInstance", new queryForInstance());
+      processMap.put("queryForInstances", new queryForInstances());
+      processMap.put("queryForNames", new queryForNames());
       processMap.put("registerInstance", new registerInstance());
       processMap.put("unregisterInstance", new unregisterInstance());
       processMap.put("updateInstance", new updateInstance());
       return processMap;
     }
 
+    public static class queryForInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, queryForInstance_args> {
+      public queryForInstance() {
+        super("queryForInstance");
+      }
+
+      public queryForInstance_args getEmptyArgsInstance() {
+        return new queryForInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public queryForInstance_result getResult(I iface, queryForInstance_args args) throws org.apache.thrift.TException {
+        queryForInstance_result result = new queryForInstance_result();
+        try {
+          result.success = iface.queryForInstance(args.projection, args.discoveryProjection, args.name, args.id);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class queryForInstances<I extends Iface> extends org.apache.thrift.ProcessFunction<I, queryForInstances_args> {
+      public queryForInstances() {
+        super("queryForInstances");
+      }
+
+      public queryForInstances_args getEmptyArgsInstance() {
+        return new queryForInstances_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public queryForInstances_result getResult(I iface, queryForInstances_args args) throws org.apache.thrift.TException {
+        queryForInstances_result result = new queryForInstances_result();
+        try {
+          result.success = iface.queryForInstances(args.projection, args.discoveryProjection, args.name);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class queryForNames<I extends Iface> extends org.apache.thrift.ProcessFunction<I, queryForNames_args> {
+      public queryForNames() {
+        super("queryForNames");
+      }
+
+      public queryForNames_args getEmptyArgsInstance() {
+        return new queryForNames_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public queryForNames_result getResult(I iface, queryForNames_args args) throws org.apache.thrift.TException {
+        queryForNames_result result = new queryForNames_result();
+        try {
+          result.success = iface.queryForNames(args.projection, args.discoveryProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
     public static class registerInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerInstance_args> {
       public registerInstance() {
         super("registerInstance");
@@ -385,26 +670,30 @@ public class DiscoveryServiceLowLevel {
     }
 
     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("queryForInstance", new queryForInstance());
+      processMap.put("queryForInstances", new queryForInstances());
+      processMap.put("queryForNames", new queryForNames());
       processMap.put("registerInstance", new registerInstance());
       processMap.put("unregisterInstance", new unregisterInstance());
       processMap.put("updateInstance", new updateInstance());
       return processMap;
     }
 
-    public static class registerInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerInstance_args, Void> {
-      public registerInstance() {
-        super("registerInstance");
+    public static class queryForInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, queryForInstance_args, DiscoveryInstance> {
+      public queryForInstance() {
+        super("queryForInstance");
       }
 
-      public registerInstance_args getEmptyArgsInstance() {
-        return new registerInstance_args();
+      public queryForInstance_args getEmptyArgsInstance() {
+        return new queryForInstance_args();
       }
 
-      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<DiscoveryInstance> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<Void>() { 
-          public void onComplete(Void o) {
-            registerInstance_result result = new registerInstance_result();
+        return new AsyncMethodCallback<DiscoveryInstance>() { 
+          public void onComplete(DiscoveryInstance o) {
+            queryForInstance_result result = new queryForInstance_result();
+            result.success = o;
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
               return;
@@ -416,7 +705,7 @@ public class DiscoveryServiceLowLevel {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            registerInstance_result result = new registerInstance_result();
+            queryForInstance_result result = new queryForInstance_result();
             if (e instanceof CuratorException) {
                         result.ex1 = (CuratorException) e;
                         result.setEx1IsSet(true);
@@ -442,25 +731,26 @@ public class DiscoveryServiceLowLevel {
         return false;
       }
 
-      public void start(I iface, registerInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
-        iface.registerInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      public void start(I iface, queryForInstance_args args, org.apache.thrift.async.AsyncMethodCallback<DiscoveryInstance> resultHandler) throws TException {
+        iface.queryForInstance(args.projection, args.discoveryProjection, args.name, args.id,resultHandler);
       }
     }
 
-    public static class unregisterInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unregisterInstance_args, Void> {
-      public unregisterInstance() {
-        super("unregisterInstance");
+    public static class queryForInstances<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, queryForInstances_args, List<DiscoveryInstance>> {
+      public queryForInstances() {
+        super("queryForInstances");
       }
 
-      public unregisterInstance_args getEmptyArgsInstance() {
-        return new unregisterInstance_args();
+      public queryForInstances_args getEmptyArgsInstance() {
+        return new queryForInstances_args();
       }
 
-      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<List<DiscoveryInstance>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<Void>() { 
-          public void onComplete(Void o) {
-            unregisterInstance_result result = new unregisterInstance_result();
+        return new AsyncMethodCallback<List<DiscoveryInstance>>() { 
+          public void onComplete(List<DiscoveryInstance> o) {
+            queryForInstances_result result = new queryForInstances_result();
+            result.success = o;
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
               return;
@@ -472,7 +762,7 @@ public class DiscoveryServiceLowLevel {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            unregisterInstance_result result = new unregisterInstance_result();
+            queryForInstances_result result = new queryForInstances_result();
             if (e instanceof CuratorException) {
                         result.ex1 = (CuratorException) e;
                         result.setEx1IsSet(true);
@@ -498,25 +788,26 @@ public class DiscoveryServiceLowLevel {
         return false;
       }
 
-      public void start(I iface, unregisterInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
-        iface.unregisterInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      public void start(I iface, queryForInstances_args args, org.apache.thrift.async.AsyncMethodCallback<List<DiscoveryInstance>> resultHandler) throws TException {
+        iface.queryForInstances(args.projection, args.discoveryProjection, args.name,resultHandler);
       }
     }
 
-    public static class updateInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateInstance_args, Void> {
-      public updateInstance() {
-        super("updateInstance");
+    public static class queryForNames<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, queryForNames_args, List<String>> {
+      public queryForNames() {
+        super("queryForNames");
       }
 
-      public updateInstance_args getEmptyArgsInstance() {
-        return new updateInstance_args();
+      public queryForNames_args getEmptyArgsInstance() {
+        return new queryForNames_args();
       }
 
-      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<Void>() { 
-          public void onComplete(Void o) {
-            updateInstance_result result = new updateInstance_result();
+        return new AsyncMethodCallback<List<String>>() { 
+          public void onComplete(List<String> o) {
+            queryForNames_result result = new queryForNames_result();
+            result.success = o;
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
               return;
@@ -528,7 +819,7 @@ public class DiscoveryServiceLowLevel {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            updateInstance_result result = new updateInstance_result();
+            queryForNames_result result = new queryForNames_result();
             if (e instanceof CuratorException) {
                         result.ex1 = (CuratorException) e;
                         result.setEx1IsSet(true);
@@ -554,8 +845,3344 @@ public class DiscoveryServiceLowLevel {
         return false;
       }
 
-      public void start(I iface, updateInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
-        iface.updateInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      public void start(I iface, queryForNames_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException {
+        iface.queryForNames(args.projection, args.discoveryProjection,resultHandler);
+      }
+    }
+
+    public static class registerInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerInstance_args, Void> {
+      public registerInstance() {
+        super("registerInstance");
+      }
+
+      public registerInstance_args getEmptyArgsInstance() {
+        return new registerInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            registerInstance_result result = new registerInstance_result();
+            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;
+            registerInstance_result result = new registerInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, registerInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.registerInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+    public static class unregisterInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unregisterInstance_args, Void> {
+      public unregisterInstance() {
+        super("unregisterInstance");
+      }
+
+      public unregisterInstance_args getEmptyArgsInstance() {
+        return new unregisterInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            unregisterInstance_result result = new unregisterInstance_result();
+            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;
+            unregisterInstance_result result = new unregisterInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, unregisterInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.unregisterInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+    public static class updateInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateInstance_args, Void> {
+      public updateInstance() {
+        super("updateInstance");
+      }
+
+      public updateInstance_args getEmptyArgsInstance() {
+        return new updateInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            updateInstance_result result = new updateInstance_result();
+            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;
+            updateInstance_result result = new updateInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, updateInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.updateInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+  }
+
+  public static class queryForInstance_args implements org.apache.thrift.TBase<queryForInstance_args, queryForInstance_args._Fields>, java.io.Serializable, Cloneable, Comparable<queryForInstance_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryForInstance_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField DISCOVERY_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("discoveryProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
+    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)4);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new queryForInstance_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new queryForInstance_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProjection discoveryProjection; // required
+    public String name; // required
+    public String id; // 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 {
+      PROJECTION((short)1, "projection"),
+      DISCOVERY_PROJECTION((short)2, "discoveryProjection"),
+      NAME((short)3, "name"),
+      ID((short)4, "id");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // DISCOVERY_PROJECTION
+            return DISCOVERY_PROJECTION;
+          case 3: // NAME
+            return NAME;
+          case 4: // ID
+            return ID;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new 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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.DISCOVERY_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("discoveryProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProjection.class)));
+      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryForInstance_args.class, metaDataMap);
+    }
+
+    public queryForInstance_args() {
+    }
+
+    public queryForInstance_args(
+      CuratorProjection projection,
+      DiscoveryProjection discoveryProjection,
+      String name,
+      String id)
+    {
+      this();
+      this.projection = projection;
+      this.discoveryProjection = discoveryProjection;
+      this.name = name;
+      this.id = id;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public queryForInstance_args(queryForInstance_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetDiscoveryProjection()) {
+        this.discoveryProjection = new DiscoveryProjection(other.discoveryProjection);
+      }
+      if (other.isSetName()) {
+        this.name = other.name;
+      }
+      if (other.isSetId()) {
+        this.id = other.id;
+      }
+    }
+
+    public queryForInstance_args deepCopy() {
+      return new queryForInstance_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.discoveryProjection = null;
+      this.name = null;
+      this.id = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public queryForInstance_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProjection getDiscoveryProjection() {
+      return this.discoveryProjection;
+    }
+
+    public queryForInstance_args setDiscoveryProjection(DiscoveryProjection discoveryProjection) {
+      this.discoveryProjection = discoveryProjection;
+      return this;
+    }
+
+    public void unsetDiscoveryProjection() {
+      this.discoveryProjection = null;
+    }
+
+    /** Returns true if field discoveryProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetDiscoveryProjection() {
+      return this.discoveryProjection != null;
+    }
+
+    public void setDiscoveryProjectionIsSet(boolean value) {
+      if (!value) {
+        this.discoveryProjection = null;
+      }
+    }
+
+    public String getName() {
+      return this.name;
+    }
+
+    public queryForInstance_args setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public void unsetName() {
+      this.name = null;
+    }
+
+    /** Returns true if field name is set (has been assigned a value) and false otherwise */
+    public boolean isSetName() {
+      return this.name != null;
+    }
+
+    public void setNameIsSet(boolean value) {
+      if (!value) {
+        this.name = null;
+      }
+    }
+
+    public String getId() {
+      return this.id;
+    }
+
+    public queryForInstance_args setId(String id) {
+      this.id = id;
+      return this;
+    }
+
+    public void unsetId() {
+      this.id = null;
+    }
+
+    /** Returns true if field id is set (has been assigned a value) and false otherwise */
+    public boolean isSetId() {
+      return this.id != null;
+    }
+
+    public void setIdIsSet(boolean value) {
+      if (!value) {
+        this.id = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case DISCOVERY_PROJECTION:
+        if (value == null) {
+          unsetDiscoveryProjection();
+        } else {
+          setDiscoveryProjection((DiscoveryProjection)value);
+        }
+        break;
+
+      case NAME:
+        if (value == null) {
+          unsetName();
+        } else {
+          setName((String)value);
+        }
+        break;
+
+      case ID:
+        if (value == null) {
+          unsetId();
+        } else {
+          setId((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case DISCOVERY_PROJECTION:
+        return getDiscoveryProjection();
+
+      case NAME:
+        return getName();
+
+      case ID:
+        return getId();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case DISCOVERY_PROJECTION:
+        return isSetDiscoveryProjection();
+      case NAME:
+        return isSetName();
+      case ID:
+        return isSetId();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof queryForInstance_args)
+        return this.equals((queryForInstance_args)that);
+      return false;
+    }
+
+    public boolean equals(queryForInstance_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_discoveryProjection = true && this.isSetDiscoveryProjection();
+      boolean that_present_discoveryProjection = true && that.isSetDiscoveryProjection();
+      if (this_present_discoveryProjection || that_present_discoveryProjection) {
+        if (!(this_present_discoveryProjection && that_present_discoveryProjection))
+          return false;
+        if (!this.discoveryProjection.equals(that.discoveryProjection))
+          return false;
+      }
+
+      boolean this_present_name = true && this.isSetName();
+      boolean that_present_name = true && that.isSetName();
+      if (this_present_name || that_present_name) {
+        if (!(this_present_name && that_present_name))
+          return false;
+        if (!this.name.equals(that.name))
+          return false;
+      }
+
+      boolean this_present_id = true && this.isSetId();
+      boolean that_present_id = true && that.isSetId();
+      if (this_present_id || that_present_id) {
+        if (!(this_present_id && that_present_id))
+          return false;
+        if (!this.id.equals(that.id))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(queryForInstance_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetDiscoveryProjection()).compareTo(other.isSetDiscoveryProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetDiscoveryProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discoveryProjection, other.discoveryProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetId()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+        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("queryForInstance_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("discoveryProjection:");
+      if (this.discoveryProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.discoveryProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("id:");
+      if (this.id == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.id);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (discoveryProjection != null) {
+        discoveryProjection.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 queryForInstance_argsStandardSchemeFactory implements SchemeFactory {
+      public queryForInstance_argsStandardScheme getScheme() {
+        return new queryForInstance_argsStandardScheme();
+      }
+    }
+
+    private static class queryForInstance_argsStandardScheme extends StandardScheme<queryForInstance_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, queryForInstance_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // DISCOVERY_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.discoveryProjection = new DiscoveryProjection();
+                struct.discoveryProjection.read(iprot);
+                struct.setDiscoveryProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.name = iprot.readString();
+                struct.setNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 4: // ID
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.id = iprot.readString();
+                struct.setIdIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, queryForInstance_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.discoveryProjection != null) {
+          oprot.writeFieldBegin(DISCOVERY_PROJECTION_FIELD_DESC);
+          struct.discoveryProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.name != null) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+        if (struct.id != null) {
+          oprot.writeFieldBegin(ID_FIELD_DESC);
+          oprot.writeString(struct.id);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class queryForInstance_argsTupleSchemeFactory implements SchemeFactory {
+      public queryForInstance_argsTupleScheme getScheme() {
+        return new queryForInstance_argsTupleScheme();
+      }
+    }
+
+    private static class queryForInstance_argsTupleScheme extends TupleScheme<queryForInstance_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, queryForInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          optionals.set(1);
+        }
+        if (struct.isSetName()) {
+          optionals.set(2);
+        }
+        if (struct.isSetId()) {
+          optionals.set(3);
+        }
+        oprot.writeBitSet(optionals, 4);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          struct.discoveryProjection.write(oprot);
+        }
+        if (struct.isSetName()) {
+          oprot.writeString(struct.name);
+        }
+        if (struct.isSetId()) {
+          oprot.writeString(struct.id);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, queryForInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(4);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.discoveryProjection = new DiscoveryProjection();
+          struct.discoveryProjection.read(iprot);
+          struct.setDiscoveryProjectionIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.name = iprot.readString();
+          struct.setNameIsSet(true);
+        }
+        if (incoming.get(3)) {
+          struct.id = iprot.readString();
+          struct.setIdIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class queryForInstance_result implements org.apache.thrift.TBase<queryForInstance_result, queryForInstance_result._Fields>, java.io.Serializable, Cloneable, Comparable<queryForInstance_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryForInstance_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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new queryForInstance_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new queryForInstance_resultTupleSchemeFactory());
+    }
+
+    public DiscoveryInstance success; // required
+    public CuratorException ex1; // 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"),
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          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, DiscoveryInstance.class)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(queryForInstance_result.class, metaDataMap);
+    }
+
+    public queryForInstance_result() {
+    }
+
+    public queryForInstance_result(
+      DiscoveryInstance success,
+      CuratorException ex1)
+    {
+      this();
+      this.success = success;
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public queryForInstance_result(queryForInstance_result other) {
+      if (other.isSetSuccess()) {
+        this.success = new DiscoveryInstance(other.success);
+      }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public queryForInstance_result deepCopy() {
+      return new queryForInstance_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.ex1 = null;
+    }
+
+    public DiscoveryInstance getSuccess() {
+      return this.success;
+    }
+
+    public queryForInstance_result setSuccess(DiscoveryInstance success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public queryForInstance_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((DiscoveryInstance)value);
+        }
+        break;
+
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case EX1:
+        return getEx1();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof queryForInstance_result)
+        return this.equals((queryForInstance_result)that);
+      return false;
+    }
+
+    public boolean equals(queryForInstance_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(queryForInstance_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("queryForInstance_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("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 queryForInstance_resultStandardSchemeFactory implements SchemeFactory {
+      public queryForInstance_resultStandardScheme getScheme() {
+        return new queryForInstance_resultStandardScheme();
+      }
+    }
+
+    private static class queryForInstance_resultStandardScheme extends StandardScheme<queryForInstance_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, queryForInstance_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 DiscoveryInstance();
+                struct.success.read(iprot);
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, queryForInstance_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.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class queryForInstance_resultTupleSchemeFactory implements SchemeFactory {
+      public queryForInstance_resultTupleScheme getScheme() {
+        return new queryForInstance_resultTupleScheme();
+      }
+    }
+
+    private static class queryForInstance_resultTupleScheme extends TupleScheme<queryForInstance_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, queryForInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          struct.success.write(oprot);
+        }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, queryForInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = new DiscoveryInstance();
+          struct.success.read(iprot);
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class queryForInstances_args implements org.apache.thrift.TBase<queryForInstances_args, queryForInstances_args._Fields>, java.io.Serializable, Cloneable, Comparable<queryForInstances_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryForInstances_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField DISCOVERY_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("discoveryProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new queryForInstances_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new queryForInstances_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProjection discoveryProjection; // required
+    public String name; // 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 {
+      PROJECTION((short)1, "projection"),
+      DISCOVERY_PROJECTION((short)2, "discoveryProjection"),
+      NAME((short)3, "name");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // DISCOVERY_PROJECTION
+            return DISCOVERY_PROJECTION;
+          case 3: // NAME
+            return NAME;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.DISCOVERY_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("discoveryProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProjection.class)));
+      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryForInstances_args.class, metaDataMap);
+    }
+
+    public queryForInstances_args() {
+    }
+
+    public queryForInstances_args(
+      CuratorProjection projection,
+      DiscoveryProjection discoveryProjection,
+      String name)
+    {
+      this();
+      this.projection = projection;
+      this.discoveryProjection = discoveryProjection;
+      this.name = name;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public queryForInstances_args(queryForInstances_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetDiscoveryProjection()) {
+        this.discoveryProjection = new DiscoveryProjection(other.discoveryProjection);
+      }
+      if (other.isSetName()) {
+        this.name = other.name;
+      }
+    }
+
+    public queryForInstances_args deepCopy() {
+      return new queryForInstances_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.discoveryProjection = null;
+      this.name = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public queryForInstances_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProjection getDiscoveryProjection() {
+      return this.discoveryProjection;
+    }
+
+    public queryForInstances_args setDiscoveryProjection(DiscoveryProjection discoveryProjection) {
+      this.discoveryProjection = discoveryProjection;
+      return this;
+    }
+
+    public void unsetDiscoveryProjection() {
+      this.discoveryProjection = null;
+    }
+
+    /** Returns true if field discoveryProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetDiscoveryProjection() {
+      return this.discoveryProjection != null;
+    }
+
+    public void setDiscoveryProjectionIsSet(boolean value) {
+      if (!value) {
+        this.discoveryProjection = null;
+      }
+    }
+
+    public String getName() {
+      return this.name;
+    }
+
+    public queryForInstances_args setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public void unsetName() {
+      this.name = null;
+    }
+
+    /** Returns true if field name is set (has been assigned a value) and false otherwise */
+    public boolean isSetName() {
+      return this.name != null;
+    }
+
+    public void setNameIsSet(boolean value) {
+      if (!value) {
+        this.name = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case DISCOVERY_PROJECTION:
+        if (value == null) {
+          unsetDiscoveryProjection();
+        } else {
+          setDiscoveryProjection((DiscoveryProjection)value);
+        }
+        break;
+
+      case NAME:
+        if (value == null) {
+          unsetName();
+        } else {
+          setName((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case DISCOVERY_PROJECTION:
+        return getDiscoveryProjection();
+
+      case NAME:
+        return getName();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case DISCOVERY_PROJECTION:
+        return isSetDiscoveryProjection();
+      case NAME:
+        return isSetName();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof queryForInstances_args)
+        return this.equals((queryForInstances_args)that);
+      return false;
+    }
+
+    public boolean equals(queryForInstances_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_discoveryProjection = true && this.isSetDiscoveryProjection();
+      boolean that_present_discoveryProjection = true && that.isSetDiscoveryProjection();
+      if (this_present_discoveryProjection || that_present_discoveryProjection) {
+        if (!(this_present_discoveryProjection && that_present_discoveryProjection))
+          return false;
+        if (!this.discoveryProjection.equals(that.discoveryProjection))
+          return false;
+      }
+
+      boolean this_present_name = true && this.isSetName();
+      boolean that_present_name = true && that.isSetName();
+      if (this_present_name || that_present_name) {
+        if (!(this_present_name && that_present_name))
+          return false;
+        if (!this.name.equals(that.name))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(queryForInstances_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetDiscoveryProjection()).compareTo(other.isSetDiscoveryProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetDiscoveryProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discoveryProjection, other.discoveryProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+        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("queryForInstances_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("discoveryProjection:");
+      if (this.discoveryProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.discoveryProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (discoveryProjection != null) {
+        discoveryProjection.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 queryForInstances_argsStandardSchemeFactory implements SchemeFactory {
+      public queryForInstances_argsStandardScheme getScheme() {
+        return new queryForInstances_argsStandardScheme();
+      }
+    }
+
+    private static class queryForInstances_argsStandardScheme extends StandardScheme<queryForInstances_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, queryForInstances_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // DISCOVERY_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.discoveryProjection = new DiscoveryProjection();
+                struct.discoveryProjection.read(iprot);
+                struct.setDiscoveryProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.name = iprot.readString();
+                struct.setNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, queryForInstances_args struct) t

<TRUNCATED>

[40/50] [abbrv] git commit: Return null if the connection manager is closed

Posted by ra...@apache.org.
Return null if the connection manager is closed


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/30019cda
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/30019cda
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/30019cda

Branch: refs/heads/master
Commit: 30019cda31afee4150bd014d849e5e7677d02909
Parents: bee07a5
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 11:20:28 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 11:20:28 2014 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/rpc/connections/ConnectionManager.java   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/30019cda/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
index afcd64e..d644231 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
@@ -118,8 +118,7 @@ public class ConnectionManager implements Closeable
 
     public CuratorEntry get(String id)
     {
-        Preconditions.checkState(state.get() == State.STARTED, "Not started");
-        return cache.getIfPresent(id);
+        return (state.get() == State.STARTED) ? cache.getIfPresent(id) : null;
     }
 
     public CuratorEntry remove(String id)


[18/50] [abbrv] started work on service discovery

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
new file mode 100644
index 0000000..a082b33
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryServiceLowLevel.java
@@ -0,0 +1,3339 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 DiscoveryServiceLowLevel {
+
+  public interface Iface {
+
+    public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException;
+
+    public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException;
+
+    public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<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 void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException
+    {
+      send_registerInstance(projection, discoveryProjection, instance);
+      recv_registerInstance();
+    }
+
+    public void send_registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws org.apache.thrift.TException
+    {
+      registerInstance_args args = new registerInstance_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setInstance(instance);
+      sendBase("registerInstance", args);
+    }
+
+    public void recv_registerInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      registerInstance_result result = new registerInstance_result();
+      receiveBase(result, "registerInstance");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      return;
+    }
+
+    public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException
+    {
+      send_unregisterInstance(projection, discoveryProjection, instance);
+      recv_unregisterInstance();
+    }
+
+    public void send_unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws org.apache.thrift.TException
+    {
+      unregisterInstance_args args = new unregisterInstance_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setInstance(instance);
+      sendBase("unregisterInstance", args);
+    }
+
+    public void recv_unregisterInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      unregisterInstance_result result = new unregisterInstance_result();
+      receiveBase(result, "unregisterInstance");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      return;
+    }
+
+    public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws CuratorException, org.apache.thrift.TException
+    {
+      send_updateInstance(projection, discoveryProjection, instance);
+      recv_updateInstance();
+    }
+
+    public void send_updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws org.apache.thrift.TException
+    {
+      updateInstance_args args = new updateInstance_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setInstance(instance);
+      sendBase("updateInstance", args);
+    }
+
+    public void recv_updateInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      updateInstance_result result = new updateInstance_result();
+      receiveBase(result, "updateInstance");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      return;
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient 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 registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      registerInstance_call method_call = new registerInstance_call(projection, discoveryProjection, instance, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class registerInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private DiscoveryInstance instance;
+      public registerInstance_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.instance = instance;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        registerInstance_args args = new registerInstance_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setInstance(instance);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws CuratorException, 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);
+        (new Client(prot)).recv_registerInstance();
+      }
+    }
+
+    public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      unregisterInstance_call method_call = new unregisterInstance_call(projection, discoveryProjection, instance, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class unregisterInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private DiscoveryInstance instance;
+      public unregisterInstance_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.instance = instance;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unregisterInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        unregisterInstance_args args = new unregisterInstance_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setInstance(instance);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws CuratorException, 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);
+        (new Client(prot)).recv_unregisterInstance();
+      }
+    }
+
+    public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      updateInstance_call method_call = new updateInstance_call(projection, discoveryProjection, instance, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class updateInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private DiscoveryInstance instance;
+      public updateInstance_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.instance = instance;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        updateInstance_args args = new updateInstance_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setInstance(instance);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws CuratorException, 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);
+        (new Client(prot)).recv_updateInstance();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<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("registerInstance", new registerInstance());
+      processMap.put("unregisterInstance", new unregisterInstance());
+      processMap.put("updateInstance", new updateInstance());
+      return processMap;
+    }
+
+    public static class registerInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerInstance_args> {
+      public registerInstance() {
+        super("registerInstance");
+      }
+
+      public registerInstance_args getEmptyArgsInstance() {
+        return new registerInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public registerInstance_result getResult(I iface, registerInstance_args args) throws org.apache.thrift.TException {
+        registerInstance_result result = new registerInstance_result();
+        try {
+          iface.registerInstance(args.projection, args.discoveryProjection, args.instance);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class unregisterInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unregisterInstance_args> {
+      public unregisterInstance() {
+        super("unregisterInstance");
+      }
+
+      public unregisterInstance_args getEmptyArgsInstance() {
+        return new unregisterInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public unregisterInstance_result getResult(I iface, unregisterInstance_args args) throws org.apache.thrift.TException {
+        unregisterInstance_result result = new unregisterInstance_result();
+        try {
+          iface.unregisterInstance(args.projection, args.discoveryProjection, args.instance);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class updateInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateInstance_args> {
+      public updateInstance() {
+        super("updateInstance");
+      }
+
+      public updateInstance_args getEmptyArgsInstance() {
+        return new updateInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public updateInstance_result getResult(I iface, updateInstance_args args) throws org.apache.thrift.TException {
+        updateInstance_result result = new updateInstance_result();
+        try {
+          iface.updateInstance(args.projection, args.discoveryProjection, args.instance);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<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("registerInstance", new registerInstance());
+      processMap.put("unregisterInstance", new unregisterInstance());
+      processMap.put("updateInstance", new updateInstance());
+      return processMap;
+    }
+
+    public static class registerInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerInstance_args, Void> {
+      public registerInstance() {
+        super("registerInstance");
+      }
+
+      public registerInstance_args getEmptyArgsInstance() {
+        return new registerInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            registerInstance_result result = new registerInstance_result();
+            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;
+            registerInstance_result result = new registerInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, registerInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.registerInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+    public static class unregisterInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unregisterInstance_args, Void> {
+      public unregisterInstance() {
+        super("unregisterInstance");
+      }
+
+      public unregisterInstance_args getEmptyArgsInstance() {
+        return new unregisterInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            unregisterInstance_result result = new unregisterInstance_result();
+            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;
+            unregisterInstance_result result = new unregisterInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, unregisterInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.unregisterInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+    public static class updateInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateInstance_args, Void> {
+      public updateInstance() {
+        super("updateInstance");
+      }
+
+      public updateInstance_args getEmptyArgsInstance() {
+        return new updateInstance_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            updateInstance_result result = new updateInstance_result();
+            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;
+            updateInstance_result result = new updateInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, updateInstance_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.updateInstance(args.projection, args.discoveryProjection, args.instance,resultHandler);
+      }
+    }
+
+  }
+
+  public static class registerInstance_args implements org.apache.thrift.TBase<registerInstance_args, registerInstance_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerInstance_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerInstance_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField DISCOVERY_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("discoveryProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField INSTANCE_FIELD_DESC = new org.apache.thrift.protocol.TField("instance", 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 registerInstance_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new registerInstance_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProjection discoveryProjection; // required
+    public DiscoveryInstance instance; // 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 {
+      PROJECTION((short)1, "projection"),
+      DISCOVERY_PROJECTION((short)2, "discoveryProjection"),
+      INSTANCE((short)3, "instance");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // DISCOVERY_PROJECTION
+            return DISCOVERY_PROJECTION;
+          case 3: // INSTANCE
+            return INSTANCE;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.DISCOVERY_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("discoveryProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProjection.class)));
+      tmpMap.put(_Fields.INSTANCE, new org.apache.thrift.meta_data.FieldMetaData("instance", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryInstance.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerInstance_args.class, metaDataMap);
+    }
+
+    public registerInstance_args() {
+    }
+
+    public registerInstance_args(
+      CuratorProjection projection,
+      DiscoveryProjection discoveryProjection,
+      DiscoveryInstance instance)
+    {
+      this();
+      this.projection = projection;
+      this.discoveryProjection = discoveryProjection;
+      this.instance = instance;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerInstance_args(registerInstance_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetDiscoveryProjection()) {
+        this.discoveryProjection = new DiscoveryProjection(other.discoveryProjection);
+      }
+      if (other.isSetInstance()) {
+        this.instance = new DiscoveryInstance(other.instance);
+      }
+    }
+
+    public registerInstance_args deepCopy() {
+      return new registerInstance_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.discoveryProjection = null;
+      this.instance = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public registerInstance_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProjection getDiscoveryProjection() {
+      return this.discoveryProjection;
+    }
+
+    public registerInstance_args setDiscoveryProjection(DiscoveryProjection discoveryProjection) {
+      this.discoveryProjection = discoveryProjection;
+      return this;
+    }
+
+    public void unsetDiscoveryProjection() {
+      this.discoveryProjection = null;
+    }
+
+    /** Returns true if field discoveryProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetDiscoveryProjection() {
+      return this.discoveryProjection != null;
+    }
+
+    public void setDiscoveryProjectionIsSet(boolean value) {
+      if (!value) {
+        this.discoveryProjection = null;
+      }
+    }
+
+    public DiscoveryInstance getInstance() {
+      return this.instance;
+    }
+
+    public registerInstance_args setInstance(DiscoveryInstance instance) {
+      this.instance = instance;
+      return this;
+    }
+
+    public void unsetInstance() {
+      this.instance = null;
+    }
+
+    /** Returns true if field instance is set (has been assigned a value) and false otherwise */
+    public boolean isSetInstance() {
+      return this.instance != null;
+    }
+
+    public void setInstanceIsSet(boolean value) {
+      if (!value) {
+        this.instance = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case DISCOVERY_PROJECTION:
+        if (value == null) {
+          unsetDiscoveryProjection();
+        } else {
+          setDiscoveryProjection((DiscoveryProjection)value);
+        }
+        break;
+
+      case INSTANCE:
+        if (value == null) {
+          unsetInstance();
+        } else {
+          setInstance((DiscoveryInstance)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case DISCOVERY_PROJECTION:
+        return getDiscoveryProjection();
+
+      case INSTANCE:
+        return getInstance();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case DISCOVERY_PROJECTION:
+        return isSetDiscoveryProjection();
+      case INSTANCE:
+        return isSetInstance();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof registerInstance_args)
+        return this.equals((registerInstance_args)that);
+      return false;
+    }
+
+    public boolean equals(registerInstance_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_discoveryProjection = true && this.isSetDiscoveryProjection();
+      boolean that_present_discoveryProjection = true && that.isSetDiscoveryProjection();
+      if (this_present_discoveryProjection || that_present_discoveryProjection) {
+        if (!(this_present_discoveryProjection && that_present_discoveryProjection))
+          return false;
+        if (!this.discoveryProjection.equals(that.discoveryProjection))
+          return false;
+      }
+
+      boolean this_present_instance = true && this.isSetInstance();
+      boolean that_present_instance = true && that.isSetInstance();
+      if (this_present_instance || that_present_instance) {
+        if (!(this_present_instance && that_present_instance))
+          return false;
+        if (!this.instance.equals(that.instance))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(registerInstance_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetDiscoveryProjection()).compareTo(other.isSetDiscoveryProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetDiscoveryProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discoveryProjection, other.discoveryProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetInstance()).compareTo(other.isSetInstance());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetInstance()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instance, other.instance);
+        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("registerInstance_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("discoveryProjection:");
+      if (this.discoveryProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.discoveryProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("instance:");
+      if (this.instance == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.instance);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (discoveryProjection != null) {
+        discoveryProjection.validate();
+      }
+      if (instance != null) {
+        instance.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 registerInstance_argsStandardSchemeFactory implements SchemeFactory {
+      public registerInstance_argsStandardScheme getScheme() {
+        return new registerInstance_argsStandardScheme();
+      }
+    }
+
+    private static class registerInstance_argsStandardScheme extends StandardScheme<registerInstance_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerInstance_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // DISCOVERY_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.discoveryProjection = new DiscoveryProjection();
+                struct.discoveryProjection.read(iprot);
+                struct.setDiscoveryProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // INSTANCE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.instance = new DiscoveryInstance();
+                struct.instance.read(iprot);
+                struct.setInstanceIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, registerInstance_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.discoveryProjection != null) {
+          oprot.writeFieldBegin(DISCOVERY_PROJECTION_FIELD_DESC);
+          struct.discoveryProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.instance != null) {
+          oprot.writeFieldBegin(INSTANCE_FIELD_DESC);
+          struct.instance.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class registerInstance_argsTupleSchemeFactory implements SchemeFactory {
+      public registerInstance_argsTupleScheme getScheme() {
+        return new registerInstance_argsTupleScheme();
+      }
+    }
+
+    private static class registerInstance_argsTupleScheme extends TupleScheme<registerInstance_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          optionals.set(1);
+        }
+        if (struct.isSetInstance()) {
+          optionals.set(2);
+        }
+        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          struct.discoveryProjection.write(oprot);
+        }
+        if (struct.isSetInstance()) {
+          struct.instance.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, registerInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(3);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.discoveryProjection = new DiscoveryProjection();
+          struct.discoveryProjection.read(iprot);
+          struct.setDiscoveryProjectionIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.instance = new DiscoveryInstance();
+          struct.instance.read(iprot);
+          struct.setInstanceIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class registerInstance_result implements org.apache.thrift.TBase<registerInstance_result, registerInstance_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerInstance_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerInstance_result");
+
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new registerInstance_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new registerInstance_resultTupleSchemeFactory());
+    }
+
+    public CuratorException ex1; // 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 {
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          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.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(registerInstance_result.class, metaDataMap);
+    }
+
+    public registerInstance_result() {
+    }
+
+    public registerInstance_result(
+      CuratorException ex1)
+    {
+      this();
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public registerInstance_result(registerInstance_result other) {
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public registerInstance_result deepCopy() {
+      return new registerInstance_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.ex1 = null;
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public registerInstance_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case EX1:
+        return getEx1();
+
+      }
+      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 EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof registerInstance_result)
+        return this.equals((registerInstance_result)that);
+      return false;
+    }
+
+    public boolean equals(registerInstance_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(registerInstance_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("registerInstance_result(");
+      boolean first = true;
+
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 registerInstance_resultStandardSchemeFactory implements SchemeFactory {
+      public registerInstance_resultStandardScheme getScheme() {
+        return new registerInstance_resultStandardScheme();
+      }
+    }
+
+    private static class registerInstance_resultStandardScheme extends StandardScheme<registerInstance_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, registerInstance_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, registerInstance_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class registerInstance_resultTupleSchemeFactory implements SchemeFactory {
+      public registerInstance_resultTupleScheme getScheme() {
+        return new registerInstance_resultTupleScheme();
+      }
+    }
+
+    private static class registerInstance_resultTupleScheme extends TupleScheme<registerInstance_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, registerInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetEx1()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, registerInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class unregisterInstance_args implements org.apache.thrift.TBase<unregisterInstance_args, unregisterInstance_args._Fields>, java.io.Serializable, Cloneable, Comparable<unregisterInstance_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unregisterInstance_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField DISCOVERY_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("discoveryProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField INSTANCE_FIELD_DESC = new org.apache.thrift.protocol.TField("instance", 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 unregisterInstance_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new unregisterInstance_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProjection discoveryProjection; // required
+    public DiscoveryInstance instance; // 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 {
+      PROJECTION((short)1, "projection"),
+      DISCOVERY_PROJECTION((short)2, "discoveryProjection"),
+      INSTANCE((short)3, "instance");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // DISCOVERY_PROJECTION
+            return DISCOVERY_PROJECTION;
+          case 3: // INSTANCE
+            return INSTANCE;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.DISCOVERY_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("discoveryProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProjection.class)));
+      tmpMap.put(_Fields.INSTANCE, new org.apache.thrift.meta_data.FieldMetaData("instance", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryInstance.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unregisterInstance_args.class, metaDataMap);
+    }
+
+    public unregisterInstance_args() {
+    }
+
+    public unregisterInstance_args(
+      CuratorProjection projection,
+      DiscoveryProjection discoveryProjection,
+      DiscoveryInstance instance)
+    {
+      this();
+      this.projection = projection;
+      this.discoveryProjection = discoveryProjection;
+      this.instance = instance;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public unregisterInstance_args(unregisterInstance_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetDiscoveryProjection()) {
+        this.discoveryProjection = new DiscoveryProjection(other.discoveryProjection);
+      }
+      if (other.isSetInstance()) {
+        this.instance = new DiscoveryInstance(other.instance);
+      }
+    }
+
+    public unregisterInstance_args deepCopy() {
+      return new unregisterInstance_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.discoveryProjection = null;
+      this.instance = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public unregisterInstance_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProjection getDiscoveryProjection() {
+      return this.discoveryProjection;
+    }
+
+    public unregisterInstance_args setDiscoveryProjection(DiscoveryProjection discoveryProjection) {
+      this.discoveryProjection = discoveryProjection;
+      return this;
+    }
+
+    public void unsetDiscoveryProjection() {
+      this.discoveryProjection = null;
+    }
+
+    /** Returns true if field discoveryProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetDiscoveryProjection() {
+      return this.discoveryProjection != null;
+    }
+
+    public void setDiscoveryProjectionIsSet(boolean value) {
+      if (!value) {
+        this.discoveryProjection = null;
+      }
+    }
+
+    public DiscoveryInstance getInstance() {
+      return this.instance;
+    }
+
+    public unregisterInstance_args setInstance(DiscoveryInstance instance) {
+      this.instance = instance;
+      return this;
+    }
+
+    public void unsetInstance() {
+      this.instance = null;
+    }
+
+    /** Returns true if field instance is set (has been assigned a value) and false otherwise */
+    public boolean isSetInstance() {
+      return this.instance != null;
+    }
+
+    public void setInstanceIsSet(boolean value) {
+      if (!value) {
+        this.instance = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case DISCOVERY_PROJECTION:
+        if (value == null) {
+          unsetDiscoveryProjection();
+        } else {
+          setDiscoveryProjection((DiscoveryProjection)value);
+        }
+        break;
+
+      case INSTANCE:
+        if (value == null) {
+          unsetInstance();
+        } else {
+          setInstance((DiscoveryInstance)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case DISCOVERY_PROJECTION:
+        return getDiscoveryProjection();
+
+      case INSTANCE:
+        return getInstance();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case DISCOVERY_PROJECTION:
+        return isSetDiscoveryProjection();
+      case INSTANCE:
+        return isSetInstance();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof unregisterInstance_args)
+        return this.equals((unregisterInstance_args)that);
+      return false;
+    }
+
+    public boolean equals(unregisterInstance_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_discoveryProjection = true && this.isSetDiscoveryProjection();
+      boolean that_present_discoveryProjection = true && that.isSetDiscoveryProjection();
+      if (this_present_discoveryProjection || that_present_discoveryProjection) {
+        if (!(this_present_discoveryProjection && that_present_discoveryProjection))
+          return false;
+        if (!this.discoveryProjection.equals(that.discoveryProjection))
+          return false;
+      }
+
+      boolean this_present_instance = true && this.isSetInstance();
+      boolean that_present_instance = true && that.isSetInstance();
+      if (this_present_instance || that_present_instance) {
+        if (!(this_present_instance && that_present_instance))
+          return false;
+        if (!this.instance.equals(that.instance))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(unregisterInstance_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetDiscoveryProjection()).compareTo(other.isSetDiscoveryProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetDiscoveryProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discoveryProjection, other.discoveryProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetInstance()).compareTo(other.isSetInstance());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetInstance()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instance, other.instance);
+        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("unregisterInstance_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("discoveryProjection:");
+      if (this.discoveryProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.discoveryProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("instance:");
+      if (this.instance == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.instance);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (discoveryProjection != null) {
+        discoveryProjection.validate();
+      }
+      if (instance != null) {
+        instance.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 unregisterInstance_argsStandardSchemeFactory implements SchemeFactory {
+      public unregisterInstance_argsStandardScheme getScheme() {
+        return new unregisterInstance_argsStandardScheme();
+      }
+    }
+
+    private static class unregisterInstance_argsStandardScheme extends StandardScheme<unregisterInstance_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, unregisterInstance_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // DISCOVERY_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.discoveryProjection = new DiscoveryProjection();
+                struct.discoveryProjection.read(iprot);
+                struct.setDiscoveryProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // INSTANCE
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.instance = new DiscoveryInstance();
+                struct.instance.read(iprot);
+                struct.setInstanceIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, unregisterInstance_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.discoveryProjection != null) {
+          oprot.writeFieldBegin(DISCOVERY_PROJECTION_FIELD_DESC);
+          struct.discoveryProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.instance != null) {
+          oprot.writeFieldBegin(INSTANCE_FIELD_DESC);
+          struct.instance.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class unregisterInstance_argsTupleSchemeFactory implements SchemeFactory {
+      public unregisterInstance_argsTupleScheme getScheme() {
+        return new unregisterInstance_argsTupleScheme();
+      }
+    }
+
+    private static class unregisterInstance_argsTupleScheme extends TupleScheme<unregisterInstance_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, unregisterInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          optionals.set(1);
+        }
+        if (struct.isSetInstance()) {
+          optionals.set(2);
+        }
+        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetDiscoveryProjection()) {
+          struct.discoveryProjection.write(oprot);
+        }
+        if (struct.isSetInstance()) {
+          struct.instance.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, unregisterInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(3);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.discoveryProjection = new DiscoveryProjection();
+          struct.discoveryProjection.read(iprot);
+          struct.setDiscoveryProjectionIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.instance = new DiscoveryInstance();
+          struct.instance.read(iprot);
+          struct.setInstanceIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class unregisterInstance_result implements org.apache.thrift.TBase<unregisterInstance_result, unregisterInstance_result._Fields>, java.io.Serializable, Cloneable, Comparable<unregisterInstance_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unregisterInstance_result");
+
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new unregisterInstance_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new unregisterInstance_resultTupleSchemeFactory());
+    }
+
+    public CuratorException ex1; // 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 {
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          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.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(unregisterInstance_result.class, metaDataMap);
+    }
+
+    public unregisterInstance_result() {
+    }
+
+    public unregisterInstance_result(
+      CuratorException ex1)
+    {
+      this();
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public unregisterInstance_result(unregisterInstance_result other) {
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public unregisterInstance_result deepCopy() {
+      return new unregisterInstance_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.ex1 = null;
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public unregisterInstance_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case EX1:
+        return getEx1();
+
+      }
+      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 EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof unregisterInstance_result)
+        return this.equals((unregisterInstance_result)that);
+      return false;
+    }
+
+    public boolean equals(unregisterInstance_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(unregisterInstance_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("unregisterInstance_result(");
+      boolean first = true;
+
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 unregisterInstance_resultStandardSchemeFactory implements SchemeFactory {
+      public unregisterInstance_resultStandardScheme getScheme() {
+        return new unregisterInstance_resultStandardScheme();
+      }
+    }
+
+    private static class unregisterInstance_resultStandardScheme extends StandardScheme<unregisterInstance_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, unregisterInstance_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.

<TRUNCATED>

[14/50] [abbrv] initial stab at exception support

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/EventService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/EventService.java
index 3f9f332..9854e0e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/EventService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/EventService.java
@@ -36,7 +36,7 @@ public class EventService {
 
   public interface Iface {
 
-    public CuratorEvent getNextEvent(CuratorProjection projection) throws org.apache.thrift.TException;
+    public CuratorEvent getNextEvent(CuratorProjection projection) throws CuratorException, org.apache.thrift.TException;
 
   }
 
@@ -66,7 +66,7 @@ public class EventService {
       super(iprot, oprot);
     }
 
-    public CuratorEvent getNextEvent(CuratorProjection projection) throws org.apache.thrift.TException
+    public CuratorEvent getNextEvent(CuratorProjection projection) throws CuratorException, org.apache.thrift.TException
     {
       send_getNextEvent(projection);
       return recv_getNextEvent();
@@ -79,13 +79,16 @@ public class EventService {
       sendBase("getNextEvent", args);
     }
 
-    public CuratorEvent recv_getNextEvent() throws org.apache.thrift.TException
+    public CuratorEvent recv_getNextEvent() throws CuratorException, org.apache.thrift.TException
     {
       getNextEvent_result result = new getNextEvent_result();
       receiveBase(result, "getNextEvent");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNextEvent failed: unknown result");
     }
 
@@ -129,7 +132,7 @@ public class EventService {
         prot.writeMessageEnd();
       }
 
-      public CuratorEvent getResult() throws org.apache.thrift.TException {
+      public CuratorEvent getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -171,7 +174,11 @@ public class EventService {
 
       public getNextEvent_result getResult(I iface, getNextEvent_args args) throws org.apache.thrift.TException {
         getNextEvent_result result = new getNextEvent_result();
-        result.success = iface.getNextEvent(args.projection);
+        try {
+          result.success = iface.getNextEvent(args.projection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -220,6 +227,12 @@ public class EventService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getNextEvent_result result = new getNextEvent_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -609,6 +622,7 @@ public class EventService {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNextEvent_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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -617,10 +631,12 @@ public class EventService {
     }
 
     public CuratorEvent success; // required
+    public CuratorException ex1; // 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");
+      SUCCESS((short)0, "success"),
+      EX1((short)1, "ex1");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -637,6 +653,8 @@ public class EventService {
         switch(fieldId) {
           case 0: // SUCCESS
             return SUCCESS;
+          case 1: // EX1
+            return EX1;
           default:
             return null;
         }
@@ -682,6 +700,8 @@ public class EventService {
       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, CuratorEvent.class)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(getNextEvent_result.class, metaDataMap);
     }
@@ -690,10 +710,12 @@ public class EventService {
     }
 
     public getNextEvent_result(
-      CuratorEvent success)
+      CuratorEvent success,
+      CuratorException ex1)
     {
       this();
       this.success = success;
+      this.ex1 = ex1;
     }
 
     /**
@@ -703,6 +725,9 @@ public class EventService {
       if (other.isSetSuccess()) {
         this.success = new CuratorEvent(other.success);
       }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
     }
 
     public getNextEvent_result deepCopy() {
@@ -712,6 +737,7 @@ public class EventService {
     @Override
     public void clear() {
       this.success = null;
+      this.ex1 = null;
     }
 
     public CuratorEvent getSuccess() {
@@ -738,6 +764,30 @@ public class EventService {
       }
     }
 
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public getNextEvent_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case SUCCESS:
@@ -748,6 +798,14 @@ public class EventService {
         }
         break;
 
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
       }
     }
 
@@ -756,6 +814,9 @@ public class EventService {
       case SUCCESS:
         return getSuccess();
 
+      case EX1:
+        return getEx1();
+
       }
       throw new IllegalStateException();
     }
@@ -769,6 +830,8 @@ public class EventService {
       switch (field) {
       case SUCCESS:
         return isSetSuccess();
+      case EX1:
+        return isSetEx1();
       }
       throw new IllegalStateException();
     }
@@ -795,6 +858,15 @@ public class EventService {
           return false;
       }
 
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
       return true;
     }
 
@@ -821,6 +893,16 @@ public class EventService {
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -848,6 +930,14 @@ public class EventService {
         sb.append(this.success);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -903,6 +993,15 @@ public class EventService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -923,6 +1022,11 @@ public class EventService {
           struct.success.write(oprot);
           oprot.writeFieldEnd();
         }
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -944,21 +1048,32 @@ public class EventService {
         if (struct.isSetSuccess()) {
           optionals.set(0);
         }
-        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
         if (struct.isSetSuccess()) {
           struct.success.write(oprot);
         }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, getNextEvent_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
+        BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
           struct.success = new CuratorEvent();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/ExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/ExceptionType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/ExceptionType.java
new file mode 100644
index 0000000..b727f3a
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/ExceptionType.java
@@ -0,0 +1,48 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum ExceptionType implements org.apache.thrift.TEnum {
+  GENERAL(0),
+  ZOOKEEPER(1),
+  NODE(2);
+
+  private final int value;
+
+  private ExceptionType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static ExceptionType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return GENERAL;
+      case 1:
+        return ZOOKEEPER;
+      case 2:
+        return NODE;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java
new file mode 100644
index 0000000..fb2a989
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeExceptionType.java
@@ -0,0 +1,51 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum NodeExceptionType implements org.apache.thrift.TEnum {
+  NONODE(0),
+  BADVERSION(1),
+  NODEEXISTS(2),
+  NOTEMPTY(3);
+
+  private final int value;
+
+  private NodeExceptionType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static NodeExceptionType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return NONODE;
+      case 1:
+        return BADVERSION;
+      case 2:
+        return NODEEXISTS;
+      case 3:
+        return NOTEMPTY;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/ZooKeeperExceptionType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/ZooKeeperExceptionType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/ZooKeeperExceptionType.java
new file mode 100644
index 0000000..2514d30
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/ZooKeeperExceptionType.java
@@ -0,0 +1,90 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum ZooKeeperExceptionType implements org.apache.thrift.TEnum {
+  SYSTEMERROR(0),
+  RUNTIMEINCONSISTENCY(1),
+  DATAINCONSISTENCY(2),
+  CONNECTIONLOSS(3),
+  MARSHALLINGERROR(4),
+  UNIMPLEMENTED(5),
+  OPERATIONTIMEOUT(6),
+  BADARGUMENTS(7),
+  APIERROR(8),
+  NOAUTH(9),
+  NOCHILDRENFOREPHEMERALS(10),
+  INVALIDACL(11),
+  AUTHFAILED(12),
+  SESSIONEXPIRED(13),
+  INVALIDCALLBACK(14),
+  SESSIONMOVED(15),
+  NOTREADONLY(16);
+
+  private final int value;
+
+  private ZooKeeperExceptionType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static ZooKeeperExceptionType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return SYSTEMERROR;
+      case 1:
+        return RUNTIMEINCONSISTENCY;
+      case 2:
+        return DATAINCONSISTENCY;
+      case 3:
+        return CONNECTIONLOSS;
+      case 4:
+        return MARSHALLINGERROR;
+      case 5:
+        return UNIMPLEMENTED;
+      case 6:
+        return OPERATIONTIMEOUT;
+      case 7:
+        return BADARGUMENTS;
+      case 8:
+        return APIERROR;
+      case 9:
+        return NOAUTH;
+      case 10:
+        return NOCHILDRENFOREPHEMERALS;
+      case 11:
+        return INVALIDACL;
+      case 12:
+        return AUTHFAILED;
+      case 13:
+        return SESSIONEXPIRED;
+      case 14:
+        return INVALIDCALLBACK;
+      case 15:
+        return SESSIONMOVED;
+      case 16:
+        return NOTREADONLY;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 5e1451e..dbd5643 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -68,6 +68,18 @@ public class TestClient
         );
 
         CreateSpec createSpec = new CreateSpec();
+        createSpec.path = "/this/should/fail";
+        createSpec.data = ByteBuffer.wrap("hey".getBytes());
+        try
+        {
+            client.createNode(curatorProjection, createSpec);
+        }
+        catch ( CuratorException e )
+        {
+            System.out.println("Ex: " + e);
+        }
+
+        createSpec = new CreateSpec();
         createSpec.path = "/a/b/c";
         createSpec.creatingParentsIfNeeded = true;
         createSpec.data = ByteBuffer.wrap("hey".getBytes());


[07/50] [abbrv] git commit: support PersistentEphemeralNode

Posted by ra...@apache.org.
support PersistentEphemeralNode


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/cbd174a6
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/cbd174a6
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/cbd174a6

Branch: refs/heads/master
Commit: cbd174a693f018f8ef6a79d22b0fe5efb530f50a
Parents: 6e9fa2a
Author: randgalt <ra...@apache.org>
Authored: Thu May 29 21:11:42 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu May 29 21:11:42 2014 -0500

----------------------------------------------------------------------
 .../event/RpcPersistentEphemeralNodeMode.java   |   12 +
 .../projection/CuratorProjectionService.java    |   28 +
 .../PersistentEphemeralNodeProjection.java      |   20 +
 curator-x-rpc/src/main/thrift/curator.thrift    |    9 +
 .../curator/generated/CuratorService.java       | 1189 ++++++++++++++++++
 .../generated/PersistentEphemeralNodeMode.java  |   51 +
 .../PersistentEphemeralNodeProjection.java      |  388 ++++++
 .../org/apache/curator/x/rpc/TestClient.java    |    6 +
 8 files changed, 1703 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
new file mode 100644
index 0000000..bda8b4d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
@@ -0,0 +1,12 @@
+package org.apache.curator.x.rpc.idl.event;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("PersistentEphemeralNodeMode")
+public enum RpcPersistentEphemeralNodeMode
+{
+    EPHEMERAL,
+    EPHEMERAL_SEQUENTIAL,
+    PROTECTED_EPHEMERAL,
+    PROTECTED_EPHEMERAL_SEQUENTIAL
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index c82ad5c..cb7a3cc 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -36,6 +36,7 @@ import org.apache.curator.framework.recipes.leader.LeaderLatch;
 import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
 import org.apache.curator.framework.recipes.leader.Participant;
 import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
+import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
 import org.apache.curator.framework.state.ConnectionState;
 import org.apache.curator.framework.state.ConnectionStateListener;
 import org.apache.curator.utils.ThreadUtils;
@@ -476,6 +477,33 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
+    {
+        final CuratorEntry entry = getEntry(projection);
+
+        PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
+        node.start();
+
+        Closer<PersistentEphemeralNode> closer = new Closer<PersistentEphemeralNode>()
+        {
+            @Override
+            public void close(PersistentEphemeralNode node)
+            {
+                try
+                {
+                    node.close();
+                }
+                catch ( Exception e )
+                {
+                    log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(node, closer);
+        return new PersistentEphemeralNodeProjection(id);
+    }
+
+    @ThriftMethod
     public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
     {
         final CuratorEntry entry = getEntry(projection);

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
new file mode 100644
index 0000000..a58d3c3
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.projection;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class PersistentEphemeralNodeProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public PersistentEphemeralNodeProjection()
+    {
+    }
+
+    public PersistentEphemeralNodeProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index bd4753a..601d775 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -27,6 +27,10 @@ enum PathChildrenCacheEventType {
   CHILD_ADDED, CHILD_UPDATED, CHILD_REMOVED, CONNECTION_SUSPENDED, CONNECTION_RECONNECTED, CONNECTION_LOST, INITIALIZED
 }
 
+enum PersistentEphemeralNodeMode {
+  EPHEMERAL, EPHEMERAL_SEQUENTIAL, PROTECTED_EPHEMERAL, PROTECTED_EPHEMERAL_SEQUENTIAL
+}
+
 struct CuratorProjection {
   1: string id;
 }
@@ -70,6 +74,10 @@ struct PathChildrenCacheProjection {
   1: string id;
 }
 
+struct PersistentEphemeralNodeProjection {
+  1: string id;
+}
+
 struct Version {
   1: i32 version;
 }
@@ -205,6 +213,7 @@ service CuratorService {
   LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs);
   NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial);
   PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode);
+  PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode);
 }
 
 service EventService {

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index 100b6c7..4c49c67 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -72,6 +72,8 @@ public class CuratorService {
 
     public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException;
 
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException;
+
   }
 
   public interface AsyncIface {
@@ -112,6 +114,8 @@ public class CuratorService {
 
     public void startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
   }
 
   public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -567,6 +571,32 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPathChildrenCache failed: unknown result");
     }
 
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException
+    {
+      send_startPersistentEphemeralNode(projection, path, data, mode);
+      return recv_startPersistentEphemeralNode();
+    }
+
+    public void send_startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException
+    {
+      startPersistentEphemeralNode_args args = new startPersistentEphemeralNode_args();
+      args.setProjection(projection);
+      args.setPath(path);
+      args.setData(data);
+      args.setMode(mode);
+      sendBase("startPersistentEphemeralNode", args);
+    }
+
+    public PersistentEphemeralNodeProjection recv_startPersistentEphemeralNode() throws org.apache.thrift.TException
+    {
+      startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
+      receiveBase(result, "startPersistentEphemeralNode");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPersistentEphemeralNode failed: unknown result");
+    }
+
   }
   public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
     public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -1236,6 +1266,47 @@ public class CuratorService {
       }
     }
 
+    public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      startPersistentEphemeralNode_call method_call = new startPersistentEphemeralNode_call(projection, path, data, mode, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class startPersistentEphemeralNode_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String path;
+      private ByteBuffer data;
+      private PersistentEphemeralNodeMode mode;
+      public startPersistentEphemeralNode_call(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, 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.projection = projection;
+        this.path = path;
+        this.data = data;
+        this.mode = mode;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startPersistentEphemeralNode", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        startPersistentEphemeralNode_args args = new startPersistentEphemeralNode_args();
+        args.setProjection(projection);
+        args.setPath(path);
+        args.setData(data);
+        args.setMode(mode);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public PersistentEphemeralNodeProjection getResult() throws 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_startPersistentEphemeralNode();
+      }
+    }
+
   }
 
   public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -1267,6 +1338,7 @@ public class CuratorService {
       processMap.put("startLeaderSelector", new startLeaderSelector());
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
+      processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
       return processMap;
     }
 
@@ -1632,6 +1704,26 @@ public class CuratorService {
       }
     }
 
+    public static class startPersistentEphemeralNode<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startPersistentEphemeralNode_args> {
+      public startPersistentEphemeralNode() {
+        super("startPersistentEphemeralNode");
+      }
+
+      public startPersistentEphemeralNode_args getEmptyArgsInstance() {
+        return new startPersistentEphemeralNode_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public startPersistentEphemeralNode_result getResult(I iface, startPersistentEphemeralNode_args args) throws org.apache.thrift.TException {
+        startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
+        result.success = iface.startPersistentEphemeralNode(args.projection, args.path, args.data, args.mode);
+        return result;
+      }
+    }
+
   }
 
   public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -1663,6 +1755,7 @@ public class CuratorService {
       processMap.put("startLeaderSelector", new startLeaderSelector());
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
+      processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
       return processMap;
     }
 
@@ -2584,6 +2677,57 @@ public class CuratorService {
       }
     }
 
+    public static class startPersistentEphemeralNode<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startPersistentEphemeralNode_args, PersistentEphemeralNodeProjection> {
+      public startPersistentEphemeralNode() {
+        super("startPersistentEphemeralNode");
+      }
+
+      public startPersistentEphemeralNode_args getEmptyArgsInstance() {
+        return new startPersistentEphemeralNode_args();
+      }
+
+      public AsyncMethodCallback<PersistentEphemeralNodeProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<PersistentEphemeralNodeProjection>() { 
+          public void onComplete(PersistentEphemeralNodeProjection o) {
+            startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_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;
+            startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
+            {
+              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, startPersistentEphemeralNode_args args, org.apache.thrift.async.AsyncMethodCallback<PersistentEphemeralNodeProjection> resultHandler) throws TException {
+        iface.startPersistentEphemeralNode(args.projection, args.path, args.data, args.mode,resultHandler);
+      }
+    }
+
   }
 
   public static class acquireLock_args implements org.apache.thrift.TBase<acquireLock_args, acquireLock_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireLock_args>   {
@@ -17924,4 +18068,1049 @@ public class CuratorService {
 
   }
 
+  public static class startPersistentEphemeralNode_args implements org.apache.thrift.TBase<startPersistentEphemeralNode_args, startPersistentEphemeralNode_args._Fields>, java.io.Serializable, Cloneable, Comparable<startPersistentEphemeralNode_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPersistentEphemeralNode_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)3);
+    private static final org.apache.thrift.protocol.TField MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("mode", org.apache.thrift.protocol.TType.I32, (short)4);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new startPersistentEphemeralNode_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new startPersistentEphemeralNode_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public String path; // required
+    public ByteBuffer data; // required
+    /**
+     * 
+     * @see PersistentEphemeralNodeMode
+     */
+    public PersistentEphemeralNodeMode mode; // 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 {
+      PROJECTION((short)1, "projection"),
+      PATH((short)2, "path"),
+      DATA((short)3, "data"),
+      /**
+       * 
+       * @see PersistentEphemeralNodeMode
+       */
+      MODE((short)4, "mode");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // PATH
+            return PATH;
+          case 3: // DATA
+            return DATA;
+          case 4: // MODE
+            return MODE;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
+      tmpMap.put(_Fields.MODE, new org.apache.thrift.meta_data.FieldMetaData("mode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PersistentEphemeralNodeMode.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPersistentEphemeralNode_args.class, metaDataMap);
+    }
+
+    public startPersistentEphemeralNode_args() {
+    }
+
+    public startPersistentEphemeralNode_args(
+      CuratorProjection projection,
+      String path,
+      ByteBuffer data,
+      PersistentEphemeralNodeMode mode)
+    {
+      this();
+      this.projection = projection;
+      this.path = path;
+      this.data = data;
+      this.mode = mode;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public startPersistentEphemeralNode_args(startPersistentEphemeralNode_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetPath()) {
+        this.path = other.path;
+      }
+      if (other.isSetData()) {
+        this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
+;
+      }
+      if (other.isSetMode()) {
+        this.mode = other.mode;
+      }
+    }
+
+    public startPersistentEphemeralNode_args deepCopy() {
+      return new startPersistentEphemeralNode_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.path = null;
+      this.data = null;
+      this.mode = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public startPersistentEphemeralNode_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public String getPath() {
+      return this.path;
+    }
+
+    public startPersistentEphemeralNode_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
+
+    public void unsetPath() {
+      this.path = null;
+    }
+
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
+
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
+      }
+    }
+
+    public byte[] getData() {
+      setData(org.apache.thrift.TBaseHelper.rightSize(data));
+      return data == null ? null : data.array();
+    }
+
+    public ByteBuffer bufferForData() {
+      return data;
+    }
+
+    public startPersistentEphemeralNode_args setData(byte[] data) {
+      setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
+      return this;
+    }
+
+    public startPersistentEphemeralNode_args setData(ByteBuffer data) {
+      this.data = data;
+      return this;
+    }
+
+    public void unsetData() {
+      this.data = null;
+    }
+
+    /** Returns true if field data is set (has been assigned a value) and false otherwise */
+    public boolean isSetData() {
+      return this.data != null;
+    }
+
+    public void setDataIsSet(boolean value) {
+      if (!value) {
+        this.data = null;
+      }
+    }
+
+    /**
+     * 
+     * @see PersistentEphemeralNodeMode
+     */
+    public PersistentEphemeralNodeMode getMode() {
+      return this.mode;
+    }
+
+    /**
+     * 
+     * @see PersistentEphemeralNodeMode
+     */
+    public startPersistentEphemeralNode_args setMode(PersistentEphemeralNodeMode mode) {
+      this.mode = mode;
+      return this;
+    }
+
+    public void unsetMode() {
+      this.mode = null;
+    }
+
+    /** Returns true if field mode is set (has been assigned a value) and false otherwise */
+    public boolean isSetMode() {
+      return this.mode != null;
+    }
+
+    public void setModeIsSet(boolean value) {
+      if (!value) {
+        this.mode = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
+
+      case DATA:
+        if (value == null) {
+          unsetData();
+        } else {
+          setData((ByteBuffer)value);
+        }
+        break;
+
+      case MODE:
+        if (value == null) {
+          unsetMode();
+        } else {
+          setMode((PersistentEphemeralNodeMode)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PATH:
+        return getPath();
+
+      case DATA:
+        return getData();
+
+      case MODE:
+        return getMode();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PATH:
+        return isSetPath();
+      case DATA:
+        return isSetData();
+      case MODE:
+        return isSetMode();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof startPersistentEphemeralNode_args)
+        return this.equals((startPersistentEphemeralNode_args)that);
+      return false;
+    }
+
+    public boolean equals(startPersistentEphemeralNode_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
+          return false;
+      }
+
+      boolean this_present_data = true && this.isSetData();
+      boolean that_present_data = true && that.isSetData();
+      if (this_present_data || that_present_data) {
+        if (!(this_present_data && that_present_data))
+          return false;
+        if (!this.data.equals(that.data))
+          return false;
+      }
+
+      boolean this_present_mode = true && this.isSetMode();
+      boolean that_present_mode = true && that.isSetMode();
+      if (this_present_mode || that_present_mode) {
+        if (!(this_present_mode && that_present_mode))
+          return false;
+        if (!this.mode.equals(that.mode))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(startPersistentEphemeralNode_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetData()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetMode()).compareTo(other.isSetMode());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetMode()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mode, other.mode);
+        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("startPersistentEphemeralNode_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("data:");
+      if (this.data == null) {
+        sb.append("null");
+      } else {
+        org.apache.thrift.TBaseHelper.toString(this.data, sb);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("mode:");
+      if (this.mode == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.mode);
+      }
+      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 (projection != null) {
+        projection.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 startPersistentEphemeralNode_argsStandardSchemeFactory implements SchemeFactory {
+      public startPersistentEphemeralNode_argsStandardScheme getScheme() {
+        return new startPersistentEphemeralNode_argsStandardScheme();
+      }
+    }
+
+    private static class startPersistentEphemeralNode_argsStandardScheme extends StandardScheme<startPersistentEphemeralNode_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, startPersistentEphemeralNode_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PATH
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.path = iprot.readString();
+                struct.setPathIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // DATA
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.data = iprot.readBinary();
+                struct.setDataIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 4: // MODE
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.mode = PersistentEphemeralNodeMode.findByValue(iprot.readI32());
+                struct.setModeIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, startPersistentEphemeralNode_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.path != null) {
+          oprot.writeFieldBegin(PATH_FIELD_DESC);
+          oprot.writeString(struct.path);
+          oprot.writeFieldEnd();
+        }
+        if (struct.data != null) {
+          oprot.writeFieldBegin(DATA_FIELD_DESC);
+          oprot.writeBinary(struct.data);
+          oprot.writeFieldEnd();
+        }
+        if (struct.mode != null) {
+          oprot.writeFieldBegin(MODE_FIELD_DESC);
+          oprot.writeI32(struct.mode.getValue());
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class startPersistentEphemeralNode_argsTupleSchemeFactory implements SchemeFactory {
+      public startPersistentEphemeralNode_argsTupleScheme getScheme() {
+        return new startPersistentEphemeralNode_argsTupleScheme();
+      }
+    }
+
+    private static class startPersistentEphemeralNode_argsTupleScheme extends TupleScheme<startPersistentEphemeralNode_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, startPersistentEphemeralNode_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetPath()) {
+          optionals.set(1);
+        }
+        if (struct.isSetData()) {
+          optionals.set(2);
+        }
+        if (struct.isSetMode()) {
+          optionals.set(3);
+        }
+        oprot.writeBitSet(optionals, 4);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetPath()) {
+          oprot.writeString(struct.path);
+        }
+        if (struct.isSetData()) {
+          oprot.writeBinary(struct.data);
+        }
+        if (struct.isSetMode()) {
+          oprot.writeI32(struct.mode.getValue());
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, startPersistentEphemeralNode_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(4);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.path = iprot.readString();
+          struct.setPathIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.data = iprot.readBinary();
+          struct.setDataIsSet(true);
+        }
+        if (incoming.get(3)) {
+          struct.mode = PersistentEphemeralNodeMode.findByValue(iprot.readI32());
+          struct.setModeIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class startPersistentEphemeralNode_result implements org.apache.thrift.TBase<startPersistentEphemeralNode_result, startPersistentEphemeralNode_result._Fields>, java.io.Serializable, Cloneable, Comparable<startPersistentEphemeralNode_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startPersistentEphemeralNode_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new startPersistentEphemeralNode_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new startPersistentEphemeralNode_resultTupleSchemeFactory());
+    }
+
+    public PersistentEphemeralNodeProjection success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      private static final 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;
+          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, PersistentEphemeralNodeProjection.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startPersistentEphemeralNode_result.class, metaDataMap);
+    }
+
+    public startPersistentEphemeralNode_result() {
+    }
+
+    public startPersistentEphemeralNode_result(
+      PersistentEphemeralNodeProjection success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public startPersistentEphemeralNode_result(startPersistentEphemeralNode_result other) {
+      if (other.isSetSuccess()) {
+        this.success = new PersistentEphemeralNodeProjection(other.success);
+      }
+    }
+
+    public startPersistentEphemeralNode_result deepCopy() {
+      return new startPersistentEphemeralNode_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public PersistentEphemeralNodeProjection getSuccess() {
+      return this.success;
+    }
+
+    public startPersistentEphemeralNode_result setSuccess(PersistentEphemeralNodeProjection success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((PersistentEphemeralNodeProjection)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof startPersistentEphemeralNode_result)
+        return this.equals((startPersistentEphemeralNode_result)that);
+      return false;
+    }
+
+    public boolean equals(startPersistentEphemeralNode_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(startPersistentEphemeralNode_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      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("startPersistentEphemeralNode_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+      if (success != null) {
+        success.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 startPersistentEphemeralNode_resultStandardSchemeFactory implements SchemeFactory {
+      public startPersistentEphemeralNode_resultStandardScheme getScheme() {
+        return new startPersistentEphemeralNode_resultStandardScheme();
+      }
+    }
+
+    private static class startPersistentEphemeralNode_resultStandardScheme extends StandardScheme<startPersistentEphemeralNode_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, startPersistentEphemeralNode_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 PersistentEphemeralNodeProjection();
+                struct.success.read(iprot);
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, startPersistentEphemeralNode_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          struct.success.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class startPersistentEphemeralNode_resultTupleSchemeFactory implements SchemeFactory {
+      public startPersistentEphemeralNode_resultTupleScheme getScheme() {
+        return new startPersistentEphemeralNode_resultTupleScheme();
+      }
+    }
+
+    private static class startPersistentEphemeralNode_resultTupleScheme extends TupleScheme<startPersistentEphemeralNode_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, startPersistentEphemeralNode_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          struct.success.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, startPersistentEphemeralNode_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = new PersistentEphemeralNodeProjection();
+          struct.success.read(iprot);
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeMode.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeMode.java
new file mode 100644
index 0000000..422d35f
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeMode.java
@@ -0,0 +1,51 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum PersistentEphemeralNodeMode implements org.apache.thrift.TEnum {
+  EPHEMERAL(0),
+  EPHEMERAL_SEQUENTIAL(1),
+  PROTECTED_EPHEMERAL(2),
+  PROTECTED_EPHEMERAL_SEQUENTIAL(3);
+
+  private final int value;
+
+  private PersistentEphemeralNodeMode(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static PersistentEphemeralNodeMode findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return EPHEMERAL;
+      case 1:
+        return EPHEMERAL_SEQUENTIAL;
+      case 2:
+        return PROTECTED_EPHEMERAL;
+      case 3:
+        return PROTECTED_EPHEMERAL_SEQUENTIAL;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeProjection.java
new file mode 100644
index 0000000..607f247
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/PersistentEphemeralNodeProjection.java
@@ -0,0 +1,388 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 PersistentEphemeralNodeProjection implements org.apache.thrift.TBase<PersistentEphemeralNodeProjection, PersistentEphemeralNodeProjection._Fields>, java.io.Serializable, Cloneable, Comparable<PersistentEphemeralNodeProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PersistentEphemeralNodeProjection");
+
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new PersistentEphemeralNodeProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PersistentEphemeralNodeProjectionTupleSchemeFactory());
+  }
+
+  public String id; // 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 {
+    ID((short)1, "id");
+
+    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: // ID
+          return ID;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PersistentEphemeralNodeProjection.class, metaDataMap);
+  }
+
+  public PersistentEphemeralNodeProjection() {
+  }
+
+  public PersistentEphemeralNodeProjection(
+    String id)
+  {
+    this();
+    this.id = id;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public PersistentEphemeralNodeProjection(PersistentEphemeralNodeProjection other) {
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+  }
+
+  public PersistentEphemeralNodeProjection deepCopy() {
+    return new PersistentEphemeralNodeProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.id = null;
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public PersistentEphemeralNodeProjection setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ID:
+      return getId();
+
+    }
+    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 ID:
+      return isSetId();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof PersistentEphemeralNodeProjection)
+      return this.equals((PersistentEphemeralNodeProjection)that);
+    return false;
+  }
+
+  public boolean equals(PersistentEphemeralNodeProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(PersistentEphemeralNodeProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      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("PersistentEphemeralNodeProjection(");
+    boolean first = true;
+
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    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 PersistentEphemeralNodeProjectionStandardSchemeFactory implements SchemeFactory {
+    public PersistentEphemeralNodeProjectionStandardScheme getScheme() {
+      return new PersistentEphemeralNodeProjectionStandardScheme();
+    }
+  }
+
+  private static class PersistentEphemeralNodeProjectionStandardScheme extends StandardScheme<PersistentEphemeralNodeProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PersistentEphemeralNodeProjection 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: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, PersistentEphemeralNodeProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class PersistentEphemeralNodeProjectionTupleSchemeFactory implements SchemeFactory {
+    public PersistentEphemeralNodeProjectionTupleScheme getScheme() {
+      return new PersistentEphemeralNodeProjectionTupleScheme();
+    }
+  }
+
+  private static class PersistentEphemeralNodeProjectionTupleScheme extends TupleScheme<PersistentEphemeralNodeProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PersistentEphemeralNodeProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetId()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PersistentEphemeralNodeProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/cbd174a6/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 8b65beb..9da935c 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -126,5 +126,11 @@ public class TestClient
 
         nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
         System.out.println("nodeCacheData: " + nodeCacheData);
+
+        PersistentEphemeralNodeProjection node = client.startPersistentEphemeralNode(curatorProjection, "/my/path", ByteBuffer.wrap("hey".getBytes()), PersistentEphemeralNodeMode.EPHEMERAL);
+        existsSpec.path = "/my/path";
+        OptionalStat nodeExists = client.exists(curatorProjection, existsSpec);
+        System.out.println("nodeExists: " + nodeExists);
+        client.closeGenericProjection(curatorProjection, node.id);
     }
 }


[19/50] [abbrv] started work on service discovery

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
new file mode 100644
index 0000000..37fbee4
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
@@ -0,0 +1,6059 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 DiscoveryService {
+
+  public interface Iface {
+
+    public List<DiscoveryInstance> getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws CuratorException, org.apache.thrift.TException;
+
+    public DiscoveryInstance getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws CuratorException, org.apache.thrift.TException;
+
+    public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws CuratorException, org.apache.thrift.TException;
+
+    public DiscoveryProjection startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance) throws CuratorException, org.apache.thrift.TException;
+
+    public DiscoveryProviderProjection startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws CuratorException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<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 List<DiscoveryInstance> getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws CuratorException, org.apache.thrift.TException
+    {
+      send_getAllInstances(projection, providerProjection);
+      return recv_getAllInstances();
+    }
+
+    public void send_getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws org.apache.thrift.TException
+    {
+      getAllInstances_args args = new getAllInstances_args();
+      args.setProjection(projection);
+      args.setProviderProjection(providerProjection);
+      sendBase("getAllInstances", args);
+    }
+
+    public List<DiscoveryInstance> recv_getAllInstances() throws CuratorException, org.apache.thrift.TException
+    {
+      getAllInstances_result result = new getAllInstances_result();
+      receiveBase(result, "getAllInstances");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllInstances failed: unknown result");
+    }
+
+    public DiscoveryInstance getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws CuratorException, org.apache.thrift.TException
+    {
+      send_getInstance(projection, providerProjection);
+      return recv_getInstance();
+    }
+
+    public void send_getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws org.apache.thrift.TException
+    {
+      getInstance_args args = new getInstance_args();
+      args.setProjection(projection);
+      args.setProviderProjection(providerProjection);
+      sendBase("getInstance", args);
+    }
+
+    public DiscoveryInstance recv_getInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      getInstance_result result = new getInstance_result();
+      receiveBase(result, "getInstance");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInstance failed: unknown result");
+    }
+
+    public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws CuratorException, org.apache.thrift.TException
+    {
+      send_noteError(projection, providerProjection, instanceId);
+      recv_noteError();
+    }
+
+    public void send_noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws org.apache.thrift.TException
+    {
+      noteError_args args = new noteError_args();
+      args.setProjection(projection);
+      args.setProviderProjection(providerProjection);
+      args.setInstanceId(instanceId);
+      sendBase("noteError", args);
+    }
+
+    public void recv_noteError() throws CuratorException, org.apache.thrift.TException
+    {
+      noteError_result result = new noteError_result();
+      receiveBase(result, "noteError");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      return;
+    }
+
+    public DiscoveryProjection startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance) throws CuratorException, org.apache.thrift.TException
+    {
+      send_startDiscovery(projection, basePath, yourInstance);
+      return recv_startDiscovery();
+    }
+
+    public void send_startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance) throws org.apache.thrift.TException
+    {
+      startDiscovery_args args = new startDiscovery_args();
+      args.setProjection(projection);
+      args.setBasePath(basePath);
+      args.setYourInstance(yourInstance);
+      sendBase("startDiscovery", args);
+    }
+
+    public DiscoveryProjection recv_startDiscovery() throws CuratorException, org.apache.thrift.TException
+    {
+      startDiscovery_result result = new startDiscovery_result();
+      receiveBase(result, "startDiscovery");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startDiscovery failed: unknown result");
+    }
+
+    public DiscoveryProviderProjection startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws CuratorException, org.apache.thrift.TException
+    {
+      send_startProvider(projection, discoveryProjection, serviceName, providerStrategy, downTimeoutMs, downErrorThreshold);
+      return recv_startProvider();
+    }
+
+    public void send_startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws org.apache.thrift.TException
+    {
+      startProvider_args args = new startProvider_args();
+      args.setProjection(projection);
+      args.setDiscoveryProjection(discoveryProjection);
+      args.setServiceName(serviceName);
+      args.setProviderStrategy(providerStrategy);
+      args.setDownTimeoutMs(downTimeoutMs);
+      args.setDownErrorThreshold(downErrorThreshold);
+      sendBase("startProvider", args);
+    }
+
+    public DiscoveryProviderProjection recv_startProvider() throws CuratorException, org.apache.thrift.TException
+    {
+      startProvider_result result = new startProvider_result();
+      receiveBase(result, "startProvider");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startProvider failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient 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 getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getAllInstances_call method_call = new getAllInstances_call(projection, providerProjection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getAllInstances_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProviderProjection providerProjection;
+      public getAllInstances_call(CuratorProjection projection, DiscoveryProviderProjection providerProjection, 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.projection = projection;
+        this.providerProjection = providerProjection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllInstances", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getAllInstances_args args = new getAllInstances_args();
+        args.setProjection(projection);
+        args.setProviderProjection(providerProjection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<DiscoveryInstance> getResult() throws CuratorException, 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_getAllInstances();
+      }
+    }
+
+    public void getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getInstance_call method_call = new getInstance_call(projection, providerProjection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProviderProjection providerProjection;
+      public getInstance_call(CuratorProjection projection, DiscoveryProviderProjection providerProjection, 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.projection = projection;
+        this.providerProjection = providerProjection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getInstance_args args = new getInstance_args();
+        args.setProjection(projection);
+        args.setProviderProjection(providerProjection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public DiscoveryInstance getResult() throws CuratorException, 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_getInstance();
+      }
+    }
+
+    public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      noteError_call method_call = new noteError_call(projection, providerProjection, instanceId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class noteError_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProviderProjection providerProjection;
+      private String instanceId;
+      public noteError_call(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId, 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.projection = projection;
+        this.providerProjection = providerProjection;
+        this.instanceId = instanceId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("noteError", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        noteError_args args = new noteError_args();
+        args.setProjection(projection);
+        args.setProviderProjection(providerProjection);
+        args.setInstanceId(instanceId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws CuratorException, 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);
+        (new Client(prot)).recv_noteError();
+      }
+    }
+
+    public void startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      startDiscovery_call method_call = new startDiscovery_call(projection, basePath, yourInstance, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class startDiscovery_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String basePath;
+      private DiscoveryInstance yourInstance;
+      public startDiscovery_call(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance, 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.projection = projection;
+        this.basePath = basePath;
+        this.yourInstance = yourInstance;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startDiscovery", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        startDiscovery_args args = new startDiscovery_args();
+        args.setProjection(projection);
+        args.setBasePath(basePath);
+        args.setYourInstance(yourInstance);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public DiscoveryProjection getResult() throws CuratorException, 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_startDiscovery();
+      }
+    }
+
+    public void startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      startProvider_call method_call = new startProvider_call(projection, discoveryProjection, serviceName, providerStrategy, downTimeoutMs, downErrorThreshold, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class startProvider_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private DiscoveryProjection discoveryProjection;
+      private String serviceName;
+      private ProviderStrategyType providerStrategy;
+      private int downTimeoutMs;
+      private int downErrorThreshold;
+      public startProvider_call(CuratorProjection projection, DiscoveryProjection discoveryProjection, String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold, 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.projection = projection;
+        this.discoveryProjection = discoveryProjection;
+        this.serviceName = serviceName;
+        this.providerStrategy = providerStrategy;
+        this.downTimeoutMs = downTimeoutMs;
+        this.downErrorThreshold = downErrorThreshold;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startProvider", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        startProvider_args args = new startProvider_args();
+        args.setProjection(projection);
+        args.setDiscoveryProjection(discoveryProjection);
+        args.setServiceName(serviceName);
+        args.setProviderStrategy(providerStrategy);
+        args.setDownTimeoutMs(downTimeoutMs);
+        args.setDownErrorThreshold(downErrorThreshold);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public DiscoveryProviderProjection getResult() throws CuratorException, 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_startProvider();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<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("getAllInstances", new getAllInstances());
+      processMap.put("getInstance", new getInstance());
+      processMap.put("noteError", new noteError());
+      processMap.put("startDiscovery", new startDiscovery());
+      processMap.put("startProvider", new startProvider());
+      return processMap;
+    }
+
+    public static class getAllInstances<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllInstances_args> {
+      public getAllInstances() {
+        super("getAllInstances");
+      }
+
+      public getAllInstances_args getEmptyArgsInstance() {
+        return new getAllInstances_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getAllInstances_result getResult(I iface, getAllInstances_args args) throws org.apache.thrift.TException {
+        getAllInstances_result result = new getAllInstances_result();
+        try {
+          result.success = iface.getAllInstances(args.projection, args.providerProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class getInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getInstance_args> {
+      public getInstance() {
+        super("getInstance");
+      }
+
+      public getInstance_args getEmptyArgsInstance() {
+        return new getInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getInstance_result getResult(I iface, getInstance_args args) throws org.apache.thrift.TException {
+        getInstance_result result = new getInstance_result();
+        try {
+          result.success = iface.getInstance(args.projection, args.providerProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class noteError<I extends Iface> extends org.apache.thrift.ProcessFunction<I, noteError_args> {
+      public noteError() {
+        super("noteError");
+      }
+
+      public noteError_args getEmptyArgsInstance() {
+        return new noteError_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public noteError_result getResult(I iface, noteError_args args) throws org.apache.thrift.TException {
+        noteError_result result = new noteError_result();
+        try {
+          iface.noteError(args.projection, args.providerProjection, args.instanceId);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class startDiscovery<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startDiscovery_args> {
+      public startDiscovery() {
+        super("startDiscovery");
+      }
+
+      public startDiscovery_args getEmptyArgsInstance() {
+        return new startDiscovery_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public startDiscovery_result getResult(I iface, startDiscovery_args args) throws org.apache.thrift.TException {
+        startDiscovery_result result = new startDiscovery_result();
+        try {
+          result.success = iface.startDiscovery(args.projection, args.basePath, args.yourInstance);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+    public static class startProvider<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startProvider_args> {
+      public startProvider() {
+        super("startProvider");
+      }
+
+      public startProvider_args getEmptyArgsInstance() {
+        return new startProvider_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public startProvider_result getResult(I iface, startProvider_args args) throws org.apache.thrift.TException {
+        startProvider_result result = new startProvider_result();
+        try {
+          result.success = iface.startProvider(args.projection, args.discoveryProjection, args.serviceName, args.providerStrategy, args.downTimeoutMs, args.downErrorThreshold);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<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("getAllInstances", new getAllInstances());
+      processMap.put("getInstance", new getInstance());
+      processMap.put("noteError", new noteError());
+      processMap.put("startDiscovery", new startDiscovery());
+      processMap.put("startProvider", new startProvider());
+      return processMap;
+    }
+
+    public static class getAllInstances<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllInstances_args, List<DiscoveryInstance>> {
+      public getAllInstances() {
+        super("getAllInstances");
+      }
+
+      public getAllInstances_args getEmptyArgsInstance() {
+        return new getAllInstances_args();
+      }
+
+      public AsyncMethodCallback<List<DiscoveryInstance>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<List<DiscoveryInstance>>() { 
+          public void onComplete(List<DiscoveryInstance> o) {
+            getAllInstances_result result = new getAllInstances_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;
+            getAllInstances_result result = new getAllInstances_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, getAllInstances_args args, org.apache.thrift.async.AsyncMethodCallback<List<DiscoveryInstance>> resultHandler) throws TException {
+        iface.getAllInstances(args.projection, args.providerProjection,resultHandler);
+      }
+    }
+
+    public static class getInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getInstance_args, DiscoveryInstance> {
+      public getInstance() {
+        super("getInstance");
+      }
+
+      public getInstance_args getEmptyArgsInstance() {
+        return new getInstance_args();
+      }
+
+      public AsyncMethodCallback<DiscoveryInstance> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<DiscoveryInstance>() { 
+          public void onComplete(DiscoveryInstance o) {
+            getInstance_result result = new getInstance_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;
+            getInstance_result result = new getInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, getInstance_args args, org.apache.thrift.async.AsyncMethodCallback<DiscoveryInstance> resultHandler) throws TException {
+        iface.getInstance(args.projection, args.providerProjection,resultHandler);
+      }
+    }
+
+    public static class noteError<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, noteError_args, Void> {
+      public noteError() {
+        super("noteError");
+      }
+
+      public noteError_args getEmptyArgsInstance() {
+        return new noteError_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            noteError_result result = new noteError_result();
+            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;
+            noteError_result result = new noteError_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, noteError_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.noteError(args.projection, args.providerProjection, args.instanceId,resultHandler);
+      }
+    }
+
+    public static class startDiscovery<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startDiscovery_args, DiscoveryProjection> {
+      public startDiscovery() {
+        super("startDiscovery");
+      }
+
+      public startDiscovery_args getEmptyArgsInstance() {
+        return new startDiscovery_args();
+      }
+
+      public AsyncMethodCallback<DiscoveryProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<DiscoveryProjection>() { 
+          public void onComplete(DiscoveryProjection o) {
+            startDiscovery_result result = new startDiscovery_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;
+            startDiscovery_result result = new startDiscovery_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, startDiscovery_args args, org.apache.thrift.async.AsyncMethodCallback<DiscoveryProjection> resultHandler) throws TException {
+        iface.startDiscovery(args.projection, args.basePath, args.yourInstance,resultHandler);
+      }
+    }
+
+    public static class startProvider<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startProvider_args, DiscoveryProviderProjection> {
+      public startProvider() {
+        super("startProvider");
+      }
+
+      public startProvider_args getEmptyArgsInstance() {
+        return new startProvider_args();
+      }
+
+      public AsyncMethodCallback<DiscoveryProviderProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<DiscoveryProviderProjection>() { 
+          public void onComplete(DiscoveryProviderProjection o) {
+            startProvider_result result = new startProvider_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;
+            startProvider_result result = new startProvider_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, startProvider_args args, org.apache.thrift.async.AsyncMethodCallback<DiscoveryProviderProjection> resultHandler) throws TException {
+        iface.startProvider(args.projection, args.discoveryProjection, args.serviceName, args.providerStrategy, args.downTimeoutMs, args.downErrorThreshold,resultHandler);
+      }
+    }
+
+  }
+
+  public static class getAllInstances_args implements org.apache.thrift.TBase<getAllInstances_args, getAllInstances_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllInstances_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllInstances_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PROVIDER_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("providerProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getAllInstances_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getAllInstances_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProviderProjection providerProjection; // 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 {
+      PROJECTION((short)1, "projection"),
+      PROVIDER_PROJECTION((short)2, "providerProjection");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // PROVIDER_PROJECTION
+            return PROVIDER_PROJECTION;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PROVIDER_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("providerProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProviderProjection.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllInstances_args.class, metaDataMap);
+    }
+
+    public getAllInstances_args() {
+    }
+
+    public getAllInstances_args(
+      CuratorProjection projection,
+      DiscoveryProviderProjection providerProjection)
+    {
+      this();
+      this.projection = projection;
+      this.providerProjection = providerProjection;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAllInstances_args(getAllInstances_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetProviderProjection()) {
+        this.providerProjection = new DiscoveryProviderProjection(other.providerProjection);
+      }
+    }
+
+    public getAllInstances_args deepCopy() {
+      return new getAllInstances_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.providerProjection = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public getAllInstances_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProviderProjection getProviderProjection() {
+      return this.providerProjection;
+    }
+
+    public getAllInstances_args setProviderProjection(DiscoveryProviderProjection providerProjection) {
+      this.providerProjection = providerProjection;
+      return this;
+    }
+
+    public void unsetProviderProjection() {
+      this.providerProjection = null;
+    }
+
+    /** Returns true if field providerProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProviderProjection() {
+      return this.providerProjection != null;
+    }
+
+    public void setProviderProjectionIsSet(boolean value) {
+      if (!value) {
+        this.providerProjection = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PROVIDER_PROJECTION:
+        if (value == null) {
+          unsetProviderProjection();
+        } else {
+          setProviderProjection((DiscoveryProviderProjection)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PROVIDER_PROJECTION:
+        return getProviderProjection();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PROVIDER_PROJECTION:
+        return isSetProviderProjection();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAllInstances_args)
+        return this.equals((getAllInstances_args)that);
+      return false;
+    }
+
+    public boolean equals(getAllInstances_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_providerProjection = true && this.isSetProviderProjection();
+      boolean that_present_providerProjection = true && that.isSetProviderProjection();
+      if (this_present_providerProjection || that_present_providerProjection) {
+        if (!(this_present_providerProjection && that_present_providerProjection))
+          return false;
+        if (!this.providerProjection.equals(that.providerProjection))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getAllInstances_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetProviderProjection()).compareTo(other.isSetProviderProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProviderProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.providerProjection, other.providerProjection);
+        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("getAllInstances_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("providerProjection:");
+      if (this.providerProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.providerProjection);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (providerProjection != null) {
+        providerProjection.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 getAllInstances_argsStandardSchemeFactory implements SchemeFactory {
+      public getAllInstances_argsStandardScheme getScheme() {
+        return new getAllInstances_argsStandardScheme();
+      }
+    }
+
+    private static class getAllInstances_argsStandardScheme extends StandardScheme<getAllInstances_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllInstances_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PROVIDER_PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.providerProjection = new DiscoveryProviderProjection();
+                struct.providerProjection.read(iprot);
+                struct.setProviderProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAllInstances_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.providerProjection != null) {
+          oprot.writeFieldBegin(PROVIDER_PROJECTION_FIELD_DESC);
+          struct.providerProjection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAllInstances_argsTupleSchemeFactory implements SchemeFactory {
+      public getAllInstances_argsTupleScheme getScheme() {
+        return new getAllInstances_argsTupleScheme();
+      }
+    }
+
+    private static class getAllInstances_argsTupleScheme extends TupleScheme<getAllInstances_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAllInstances_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetProviderProjection()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetProviderProjection()) {
+          struct.providerProjection.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAllInstances_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.providerProjection = new DiscoveryProviderProjection();
+          struct.providerProjection.read(iprot);
+          struct.setProviderProjectionIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class getAllInstances_result implements org.apache.thrift.TBase<getAllInstances_result, getAllInstances_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllInstances_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllInstances_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getAllInstances_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getAllInstances_resultTupleSchemeFactory());
+    }
+
+    public List<DiscoveryInstance> success; // required
+    public CuratorException ex1; // 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"),
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryInstance.class))));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(getAllInstances_result.class, metaDataMap);
+    }
+
+    public getAllInstances_result() {
+    }
+
+    public getAllInstances_result(
+      List<DiscoveryInstance> success,
+      CuratorException ex1)
+    {
+      this();
+      this.success = success;
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getAllInstances_result(getAllInstances_result other) {
+      if (other.isSetSuccess()) {
+        List<DiscoveryInstance> __this__success = new ArrayList<DiscoveryInstance>(other.success.size());
+        for (DiscoveryInstance other_element : other.success) {
+          __this__success.add(new DiscoveryInstance(other_element));
+        }
+        this.success = __this__success;
+      }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public getAllInstances_result deepCopy() {
+      return new getAllInstances_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.ex1 = null;
+    }
+
+    public int getSuccessSize() {
+      return (this.success == null) ? 0 : this.success.size();
+    }
+
+    public java.util.Iterator<DiscoveryInstance> getSuccessIterator() {
+      return (this.success == null) ? null : this.success.iterator();
+    }
+
+    public void addToSuccess(DiscoveryInstance elem) {
+      if (this.success == null) {
+        this.success = new ArrayList<DiscoveryInstance>();
+      }
+      this.success.add(elem);
+    }
+
+    public List<DiscoveryInstance> getSuccess() {
+      return this.success;
+    }
+
+    public getAllInstances_result setSuccess(List<DiscoveryInstance> success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public getAllInstances_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((List<DiscoveryInstance>)value);
+        }
+        break;
+
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case EX1:
+        return getEx1();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getAllInstances_result)
+        return this.equals((getAllInstances_result)that);
+      return false;
+    }
+
+    public boolean equals(getAllInstances_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getAllInstances_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("getAllInstances_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("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 getAllInstances_resultStandardSchemeFactory implements SchemeFactory {
+      public getAllInstances_resultStandardScheme getScheme() {
+        return new getAllInstances_resultStandardScheme();
+      }
+    }
+
+    private static class getAllInstances_resultStandardScheme extends StandardScheme<getAllInstances_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getAllInstances_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+                {
+                  org.apache.thrift.protocol.TList _list48 = iprot.readListBegin();
+                  struct.success = new ArrayList<DiscoveryInstance>(_list48.size);
+                  for (int _i49 = 0; _i49 < _list48.size; ++_i49)
+                  {
+                    DiscoveryInstance _elem50;
+                    _elem50 = new DiscoveryInstance();
+                    _elem50.read(iprot);
+                    struct.success.add(_elem50);
+                  }
+                  iprot.readListEnd();
+                }
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getAllInstances_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+            for (DiscoveryInstance _iter51 : struct.success)
+            {
+              _iter51.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getAllInstances_resultTupleSchemeFactory implements SchemeFactory {
+      public getAllInstances_resultTupleScheme getScheme() {
+        return new getAllInstances_resultTupleScheme();
+      }
+    }
+
+    private static class getAllInstances_resultTupleScheme extends TupleScheme<getAllInstances_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getAllInstances_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          {
+            oprot.writeI32(struct.success.size());
+            for (DiscoveryInstance _iter52 : struct.success)
+            {
+              _iter52.write(oprot);
+            }
+          }
+        }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getAllInstances_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          {
+            org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.success = new ArrayList<DiscoveryInstance>(_list53.size);
+            for (int _i54 = 0; _i54 < _list53.size; ++_i54)
+            {
+              DiscoveryInstance _elem55;
+              _elem55 = new DiscoveryInstance();
+              _elem55.read(iprot);
+              struct.success.add(_elem55);
+            }
+          }
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class getInstance_args implements org.apache.thrift.TBase<getInstance_args, getInstance_args._Fields>, java.io.Serializable, Cloneable, Comparable<getInstance_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInstance_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PROVIDER_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("providerProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getInstance_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getInstance_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public DiscoveryProviderProjection providerProjection; // 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 {
+      PROJECTION((short)1, "projection"),
+      PROVIDER_PROJECTION((short)2, "providerProjection");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // PROVIDER_PROJECTION
+            return PROVIDER_PROJECTION;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PROVIDER_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("providerProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DiscoveryProviderProjection.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInstance_args.class, metaDataMap);
+    }
+
+    public getInstance_args() {
+    }
+
+    public getInstance_args(
+      CuratorProjection projection,
+      DiscoveryProviderProjection providerProjection)
+    {
+      this();
+      this.projection = projection;
+      this.providerProjection = providerProjection;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getInstance_args(getInstance_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetProviderProjection()) {
+        this.providerProjection = new DiscoveryProviderProjection(other.providerProjection);
+      }
+    }
+
+    public getInstance_args deepCopy() {
+      return new getInstance_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.providerProjection = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public getInstance_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public DiscoveryProviderProjection getProviderProjection() {
+      return this.providerProjection;
+    }
+
+    public getInstance_args setProviderProjection(DiscoveryProviderProjection providerProjection) {
+      this.providerProjection = providerProjection;
+      return this;
+    }
+
+    public void unsetProviderProjection() {
+      this.providerProjection = null;
+    }
+
+    /** Returns true if field providerProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProviderProjection() {
+      return this.providerProjection != null;
+    }
+
+    public void setProviderProjectionIsSet(boolean value) {
+      if (!value) {
+        this.providerProjection = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PROVIDER_PROJECTION:
+        if (value == null) {
+          unsetProviderProjection();
+        } else {
+          setProviderProjection((DiscoveryProviderProjection)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PROVIDER_PROJECTION:
+        return getProviderProjection();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PROVIDER_PROJECTION:
+        return isSetProviderProjection();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getInstance_args)
+        return this.equals((getInstance_args)that);
+      return false;
+    }
+
+    public boolean equals(getInstance_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_providerProjection = true && this.isSetProviderProjection();
+      boolean that_present_providerProjection = true && that.isSetProviderProjection();
+      if (this_present_providerProjection || that_present_providerProjection) {
+        if (!(this_present_providerProjection && that_present_providerProjection))
+          return false;
+        if (!this.providerProjection.equals(that.providerProjection))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getInstance_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetProviderProjection()).compareTo(other.isSetProviderProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProviderProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.providerProjection, other.providerProjection);
+        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("getInstance_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("providerProjection:");
+      if (this.providerProjection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.providerProjection);
+      }
+      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 (projection != null) {
+        projection.validate();
+      }
+      if (providerProjection != null) {
+        providerProjection.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 getInstance_argsStandardSchemeFactory implements SchemeFactory {
+      public getInstance_argsStandardScheme getScheme() {
+        return new getInstance_argsStandardScheme();
+      }
+    }
+
+    priva

<TRUNCATED>

[26/50] [abbrv] git commit: updated

Posted by ra...@apache.org.
updated


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a2b0ffd7
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a2b0ffd7
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a2b0ffd7

Branch: refs/heads/master
Commit: a2b0ffd7066bfc7a457460d197adb8c3196a0ff3
Parents: bdc595a
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 09:45:15 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 09:45:15 2014 -0500

----------------------------------------------------------------------
 .../src/main/resources/curator/help.txt         | 70 ++++++++++++++++++--
 1 file changed, 64 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/a2b0ffd7/curator-x-rpc/src/main/resources/curator/help.txt
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/resources/curator/help.txt b/curator-x-rpc/src/main/resources/curator/help.txt
index 086654e..53e751f 100644
--- a/curator-x-rpc/src/main/resources/curator/help.txt
+++ b/curator-x-rpc/src/main/resources/curator/help.txt
@@ -2,12 +2,70 @@ Curator RPC - an RPC server for using Apache Curator APIs and recipes from non J
 
 Arguments:
     <none>    show this help
-    <path>    path to a JSON or YAML configuration file
-    <string>  JSON or YAML object for configuration
+    <config>  either a path to a JSON or YAML configuration file or a JSON/YAML object for
+              configuration
 
-Curator RPC uses Dropwizard for configuration. The format is JSON or YAML (your choice).
+Curator RPC uses Dropwizard for configuration. The format is JSON or YAML (your choice). Here is
+the model configuration shown in JSON with added comments. Required fields have "*" in the comment.
 
-Curator also uses Dropwizard's logging module. The configuration for it is described here:
-http://dropwizard.readthedocs.org/en/latest/manual/configuration.html#logging
+{
+    "thrift": { // * Thrift server configuration
+        "bindAddress": "string", // address to bind to. Default is "localhost"
+        "port": int, // * port to listen on
+        "acceptBacklog": int, // default is 1024
+        "connectionLimit": int, // max concurrent connections. Default is unlimited.
+        "acceptorThreadCount": int, // default is 1
+        "ioThreadCount": int, // default is 2 * number of processors
+        "idleConnectionTimeout": "Duration", // default is 60 seconds
+        "transportName": "string", // default is "framed"
+        "protocolName": "string" // default is "binary"
+    },
 
-TODO - more details to follow
+    "projectionExpiration": "Duration", // time for projections to expire if unused. Default is 3
+                                        // minutes.
+
+    "pingTime": "Duration", // time that the EventService will return PING if no other events.
+                            // Default is 5 seconds.
+
+    "connections": [ // * list of ZooKeeper connections
+        "name": "string", // * unique name for the connection
+        "sessionLength": "Duration", // duration for the session. Default is 1 minute.
+        "connectionTimeout": "Duration", // duration for connecting. Default is 15 seconds.
+        "authorization": { // Authorization spec. Default is NULL.
+            "scheme": "string", // * the authorization scheme
+            "auth": "string" // * the authorization auth
+        },
+        "namespace": "string", // Curator namespace. Default is NULL.
+        "retry": {  // Retry policy. Default is an exponential-backoff policy.
+            "type": "string", // Policy type. Either "exponential-backoff",
+                              // "bounded-exponential-backoff" or "ntimes"
+            -- Remaining values depending on type. See below --
+        },
+    ],
+
+    "logging": { // logging config - Dropwizard's logging library is used
+        See http://dropwizard.readthedocs.org/en/latest/manual/configuration.html#logging
+    }
+}
+
+"Duration" is a string. E.g. "1s" (1 second), "10m" (10 minutes)
+
+Retry Policy Specs:
+    For type: "exponential-backoff"
+        {
+            "baseSleepTime": "Duration", // default is 100 milliseconds
+            "maxRetries": int // default is 3
+        }
+
+    For type: "bounded-exponential-backoff"
+        {
+            "baseSleepTime": "Duration", // default is 100 milliseconds
+            "maxSleepTime": "Duration",  // default is 30 seconds
+            "maxRetries": int // default is 3
+        }
+
+    For type: "ntimes"
+        {
+            "sleepBetweenRetries": "Duration", // default is 100 milliseconds
+            "n": int // default is 3
+        }


[34/50] [abbrv] git commit: wip on doc

Posted by ra...@apache.org.
wip on doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bfc388ce
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bfc388ce
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bfc388ce

Branch: refs/heads/master
Commit: bfc388ce020afa62a6f5e1d6bd3c6cdd9a82e8a3
Parents: 48b0759
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 13:14:49 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 13:14:49 2014 -0500

----------------------------------------------------------------------
 .../idl/services/CuratorProjectionService.java  | 15 ++++
 .../src/site/confluence/events.confluence       | 85 ++++++++++++++++++++
 2 files changed, 100 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/bfc388ce/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index ca5a604..b9de507 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -314,6 +314,21 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
+    public void sync(CuratorProjection projection, String path, String asyncContext) throws RpcException
+    {
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            entry.getClient().sync().inBackground(backgroundCallback, asyncContext).forPath(path);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
     public boolean closeGenericProjection(CuratorProjection projection, String id) throws RpcException
     {
         try

http://git-wip-us.apache.org/repos/asf/curator/blob/bfc388ce/curator-x-rpc/src/site/confluence/events.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
index 416b978..a6df4e8 100644
--- a/curator-x-rpc/src/site/confluence/events.confluence
+++ b/curator-x-rpc/src/site/confluence/events.confluence
@@ -2,3 +2,88 @@
 
 h1. Events
 
+
+h2. Event Loop
+
+In order to receive out\-of\-bounds messages (connection state changes, watcher triggers, etc.) you must have an event loop to recieve
+messages from the EventService. Here is pseudo code:
+
+{code}
+inThread => {
+    while ( isOpen ) {
+        event = eventService.getNextEvent(curatorProjection)
+        ... process event ...
+    }
+}
+{code}
+
+h2. Schema
+
+h3. CuratorEvent
+
+||Field||Type||Description||
+|type|CuratorEventType|The event type|
+|resultCode|int|some event types have a result code (i.e. async API calls)|
+|path|string|if there is a path associated with the event|
+|context|string|async context for async API calls|
+|stat|Stat|some event types have a ZooKeeper Stat object|
+|data|bytes|ZNode data if the event type has it|
+|name|string|ZNode name if the event type has it|
+|children|list of string|list of node names if the event type has it|
+|aclList|list of Acl|list of ACL data if the event type has it|
+|watchedEvent|WatchedEvent|if the event type is WATCHED|
+|leaderEvent|LeaderEvent|if the event type is WATCHED|
+|childrenCacheEvent|PathChildrenCacheEvent|if the event type is PATH\_CHILDREN\_CACHE|
+
+h3. CuratorEventType
+
+||Value||Description||
+|PING|Returned if there no events have been generated within the [[configured|configuration.html]] pingTime|
+|CREATE|Async createNode() API completion|
+|DELETE|Async deleteNode() API completion|
+|EXISTS|Async exists() API completion|
+|GET\_DATA|Async getData() API completion|
+|SET\_DATA|Async setData() API completion|
+|CHILDREN|Async getChildren() API completion|
+|SYNC|Async sync() API completion|
+|WATCHED|A watcher has triggered|
+|CONNECTION\_CONNECTED|A Curator ConnectionStateListener is installed. This event is for the initial successful connection.|
+|CONNECTION\_SUSPENDED|A Curator ConnectionStateListener is installed. This event means the connection has been suspended.|
+|CONNECTION\_RECONNECTED|A Curator ConnectionStateListener is installed. This event means the connection has been reconnected.|
+|CONNECTION\_LOST|A Curator ConnectionStateListener is installed. This event means the connection has been lost.|
+|CONNECTION\_READ\_ONLY|A Curator ConnectionStateListener is installed. This event means the connection has changed to read only.|
+|LEADER|A Leader recipe event|
+|PATH\_CHILDREN\_CACHE|A path children cache event|
+|NODE\_CACHE|The node for a node cache has changed|
+
+h3. LeaderEvent
+
+||Field||Type||Description||
+|path|string|The leader's path|
+|participantId|string|The participant ID for the event being reported|
+|isLeader|bool|if true, this participant is being made leader. If false, it is losing leadership.|
+
+h3. PathChildrenCacheEvent
+
+||Field||Type||Description||
+|cachedPath|name|The path being cached|
+|type|PathChildrenCacheEventType|cache event type|
+|data|ChildData|data for the child ZNode|
+
+h3. PathChildrenCacheEventType
+
+Values:     CHILD\_ADDED,
+            CHILD\_UPDATED,
+            CHILD\_REMOVED,
+            CONNECTION\_SUSPENDED,
+            CONNECTION\_RECONNECTED,
+            CONNECTION\_LOST,
+            INITIALIZED
+
+h3. ChildData
+
+||Field||Type||Description||
+|path|string|The ZNode path|
+|stat|Stat|ZooKeeper Stat object|
+|data|bytes|ZNode data (if the cache is configured to cache data)|
+


[21/50] [abbrv] git commit: started work on service discovery

Posted by ra...@apache.org.
started work on service discovery


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/87582a9b
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/87582a9b
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/87582a9b

Branch: refs/heads/master
Commit: 87582a9b2f5640fedaa6122a8c7c7d4eafb96e19
Parents: c6229cf
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 17:14:45 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 17:14:45 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/pom.xml                           |   19 +
 .../curator/x/rpc/CuratorProjectionServer.java  |    6 +-
 .../curator/x/rpc/connections/CuratorEntry.java |    8 +
 .../x/rpc/idl/discovery/DiscoveryInstance.java  |   66 +
 .../idl/discovery/DiscoveryInstanceType.java    |    8 +
 .../rpc/idl/discovery/DiscoveryProjection.java  |   38 +
 .../discovery/DiscoveryProviderProjection.java  |   38 +
 .../x/rpc/idl/discovery/DiscoveryService.java   |  211 +
 .../idl/discovery/DiscoveryServiceLowLevel.java |   85 +
 .../rpc/idl/discovery/ProviderStrategyType.java |    9 +
 .../idl/services/CuratorProjectionService.java  |   18 +-
 .../x/rpc/idl/structs/CuratorProjection.java    |    1 -
 curator-x-rpc/src/main/scripts/generate.sh      |    3 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |   44 +-
 .../curator/generated/CuratorService.java       |  133 +-
 .../curator/generated/DiscoveryInstance.java    | 1201 ++++
 .../generated/DiscoveryInstanceType.java        |   48 +
 .../curator/generated/DiscoveryProjection.java  |  388 ++
 .../generated/DiscoveryProviderProjection.java  |  388 ++
 .../curator/generated/DiscoveryService.java     | 6059 ++++++++++++++++++
 .../generated/DiscoveryServiceLowLevel.java     | 3339 ++++++++++
 .../curator/generated/ProviderStrategyType.java |   51 +
 22 files changed, 12135 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
index 6aeaa94..3f13a81 100644
--- a/curator-x-rpc/pom.xml
+++ b/curator-x-rpc/pom.xml
@@ -31,6 +31,25 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.curator</groupId>
+            <artifactId>curator-x-discovery</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>log4j-over-slf4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
             <groupId>com.facebook.swift</groupId>
             <artifactId>swift-service</artifactId>
             <exclusions>

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index 78f8eaa..a0f7817 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -30,6 +30,8 @@ import com.google.common.io.Resources;
 import org.apache.curator.x.rpc.configuration.Configuration;
 import org.apache.curator.x.rpc.configuration.ConfigurationBuilder;
 import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.idl.discovery.DiscoveryService;
+import org.apache.curator.x.rpc.idl.discovery.DiscoveryServiceLowLevel;
 import org.apache.curator.x.rpc.idl.services.EventService;
 import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
 import org.slf4j.Logger;
@@ -97,8 +99,10 @@ public class CuratorProjectionServer
         this.configuration = configuration;
         connectionManager = new ConnectionManager(configuration.getConnections(), configuration.getProjectionExpiration().toMillis());
         EventService eventService = new EventService(connectionManager, configuration.getPingTime().toMillis());
+        DiscoveryService discoveryService = new DiscoveryService(connectionManager);
         CuratorProjectionService projectionService = new CuratorProjectionService(connectionManager);
-        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), Lists.<ThriftEventHandler>newArrayList(), projectionService, eventService);
+        DiscoveryServiceLowLevel discoveryServiceLowLevel = new DiscoveryServiceLowLevel(connectionManager);
+        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), Lists.<ThriftEventHandler>newArrayList(), projectionService, eventService, discoveryService, discoveryServiceLowLevel);
         server = new ThriftServer(processor, configuration.getThrift());
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index 9e57c6f..d157c27 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -1,5 +1,6 @@
 package org.apache.curator.x.rpc.connections;
 
+import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Queues;
 import org.apache.curator.framework.CuratorFramework;
@@ -25,6 +26,13 @@ public class CuratorEntry implements Closeable
     private final AtomicReference<State> state = new AtomicReference<State>(State.OPEN);
     private final Map<String, Entry> things = Maps.newConcurrentMap();
 
+    public static <T> T mustGetThing(CuratorEntry entry, String id, Class<T> clazz)
+    {
+        T thing = entry.getThing(id, clazz);
+        Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
+        return thing;
+    }
+
     private static class Entry
     {
         final Object thing;

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
new file mode 100644
index 0000000..94e6307
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
@@ -0,0 +1,66 @@
+package org.apache.curator.x.rpc.idl.discovery;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import org.apache.curator.x.discovery.ServiceInstance;
+
+@ThriftStruct
+public class DiscoveryInstance
+{
+    @ThriftField(1)
+    public String name;
+
+    @ThriftField(2)
+    public String id;
+
+    @ThriftField(3)
+    public String address;
+
+    @ThriftField(4)
+    public Integer port;
+
+    @ThriftField(5)
+    public Integer sslPort;
+
+    @ThriftField(6)
+    public byte[] payload;
+
+    @ThriftField(7)
+    public long registrationTimeUTC;
+
+    @ThriftField(8)
+    public DiscoveryInstanceType serviceType;
+
+    @ThriftField(9)
+    public String uriSpec;
+
+    public DiscoveryInstance()
+    {
+    }
+
+    public DiscoveryInstance(ServiceInstance<byte[]> instance)
+    {
+        this.name = instance.getName();
+        this.id = instance.getId();
+        this.address = instance.getAddress();
+        this.port = instance.getPort();
+        this.sslPort = instance.getSslPort();
+        this.payload = instance.getPayload();
+        this.registrationTimeUTC = instance.getRegistrationTimeUTC();
+        this.serviceType = DiscoveryInstanceType.valueOf(instance.getServiceType().name());
+        this.uriSpec = instance.buildUriSpec();
+    }
+
+    public DiscoveryInstance(String name, String id, String address, Integer port, Integer sslPort, byte[] payload, long registrationTimeUTC, DiscoveryInstanceType serviceType, String uriSpec)
+    {
+        this.name = name;
+        this.id = id;
+        this.address = address;
+        this.port = port;
+        this.sslPort = sslPort;
+        this.payload = payload;
+        this.registrationTimeUTC = registrationTimeUTC;
+        this.serviceType = serviceType;
+        this.uriSpec = uriSpec;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
new file mode 100644
index 0000000..ac7cc5d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
@@ -0,0 +1,8 @@
+package org.apache.curator.x.rpc.idl.discovery;
+
+public enum DiscoveryInstanceType
+{
+    DYNAMIC,
+    STATIC,
+    PERMANENT
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java
new file mode 100644
index 0000000..6b1e0f4
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.discovery;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class DiscoveryProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public DiscoveryProjection()
+    {
+    }
+
+    public DiscoveryProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java
new file mode 100644
index 0000000..c8655fa
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.discovery;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class DiscoveryProviderProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public DiscoveryProviderProjection()
+    {
+    }
+
+    public DiscoveryProviderProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
new file mode 100644
index 0000000..edfc141
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -0,0 +1,211 @@
+package org.apache.curator.x.rpc.idl.discovery;
+
+import com.facebook.swift.service.ThriftMethod;
+import com.facebook.swift.service.ThriftService;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import org.apache.curator.x.discovery.DownInstancePolicy;
+import org.apache.curator.x.discovery.ProviderStrategy;
+import org.apache.curator.x.discovery.ServiceDiscovery;
+import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
+import org.apache.curator.x.discovery.ServiceInstance;
+import org.apache.curator.x.discovery.ServiceProvider;
+import org.apache.curator.x.discovery.strategies.RandomStrategy;
+import org.apache.curator.x.discovery.strategies.RoundRobinStrategy;
+import org.apache.curator.x.discovery.strategies.StickyStrategy;
+import org.apache.curator.x.rpc.connections.Closer;
+import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.connections.CuratorEntry;
+import org.apache.curator.x.rpc.idl.exceptions.RpcException;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@ThriftService
+public class DiscoveryService
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private final ConnectionManager connectionManager;
+
+    public DiscoveryService(ConnectionManager connectionManager)
+    {
+        this.connectionManager = connectionManager;
+    }
+
+    @ThriftMethod
+    public DiscoveryProjection startDiscovery(CuratorProjection projection, final String basePath, DiscoveryInstance yourInstance) throws RpcException
+    {
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            final ServiceDiscovery<byte[]> serviceDiscovery = ServiceDiscoveryBuilder
+                .builder(byte[].class)
+                .basePath(basePath)
+                .client(entry.getClient())
+                .thisInstance(null) // TODO
+                .build();
+            serviceDiscovery.start();
+
+            Closer closer = new Closer()
+            {
+                @Override
+                public void close()
+                {
+                    try
+                    {
+                        serviceDiscovery.close();
+                    }
+                    catch ( IOException e )
+                    {
+                        log.error("Could not close ServiceDiscovery with basePath: " + basePath, e);
+                    }
+                }
+            };
+            String id = entry.addThing(serviceDiscovery, closer);
+
+            return new DiscoveryProjection(id);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public DiscoveryProviderProjection startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, final String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws RpcException
+    {
+        ProviderStrategy<byte[]> strategy = null;
+        switch ( providerStrategy )
+        {
+            default:
+            case RANDOM:
+            {
+                strategy = new RandomStrategy<byte[]>();
+                break;
+            }
+
+            case STICKY_RANDOM:
+            {
+                strategy = new StickyStrategy<byte[]>(new RandomStrategy<byte[]>());
+                break;
+            }
+
+            case STICKY_ROUND_ROBIN:
+            {
+                strategy = new StickyStrategy<byte[]>(new RoundRobinStrategy<byte[]>());
+                break;
+            }
+
+            case ROUND_ROBIN:
+            {
+                strategy = new RoundRobinStrategy<byte[]>();
+                break;
+            }
+        }
+
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+        final ServiceProvider<byte[]> serviceProvider = serviceDiscovery
+            .serviceProviderBuilder()
+            .downInstancePolicy(new DownInstancePolicy(downTimeoutMs, TimeUnit.MILLISECONDS, downErrorThreshold))
+            .providerStrategy(strategy)
+            .serviceName(serviceName)
+            .build();
+        try
+        {
+            serviceProvider.start();
+            Closer closer = new Closer()
+            {
+                @Override
+                public void close()
+                {
+                    try
+                    {
+                        serviceProvider.close();
+                    }
+                    catch ( IOException e )
+                    {
+                        log.error("Could not close ServiceProvider with serviceName: " + serviceName, e);
+                    }
+                }
+            };
+            String id = entry.addThing(serviceProvider, closer);
+            return new DiscoveryProviderProjection(id);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public DiscoveryInstance getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceProvider<byte[]> serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
+        try
+        {
+            return new DiscoveryInstance(serviceProvider.getInstance());
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public List<DiscoveryInstance> getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceProvider<byte[]> serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
+        try
+        {
+            List<ServiceInstance<byte[]>> allInstances = Lists.newArrayList(serviceProvider.getAllInstances());
+            return Lists.transform
+            (
+                allInstances,
+                new Function<ServiceInstance<byte[]>, DiscoveryInstance>()
+                {
+                    @Override
+                    public DiscoveryInstance apply(ServiceInstance<byte[]> instance)
+                    {
+                        return new DiscoveryInstance(instance);
+                    }
+                }
+            );
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws RpcException
+    {
+        CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+        @SuppressWarnings("unchecked")
+        ServiceProvider<byte[]> serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
+        try
+        {
+            for ( ServiceInstance<byte[]> instance : serviceProvider.getAllInstances() )
+            {
+                if ( instance.getId().equals(instanceId) )
+                {
+                    serviceProvider.noteError(instance);
+                    break;
+                }
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
new file mode 100644
index 0000000..b08be1d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
@@ -0,0 +1,85 @@
+package org.apache.curator.x.rpc.idl.discovery;
+
+import com.facebook.swift.service.ThriftMethod;
+import com.facebook.swift.service.ThriftService;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import org.apache.curator.x.discovery.DownInstancePolicy;
+import org.apache.curator.x.discovery.ProviderStrategy;
+import org.apache.curator.x.discovery.ServiceDiscovery;
+import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
+import org.apache.curator.x.discovery.ServiceInstance;
+import org.apache.curator.x.discovery.ServiceProvider;
+import org.apache.curator.x.discovery.strategies.RandomStrategy;
+import org.apache.curator.x.discovery.strategies.RoundRobinStrategy;
+import org.apache.curator.x.discovery.strategies.StickyStrategy;
+import org.apache.curator.x.rpc.connections.Closer;
+import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.connections.CuratorEntry;
+import org.apache.curator.x.rpc.idl.exceptions.RpcException;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@ThriftService
+public class DiscoveryServiceLowLevel
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private final ConnectionManager connectionManager;
+
+    public DiscoveryServiceLowLevel(ConnectionManager connectionManager)
+    {
+        this.connectionManager = connectionManager;
+    }
+
+    @ThriftMethod
+    public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
+    {
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            @SuppressWarnings("unchecked")
+            ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+            serviceDiscovery.registerService(null); // TODO
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
+    {
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            @SuppressWarnings("unchecked")
+            ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+            serviceDiscovery.updateService(null); // TODO
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
+    public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
+    {
+        try
+        {
+            CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
+            @SuppressWarnings("unchecked")
+            ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
+            serviceDiscovery.unregisterService(null); // TODO
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
new file mode 100644
index 0000000..2caf0b0
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
@@ -0,0 +1,9 @@
+package org.apache.curator.x.rpc.idl.discovery;
+
+public enum ProviderStrategyType
+{
+    RANDOM,
+    STICKY_RANDOM,
+    STICKY_ROUND_ROBIN,
+    ROUND_ROBIN
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index 07397ea..b7a1145 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -22,7 +22,6 @@ package org.apache.curator.x.rpc.idl.services;
 import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.api.*;
@@ -429,7 +428,7 @@ public class CuratorProjectionService
         {
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-            LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+            LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
             Collection<Participant> participants = leaderLatch.getParticipants();
             return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
                 {
@@ -453,7 +452,7 @@ public class CuratorProjectionService
         {
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-            LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+            LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
             return leaderLatch.hasLeadership();
         }
         catch ( Exception e )
@@ -514,7 +513,7 @@ public class CuratorProjectionService
         {
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-            PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+            PathChildrenCache pathChildrenCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, PathChildrenCache.class);
             return Lists.transform
             (
                 pathChildrenCache.getCurrentData(),
@@ -541,7 +540,7 @@ public class CuratorProjectionService
         {
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-            PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+            PathChildrenCache pathChildrenCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, PathChildrenCache.class);
             return new RpcChildData(pathChildrenCache.getCurrentData(path));
         }
         catch ( Exception e )
@@ -602,7 +601,7 @@ public class CuratorProjectionService
         {
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
 
-            NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
+            NodeCache nodeCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, NodeCache.class);
             return new RpcChildData(nodeCache.getCurrentData());
         }
         catch ( Exception e )
@@ -704,11 +703,4 @@ public class CuratorProjectionService
         }
         throw new Exception("That operation is not available");
     }
-
-    private <T> T getThing(CuratorEntry entry, String id, Class<T> clazz)
-    {
-        T thing = entry.getThing(id, clazz);
-        Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
-        return thing;
-    }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
index a97ca4b..82ea2a3 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
@@ -18,7 +18,6 @@
  */
 package org.apache.curator.x.rpc.idl.structs;
 
-import com.facebook.swift.codec.ThriftConstructor;
 import com.facebook.swift.codec.ThriftField;
 import com.facebook.swift.codec.ThriftStruct;
 

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/scripts/generate.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
index 684d8f5..4c76ffa 100755
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ b/curator-x-rpc/src/main/scripts/generate.sh
@@ -31,7 +31,7 @@ RPC_PATH="$BASE_DIR/curator-x-rpc/target/classes"
 
 CLASSES=""
 
-for p in services structs exceptions; do
+for p in services structs exceptions discovery; do
     for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/$p/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`; do
         if [[ $f != *[\$]* ]]; then
             CLASSES="$CLASSES org.apache.curator.x.rpc.idl.$p.$f";
@@ -45,6 +45,7 @@ PATHS="$1:$2"
 PATHS="$PATHS:$BASE_DIR/curator-client/target/classes"
 PATHS="$PATHS:$BASE_DIR/curator-framework/target/classes"
 PATHS="$PATHS:$BASE_DIR/curator-recipes/target/classes"
+PATHS="$PATHS:$BASE_DIR/curator-x-discovery/target/classes"
 PATHS="$PATHS:$RPC_PATH"
 
 java -cp $PATHS com.facebook.swift.generator.swift2thrift.Main \

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 4de5cff..1008b32 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -43,6 +43,14 @@ enum ZooKeeperExceptionType {
   SYSTEMERROR, RUNTIMEINCONSISTENCY, DATAINCONSISTENCY, CONNECTIONLOSS, MARSHALLINGERROR, UNIMPLEMENTED, OPERATIONTIMEOUT, BADARGUMENTS, APIERROR, NOAUTH, NOCHILDRENFOREPHEMERALS, INVALIDACL, AUTHFAILED, SESSIONEXPIRED, INVALIDCALLBACK, SESSIONMOVED, NOTREADONLY
 }
 
+enum DiscoveryInstanceType {
+  DYNAMIC, STATIC, PERMANENT
+}
+
+enum ProviderStrategyType {
+  RANDOM, STICKY_RANDOM, STICKY_ROUND_ROBIN, ROUND_ROBIN
+}
+
 struct CuratorProjection {
   1: string id;
 }
@@ -143,6 +151,14 @@ struct Version {
   1: i32 version;
 }
 
+struct DiscoveryProjection {
+  1: string id;
+}
+
+struct DiscoveryProviderProjection {
+  1: string id;
+}
+
 struct CreateSpec {
   1: string path;
   2: binary data;
@@ -198,6 +214,18 @@ exception CuratorException {
   4: string message;
 }
 
+struct DiscoveryInstance {
+  1: string name;
+  2: string id;
+  3: string address;
+  4: i32 port;
+  5: i32 sslPort;
+  6: binary payload;
+  7: i64 registrationTimeUTC;
+  8: DiscoveryInstanceType serviceType;
+  9: string uriSpec;
+}
+
 struct CuratorEvent {
   2: CuratorEventType type;
   3: i32 resultCode;
@@ -227,7 +255,7 @@ service CuratorService {
   list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection) throws (1: CuratorException ex1);
   ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path) throws (1: CuratorException ex1);
   bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
-  CuratorProjection newCuratorProjection(1: string connectionName);
+  CuratorProjection newCuratorProjection(1: string connectionName) throws (1: CuratorException ex1);
   oneway void pingCuratorProjection(1: CuratorProjection projection);
   Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec) throws (1: CuratorException ex1);
   LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs) throws (1: CuratorException ex1);
@@ -240,3 +268,17 @@ service CuratorService {
 service EventService {
   CuratorEvent getNextEvent(1: CuratorProjection projection) throws (1: CuratorException ex1);
 }
+
+service DiscoveryService {
+  list<DiscoveryInstance> getAllInstances(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
+  DiscoveryInstance getInstance(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
+  void noteError(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection, 3: string instanceId) throws (1: CuratorException ex1);
+  DiscoveryProjection startDiscovery(1: CuratorProjection projection, 2: string basePath, 3: DiscoveryInstance yourInstance) throws (1: CuratorException ex1);
+  DiscoveryProviderProjection startProvider(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string serviceName, 4: ProviderStrategyType providerStrategy, 5: i32 downTimeoutMs, 6: i32 downErrorThreshold) throws (1: CuratorException ex1);
+}
+
+service DiscoveryServiceLowLevel {
+  void registerInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
+  void unregisterInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
+  void updateInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index e944176..e4281d9 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -62,7 +62,7 @@ public class CuratorService {
 
     public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
 
-    public CuratorProjection newCuratorProjection(String connectionName) throws org.apache.thrift.TException;
+    public CuratorProjection newCuratorProjection(String connectionName) throws CuratorException, org.apache.thrift.TException;
 
     public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
@@ -481,7 +481,7 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isLeader failed: unknown result");
     }
 
-    public CuratorProjection newCuratorProjection(String connectionName) throws org.apache.thrift.TException
+    public CuratorProjection newCuratorProjection(String connectionName) throws CuratorException, org.apache.thrift.TException
     {
       send_newCuratorProjection(connectionName);
       return recv_newCuratorProjection();
@@ -494,13 +494,16 @@ public class CuratorService {
       sendBase("newCuratorProjection", args);
     }
 
-    public CuratorProjection recv_newCuratorProjection() throws org.apache.thrift.TException
+    public CuratorProjection recv_newCuratorProjection() throws CuratorException, org.apache.thrift.TException
     {
       newCuratorProjection_result result = new newCuratorProjection_result();
       receiveBase(result, "newCuratorProjection");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "newCuratorProjection failed: unknown result");
     }
 
@@ -1187,7 +1190,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public CuratorProjection getResult() throws org.apache.thrift.TException {
+      public CuratorProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1835,7 +1838,11 @@ public class CuratorService {
 
       public newCuratorProjection_result getResult(I iface, newCuratorProjection_args args) throws org.apache.thrift.TException {
         newCuratorProjection_result result = new newCuratorProjection_result();
-        result.success = iface.newCuratorProjection(args.connectionName);
+        try {
+          result.success = iface.newCuratorProjection(args.connectionName);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -2780,6 +2787,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             newCuratorProjection_result result = new newCuratorProjection_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -15170,6 +15183,7 @@ public class CuratorService {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("newCuratorProjection_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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -15178,10 +15192,12 @@ public class CuratorService {
     }
 
     public CuratorProjection success; // required
+    public CuratorException ex1; // 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");
+      SUCCESS((short)0, "success"),
+      EX1((short)1, "ex1");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -15198,6 +15214,8 @@ public class CuratorService {
         switch(fieldId) {
           case 0: // SUCCESS
             return SUCCESS;
+          case 1: // EX1
+            return EX1;
           default:
             return null;
         }
@@ -15243,6 +15261,8 @@ public class CuratorService {
       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, CuratorProjection.class)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(newCuratorProjection_result.class, metaDataMap);
     }
@@ -15251,10 +15271,12 @@ public class CuratorService {
     }
 
     public newCuratorProjection_result(
-      CuratorProjection success)
+      CuratorProjection success,
+      CuratorException ex1)
     {
       this();
       this.success = success;
+      this.ex1 = ex1;
     }
 
     /**
@@ -15264,6 +15286,9 @@ public class CuratorService {
       if (other.isSetSuccess()) {
         this.success = new CuratorProjection(other.success);
       }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
     }
 
     public newCuratorProjection_result deepCopy() {
@@ -15273,6 +15298,7 @@ public class CuratorService {
     @Override
     public void clear() {
       this.success = null;
+      this.ex1 = null;
     }
 
     public CuratorProjection getSuccess() {
@@ -15299,6 +15325,30 @@ public class CuratorService {
       }
     }
 
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public newCuratorProjection_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case SUCCESS:
@@ -15309,6 +15359,14 @@ public class CuratorService {
         }
         break;
 
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
       }
     }
 
@@ -15317,6 +15375,9 @@ public class CuratorService {
       case SUCCESS:
         return getSuccess();
 
+      case EX1:
+        return getEx1();
+
       }
       throw new IllegalStateException();
     }
@@ -15330,6 +15391,8 @@ public class CuratorService {
       switch (field) {
       case SUCCESS:
         return isSetSuccess();
+      case EX1:
+        return isSetEx1();
       }
       throw new IllegalStateException();
     }
@@ -15356,6 +15419,15 @@ public class CuratorService {
           return false;
       }
 
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
       return true;
     }
 
@@ -15382,6 +15454,16 @@ public class CuratorService {
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -15409,6 +15491,14 @@ public class CuratorService {
         sb.append(this.success);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -15464,6 +15554,15 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -15484,6 +15583,11 @@ public class CuratorService {
           struct.success.write(oprot);
           oprot.writeFieldEnd();
         }
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -15505,21 +15609,32 @@ public class CuratorService {
         if (struct.isSetSuccess()) {
           optionals.set(0);
         }
-        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
         if (struct.isSetSuccess()) {
           struct.success.write(oprot);
         }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, newCuratorProjection_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
+        BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
           struct.success = new CuratorProjection();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstance.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstance.java
new file mode 100644
index 0000000..b73be31
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstance.java
@@ -0,0 +1,1201 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 DiscoveryInstance implements org.apache.thrift.TBase<DiscoveryInstance, DiscoveryInstance._Fields>, java.io.Serializable, Cloneable, Comparable<DiscoveryInstance> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DiscoveryInstance");
+
+  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)4);
+  private static final org.apache.thrift.protocol.TField SSL_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sslPort", org.apache.thrift.protocol.TType.I32, (short)5);
+  private static final org.apache.thrift.protocol.TField PAYLOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("payload", org.apache.thrift.protocol.TType.STRING, (short)6);
+  private static final org.apache.thrift.protocol.TField REGISTRATION_TIME_UTC_FIELD_DESC = new org.apache.thrift.protocol.TField("registrationTimeUTC", org.apache.thrift.protocol.TType.I64, (short)7);
+  private static final org.apache.thrift.protocol.TField SERVICE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceType", org.apache.thrift.protocol.TType.I32, (short)8);
+  private static final org.apache.thrift.protocol.TField URI_SPEC_FIELD_DESC = new org.apache.thrift.protocol.TField("uriSpec", org.apache.thrift.protocol.TType.STRING, (short)9);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new DiscoveryInstanceStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new DiscoveryInstanceTupleSchemeFactory());
+  }
+
+  public String name; // required
+  public String id; // required
+  public String address; // required
+  public int port; // required
+  public int sslPort; // required
+  public ByteBuffer payload; // required
+  public long registrationTimeUTC; // required
+  /**
+   * 
+   * @see DiscoveryInstanceType
+   */
+  public DiscoveryInstanceType serviceType; // required
+  public String uriSpec; // 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 {
+    NAME((short)1, "name"),
+    ID((short)2, "id"),
+    ADDRESS((short)3, "address"),
+    PORT((short)4, "port"),
+    SSL_PORT((short)5, "sslPort"),
+    PAYLOAD((short)6, "payload"),
+    REGISTRATION_TIME_UTC((short)7, "registrationTimeUTC"),
+    /**
+     * 
+     * @see DiscoveryInstanceType
+     */
+    SERVICE_TYPE((short)8, "serviceType"),
+    URI_SPEC((short)9, "uriSpec");
+
+    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: // NAME
+          return NAME;
+        case 2: // ID
+          return ID;
+        case 3: // ADDRESS
+          return ADDRESS;
+        case 4: // PORT
+          return PORT;
+        case 5: // SSL_PORT
+          return SSL_PORT;
+        case 6: // PAYLOAD
+          return PAYLOAD;
+        case 7: // REGISTRATION_TIME_UTC
+          return REGISTRATION_TIME_UTC;
+        case 8: // SERVICE_TYPE
+          return SERVICE_TYPE;
+        case 9: // URI_SPEC
+          return URI_SPEC;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  private static final int __PORT_ISSET_ID = 0;
+  private static final int __SSLPORT_ISSET_ID = 1;
+  private static final int __REGISTRATIONTIMEUTC_ISSET_ID = 2;
+  private byte __isset_bitfield = 0;
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    tmpMap.put(_Fields.SSL_PORT, new org.apache.thrift.meta_data.FieldMetaData("sslPort", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    tmpMap.put(_Fields.PAYLOAD, new org.apache.thrift.meta_data.FieldMetaData("payload", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+    tmpMap.put(_Fields.REGISTRATION_TIME_UTC, new org.apache.thrift.meta_data.FieldMetaData("registrationTimeUTC", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.SERVICE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("serviceType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DiscoveryInstanceType.class)));
+    tmpMap.put(_Fields.URI_SPEC, new org.apache.thrift.meta_data.FieldMetaData("uriSpec", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DiscoveryInstance.class, metaDataMap);
+  }
+
+  public DiscoveryInstance() {
+  }
+
+  public DiscoveryInstance(
+    String name,
+    String id,
+    String address,
+    int port,
+    int sslPort,
+    ByteBuffer payload,
+    long registrationTimeUTC,
+    DiscoveryInstanceType serviceType,
+    String uriSpec)
+  {
+    this();
+    this.name = name;
+    this.id = id;
+    this.address = address;
+    this.port = port;
+    setPortIsSet(true);
+    this.sslPort = sslPort;
+    setSslPortIsSet(true);
+    this.payload = payload;
+    this.registrationTimeUTC = registrationTimeUTC;
+    setRegistrationTimeUTCIsSet(true);
+    this.serviceType = serviceType;
+    this.uriSpec = uriSpec;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public DiscoveryInstance(DiscoveryInstance other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetName()) {
+      this.name = other.name;
+    }
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+    if (other.isSetAddress()) {
+      this.address = other.address;
+    }
+    this.port = other.port;
+    this.sslPort = other.sslPort;
+    if (other.isSetPayload()) {
+      this.payload = org.apache.thrift.TBaseHelper.copyBinary(other.payload);
+;
+    }
+    this.registrationTimeUTC = other.registrationTimeUTC;
+    if (other.isSetServiceType()) {
+      this.serviceType = other.serviceType;
+    }
+    if (other.isSetUriSpec()) {
+      this.uriSpec = other.uriSpec;
+    }
+  }
+
+  public DiscoveryInstance deepCopy() {
+    return new DiscoveryInstance(this);
+  }
+
+  @Override
+  public void clear() {
+    this.name = null;
+    this.id = null;
+    this.address = null;
+    setPortIsSet(false);
+    this.port = 0;
+    setSslPortIsSet(false);
+    this.sslPort = 0;
+    this.payload = null;
+    setRegistrationTimeUTCIsSet(false);
+    this.registrationTimeUTC = 0;
+    this.serviceType = null;
+    this.uriSpec = null;
+  }
+
+  public String getName() {
+    return this.name;
+  }
+
+  public DiscoveryInstance setName(String name) {
+    this.name = name;
+    return this;
+  }
+
+  public void unsetName() {
+    this.name = null;
+  }
+
+  /** Returns true if field name is set (has been assigned a value) and false otherwise */
+  public boolean isSetName() {
+    return this.name != null;
+  }
+
+  public void setNameIsSet(boolean value) {
+    if (!value) {
+      this.name = null;
+    }
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public DiscoveryInstance setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public String getAddress() {
+    return this.address;
+  }
+
+  public DiscoveryInstance setAddress(String address) {
+    this.address = address;
+    return this;
+  }
+
+  public void unsetAddress() {
+    this.address = null;
+  }
+
+  /** Returns true if field address is set (has been assigned a value) and false otherwise */
+  public boolean isSetAddress() {
+    return this.address != null;
+  }
+
+  public void setAddressIsSet(boolean value) {
+    if (!value) {
+      this.address = null;
+    }
+  }
+
+  public int getPort() {
+    return this.port;
+  }
+
+  public DiscoveryInstance setPort(int port) {
+    this.port = port;
+    setPortIsSet(true);
+    return this;
+  }
+
+  public void unsetPort() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
+  }
+
+  /** Returns true if field port is set (has been assigned a value) and false otherwise */
+  public boolean isSetPort() {
+    return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
+  }
+
+  public void setPortIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
+  }
+
+  public int getSslPort() {
+    return this.sslPort;
+  }
+
+  public DiscoveryInstance setSslPort(int sslPort) {
+    this.sslPort = sslPort;
+    setSslPortIsSet(true);
+    return this;
+  }
+
+  public void unsetSslPort() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SSLPORT_ISSET_ID);
+  }
+
+  /** Returns true if field sslPort is set (has been assigned a value) and false otherwise */
+  public boolean isSetSslPort() {
+    return EncodingUtils.testBit(__isset_bitfield, __SSLPORT_ISSET_ID);
+  }
+
+  public void setSslPortIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SSLPORT_ISSET_ID, value);
+  }
+
+  public byte[] getPayload() {
+    setPayload(org.apache.thrift.TBaseHelper.rightSize(payload));
+    return payload == null ? null : payload.array();
+  }
+
+  public ByteBuffer bufferForPayload() {
+    return payload;
+  }
+
+  public DiscoveryInstance setPayload(byte[] payload) {
+    setPayload(payload == null ? (ByteBuffer)null : ByteBuffer.wrap(payload));
+    return this;
+  }
+
+  public DiscoveryInstance setPayload(ByteBuffer payload) {
+    this.payload = payload;
+    return this;
+  }
+
+  public void unsetPayload() {
+    this.payload = null;
+  }
+
+  /** Returns true if field payload is set (has been assigned a value) and false otherwise */
+  public boolean isSetPayload() {
+    return this.payload != null;
+  }
+
+  public void setPayloadIsSet(boolean value) {
+    if (!value) {
+      this.payload = null;
+    }
+  }
+
+  public long getRegistrationTimeUTC() {
+    return this.registrationTimeUTC;
+  }
+
+  public DiscoveryInstance setRegistrationTimeUTC(long registrationTimeUTC) {
+    this.registrationTimeUTC = registrationTimeUTC;
+    setRegistrationTimeUTCIsSet(true);
+    return this;
+  }
+
+  public void unsetRegistrationTimeUTC() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REGISTRATIONTIMEUTC_ISSET_ID);
+  }
+
+  /** Returns true if field registrationTimeUTC is set (has been assigned a value) and false otherwise */
+  public boolean isSetRegistrationTimeUTC() {
+    return EncodingUtils.testBit(__isset_bitfield, __REGISTRATIONTIMEUTC_ISSET_ID);
+  }
+
+  public void setRegistrationTimeUTCIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REGISTRATIONTIMEUTC_ISSET_ID, value);
+  }
+
+  /**
+   * 
+   * @see DiscoveryInstanceType
+   */
+  public DiscoveryInstanceType getServiceType() {
+    return this.serviceType;
+  }
+
+  /**
+   * 
+   * @see DiscoveryInstanceType
+   */
+  public DiscoveryInstance setServiceType(DiscoveryInstanceType serviceType) {
+    this.serviceType = serviceType;
+    return this;
+  }
+
+  public void unsetServiceType() {
+    this.serviceType = null;
+  }
+
+  /** Returns true if field serviceType is set (has been assigned a value) and false otherwise */
+  public boolean isSetServiceType() {
+    return this.serviceType != null;
+  }
+
+  public void setServiceTypeIsSet(boolean value) {
+    if (!value) {
+      this.serviceType = null;
+    }
+  }
+
+  public String getUriSpec() {
+    return this.uriSpec;
+  }
+
+  public DiscoveryInstance setUriSpec(String uriSpec) {
+    this.uriSpec = uriSpec;
+    return this;
+  }
+
+  public void unsetUriSpec() {
+    this.uriSpec = null;
+  }
+
+  /** Returns true if field uriSpec is set (has been assigned a value) and false otherwise */
+  public boolean isSetUriSpec() {
+    return this.uriSpec != null;
+  }
+
+  public void setUriSpecIsSet(boolean value) {
+    if (!value) {
+      this.uriSpec = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case NAME:
+      if (value == null) {
+        unsetName();
+      } else {
+        setName((String)value);
+      }
+      break;
+
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    case ADDRESS:
+      if (value == null) {
+        unsetAddress();
+      } else {
+        setAddress((String)value);
+      }
+      break;
+
+    case PORT:
+      if (value == null) {
+        unsetPort();
+      } else {
+        setPort((Integer)value);
+      }
+      break;
+
+    case SSL_PORT:
+      if (value == null) {
+        unsetSslPort();
+      } else {
+        setSslPort((Integer)value);
+      }
+      break;
+
+    case PAYLOAD:
+      if (value == null) {
+        unsetPayload();
+      } else {
+        setPayload((ByteBuffer)value);
+      }
+      break;
+
+    case REGISTRATION_TIME_UTC:
+      if (value == null) {
+        unsetRegistrationTimeUTC();
+      } else {
+        setRegistrationTimeUTC((Long)value);
+      }
+      break;
+
+    case SERVICE_TYPE:
+      if (value == null) {
+        unsetServiceType();
+      } else {
+        setServiceType((DiscoveryInstanceType)value);
+      }
+      break;
+
+    case URI_SPEC:
+      if (value == null) {
+        unsetUriSpec();
+      } else {
+        setUriSpec((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case NAME:
+      return getName();
+
+    case ID:
+      return getId();
+
+    case ADDRESS:
+      return getAddress();
+
+    case PORT:
+      return Integer.valueOf(getPort());
+
+    case SSL_PORT:
+      return Integer.valueOf(getSslPort());
+
+    case PAYLOAD:
+      return getPayload();
+
+    case REGISTRATION_TIME_UTC:
+      return Long.valueOf(getRegistrationTimeUTC());
+
+    case SERVICE_TYPE:
+      return getServiceType();
+
+    case URI_SPEC:
+      return getUriSpec();
+
+    }
+    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 NAME:
+      return isSetName();
+    case ID:
+      return isSetId();
+    case ADDRESS:
+      return isSetAddress();
+    case PORT:
+      return isSetPort();
+    case SSL_PORT:
+      return isSetSslPort();
+    case PAYLOAD:
+      return isSetPayload();
+    case REGISTRATION_TIME_UTC:
+      return isSetRegistrationTimeUTC();
+    case SERVICE_TYPE:
+      return isSetServiceType();
+    case URI_SPEC:
+      return isSetUriSpec();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof DiscoveryInstance)
+      return this.equals((DiscoveryInstance)that);
+    return false;
+  }
+
+  public boolean equals(DiscoveryInstance that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_name = true && this.isSetName();
+    boolean that_present_name = true && that.isSetName();
+    if (this_present_name || that_present_name) {
+      if (!(this_present_name && that_present_name))
+        return false;
+      if (!this.name.equals(that.name))
+        return false;
+    }
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    boolean this_present_address = true && this.isSetAddress();
+    boolean that_present_address = true && that.isSetAddress();
+    if (this_present_address || that_present_address) {
+      if (!(this_present_address && that_present_address))
+        return false;
+      if (!this.address.equals(that.address))
+        return false;
+    }
+
+    boolean this_present_port = true;
+    boolean that_present_port = true;
+    if (this_present_port || that_present_port) {
+      if (!(this_present_port && that_present_port))
+        return false;
+      if (this.port != that.port)
+        return false;
+    }
+
+    boolean this_present_sslPort = true;
+    boolean that_present_sslPort = true;
+    if (this_present_sslPort || that_present_sslPort) {
+      if (!(this_present_sslPort && that_present_sslPort))
+        return false;
+      if (this.sslPort != that.sslPort)
+        return false;
+    }
+
+    boolean this_present_payload = true && this.isSetPayload();
+    boolean that_present_payload = true && that.isSetPayload();
+    if (this_present_payload || that_present_payload) {
+      if (!(this_present_payload && that_present_payload))
+        return false;
+      if (!this.payload.equals(that.payload))
+        return false;
+    }
+
+    boolean this_present_registrationTimeUTC = true;
+    boolean that_present_registrationTimeUTC = true;
+    if (this_present_registrationTimeUTC || that_present_registrationTimeUTC) {
+      if (!(this_present_registrationTimeUTC && that_present_registrationTimeUTC))
+        return false;
+      if (this.registrationTimeUTC != that.registrationTimeUTC)
+        return false;
+    }
+
+    boolean this_present_serviceType = true && this.isSetServiceType();
+    boolean that_present_serviceType = true && that.isSetServiceType();
+    if (this_present_serviceType || that_present_serviceType) {
+      if (!(this_present_serviceType && that_present_serviceType))
+        return false;
+      if (!this.serviceType.equals(that.serviceType))
+        return false;
+    }
+
+    boolean this_present_uriSpec = true && this.isSetUriSpec();
+    boolean that_present_uriSpec = true && that.isSetUriSpec();
+    if (this_present_uriSpec || that_present_uriSpec) {
+      if (!(this_present_uriSpec && that_present_uriSpec))
+        return false;
+      if (!this.uriSpec.equals(that.uriSpec))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(DiscoveryInstance other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(other.isSetAddress());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetAddress()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, other.address);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPort()).compareTo(other.isSetPort());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPort()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetSslPort()).compareTo(other.isSetSslPort());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetSslPort()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sslPort, other.sslPort);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPayload()).compareTo(other.isSetPayload());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPayload()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payload, other.payload);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetRegistrationTimeUTC()).compareTo(other.isSetRegistrationTimeUTC());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetRegistrationTimeUTC()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.registrationTimeUTC, other.registrationTimeUTC);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetServiceType()).compareTo(other.isSetServiceType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetServiceType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceType, other.serviceType);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetUriSpec()).compareTo(other.isSetUriSpec());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetUriSpec()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uriSpec, other.uriSpec);
+      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("DiscoveryInstance(");
+    boolean first = true;
+
+    sb.append("name:");
+    if (this.name == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.name);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("address:");
+    if (this.address == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.address);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("port:");
+    sb.append(this.port);
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("sslPort:");
+    sb.append(this.sslPort);
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("payload:");
+    if (this.payload == null) {
+      sb.append("null");
+    } else {
+      org.apache.thrift.TBaseHelper.toString(this.payload, sb);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("registrationTimeUTC:");
+    sb.append(this.registrationTimeUTC);
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("serviceType:");
+    if (this.serviceType == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.serviceType);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("uriSpec:");
+    if (this.uriSpec == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.uriSpec);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+      __isset_bitfield = 0;
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class DiscoveryInstanceStandardSchemeFactory implements SchemeFactory {
+    public DiscoveryInstanceStandardScheme getScheme() {
+      return new DiscoveryInstanceStandardScheme();
+    }
+  }
+
+  private static class DiscoveryInstanceStandardScheme extends StandardScheme<DiscoveryInstance> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, DiscoveryInstance 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: // NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.name = iprot.readString();
+              struct.setNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // ADDRESS
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.address = iprot.readString();
+              struct.setAddressIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PORT
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.port = iprot.readI32();
+              struct.setPortIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // SSL_PORT
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.sslPort = iprot.readI32();
+              struct.setSslPortIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 6: // PAYLOAD
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.payload = iprot.readBinary();
+              struct.setPayloadIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // REGISTRATION_TIME_UTC
+            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+              struct.registrationTimeUTC = iprot.readI64();
+              struct.setRegistrationTimeUTCIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // SERVICE_TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.serviceType = DiscoveryInstanceType.findByValue(iprot.readI32());
+              struct.setServiceTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 9: // URI_SPEC
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.uriSpec = iprot.readString();
+              struct.setUriSpecIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, DiscoveryInstance struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.name != null) {
+        oprot.writeFieldBegin(NAME_FIELD_DESC);
+        oprot.writeString(struct.name);
+        oprot.writeFieldEnd();
+      }
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      if (struct.address != null) {
+        oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
+        oprot.writeString(struct.address);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(PORT_FIELD_DESC);
+      oprot.writeI32(struct.port);
+      oprot.writeFieldEnd();
+      oprot.writeFieldBegin(SSL_PORT_FIELD_DESC);
+      oprot.writeI32(struct.sslPort);
+      oprot.writeFieldEnd();
+      if (struct.payload != null) {
+        oprot.writeFieldBegin(PAYLOAD_FIELD_DESC);
+        oprot.writeBinary(struct.payload);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldBegin(REGISTRATION_TIME_UTC_FIELD_DESC);
+      oprot.writeI64(struct.registrationTimeUTC);
+      oprot.writeFieldEnd();
+      if (struct.serviceType != null) {
+        oprot.writeFieldBegin(SERVICE_TYPE_FIELD_DESC);
+        oprot.writeI32(struct.serviceType.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.uriSpec != null) {
+        oprot.writeFieldBegin(URI_SPEC_FIELD_DESC);
+        oprot.writeString(struct.uriSpec);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class DiscoveryInstanceTupleSchemeFactory implements SchemeFactory {
+    public DiscoveryInstanceTupleScheme getScheme() {
+      return new DiscoveryInstanceTupleScheme();
+    }
+  }
+
+  private static class DiscoveryInstanceTupleScheme extends TupleScheme<DiscoveryInstance> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, DiscoveryInstance struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetName()) {
+        optionals.set(0);
+      }
+      if (struct.isSetId()) {
+        optionals.set(1);
+      }
+      if (struct.isSetAddress()) {
+        optionals.set(2);
+      }
+      if (struct.isSetPort()) {
+        optionals.set(3);
+      }
+      if (struct.isSetSslPort()) {
+        optionals.set(4);
+      }
+      if (struct.isSetPayload()) {
+        optionals.set(5);
+      }
+      if (struct.isSetRegistrationTimeUTC()) {
+        optionals.set(6);
+      }
+      if (struct.isSetServiceType()) {
+        optionals.set(7);
+      }
+      if (struct.isSetUriSpec()) {
+        optionals.set(8);
+      }
+      oprot.writeBitSet(optionals, 9);
+      if (struct.isSetName()) {
+        oprot.writeString(struct.name);
+      }
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+      if (struct.isSetAddress()) {
+        oprot.writeString(struct.address);
+      }
+      if (struct.isSetPort()) {
+        oprot.writeI32(struct.port);
+      }
+      if (struct.isSetSslPort()) {
+        oprot.writeI32(struct.sslPort);
+      }
+      if (struct.isSetPayload()) {
+        oprot.writeBinary(struct.payload);
+      }
+      if (struct.isSetRegistrationTimeUTC()) {
+        oprot.writeI64(struct.registrationTimeUTC);
+      }
+      if (struct.isSetServiceType()) {
+        oprot.writeI32(struct.serviceType.getValue());
+      }
+      if (struct.isSetUriSpec()) {
+        oprot.writeString(struct.uriSpec);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, DiscoveryInstance struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(9);
+      if (incoming.get(0)) {
+        struct.name = iprot.readString();
+        struct.setNameIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.address = iprot.readString();
+        struct.setAddressIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.port = iprot.readI32();
+        struct.setPortIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.sslPort = iprot.readI32();
+        struct.setSslPortIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.payload = iprot.readBinary();
+        struct.setPayloadIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.registrationTimeUTC = iprot.readI64();
+        struct.setRegistrationTimeUTCIsSet(true);
+      }
+      if (incoming.get(7)) {
+        struct.serviceType = DiscoveryInstanceType.findByValue(iprot.readI32());
+        struct.setServiceTypeIsSet(true);
+      }
+      if (incoming.get(8)) {
+        struct.uriSpec = iprot.readString();
+        struct.setUriSpecIsSet(true);
+      }
+    }
+  }
+
+}
+


[11/50] [abbrv] refactoring

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 204ef7d..7917a32 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -41,10 +41,6 @@ struct ExistsSpec {
   3: string asyncContext;
 }
 
-struct GenericProjection {
-  1: string id;
-}
-
 struct GetChildrenSpec {
   1: string path;
   2: bool watched;
@@ -58,51 +54,47 @@ struct GetDataSpec {
   4: bool decompressed;
 }
 
-struct LeaderProjection {
-  1: string id;
+struct LeaderEvent {
+  1: string path;
+  2: string participantId;
+  3: bool isLeader;
 }
 
-struct LeaseProjection {
+struct LeaderProjection {
   1: string id;
 }
 
-struct LockProjection {
-  1: string id;
+struct LeaderResult {
+  1: LeaderProjection projection;
+  2: bool hasLeadership;
 }
 
-struct NodeCacheProjection {
+struct LeaseProjection {
   1: string id;
 }
 
-struct PathChildrenCacheProjection {
+struct LockProjection {
   1: string id;
 }
 
-struct PersistentEphemeralNodeProjection {
+struct NodeCacheProjection {
   1: string id;
 }
 
-struct Version {
-  1: i32 version;
+struct OptionalChildrenList {
+  1: list<string> children;
 }
 
-struct LeaderEvent {
+struct OptionalPath {
   1: string path;
-  2: string participantId;
-  3: bool isLeader;
 }
 
-struct LeaderResult {
-  1: LeaderProjection projection;
-  2: bool hasLeadership;
-}
-
-struct OptionalChildrenList {
-  1: list<string> children;
+struct PathChildrenCacheProjection {
+  1: string id;
 }
 
-struct OptionalPath {
-  1: string path;
+struct PersistentEphemeralNodeProjection {
+  1: string id;
 }
 
 struct Id {
@@ -135,6 +127,10 @@ struct WatchedEvent {
   3: string path;
 }
 
+struct Version {
+  1: i32 version;
+}
+
 struct CreateSpec {
   1: string path;
   2: binary data;
@@ -153,15 +149,6 @@ struct DeleteSpec {
   5: Version version;
 }
 
-struct SetDataSpec {
-  1: string path;
-  2: bool watched;
-  3: string asyncContext;
-  4: bool compressed;
-  5: Version version;
-  6: binary data;
-}
-
 struct OptionalStat {
   1: Stat stat;
 }
@@ -183,6 +170,15 @@ struct PathChildrenCacheEvent {
   3: ChildData data;
 }
 
+struct SetDataSpec {
+  1: string path;
+  2: bool watched;
+  3: string asyncContext;
+  4: bool compressed;
+  5: Version version;
+  6: binary data;
+}
+
 struct CuratorEvent {
   2: CuratorEventType type;
   3: i32 resultCode;
@@ -200,7 +196,7 @@ struct CuratorEvent {
 
 service CuratorService {
   LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs);
-  void closeCuratorProjection(1: CuratorProjection projection);
+  oneway void closeCuratorProjection(1: CuratorProjection projection);
   bool closeGenericProjection(1: CuratorProjection curatorProjection, 2: string id);
   OptionalPath createNode(1: CuratorProjection projection, 2: CreateSpec spec);
   void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec);

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index 5e85d1e..ecc0457 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -174,7 +174,6 @@ public class CuratorService {
     public void closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
     {
       send_closeCuratorProjection(projection);
-      recv_closeCuratorProjection();
     }
 
     public void send_closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
@@ -184,13 +183,6 @@ public class CuratorService {
       sendBase("closeCuratorProjection", args);
     }
 
-    public void recv_closeCuratorProjection() throws org.apache.thrift.TException
-    {
-      closeCuratorProjection_result result = new closeCuratorProjection_result();
-      receiveBase(result, "closeCuratorProjection");
-      return;
-    }
-
     public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException
     {
       send_closeGenericProjection(curatorProjection, id);
@@ -710,7 +702,7 @@ public class CuratorService {
     public static class closeCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
       private CuratorProjection projection;
       public closeCuratorProjection_call(CuratorProjection projection, 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);
+        super(client, protocolFactory, transport, resultHandler, true);
         this.projection = projection;
       }
 
@@ -728,7 +720,6 @@ public class CuratorService {
         }
         org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
         org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
-        (new Client(prot)).recv_closeCuratorProjection();
       }
     }
 
@@ -1496,13 +1487,12 @@ public class CuratorService {
       }
 
       protected boolean isOneway() {
-        return false;
+        return true;
       }
 
-      public closeCuratorProjection_result getResult(I iface, closeCuratorProjection_args args) throws org.apache.thrift.TException {
-        closeCuratorProjection_result result = new closeCuratorProjection_result();
+      public org.apache.thrift.TBase getResult(I iface, closeCuratorProjection_args args) throws org.apache.thrift.TException {
         iface.closeCuratorProjection(args.projection);
-        return result;
+        return null;
       }
     }
 
@@ -1988,36 +1978,14 @@ public class CuratorService {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
         return new AsyncMethodCallback<Void>() { 
           public void onComplete(Void o) {
-            closeCuratorProjection_result result = new closeCuratorProjection_result();
-            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;
-            closeCuratorProjection_result result = new closeCuratorProjection_result();
-            {
-              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;
+        return true;
       }
 
       public void start(I iface, closeCuratorProjection_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
@@ -4249,252 +4217,6 @@ public class CuratorService {
 
   }
 
-  public static class closeCuratorProjection_result implements org.apache.thrift.TBase<closeCuratorProjection_result, closeCuratorProjection_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeCuratorProjection_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeCuratorProjection_result");
-
-
-    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-    static {
-      schemes.put(StandardScheme.class, new closeCuratorProjection_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new closeCuratorProjection_resultTupleSchemeFactory());
-    }
-
-
-    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-;
-
-      private static final 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) {
-          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;
-      }
-    }
-    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);
-      metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeCuratorProjection_result.class, metaDataMap);
-    }
-
-    public closeCuratorProjection_result() {
-    }
-
-    /**
-     * Performs a deep copy on <i>other</i>.
-     */
-    public closeCuratorProjection_result(closeCuratorProjection_result other) {
-    }
-
-    public closeCuratorProjection_result deepCopy() {
-      return new closeCuratorProjection_result(this);
-    }
-
-    @Override
-    public void clear() {
-    }
-
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      }
-      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) {
-      }
-      throw new IllegalStateException();
-    }
-
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof closeCuratorProjection_result)
-        return this.equals((closeCuratorProjection_result)that);
-      return false;
-    }
-
-    public boolean equals(closeCuratorProjection_result that) {
-      if (that == null)
-        return false;
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      return 0;
-    }
-
-    @Override
-    public int compareTo(closeCuratorProjection_result other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
-
-      int lastComparison = 0;
-
-      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("closeCuratorProjection_result(");
-      boolean first = true;
-
-      sb.append(")");
-      return sb.toString();
-    }
-
-    public void validate() throws org.apache.thrift.TException {
-      // check for required fields
-      // check for sub-struct validity
-    }
-
-    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-      try {
-        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-      } catch (org.apache.thrift.TException te) {
-        throw new java.io.IOException(te);
-      }
-    }
-
-    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 closeCuratorProjection_resultStandardSchemeFactory implements SchemeFactory {
-      public closeCuratorProjection_resultStandardScheme getScheme() {
-        return new closeCuratorProjection_resultStandardScheme();
-      }
-    }
-
-    private static class closeCuratorProjection_resultStandardScheme extends StandardScheme<closeCuratorProjection_result> {
-
-      public void read(org.apache.thrift.protocol.TProtocol iprot, closeCuratorProjection_result struct) throws org.apache.thrift.TException {
-        org.apache.thrift.protocol.TField schemeField;
-        iprot.readStructBegin();
-        while (true)
-        {
-          schemeField = iprot.readFieldBegin();
-          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
-            break;
-          }
-          switch (schemeField.id) {
-            default:
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-          }
-          iprot.readFieldEnd();
-        }
-        iprot.readStructEnd();
-
-        // check for required fields of primitive type, which can't be checked in the validate method
-        struct.validate();
-      }
-
-      public void write(org.apache.thrift.protocol.TProtocol oprot, closeCuratorProjection_result struct) throws org.apache.thrift.TException {
-        struct.validate();
-
-        oprot.writeStructBegin(STRUCT_DESC);
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-
-    }
-
-    private static class closeCuratorProjection_resultTupleSchemeFactory implements SchemeFactory {
-      public closeCuratorProjection_resultTupleScheme getScheme() {
-        return new closeCuratorProjection_resultTupleScheme();
-      }
-    }
-
-    private static class closeCuratorProjection_resultTupleScheme extends TupleScheme<closeCuratorProjection_result> {
-
-      @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, closeCuratorProjection_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol oprot = (TTupleProtocol) prot;
-      }
-
-      @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, closeCuratorProjection_result struct) throws org.apache.thrift.TException {
-        TTupleProtocol iprot = (TTupleProtocol) prot;
-      }
-    }
-
-  }
-
   public static class closeGenericProjection_args implements org.apache.thrift.TBase<closeGenericProjection_args, closeGenericProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeGenericProjection_args>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeGenericProjection_args");
 

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/test/java/org/apache/curator/generated/GenericProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/GenericProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/GenericProjection.java
deleted file mode 100644
index a4d7106..0000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/GenericProjection.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- *  @generated
- */
-package org.apache.curator.generated;
-
-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 GenericProjection implements org.apache.thrift.TBase<GenericProjection, GenericProjection._Fields>, java.io.Serializable, Cloneable, Comparable<GenericProjection> {
-  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GenericProjection");
-
-  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
-
-  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
-  static {
-    schemes.put(StandardScheme.class, new GenericProjectionStandardSchemeFactory());
-    schemes.put(TupleScheme.class, new GenericProjectionTupleSchemeFactory());
-  }
-
-  public String id; // 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 {
-    ID((short)1, "id");
-
-    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: // ID
-          return ID;
-        default:
-          return null;
-      }
-    }
-
-    /**
-     * Find the _Fields constant that matches fieldId, throwing an exception
-     * if it is not found.
-     */
-    public static _Fields findByThriftIdOrThrow(int fieldId) {
-      _Fields fields = findByThriftId(fieldId);
-      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    metaDataMap = Collections.unmodifiableMap(tmpMap);
-    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GenericProjection.class, metaDataMap);
-  }
-
-  public GenericProjection() {
-  }
-
-  public GenericProjection(
-    String id)
-  {
-    this();
-    this.id = id;
-  }
-
-  /**
-   * Performs a deep copy on <i>other</i>.
-   */
-  public GenericProjection(GenericProjection other) {
-    if (other.isSetId()) {
-      this.id = other.id;
-    }
-  }
-
-  public GenericProjection deepCopy() {
-    return new GenericProjection(this);
-  }
-
-  @Override
-  public void clear() {
-    this.id = null;
-  }
-
-  public String getId() {
-    return this.id;
-  }
-
-  public GenericProjection setId(String id) {
-    this.id = id;
-    return this;
-  }
-
-  public void unsetId() {
-    this.id = null;
-  }
-
-  /** Returns true if field id is set (has been assigned a value) and false otherwise */
-  public boolean isSetId() {
-    return this.id != null;
-  }
-
-  public void setIdIsSet(boolean value) {
-    if (!value) {
-      this.id = null;
-    }
-  }
-
-  public void setFieldValue(_Fields field, Object value) {
-    switch (field) {
-    case ID:
-      if (value == null) {
-        unsetId();
-      } else {
-        setId((String)value);
-      }
-      break;
-
-    }
-  }
-
-  public Object getFieldValue(_Fields field) {
-    switch (field) {
-    case ID:
-      return getId();
-
-    }
-    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 ID:
-      return isSetId();
-    }
-    throw new IllegalStateException();
-  }
-
-  @Override
-  public boolean equals(Object that) {
-    if (that == null)
-      return false;
-    if (that instanceof GenericProjection)
-      return this.equals((GenericProjection)that);
-    return false;
-  }
-
-  public boolean equals(GenericProjection that) {
-    if (that == null)
-      return false;
-
-    boolean this_present_id = true && this.isSetId();
-    boolean that_present_id = true && that.isSetId();
-    if (this_present_id || that_present_id) {
-      if (!(this_present_id && that_present_id))
-        return false;
-      if (!this.id.equals(that.id))
-        return false;
-    }
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    return 0;
-  }
-
-  @Override
-  public int compareTo(GenericProjection other) {
-    if (!getClass().equals(other.getClass())) {
-      return getClass().getName().compareTo(other.getClass().getName());
-    }
-
-    int lastComparison = 0;
-
-    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetId()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
-      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("GenericProjection(");
-    boolean first = true;
-
-    sb.append("id:");
-    if (this.id == null) {
-      sb.append("null");
-    } else {
-      sb.append(this.id);
-    }
-    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 GenericProjectionStandardSchemeFactory implements SchemeFactory {
-    public GenericProjectionStandardScheme getScheme() {
-      return new GenericProjectionStandardScheme();
-    }
-  }
-
-  private static class GenericProjectionStandardScheme extends StandardScheme<GenericProjection> {
-
-    public void read(org.apache.thrift.protocol.TProtocol iprot, GenericProjection 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: // ID
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.id = iprot.readString();
-              struct.setIdIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          default:
-            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-
-      // check for required fields of primitive type, which can't be checked in the validate method
-      struct.validate();
-    }
-
-    public void write(org.apache.thrift.protocol.TProtocol oprot, GenericProjection struct) throws org.apache.thrift.TException {
-      struct.validate();
-
-      oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.id != null) {
-        oprot.writeFieldBegin(ID_FIELD_DESC);
-        oprot.writeString(struct.id);
-        oprot.writeFieldEnd();
-      }
-      oprot.writeFieldStop();
-      oprot.writeStructEnd();
-    }
-
-  }
-
-  private static class GenericProjectionTupleSchemeFactory implements SchemeFactory {
-    public GenericProjectionTupleScheme getScheme() {
-      return new GenericProjectionTupleScheme();
-    }
-  }
-
-  private static class GenericProjectionTupleScheme extends TupleScheme<GenericProjection> {
-
-    @Override
-    public void write(org.apache.thrift.protocol.TProtocol prot, GenericProjection struct) throws org.apache.thrift.TException {
-      TTupleProtocol oprot = (TTupleProtocol) prot;
-      BitSet optionals = new BitSet();
-      if (struct.isSetId()) {
-        optionals.set(0);
-      }
-      oprot.writeBitSet(optionals, 1);
-      if (struct.isSetId()) {
-        oprot.writeString(struct.id);
-      }
-    }
-
-    @Override
-    public void read(org.apache.thrift.protocol.TProtocol prot, GenericProjection struct) throws org.apache.thrift.TException {
-      TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(1);
-      if (incoming.get(0)) {
-        struct.id = iprot.readString();
-        struct.setIdIsSet(true);
-      }
-    }
-  }
-
-}
-


[49/50] [abbrv] git commit: javadoc plugin needs more memory

Posted by ra...@apache.org.
javadoc plugin needs more memory


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/64e5cfec
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/64e5cfec
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/64e5cfec

Branch: refs/heads/master
Commit: 64e5cfec37e1a20d4ea925fbb401774fa370995c
Parents: 0a558a3
Author: randgalt <ra...@apache.org>
Authored: Tue Jun 3 13:04:55 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue Jun 3 13:04:55 2014 -0500

----------------------------------------------------------------------
 pom.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/64e5cfec/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 837908e..812198d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -66,7 +66,6 @@
         <maven-compiler-plugin-version>3.1</maven-compiler-plugin-version>
         <maven-bundle-plugin-version>2.3.7</maven-bundle-plugin-version>
         <maven-surefire-plugin-version>2.17</maven-surefire-plugin-version>
-        <maven-javadoc-plugin-version>2.9.1</maven-javadoc-plugin-version>
         <maven-site-plugin-version>3.3</maven-site-plugin-version>
         <doxia-module-confluence-version>1.5</doxia-module-confluence-version>
         <maven-scm-publish-plugin-version>1.0</maven-scm-publish-plugin-version>
@@ -479,6 +478,9 @@
                 <version>${maven-javadoc-plugin-version}</version>
                 <configuration>
                     <aggregate>true</aggregate>
+                    <additionalJOptions>
+                        <additionalJOption>-J-Xmx1g</additionalJOption>
+                    </additionalJOptions>
                 </configuration>
             </plugin>
         </plugins>
@@ -646,6 +648,9 @@
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
                     <aggregate>true</aggregate>
+                    <additionalJOptions>
+                        <additionalJOption>-J-Xmx1g</additionalJOption>
+                    </additionalJOptions>
                 </configuration>
             </plugin>
 


[24/50] [abbrv] git commit: service discovery is feature complete - needs testing

Posted by ra...@apache.org.
service discovery is feature complete - needs testing


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2998114b
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2998114b
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2998114b

Branch: refs/heads/master
Commit: 2998114ba1674746777f82554cd031131e4c721c
Parents: b79909a
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 17:29:39 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 17:29:39 2014 -0500

----------------------------------------------------------------------
 .../org/apache/curator/x/discovery/ServiceInstance.java     | 2 +-
 .../curator/x/rpc/idl/discovery/DiscoveryInstance.java      | 7 +++++++
 .../curator/x/rpc/idl/discovery/DiscoveryService.java       | 2 +-
 .../x/rpc/idl/discovery/DiscoveryServiceLowLevel.java       | 9 +++------
 4 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/2998114b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
index 3572be6..29779b1 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
@@ -75,7 +75,7 @@ public class ServiceInstance<T>
      * @param serviceType type of the service
      * @param uriSpec the uri spec or null
      */
-    ServiceInstance(String name, String id, String address, Integer port, Integer sslPort, T payload, long registrationTimeUTC, ServiceType serviceType, UriSpec uriSpec)
+    public ServiceInstance(String name, String id, String address, Integer port, Integer sslPort, T payload, long registrationTimeUTC, ServiceType serviceType, UriSpec uriSpec)
     {
         name = Preconditions.checkNotNull(name, "name cannot be null");
         id = Preconditions.checkNotNull(id, "id cannot be null");

http://git-wip-us.apache.org/repos/asf/curator/blob/2998114b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
index 4cd67d6..a6f35cd 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
@@ -3,6 +3,8 @@ package org.apache.curator.x.rpc.idl.discovery;
 import com.facebook.swift.codec.ThriftField;
 import com.facebook.swift.codec.ThriftStruct;
 import org.apache.curator.x.discovery.ServiceInstance;
+import org.apache.curator.x.discovery.ServiceType;
+import org.apache.curator.x.discovery.UriSpec;
 
 @ThriftStruct
 public class DiscoveryInstance
@@ -66,4 +68,9 @@ public class DiscoveryInstance
         this.serviceType = serviceType;
         this.uriSpec = uriSpec;
     }
+
+    public ServiceInstance<byte[]> toReal()
+    {
+        return new ServiceInstance<byte[]>(name, id, address, port, sslPort, payload, registrationTimeUTC, ServiceType.valueOf(serviceType.name()), new UriSpec(uriSpec));
+    }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/2998114b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
index 5ed9a01..a85f113 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -47,7 +47,7 @@ public class DiscoveryService
                 .builder(byte[].class)
                 .basePath(basePath)
                 .client(entry.getClient())
-                .thisInstance(null) // TODO
+                .thisInstance(yourInstance.toReal())
                 .build();
             serviceDiscovery.start();
 

http://git-wip-us.apache.org/repos/asf/curator/blob/2998114b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
index fa7dbfe..4c6945f 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
@@ -10,14 +10,11 @@ import org.apache.curator.x.rpc.connections.ConnectionManager;
 import org.apache.curator.x.rpc.connections.CuratorEntry;
 import org.apache.curator.x.rpc.idl.exceptions.RpcException;
 import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import java.util.Collection;
 
 @ThriftService
 public class DiscoveryServiceLowLevel
 {
-    private final Logger log = LoggerFactory.getLogger(getClass());
     private final ConnectionManager connectionManager;
 
     public DiscoveryServiceLowLevel(ConnectionManager connectionManager)
@@ -33,7 +30,7 @@ public class DiscoveryServiceLowLevel
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
             @SuppressWarnings("unchecked")
             ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
-            serviceDiscovery.registerService(null); // TODO
+            serviceDiscovery.registerService(instance.toReal());
         }
         catch ( Exception e )
         {
@@ -49,7 +46,7 @@ public class DiscoveryServiceLowLevel
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
             @SuppressWarnings("unchecked")
             ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
-            serviceDiscovery.updateService(null); // TODO
+            serviceDiscovery.updateService(instance.toReal());
         }
         catch ( Exception e )
         {
@@ -65,7 +62,7 @@ public class DiscoveryServiceLowLevel
             CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
             @SuppressWarnings("unchecked")
             ServiceDiscovery<byte[]> serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
-            serviceDiscovery.unregisterService(null); // TODO
+            serviceDiscovery.unregisterService(instance.toReal());
         }
         catch ( Exception e )
         {


[12/50] [abbrv] refactoring

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/RpcCreateMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/RpcCreateMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/RpcCreateMode.java
deleted file mode 100644
index 3ef6b45..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/RpcCreateMode.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("CreateMode")
-public enum RpcCreateMode
-{
-    PERSISTENT,
-    PERSISTENT_SEQUENTIAL,
-    EPHEMERAL,
-    EPHEMERAL_SEQUENTIAL
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/SetDataSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/SetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/SetDataSpec.java
deleted file mode 100644
index 195e620..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/SetDataSpec.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class SetDataSpec
-{
-    @ThriftField(1)
-    public String path;
-
-    @ThriftField(2)
-    public boolean watched;
-
-    @ThriftField(3)
-    public String asyncContext;
-
-    @ThriftField(4)
-    public boolean compressed;
-
-    @ThriftField(5)
-    public Version version;
-
-    @ThriftField(6)
-    public byte[] data;
-
-    public SetDataSpec()
-    {
-    }
-
-    public SetDataSpec(String path, boolean watched, String asyncContext, boolean compressed, Version version, byte[] data)
-    {
-        this.path = path;
-        this.watched = watched;
-        this.asyncContext = asyncContext;
-        this.compressed = compressed;
-        this.version = version;
-        this.data = data;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/Version.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/Version.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/Version.java
deleted file mode 100644
index 172704b..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/Version.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class Version
-{
-    @ThriftField(1)
-    public int version;
-
-    public Version()
-    {
-    }
-
-    public Version(int version)
-    {
-        this.version = version;
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
new file mode 100644
index 0000000..7e9e9c1
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -0,0 +1,592 @@
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.services;
+
+import com.facebook.swift.service.ThriftMethod;
+import com.facebook.swift.service.ThriftService;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.api.*;
+import org.apache.curator.framework.recipes.cache.ChildData;
+import org.apache.curator.framework.recipes.cache.NodeCache;
+import org.apache.curator.framework.recipes.cache.NodeCacheListener;
+import org.apache.curator.framework.recipes.cache.PathChildrenCache;
+import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
+import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
+import org.apache.curator.framework.recipes.leader.LeaderLatch;
+import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
+import org.apache.curator.framework.recipes.leader.Participant;
+import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
+import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2;
+import org.apache.curator.framework.recipes.locks.Lease;
+import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.curator.utils.ThreadUtils;
+import org.apache.curator.x.rpc.connections.Closer;
+import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.connections.CuratorEntry;
+import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
+import org.apache.curator.x.rpc.details.RpcWatcher;
+import org.apache.curator.x.rpc.idl.structs.*;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.data.Stat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+@ThriftService("CuratorService")
+public class CuratorProjectionService
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    private final ConnectionManager connectionManager;
+
+    public CuratorProjectionService(ConnectionManager connectionManager)
+    {
+        this.connectionManager = connectionManager;
+    }
+
+    @ThriftMethod
+    public CuratorProjection newCuratorProjection(String connectionName)
+    {
+        CuratorFramework client = connectionManager.newConnection(connectionName);
+
+        String id = CuratorEntry.newId();
+        client.start();
+        connectionManager.add(id, client);
+        final CuratorProjection projection = new CuratorProjection(id);
+
+        ConnectionStateListener listener = new ConnectionStateListener()
+        {
+            @Override
+            public void stateChanged(CuratorFramework client, ConnectionState newState)
+            {
+                addEvent(projection, new RpcCuratorEvent(newState));
+            }
+        };
+        client.getConnectionStateListenable().addListener(listener);
+
+        return projection;
+    }
+
+    @ThriftMethod(oneway = true)
+    public void closeCuratorProjection(CuratorProjection projection)
+    {
+        CuratorEntry entry = connectionManager.remove(projection.id);
+        if ( entry != null )
+        {
+            entry.close();
+        }
+    }
+
+    @ThriftMethod(oneway = true)
+    public void pingCuratorProjection(CuratorProjection projection)
+    {
+        connectionManager.get(projection.id);
+    }
+
+    @ThriftMethod
+    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.create();
+        if ( spec.creatingParentsIfNeeded )
+        {
+            builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
+        }
+        if ( spec.compressed )
+        {
+            builder = castBuilder(builder, Compressible.class).compressed();
+        }
+        if ( spec.withProtection )
+        {
+            builder = castBuilder(builder, CreateBuilder.class).withProtection();
+        }
+        if ( spec.mode != null )
+        {
+            builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+        }
+
+        Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
+        return new OptionalPath((path != null) ? String.valueOf(path) : null);
+    }
+
+    @ThriftMethod
+    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.delete();
+        if ( spec.guaranteed )
+        {
+            builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
+        }
+        if ( spec.version != null )
+        {
+            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
+        }
+
+        castBuilder(builder, Pathable.class).forPath(spec.path);
+    }
+
+    @ThriftMethod
+    public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.getData();
+        if ( spec.watched )
+        {
+            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+        }
+
+        if ( spec.decompressed )
+        {
+            builder = castBuilder(builder, Decompressible.class).decompressed();
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+        }
+
+        Stat stat = new Stat();
+        builder = castBuilder(builder, Statable.class).storingStatIn(stat);
+
+        return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
+    }
+
+    @ThriftMethod
+    public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.setData();
+        if ( spec.watched )
+        {
+            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+        }
+        if ( spec.version != null )
+        {
+            builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
+        }
+
+        if ( spec.compressed )
+        {
+            builder = castBuilder(builder, Compressible.class).compressed();
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+        }
+
+        Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
+        return RpcCuratorEvent.toRpcStat(stat);
+    }
+
+    @ThriftMethod
+    public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.checkExists();
+        if ( spec.watched )
+        {
+            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+        }
+
+        Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
+        return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
+    }
+
+    @ThriftMethod
+    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws Exception
+    {
+        CuratorFramework client = getEntry(projection).getClient();
+
+        Object builder = client.getChildren();
+        if ( spec.watched )
+        {
+            builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
+        }
+
+        if ( spec.asyncContext != null )
+        {
+            BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
+            builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
+        }
+
+        @SuppressWarnings("unchecked")
+        List<String> children = (List<String>)castBuilder(builder, Pathable.class).forPath(spec.path);
+        return new OptionalChildrenList(children);
+    }
+
+    @ThriftMethod
+    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws Exception
+    {
+        CuratorEntry entry = getEntry(curatorProjection);
+        return entry.closeThing(id);
+    }
+
+    @ThriftMethod
+    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+        final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
+        if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
+        {
+            return new LockProjection();
+        }
+
+        Closer closer = new Closer()
+        {
+            @Override
+            public void close()
+            {
+                if ( lock.isAcquiredInThisProcess() )
+                {
+                    try
+                    {
+                        lock.release();
+                    }
+                    catch ( Exception e )
+                    {
+                        log.error("Could not release left-over lock for path: " + path, e);
+                    }
+                }
+            }
+        };
+        String id = entry.addThing(lock, closer);
+        return new LockProjection(id);
+    }
+
+    @ThriftMethod
+    public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
+        leaderLatch.start();
+
+        Closer closer = new Closer()
+        {
+            @Override
+            public void close()
+            {
+                try
+                {
+                    leaderLatch.close();
+                }
+                catch ( IOException e )
+                {
+                    log.error("Could not close left-over leader latch for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(leaderLatch, closer);
+
+        LeaderLatchListener listener = new LeaderLatchListener()
+        {
+            @Override
+            public void isLeader()
+            {
+                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
+            }
+
+            @Override
+            public void notLeader()
+            {
+                addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
+            }
+        };
+        leaderLatch.addListener(listener);
+
+        if ( waitForLeadershipMs > 0 )
+        {
+            leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
+        }
+
+        return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
+    }
+
+    @ThriftMethod
+    public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+        Collection<Participant> participants = leaderLatch.getParticipants();
+        return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
+            {
+                @Override
+                public RpcParticipant apply(Participant participant)
+                {
+                    return new RpcParticipant(participant.getId(), participant.isLeader());
+                }
+            });
+    }
+
+    @ThriftMethod
+    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
+        return leaderLatch.hasLeadership();
+    }
+
+    @ThriftMethod
+    public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws Exception
+    {
+        final CuratorEntry entry = getEntry(projection);
+
+        final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
+        cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
+
+        Closer closer = new Closer()
+        {
+            @Override
+            public void close()
+            {
+                try
+                {
+                    cache.close();
+                }
+                catch ( IOException e )
+                {
+                    log.error("Could not close left-over PathChildrenCache for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(cache, closer);
+
+        PathChildrenCacheListener listener = new PathChildrenCacheListener()
+        {
+            @Override
+            public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
+            {
+                entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
+            }
+        };
+        cache.getListenable().addListener(listener);
+
+        return new PathChildrenCacheProjection(id);
+    }
+
+    @ThriftMethod
+    public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+        return Lists.transform
+        (
+            pathChildrenCache.getCurrentData(),
+            new Function<ChildData, RpcChildData>()
+            {
+                @Override
+                public RpcChildData apply(ChildData childData)
+                {
+                    return new RpcChildData(childData);
+                }
+            }
+        );
+    }
+
+    @ThriftMethod
+    public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
+        return new RpcChildData(pathChildrenCache.getCurrentData(path));
+    }
+
+    @ThriftMethod
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws Exception
+    {
+        final CuratorEntry entry = getEntry(projection);
+
+        final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
+        cache.start(buildInitial);
+
+        Closer closer = new Closer()
+        {
+            @Override
+            public void close()
+            {
+                try
+                {
+                    cache.close();
+                }
+                catch ( IOException e )
+                {
+                    log.error("Could not close left-over NodeCache for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(cache, closer);
+
+        NodeCacheListener listener = new NodeCacheListener()
+        {
+            @Override
+            public void nodeChanged() throws Exception
+            {
+                entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
+            }
+        };
+        cache.getListenable().addListener(listener);
+
+        return new NodeCacheProjection(id);
+    }
+
+    @ThriftMethod
+    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
+        return new RpcChildData(nodeCache.getCurrentData());
+    }
+
+    @ThriftMethod
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
+        node.start();
+
+        Closer closer = new Closer()
+        {
+            @Override
+            public void close()
+            {
+                try
+                {
+                    node.close();
+                }
+                catch ( Exception e )
+                {
+                    log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
+                }
+            }
+        };
+        String id = entry.addThing(node, closer);
+        return new PersistentEphemeralNodeProjection(id);
+    }
+
+    @ThriftMethod
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
+        final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
+        if ( leases == null )
+        {
+            return Lists.newArrayList();
+        }
+
+        List<LeaseProjection> leaseProjections = Lists.newArrayList();
+        for ( final Lease lease : leases )
+        {
+            Closer closer = new Closer()
+            {
+                @Override
+                public void close()
+                {
+                    try
+                    {
+                        semaphore.returnLease(lease);
+                    }
+                    catch ( Exception e )
+                    {
+                        log.error("Could not release semaphore leases for path: " + path, e);
+                    }
+                }
+            };
+            leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
+        }
+        return leaseProjections;
+    }
+
+    public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
+    {
+        CuratorEntry entry = connectionManager.get(projection.id);
+        if ( entry != null )
+        {
+            entry.addEvent(event);
+        }
+    }
+
+    private CuratorEntry getEntry(CuratorProjection projection) throws Exception
+    {
+        CuratorEntry entry = connectionManager.get(projection.id);
+        if ( entry == null )
+        {
+            throw new Exception("No client found with id: " + projection.id);
+        }
+        return entry;
+    }
+
+    private static <T> T castBuilder(Object createBuilder, Class<T> clazz) throws Exception
+    {
+        if ( clazz.isAssignableFrom(createBuilder.getClass()) )
+        {
+            return clazz.cast(createBuilder);
+        }
+        throw new Exception("That operation is not available");
+    }
+
+    private <T> T getThing(CuratorEntry entry, String id, Class<T> clazz)
+    {
+        T thing = entry.getThing(id, clazz);
+        Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
+        return thing;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
new file mode 100644
index 0000000..c10c5df
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
@@ -0,0 +1,34 @@
+package org.apache.curator.x.rpc.idl.services;
+
+import com.facebook.swift.service.ThriftMethod;
+import com.facebook.swift.service.ThriftService;
+import org.apache.curator.x.rpc.connections.CuratorEntry;
+import org.apache.curator.x.rpc.connections.ConnectionManager;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
+
+@ThriftService("EventService")
+public class EventService
+{
+    private final ConnectionManager connectionManager;
+    private final long pingTimeMs;
+
+    public EventService(ConnectionManager connectionManager, long pingTimeMs)
+    {
+        this.connectionManager = connectionManager;
+        this.pingTimeMs = pingTimeMs;
+    }
+
+    @ThriftMethod
+    public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws InterruptedException
+    {
+        CuratorEntry entry = connectionManager.get(projection.id);
+        if ( entry == null )
+        {
+            // TODO
+            return null;
+        }
+        RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
+        return (event != null) ? event : new RpcCuratorEvent();
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java
new file mode 100644
index 0000000..d0232a9
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class CreateSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public byte[] data;
+
+    @ThriftField(3)
+    public RpcCreateMode mode;
+
+    @ThriftField(4)
+    public String asyncContext;
+
+    @ThriftField(5)
+    public boolean compressed;
+
+    @ThriftField(6)
+    public boolean creatingParentsIfNeeded;
+
+    @ThriftField(7)
+    public boolean withProtection;
+
+    public CreateSpec()
+    {
+    }
+
+    public CreateSpec(String path, byte[] data, RpcCreateMode mode, String asyncContext, boolean compressed, boolean creatingParentsIfNeeded, boolean withProtection)
+    {
+        this.path = path;
+        this.data = data;
+        this.mode = mode;
+        this.asyncContext = asyncContext;
+        this.compressed = compressed;
+        this.creatingParentsIfNeeded = creatingParentsIfNeeded;
+        this.withProtection = withProtection;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
new file mode 100644
index 0000000..a97ca4b
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftConstructor;
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class CuratorProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public CuratorProjection()
+    {
+    }
+
+    public CuratorProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
new file mode 100644
index 0000000..2d418ee
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class DeleteSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public boolean guaranteed;
+
+    @ThriftField(3)
+    public String asyncContext;
+
+    @ThriftField(4)
+    public boolean compressed;
+
+    @ThriftField(5)
+    public Version version;
+
+    public DeleteSpec()
+    {
+    }
+
+    public DeleteSpec(String path, boolean guaranteed, String asyncContext, boolean compressed, Version version)
+    {
+        this.path = path;
+        this.guaranteed = guaranteed;
+        this.asyncContext = asyncContext;
+        this.compressed = compressed;
+        this.version = version;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java
new file mode 100644
index 0000000..f271f7e
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class ExistsSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public boolean watched;
+
+    @ThriftField(3)
+    public String asyncContext;
+
+    public ExistsSpec()
+    {
+    }
+
+    public ExistsSpec(String path, boolean watched, String asyncContext)
+    {
+        this.path = path;
+        this.watched = watched;
+        this.asyncContext = asyncContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java
new file mode 100644
index 0000000..37dea04
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class GetChildrenSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public boolean watched;
+
+    @ThriftField(3)
+    public String asyncContext;
+
+    public GetChildrenSpec()
+    {
+    }
+
+    public GetChildrenSpec(String path, boolean watched, String asyncContext)
+    {
+        this.path = path;
+        this.watched = watched;
+        this.asyncContext = asyncContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java
new file mode 100644
index 0000000..9b741d0
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class GetDataSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public boolean watched;
+
+    @ThriftField(3)
+    public String asyncContext;
+
+    @ThriftField(4)
+    public boolean decompressed;
+
+    public GetDataSpec()
+    {
+    }
+
+    public GetDataSpec(String path, boolean watched, String asyncContext, boolean decompressed)
+    {
+        this.path = path;
+        this.watched = watched;
+        this.asyncContext = asyncContext;
+        this.decompressed = decompressed;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
new file mode 100644
index 0000000..68f3916
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
@@ -0,0 +1,28 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LeaderEvent
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public String participantId;
+
+    @ThriftField(3)
+    public boolean isLeader;
+
+    public LeaderEvent()
+    {
+    }
+
+    public LeaderEvent(String path, String participantId, boolean isLeader)
+    {
+        this.path = path;
+        this.participantId = participantId;
+        this.isLeader = isLeader;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
new file mode 100644
index 0000000..0d12a4c
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LeaderProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public LeaderProjection()
+    {
+    }
+
+    public LeaderProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
new file mode 100644
index 0000000..8161ef4
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
@@ -0,0 +1,24 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LeaderResult
+{
+    @ThriftField(1)
+    public LeaderProjection projection;
+
+    @ThriftField(2)
+    public boolean hasLeadership;
+
+    public LeaderResult()
+    {
+    }
+
+    public LeaderResult(LeaderProjection projection, boolean hasLeadership)
+    {
+        this.projection = projection;
+        this.hasLeadership = hasLeadership;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
new file mode 100644
index 0000000..784bcf6
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LeaseProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public LeaseProjection()
+    {
+    }
+
+    public LeaseProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
new file mode 100644
index 0000000..9421527
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LockProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public LockProjection()
+    {
+    }
+
+    public LockProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
new file mode 100644
index 0000000..3a28704
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class NodeCacheProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public NodeCacheProjection()
+    {
+    }
+
+    public NodeCacheProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
new file mode 100644
index 0000000..6a038bb
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
@@ -0,0 +1,21 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import java.util.List;
+
+@ThriftStruct
+public class OptionalChildrenList
+{
+    @ThriftField(1)
+    public List<String> children;
+
+    public OptionalChildrenList()
+    {
+    }
+
+    public OptionalChildrenList(List<String> children)
+    {
+        this.children = children;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
new file mode 100644
index 0000000..1e48a7d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class OptionalPath
+{
+    @ThriftField(1)
+    public String path;
+
+    public OptionalPath()
+    {
+    }
+
+    public OptionalPath(String path)
+    {
+        this.path = path;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java
new file mode 100644
index 0000000..df0c234
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct("OptionalStat")
+public class OptionalRpcStat
+{
+    @ThriftField(1)
+    public RpcStat stat;
+
+    public OptionalRpcStat()
+    {
+    }
+
+    public OptionalRpcStat(RpcStat stat)
+    {
+        this.stat = stat;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
new file mode 100644
index 0000000..a909c83
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class PathChildrenCacheProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public PathChildrenCacheProjection()
+    {
+    }
+
+    public PathChildrenCacheProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
new file mode 100644
index 0000000..8a5d225
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
@@ -0,0 +1,8 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+public enum PathChildrenCacheStartMode
+{
+    NORMAL,
+    BUILD_INITIAL_CACHE,
+    POST_INITIALIZED_EVENT
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
new file mode 100644
index 0000000..f775d8e
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class PersistentEphemeralNodeProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public PersistentEphemeralNodeProjection()
+    {
+    }
+
+    public PersistentEphemeralNodeProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java
new file mode 100644
index 0000000..c4cb9ac
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct("Acl")
+public class RpcAcl
+{
+    @ThriftField(1)
+    public int perms;
+
+    @ThriftField(2)
+    public RpcId id;
+
+    public RpcAcl()
+    {
+    }
+
+    public RpcAcl(int perms, RpcId id)
+    {
+        this.perms = perms;
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
new file mode 100644
index 0000000..f7862f7
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
@@ -0,0 +1,39 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import org.apache.curator.framework.recipes.cache.ChildData;
+
+@ThriftStruct("ChildData")
+public class RpcChildData
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public RpcStat stat;
+
+    @ThriftField(3)
+    public byte[] data;
+
+    public RpcChildData()
+    {
+    }
+
+    public RpcChildData(ChildData data)
+    {
+        if ( data != null )
+        {
+            this.path = data.getPath();
+            this.stat = RpcCuratorEvent.toRpcStat(data.getStat());
+            this.data = data.getData();
+        }
+    }
+
+    public RpcChildData(String path, RpcStat stat, byte[] data)
+    {
+        this.path = path;
+        this.stat = stat;
+        this.data = data;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java
new file mode 100644
index 0000000..d50bb74
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("CreateMode")
+public enum RpcCreateMode
+{
+    PERSISTENT,
+    PERSISTENT_SEQUENTIAL,
+    EPHEMERAL,
+    EPHEMERAL_SEQUENTIAL
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
new file mode 100644
index 0000000..52d18df
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
@@ -0,0 +1,224 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import com.google.common.base.Function;
+import com.google.common.collect.Lists;
+import org.apache.curator.framework.api.CuratorEvent;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.data.ACL;
+import org.apache.zookeeper.data.Stat;
+import javax.annotation.Nullable;
+import java.util.List;
+
+@SuppressWarnings("deprecation")
+@ThriftStruct("CuratorEvent")
+public class RpcCuratorEvent
+{
+    @ThriftField(2)
+    public RpcCuratorEventType type;
+
+    @ThriftField(3)
+    public int resultCode;
+
+    @ThriftField(4)
+    public String path;
+
+    @ThriftField(5)
+    public String context;
+
+    @ThriftField(6)
+    public RpcStat stat;
+
+    @ThriftField(7)
+    public byte[] data;
+
+    @ThriftField(8)
+    public String name;
+
+    @ThriftField(9)
+    public List<String> children;
+
+    @ThriftField(10)
+    public List<RpcAcl> aclList;
+
+    @ThriftField(11)
+    public RpcWatchedEvent watchedEvent;
+
+    @ThriftField(12)
+    public LeaderEvent leaderEvent;
+
+    @ThriftField(13)
+    public RpcPathChildrenCacheEvent childrenCacheEvent;
+
+    public RpcCuratorEvent()
+    {
+        this.type = RpcCuratorEventType.PING;
+        this.resultCode = 0;
+        this.path = null;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
+    public RpcCuratorEvent(RpcCuratorEventType type, String path)
+    {
+        this.type = type;
+        this.resultCode = 0;
+        this.path = path;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
+    public RpcCuratorEvent(RpcPathChildrenCacheEvent childrenCacheEvent)
+    {
+        this.type = RpcCuratorEventType.PATH_CHILDREN_CACHE;
+        this.resultCode = 0;
+        this.path = null;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = null;
+        this.childrenCacheEvent = childrenCacheEvent;
+    }
+
+    public RpcCuratorEvent(CuratorEvent event)
+    {
+        this.type = RpcCuratorEventType.valueOf(event.getType().name());
+        this.resultCode = event.getResultCode();
+        this.path = event.getPath();
+        this.context = (event.getContext() != null) ? String.valueOf(event.getContext()) : null;
+        this.stat = toRpcStat(event.getStat());
+        this.data = event.getData();
+        this.name = event.getName();
+        this.children = event.getChildren();
+        this.aclList = toRpcAclList(event.getACLList());
+        this.watchedEvent = toRpcWatchedEvent(event.getWatchedEvent());
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
+    public RpcCuratorEvent(ConnectionState newState)
+    {
+        this.type = RpcCuratorEventType.valueOf(newState.name());
+        this.resultCode = 0;
+        this.path = null;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
+    public RpcCuratorEvent(WatchedEvent event)
+    {
+        this.type = RpcCuratorEventType.WATCHED;
+        this.resultCode = 0;
+        this.path = event.getPath();
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = new RpcWatchedEvent(RpcKeeperState.valueOf(event.getState().name()), RpcEventType.valueOf(event.getType().name()), event.getPath());
+        this.leaderEvent = null;
+        this.childrenCacheEvent = null;
+    }
+
+    public RpcCuratorEvent(LeaderEvent event)
+    {
+        this.type = RpcCuratorEventType.LEADER;
+        this.resultCode = 0;
+        this.path = event.path;
+        this.context = null;
+        this.stat = null;
+        this.data = null;
+        this.name = null;
+        this.children = null;
+        this.aclList = null;
+        this.watchedEvent = null;
+        this.leaderEvent = event;
+        this.childrenCacheEvent = null;
+    }
+
+    public static RpcStat toRpcStat(Stat stat)
+    {
+        if ( stat != null )
+        {
+            return new RpcStat(stat);
+        }
+        return null;
+    }
+
+    private List<RpcAcl> toRpcAclList(List<ACL> aclList)
+    {
+        if ( aclList != null )
+        {
+            return Lists.transform
+            (
+                aclList,
+                new Function<ACL, RpcAcl>()
+                {
+                    @Nullable
+                    @Override
+                    public RpcAcl apply(ACL acl)
+                    {
+                        RpcId id = new RpcId(acl.getId().getScheme(), acl.getId().getId());
+                        return new RpcAcl(acl.getPerms(), id);
+                    }
+                }
+            );
+        }
+        return null;
+    }
+
+    private RpcWatchedEvent toRpcWatchedEvent(WatchedEvent watchedEvent)
+    {
+        if ( watchedEvent != null )
+        {
+            return new RpcWatchedEvent(watchedEvent);
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java
new file mode 100644
index 0000000..88b4a1f
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("CuratorEventType")
+public enum RpcCuratorEventType
+{
+    PING,
+    CREATE,
+    DELETE,
+    EXISTS,
+    GET_DATA,
+    SET_DATA,
+    CHILDREN,
+    SYNC,
+    GET_ACL,
+    SET_ACL,
+    WATCHED,
+    CLOSING,
+    CONNECTION_CONNECTED,
+    CONNECTION_SUSPENDED,
+    CONNECTION_RECONNECTED,
+    CONNECTION_LOST,
+    CONNECTION_READ_ONLY,
+    LEADER,
+    PATH_CHILDREN_CACHE,
+    NODE_CACHE
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java
new file mode 100644
index 0000000..d20adb0
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("EventType")
+public enum RpcEventType
+{
+    None,
+    NodeCreated,
+    NodeDeleted,
+    NodeDataChanged,
+    NodeChildrenChanged
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java
new file mode 100644
index 0000000..233736b
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct("Id")
+public class RpcId
+{
+    @ThriftField(1)
+    public String scheme;
+
+    @ThriftField(2)
+    public String id;
+
+    public RpcId()
+    {
+    }
+
+    public RpcId(String scheme, String id)
+    {
+        this.scheme = scheme;
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java
new file mode 100644
index 0000000..8839a1d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("KeeperState")
+public enum RpcKeeperState
+{
+    Unknown,
+    Disconnected,
+    NoSyncConnected,
+    SyncConnected,
+    AuthFailed,
+    ConnectedReadOnly,
+    SaslAuthenticated,
+    Expired
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
new file mode 100644
index 0000000..7b1dfde
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
@@ -0,0 +1,24 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct("Participant")
+public class RpcParticipant
+{
+    @ThriftField(1)
+    public String id;
+
+    @ThriftField(2)
+    public boolean isLeader;
+
+    public RpcParticipant()
+    {
+    }
+
+    public RpcParticipant(String id, boolean isLeader)
+    {
+        this.id = id;
+        this.isLeader = isLeader;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
new file mode 100644
index 0000000..6766e8e
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
@@ -0,0 +1,36 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
+
+@ThriftStruct("PathChildrenCacheEvent")
+public class RpcPathChildrenCacheEvent
+{
+    @ThriftField(1)
+    public String cachedPath;
+
+    @ThriftField(2)
+    public RpcPathChildrenCacheEventType type;
+
+    @ThriftField(3)
+    public RpcChildData data;
+
+    public RpcPathChildrenCacheEvent()
+    {
+    }
+
+    public RpcPathChildrenCacheEvent(String cachedPath, PathChildrenCacheEvent event)
+    {
+        this.cachedPath = cachedPath;
+        type = RpcPathChildrenCacheEventType.valueOf(event.getType().name());
+        data = (event.getData() != null) ? new RpcChildData(event.getData()) : null;
+    }
+
+    public RpcPathChildrenCacheEvent(String cachedPath, RpcPathChildrenCacheEventType type, RpcChildData data)
+    {
+        this.cachedPath = cachedPath;
+        this.type = type;
+        this.data = data;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
new file mode 100644
index 0000000..e14284d
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
@@ -0,0 +1,15 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("PathChildrenCacheEventType")
+public enum RpcPathChildrenCacheEventType
+{
+    CHILD_ADDED,
+    CHILD_UPDATED,
+    CHILD_REMOVED,
+    CONNECTION_SUSPENDED,
+    CONNECTION_RECONNECTED,
+    CONNECTION_LOST,
+    INITIALIZED
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
new file mode 100644
index 0000000..7fedaf9
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
@@ -0,0 +1,12 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftEnum;
+
+@ThriftEnum("PersistentEphemeralNodeMode")
+public enum RpcPersistentEphemeralNodeMode
+{
+    EPHEMERAL,
+    EPHEMERAL_SEQUENTIAL,
+    PROTECTED_EPHEMERAL,
+    PROTECTED_EPHEMERAL_SEQUENTIAL
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java
new file mode 100644
index 0000000..5e62f15
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java
@@ -0,0 +1,95 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import org.apache.zookeeper.data.Stat;
+
+@ThriftStruct("Stat")
+public class RpcStat
+{
+    @ThriftField(1)
+    public long czxid;
+
+    @ThriftField(2)
+    public long mzxid;
+
+    @ThriftField(3)
+    public long ctime;
+
+    @ThriftField(4)
+    public long mtime;
+
+    @ThriftField(5)
+    public int version;
+
+    @ThriftField(6)
+    public int cversion;
+
+    @ThriftField(7)
+    public int aversion;
+
+    @ThriftField(8)
+    public long ephemeralOwner;
+
+    @ThriftField(9)
+    public int dataLength;
+
+    @ThriftField(10)
+    public int numChildren;
+
+    @ThriftField(11)
+    public long pzxid;
+
+    public RpcStat()
+    {
+    }
+
+    public RpcStat(Stat stat)
+    {
+        czxid = stat.getCzxid();
+        mzxid = stat.getMzxid();
+        ctime = stat.getCtime();
+        mtime = stat.getMtime();
+        version = stat.getVersion();
+        cversion = stat.getCversion();
+        aversion = stat.getAversion();
+        ephemeralOwner = stat.getEphemeralOwner();
+        dataLength = stat.getDataLength();
+        numChildren = stat.getNumChildren();
+        pzxid = stat.getPzxid();
+    }
+
+    public RpcStat(long czxid, long mzxid, long ctime, long mtime, int version, int cversion, int aversion, long ephemeralOwner, int dataLength, int numChildren, long pzxid)
+    {
+        this.czxid = czxid;
+        this.mzxid = mzxid;
+        this.ctime = ctime;
+        this.mtime = mtime;
+        this.version = version;
+        this.cversion = cversion;
+        this.aversion = aversion;
+        this.ephemeralOwner = ephemeralOwner;
+        this.dataLength = dataLength;
+        this.numChildren = numChildren;
+        this.pzxid = pzxid;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java
new file mode 100644
index 0000000..cc7e818
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+import org.apache.zookeeper.WatchedEvent;
+
+@ThriftStruct("WatchedEvent")
+public class RpcWatchedEvent
+{
+    @ThriftField(1)
+    public RpcKeeperState keeperState;
+
+    @ThriftField(2)
+    public RpcEventType eventType;
+
+    @ThriftField(3)
+    public String path;
+
+    public RpcWatchedEvent()
+    {
+    }
+
+    public RpcWatchedEvent(WatchedEvent watchedEvent)
+    {
+        keeperState = RpcKeeperState.valueOf(watchedEvent.getState().name());
+        eventType = RpcEventType.valueOf(watchedEvent.getType().name());
+        path = watchedEvent.getPath();
+    }
+
+    public RpcWatchedEvent(RpcKeeperState keeperState, RpcEventType eventType, String path)
+    {
+        this.keeperState = keeperState;
+        this.eventType = eventType;
+        this.path = path;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java
new file mode 100644
index 0000000..0814699
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class SetDataSpec
+{
+    @ThriftField(1)
+    public String path;
+
+    @ThriftField(2)
+    public boolean watched;
+
+    @ThriftField(3)
+    public String asyncContext;
+
+    @ThriftField(4)
+    public boolean compressed;
+
+    @ThriftField(5)
+    public Version version;
+
+    @ThriftField(6)
+    public byte[] data;
+
+    public SetDataSpec()
+    {
+    }
+
+    public SetDataSpec(String path, boolean watched, String asyncContext, boolean compressed, Version version, byte[] data)
+    {
+        this.path = path;
+        this.watched = watched;
+        this.asyncContext = asyncContext;
+        this.compressed = compressed;
+        this.version = version;
+        this.data = data;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
new file mode 100644
index 0000000..cb3fcec
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class Version
+{
+    @ThriftField(1)
+    public int version;
+
+    public Version()
+    {
+    }
+
+    public Version(int version)
+    {
+        this.version = version;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/scripts/generate.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
index 15f6546..de5e21c 100755
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ b/curator-x-rpc/src/main/scripts/generate.sh
@@ -31,7 +31,7 @@ RPC_PATH="$BASE_DIR/curator-x-rpc/target/classes"
 
 CLASSES=""
 
-for p in projection event; do
+for p in services structs; do
     for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/$p/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`; do
         if [[ $f != *[\$]* ]]; then
             CLASSES="$CLASSES org.apache.curator.x.rpc.idl.$p.$f";


[04/50] [abbrv] node cache support

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index 8936004..da9ae2c 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -54,6 +54,8 @@ public class CuratorService {
 
     public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException;
 
+    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException;
+
     public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException;
 
     public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException;
@@ -66,6 +68,8 @@ public class CuratorService {
 
     public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws org.apache.thrift.TException;
 
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException;
+
     public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException;
 
   }
@@ -90,6 +94,8 @@ public class CuratorService {
 
     public void getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -102,6 +108,8 @@ public class CuratorService {
 
     public void startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
   }
@@ -336,6 +344,30 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLeaderParticipants failed: unknown result");
     }
 
+    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException
+    {
+      send_getNodeCacheData(projection, cacheProjection);
+      return recv_getNodeCacheData();
+    }
+
+    public void send_getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException
+    {
+      getNodeCacheData_args args = new getNodeCacheData_args();
+      args.setProjection(projection);
+      args.setCacheProjection(cacheProjection);
+      sendBase("getNodeCacheData", args);
+    }
+
+    public ChildData recv_getNodeCacheData() throws org.apache.thrift.TException
+    {
+      getNodeCacheData_result result = new getNodeCacheData_result();
+      receiveBase(result, "getNodeCacheData");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNodeCacheData failed: unknown result");
+    }
+
     public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException
     {
       send_getPathChildrenCacheData(projection, cacheProjection);
@@ -482,6 +514,32 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startLeaderSelector failed: unknown result");
     }
 
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException
+    {
+      send_startNodeCache(projection, path, dataIsCompressed, buildInitial);
+      return recv_startNodeCache();
+    }
+
+    public void send_startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException
+    {
+      startNodeCache_args args = new startNodeCache_args();
+      args.setProjection(projection);
+      args.setPath(path);
+      args.setDataIsCompressed(dataIsCompressed);
+      args.setBuildInitial(buildInitial);
+      sendBase("startNodeCache", args);
+    }
+
+    public NodeCacheProjection recv_startNodeCache() throws org.apache.thrift.TException
+    {
+      startNodeCache_result result = new startNodeCache_result();
+      receiveBase(result, "startNodeCache");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startNodeCache failed: unknown result");
+    }
+
     public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException
     {
       send_startPathChildrenCache(projection, path, cacheData, dataIsCompressed, startMode);
@@ -842,6 +900,41 @@ public class CuratorService {
       }
     }
 
+    public void getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getNodeCacheData_call method_call = new getNodeCacheData_call(projection, cacheProjection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getNodeCacheData_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private NodeCacheProjection cacheProjection;
+      public getNodeCacheData_call(CuratorProjection projection, NodeCacheProjection cacheProjection, 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.projection = projection;
+        this.cacheProjection = cacheProjection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNodeCacheData", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getNodeCacheData_args args = new getNodeCacheData_args();
+        args.setProjection(projection);
+        args.setCacheProjection(cacheProjection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public ChildData getResult() throws 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_getNodeCacheData();
+      }
+    }
+
     public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       getPathChildrenCacheData_call method_call = new getPathChildrenCacheData_call(projection, cacheProjection, resultHandler, this, ___protocolFactory, ___transport);
@@ -1058,6 +1151,47 @@ public class CuratorService {
       }
     }
 
+    public void startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      startNodeCache_call method_call = new startNodeCache_call(projection, path, dataIsCompressed, buildInitial, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class startNodeCache_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String path;
+      private boolean dataIsCompressed;
+      private boolean buildInitial;
+      public startNodeCache_call(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, 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.projection = projection;
+        this.path = path;
+        this.dataIsCompressed = dataIsCompressed;
+        this.buildInitial = buildInitial;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startNodeCache", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        startNodeCache_args args = new startNodeCache_args();
+        args.setProjection(projection);
+        args.setPath(path);
+        args.setDataIsCompressed(dataIsCompressed);
+        args.setBuildInitial(buildInitial);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public NodeCacheProjection getResult() throws 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_startNodeCache();
+      }
+    }
+
     public void startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       startPathChildrenCache_call method_call = new startPathChildrenCache_call(projection, path, cacheData, dataIsCompressed, startMode, resultHandler, this, ___protocolFactory, ___transport);
@@ -1124,12 +1258,14 @@ public class CuratorService {
       processMap.put("getChildren", new getChildren());
       processMap.put("getData", new getData());
       processMap.put("getLeaderParticipants", new getLeaderParticipants());
+      processMap.put("getNodeCacheData", new getNodeCacheData());
       processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
       processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
       processMap.put("setData", new setData());
       processMap.put("startLeaderSelector", new startLeaderSelector());
+      processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       return processMap;
     }
@@ -1315,6 +1451,26 @@ public class CuratorService {
       }
     }
 
+    public static class getNodeCacheData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getNodeCacheData_args> {
+      public getNodeCacheData() {
+        super("getNodeCacheData");
+      }
+
+      public getNodeCacheData_args getEmptyArgsInstance() {
+        return new getNodeCacheData_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getNodeCacheData_result getResult(I iface, getNodeCacheData_args args) throws org.apache.thrift.TException {
+        getNodeCacheData_result result = new getNodeCacheData_result();
+        result.success = iface.getNodeCacheData(args.projection, args.cacheProjection);
+        return result;
+      }
+    }
+
     public static class getPathChildrenCacheData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPathChildrenCacheData_args> {
       public getPathChildrenCacheData() {
         super("getPathChildrenCacheData");
@@ -1436,6 +1592,26 @@ public class CuratorService {
       }
     }
 
+    public static class startNodeCache<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startNodeCache_args> {
+      public startNodeCache() {
+        super("startNodeCache");
+      }
+
+      public startNodeCache_args getEmptyArgsInstance() {
+        return new startNodeCache_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public startNodeCache_result getResult(I iface, startNodeCache_args args) throws org.apache.thrift.TException {
+        startNodeCache_result result = new startNodeCache_result();
+        result.success = iface.startNodeCache(args.projection, args.path, args.dataIsCompressed, args.buildInitial);
+        return result;
+      }
+    }
+
     public static class startPathChildrenCache<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startPathChildrenCache_args> {
       public startPathChildrenCache() {
         super("startPathChildrenCache");
@@ -1478,12 +1654,14 @@ public class CuratorService {
       processMap.put("getChildren", new getChildren());
       processMap.put("getData", new getData());
       processMap.put("getLeaderParticipants", new getLeaderParticipants());
+      processMap.put("getNodeCacheData", new getNodeCacheData());
       processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
       processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
       processMap.put("setData", new setData());
       processMap.put("startLeaderSelector", new startLeaderSelector());
+      processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       return processMap;
     }
@@ -1946,6 +2124,57 @@ public class CuratorService {
       }
     }
 
+    public static class getNodeCacheData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getNodeCacheData_args, ChildData> {
+      public getNodeCacheData() {
+        super("getNodeCacheData");
+      }
+
+      public getNodeCacheData_args getEmptyArgsInstance() {
+        return new getNodeCacheData_args();
+      }
+
+      public AsyncMethodCallback<ChildData> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<ChildData>() { 
+          public void onComplete(ChildData o) {
+            getNodeCacheData_result result = new getNodeCacheData_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;
+            getNodeCacheData_result result = new getNodeCacheData_result();
+            {
+              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, getNodeCacheData_args args, org.apache.thrift.async.AsyncMethodCallback<ChildData> resultHandler) throws TException {
+        iface.getNodeCacheData(args.projection, args.cacheProjection,resultHandler);
+      }
+    }
+
     public static class getPathChildrenCacheData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPathChildrenCacheData_args, List<ChildData>> {
       public getPathChildrenCacheData() {
         super("getPathChildrenCacheData");
@@ -2253,6 +2482,57 @@ public class CuratorService {
       }
     }
 
+    public static class startNodeCache<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startNodeCache_args, NodeCacheProjection> {
+      public startNodeCache() {
+        super("startNodeCache");
+      }
+
+      public startNodeCache_args getEmptyArgsInstance() {
+        return new startNodeCache_args();
+      }
+
+      public AsyncMethodCallback<NodeCacheProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<NodeCacheProjection>() { 
+          public void onComplete(NodeCacheProjection o) {
+            startNodeCache_result result = new startNodeCache_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;
+            startNodeCache_result result = new startNodeCache_result();
+            {
+              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, startNodeCache_args args, org.apache.thrift.async.AsyncMethodCallback<NodeCacheProjection> resultHandler) throws TException {
+        iface.startNodeCache(args.projection, args.path, args.dataIsCompressed, args.buildInitial,resultHandler);
+      }
+    }
+
     public static class startPathChildrenCache<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startPathChildrenCache_args, PathChildrenCacheProjection> {
       public startPathChildrenCache() {
         super("startPathChildrenCache");
@@ -9525,20 +9805,20 @@ public class CuratorService {
 
   }
 
-  public static class getPathChildrenCacheData_args implements org.apache.thrift.TBase<getPathChildrenCacheData_args, getPathChildrenCacheData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_args");
+  public static class getNodeCacheData_args implements org.apache.thrift.TBase<getNodeCacheData_args, getNodeCacheData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getNodeCacheData_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNodeCacheData_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField CACHE_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new getPathChildrenCacheData_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getPathChildrenCacheData_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new getNodeCacheData_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getNodeCacheData_argsTupleSchemeFactory());
     }
 
     public CuratorProjection projection; // required
-    public PathChildrenCacheProjection cacheProjection; // required
+    public NodeCacheProjection cacheProjection; // 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 {
@@ -9608,17 +9888,17 @@ public class CuratorService {
       tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
       tmpMap.put(_Fields.CACHE_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("cacheProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheProjection.class)));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NodeCacheProjection.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNodeCacheData_args.class, metaDataMap);
     }
 
-    public getPathChildrenCacheData_args() {
+    public getNodeCacheData_args() {
     }
 
-    public getPathChildrenCacheData_args(
+    public getNodeCacheData_args(
       CuratorProjection projection,
-      PathChildrenCacheProjection cacheProjection)
+      NodeCacheProjection cacheProjection)
     {
       this();
       this.projection = projection;
@@ -9628,17 +9908,17 @@ public class CuratorService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getPathChildrenCacheData_args(getPathChildrenCacheData_args other) {
+    public getNodeCacheData_args(getNodeCacheData_args other) {
       if (other.isSetProjection()) {
         this.projection = new CuratorProjection(other.projection);
       }
       if (other.isSetCacheProjection()) {
-        this.cacheProjection = new PathChildrenCacheProjection(other.cacheProjection);
+        this.cacheProjection = new NodeCacheProjection(other.cacheProjection);
       }
     }
 
-    public getPathChildrenCacheData_args deepCopy() {
-      return new getPathChildrenCacheData_args(this);
+    public getNodeCacheData_args deepCopy() {
+      return new getNodeCacheData_args(this);
     }
 
     @Override
@@ -9651,7 +9931,7 @@ public class CuratorService {
       return this.projection;
     }
 
-    public getPathChildrenCacheData_args setProjection(CuratorProjection projection) {
+    public getNodeCacheData_args setProjection(CuratorProjection projection) {
       this.projection = projection;
       return this;
     }
@@ -9671,11 +9951,11 @@ public class CuratorService {
       }
     }
 
-    public PathChildrenCacheProjection getCacheProjection() {
+    public NodeCacheProjection getCacheProjection() {
       return this.cacheProjection;
     }
 
-    public getPathChildrenCacheData_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
+    public getNodeCacheData_args setCacheProjection(NodeCacheProjection cacheProjection) {
       this.cacheProjection = cacheProjection;
       return this;
     }
@@ -9709,7 +9989,7 @@ public class CuratorService {
         if (value == null) {
           unsetCacheProjection();
         } else {
-          setCacheProjection((PathChildrenCacheProjection)value);
+          setCacheProjection((NodeCacheProjection)value);
         }
         break;
 
@@ -9747,12 +10027,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getPathChildrenCacheData_args)
-        return this.equals((getPathChildrenCacheData_args)that);
+      if (that instanceof getNodeCacheData_args)
+        return this.equals((getNodeCacheData_args)that);
       return false;
     }
 
-    public boolean equals(getPathChildrenCacheData_args that) {
+    public boolean equals(getNodeCacheData_args that) {
       if (that == null)
         return false;
 
@@ -9783,7 +10063,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(getPathChildrenCacheData_args other) {
+    public int compareTo(getNodeCacheData_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -9827,7 +10107,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getPathChildrenCacheData_args(");
+      StringBuilder sb = new StringBuilder("getNodeCacheData_args(");
       boolean first = true;
 
       sb.append("projection:");
@@ -9876,15 +10156,15 @@ public class CuratorService {
       }
     }
 
-    private static class getPathChildrenCacheData_argsStandardSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheData_argsStandardScheme getScheme() {
-        return new getPathChildrenCacheData_argsStandardScheme();
+    private static class getNodeCacheData_argsStandardSchemeFactory implements SchemeFactory {
+      public getNodeCacheData_argsStandardScheme getScheme() {
+        return new getNodeCacheData_argsStandardScheme();
       }
     }
 
-    private static class getPathChildrenCacheData_argsStandardScheme extends StandardScheme<getPathChildrenCacheData_args> {
+    private static class getNodeCacheData_argsStandardScheme extends StandardScheme<getNodeCacheData_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getNodeCacheData_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -9905,7 +10185,7 @@ public class CuratorService {
               break;
             case 2: // CACHE_PROJECTION
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.cacheProjection = new PathChildrenCacheProjection();
+                struct.cacheProjection = new NodeCacheProjection();
                 struct.cacheProjection.read(iprot);
                 struct.setCacheProjectionIsSet(true);
               } else { 
@@ -9923,7 +10203,7 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getNodeCacheData_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -9943,16 +10223,16 @@ public class CuratorService {
 
     }
 
-    private static class getPathChildrenCacheData_argsTupleSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheData_argsTupleScheme getScheme() {
-        return new getPathChildrenCacheData_argsTupleScheme();
+    private static class getNodeCacheData_argsTupleSchemeFactory implements SchemeFactory {
+      public getNodeCacheData_argsTupleScheme getScheme() {
+        return new getNodeCacheData_argsTupleScheme();
       }
     }
 
-    private static class getPathChildrenCacheData_argsTupleScheme extends TupleScheme<getPathChildrenCacheData_args> {
+    private static class getNodeCacheData_argsTupleScheme extends TupleScheme<getNodeCacheData_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, getNodeCacheData_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetProjection()) {
@@ -9971,7 +10251,7 @@ public class CuratorService {
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, getNodeCacheData_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
@@ -9980,7 +10260,7 @@ public class CuratorService {
           struct.setProjectionIsSet(true);
         }
         if (incoming.get(1)) {
-          struct.cacheProjection = new PathChildrenCacheProjection();
+          struct.cacheProjection = new NodeCacheProjection();
           struct.cacheProjection.read(iprot);
           struct.setCacheProjectionIsSet(true);
         }
@@ -9989,18 +10269,18 @@ public class CuratorService {
 
   }
 
-  public static class getPathChildrenCacheData_result implements org.apache.thrift.TBase<getPathChildrenCacheData_result, getPathChildrenCacheData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_result");
+  public static class getNodeCacheData_result implements org.apache.thrift.TBase<getNodeCacheData_result, getNodeCacheData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getNodeCacheData_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getNodeCacheData_result");
 
-    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new getPathChildrenCacheData_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getPathChildrenCacheData_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new getNodeCacheData_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getNodeCacheData_resultTupleSchemeFactory());
     }
 
-    public List<ChildData> success; // required
+    public ChildData success; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -10065,17 +10345,16 @@ public class CuratorService {
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ChildData.class))));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ChildData.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getNodeCacheData_result.class, metaDataMap);
     }
 
-    public getPathChildrenCacheData_result() {
+    public getNodeCacheData_result() {
     }
 
-    public getPathChildrenCacheData_result(
-      List<ChildData> success)
+    public getNodeCacheData_result(
+      ChildData success)
     {
       this();
       this.success = success;
@@ -10084,18 +10363,14 @@ public class CuratorService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getPathChildrenCacheData_result(getPathChildrenCacheData_result other) {
+    public getNodeCacheData_result(getNodeCacheData_result other) {
       if (other.isSetSuccess()) {
-        List<ChildData> __this__success = new ArrayList<ChildData>(other.success.size());
-        for (ChildData other_element : other.success) {
-          __this__success.add(new ChildData(other_element));
-        }
-        this.success = __this__success;
+        this.success = new ChildData(other.success);
       }
     }
 
-    public getPathChildrenCacheData_result deepCopy() {
-      return new getPathChildrenCacheData_result(this);
+    public getNodeCacheData_result deepCopy() {
+      return new getNodeCacheData_result(this);
     }
 
     @Override
@@ -10103,26 +10378,11 @@ public class CuratorService {
       this.success = null;
     }
 
-    public int getSuccessSize() {
-      return (this.success == null) ? 0 : this.success.size();
-    }
-
-    public java.util.Iterator<ChildData> getSuccessIterator() {
-      return (this.success == null) ? null : this.success.iterator();
-    }
-
-    public void addToSuccess(ChildData elem) {
-      if (this.success == null) {
-        this.success = new ArrayList<ChildData>();
-      }
-      this.success.add(elem);
-    }
-
-    public List<ChildData> getSuccess() {
+    public ChildData getSuccess() {
       return this.success;
     }
 
-    public getPathChildrenCacheData_result setSuccess(List<ChildData> success) {
+    public getNodeCacheData_result setSuccess(ChildData success) {
       this.success = success;
       return this;
     }
@@ -10148,7 +10408,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((List<ChildData>)value);
+          setSuccess((ChildData)value);
         }
         break;
 
@@ -10181,12 +10441,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getPathChildrenCacheData_result)
-        return this.equals((getPathChildrenCacheData_result)that);
+      if (that instanceof getNodeCacheData_result)
+        return this.equals((getNodeCacheData_result)that);
       return false;
     }
 
-    public boolean equals(getPathChildrenCacheData_result that) {
+    public boolean equals(getNodeCacheData_result that) {
       if (that == null)
         return false;
 
@@ -10208,7 +10468,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(getPathChildrenCacheData_result other) {
+    public int compareTo(getNodeCacheData_result other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -10242,7 +10502,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getPathChildrenCacheData_result(");
+      StringBuilder sb = new StringBuilder("getNodeCacheData_result(");
       boolean first = true;
 
       sb.append("success:");
@@ -10259,6 +10519,9 @@ public class CuratorService {
     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 {
@@ -10277,15 +10540,15 @@ public class CuratorService {
       }
     }
 
-    private static class getPathChildrenCacheData_resultStandardSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheData_resultStandardScheme getScheme() {
-        return new getPathChildrenCacheData_resultStandardScheme();
+    private static class getNodeCacheData_resultStandardSchemeFactory implements SchemeFactory {
+      public getNodeCacheData_resultStandardScheme getScheme() {
+        return new getNodeCacheData_resultStandardScheme();
       }
     }
 
-    private static class getPathChildrenCacheData_resultStandardScheme extends StandardScheme<getPathChildrenCacheData_result> {
+    private static class getNodeCacheData_resultStandardScheme extends StandardScheme<getNodeCacheData_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getNodeCacheData_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -10296,19 +10559,9 @@ public class CuratorService {
           }
           switch (schemeField.id) {
             case 0: // SUCCESS
-              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
-                {
-                  org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
-                  struct.success = new ArrayList<ChildData>(_list32.size);
-                  for (int _i33 = 0; _i33 < _list32.size; ++_i33)
-                  {
-                    ChildData _elem34;
-                    _elem34 = new ChildData();
-                    _elem34.read(iprot);
-                    struct.success.add(_elem34);
-                  }
-                  iprot.readListEnd();
-                }
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.success = new ChildData();
+                struct.success.read(iprot);
                 struct.setSuccessIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -10325,20 +10578,13 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getNodeCacheData_result struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
         if (struct.success != null) {
           oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-          {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
-            for (ChildData _iter35 : struct.success)
-            {
-              _iter35.write(oprot);
-            }
-            oprot.writeListEnd();
-          }
+          struct.success.write(oprot);
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -10347,16 +10593,16 @@ public class CuratorService {
 
     }
 
-    private static class getPathChildrenCacheData_resultTupleSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheData_resultTupleScheme getScheme() {
-        return new getPathChildrenCacheData_resultTupleScheme();
+    private static class getNodeCacheData_resultTupleSchemeFactory implements SchemeFactory {
+      public getNodeCacheData_resultTupleScheme getScheme() {
+        return new getNodeCacheData_resultTupleScheme();
       }
     }
 
-    private static class getPathChildrenCacheData_resultTupleScheme extends TupleScheme<getPathChildrenCacheData_result> {
+    private static class getNodeCacheData_resultTupleScheme extends TupleScheme<getNodeCacheData_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, getNodeCacheData_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetSuccess()) {
@@ -10364,32 +10610,17 @@ public class CuratorService {
         }
         oprot.writeBitSet(optionals, 1);
         if (struct.isSetSuccess()) {
-          {
-            oprot.writeI32(struct.success.size());
-            for (ChildData _iter36 : struct.success)
-            {
-              _iter36.write(oprot);
-            }
-          }
+          struct.success.write(oprot);
         }
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, getNodeCacheData_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(1);
         if (incoming.get(0)) {
-          {
-            org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
-            struct.success = new ArrayList<ChildData>(_list37.size);
-            for (int _i38 = 0; _i38 < _list37.size; ++_i38)
-            {
-              ChildData _elem39;
-              _elem39 = new ChildData();
-              _elem39.read(iprot);
-              struct.success.add(_elem39);
-            }
-          }
+          struct.success = new ChildData();
+          struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
       }
@@ -10397,28 +10628,25 @@ public class CuratorService {
 
   }
 
-  public static class getPathChildrenCacheDataForPath_args implements org.apache.thrift.TBase<getPathChildrenCacheDataForPath_args, getPathChildrenCacheDataForPath_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheDataForPath_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheDataForPath_args");
+  public static class getPathChildrenCacheData_args implements org.apache.thrift.TBase<getPathChildrenCacheData_args, getPathChildrenCacheData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField CACHE_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)3);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new getPathChildrenCacheDataForPath_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getPathChildrenCacheDataForPath_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new getPathChildrenCacheData_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheData_argsTupleSchemeFactory());
     }
 
     public CuratorProjection projection; // required
     public PathChildrenCacheProjection cacheProjection; // required
-    public String path; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       PROJECTION((short)1, "projection"),
-      CACHE_PROJECTION((short)2, "cacheProjection"),
-      PATH((short)3, "path");
+      CACHE_PROJECTION((short)2, "cacheProjection");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -10437,8 +10665,6 @@ public class CuratorService {
             return PROJECTION;
           case 2: // CACHE_PROJECTION
             return CACHE_PROJECTION;
-          case 3: // PATH
-            return PATH;
           default:
             return null;
         }
@@ -10486,57 +10712,49 @@ public class CuratorService {
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
       tmpMap.put(_Fields.CACHE_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("cacheProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheProjection.class)));
-      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheDataForPath_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_args.class, metaDataMap);
     }
 
-    public getPathChildrenCacheDataForPath_args() {
+    public getPathChildrenCacheData_args() {
     }
 
-    public getPathChildrenCacheDataForPath_args(
+    public getPathChildrenCacheData_args(
       CuratorProjection projection,
-      PathChildrenCacheProjection cacheProjection,
-      String path)
+      PathChildrenCacheProjection cacheProjection)
     {
       this();
       this.projection = projection;
       this.cacheProjection = cacheProjection;
-      this.path = path;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getPathChildrenCacheDataForPath_args(getPathChildrenCacheDataForPath_args other) {
+    public getPathChildrenCacheData_args(getPathChildrenCacheData_args other) {
       if (other.isSetProjection()) {
         this.projection = new CuratorProjection(other.projection);
       }
       if (other.isSetCacheProjection()) {
         this.cacheProjection = new PathChildrenCacheProjection(other.cacheProjection);
       }
-      if (other.isSetPath()) {
-        this.path = other.path;
-      }
     }
 
-    public getPathChildrenCacheDataForPath_args deepCopy() {
-      return new getPathChildrenCacheDataForPath_args(this);
+    public getPathChildrenCacheData_args deepCopy() {
+      return new getPathChildrenCacheData_args(this);
     }
 
     @Override
     public void clear() {
       this.projection = null;
       this.cacheProjection = null;
-      this.path = null;
     }
 
     public CuratorProjection getProjection() {
       return this.projection;
     }
 
-    public getPathChildrenCacheDataForPath_args setProjection(CuratorProjection projection) {
+    public getPathChildrenCacheData_args setProjection(CuratorProjection projection) {
       this.projection = projection;
       return this;
     }
@@ -10560,7 +10778,7 @@ public class CuratorService {
       return this.cacheProjection;
     }
 
-    public getPathChildrenCacheDataForPath_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
+    public getPathChildrenCacheData_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
       this.cacheProjection = cacheProjection;
       return this;
     }
@@ -10580,30 +10798,6 @@ public class CuratorService {
       }
     }
 
-    public String getPath() {
-      return this.path;
-    }
-
-    public getPathChildrenCacheDataForPath_args setPath(String path) {
-      this.path = path;
-      return this;
-    }
-
-    public void unsetPath() {
-      this.path = null;
-    }
-
-    /** Returns true if field path is set (has been assigned a value) and false otherwise */
-    public boolean isSetPath() {
-      return this.path != null;
-    }
-
-    public void setPathIsSet(boolean value) {
-      if (!value) {
-        this.path = null;
-      }
-    }
-
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case PROJECTION:
@@ -10622,14 +10816,6 @@ public class CuratorService {
         }
         break;
 
-      case PATH:
-        if (value == null) {
-          unsetPath();
-        } else {
-          setPath((String)value);
-        }
-        break;
-
       }
     }
 
@@ -10641,9 +10827,6 @@ public class CuratorService {
       case CACHE_PROJECTION:
         return getCacheProjection();
 
-      case PATH:
-        return getPath();
-
       }
       throw new IllegalStateException();
     }
@@ -10659,8 +10842,6 @@ public class CuratorService {
         return isSetProjection();
       case CACHE_PROJECTION:
         return isSetCacheProjection();
-      case PATH:
-        return isSetPath();
       }
       throw new IllegalStateException();
     }
@@ -10669,12 +10850,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getPathChildrenCacheDataForPath_args)
-        return this.equals((getPathChildrenCacheDataForPath_args)that);
+      if (that instanceof getPathChildrenCacheData_args)
+        return this.equals((getPathChildrenCacheData_args)that);
       return false;
     }
 
-    public boolean equals(getPathChildrenCacheDataForPath_args that) {
+    public boolean equals(getPathChildrenCacheData_args that) {
       if (that == null)
         return false;
 
@@ -10696,15 +10877,6 @@ public class CuratorService {
           return false;
       }
 
-      boolean this_present_path = true && this.isSetPath();
-      boolean that_present_path = true && that.isSetPath();
-      if (this_present_path || that_present_path) {
-        if (!(this_present_path && that_present_path))
-          return false;
-        if (!this.path.equals(that.path))
-          return false;
-      }
-
       return true;
     }
 
@@ -10714,7 +10886,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(getPathChildrenCacheDataForPath_args other) {
+    public int compareTo(getPathChildrenCacheData_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -10741,16 +10913,6 @@ public class CuratorService {
           return lastComparison;
         }
       }
-      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetPath()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
       return 0;
     }
 
@@ -10768,7 +10930,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getPathChildrenCacheDataForPath_args(");
+      StringBuilder sb = new StringBuilder("getPathChildrenCacheData_args(");
       boolean first = true;
 
       sb.append("projection:");
@@ -10786,14 +10948,6 @@ public class CuratorService {
         sb.append(this.cacheProjection);
       }
       first = false;
-      if (!first) sb.append(", ");
-      sb.append("path:");
-      if (this.path == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.path);
-      }
-      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -10825,15 +10979,15 @@ public class CuratorService {
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_argsStandardSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheDataForPath_argsStandardScheme getScheme() {
-        return new getPathChildrenCacheDataForPath_argsStandardScheme();
+    private static class getPathChildrenCacheData_argsStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_argsStandardScheme getScheme() {
+        return new getPathChildrenCacheData_argsStandardScheme();
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_argsStandardScheme extends StandardScheme<getPathChildrenCacheDataForPath_args> {
+    private static class getPathChildrenCacheData_argsStandardScheme extends StandardScheme<getPathChildrenCacheData_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -10861,14 +11015,6 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
-            case 3: // PATH
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-                struct.path = iprot.readString();
-                struct.setPathIsSet(true);
-              } else { 
-                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-              }
-              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -10880,7 +11026,7 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -10894,27 +11040,22 @@ public class CuratorService {
           struct.cacheProjection.write(oprot);
           oprot.writeFieldEnd();
         }
-        if (struct.path != null) {
-          oprot.writeFieldBegin(PATH_FIELD_DESC);
-          oprot.writeString(struct.path);
-          oprot.writeFieldEnd();
-        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
 
     }
 
-    private static class getPathChildrenCacheDataForPath_argsTupleSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheDataForPath_argsTupleScheme getScheme() {
-        return new getPathChildrenCacheDataForPath_argsTupleScheme();
+    private static class getPathChildrenCacheData_argsTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_argsTupleScheme getScheme() {
+        return new getPathChildrenCacheData_argsTupleScheme();
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_argsTupleScheme extends TupleScheme<getPathChildrenCacheDataForPath_args> {
+    private static class getPathChildrenCacheData_argsTupleScheme extends TupleScheme<getPathChildrenCacheData_args> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetProjection()) {
@@ -10923,25 +11064,19 @@ public class CuratorService {
         if (struct.isSetCacheProjection()) {
           optionals.set(1);
         }
-        if (struct.isSetPath()) {
-          optionals.set(2);
-        }
-        oprot.writeBitSet(optionals, 3);
+        oprot.writeBitSet(optionals, 2);
         if (struct.isSetProjection()) {
           struct.projection.write(oprot);
         }
         if (struct.isSetCacheProjection()) {
           struct.cacheProjection.write(oprot);
         }
-        if (struct.isSetPath()) {
-          oprot.writeString(struct.path);
-        }
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(3);
+        BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
           struct.projection = new CuratorProjection();
           struct.projection.read(iprot);
@@ -10952,27 +11087,23 @@ public class CuratorService {
           struct.cacheProjection.read(iprot);
           struct.setCacheProjectionIsSet(true);
         }
-        if (incoming.get(2)) {
-          struct.path = iprot.readString();
-          struct.setPathIsSet(true);
-        }
       }
     }
 
   }
 
-  public static class getPathChildrenCacheDataForPath_result implements org.apache.thrift.TBase<getPathChildrenCacheDataForPath_result, getPathChildrenCacheDataForPath_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheDataForPath_result>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheDataForPath_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);
+  public static class getPathChildrenCacheData_result implements org.apache.thrift.TBase<getPathChildrenCacheData_result, getPathChildrenCacheData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheData_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheData_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new getPathChildrenCacheDataForPath_resultStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new getPathChildrenCacheDataForPath_resultTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new getPathChildrenCacheData_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheData_resultTupleSchemeFactory());
     }
 
-    public ChildData success; // required
+    public List<ChildData> success; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -11037,16 +11168,17 @@ public class CuratorService {
     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, ChildData.class)));
+          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ChildData.class))));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheDataForPath_result.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheData_result.class, metaDataMap);
     }
 
-    public getPathChildrenCacheDataForPath_result() {
+    public getPathChildrenCacheData_result() {
     }
 
-    public getPathChildrenCacheDataForPath_result(
-      ChildData success)
+    public getPathChildrenCacheData_result(
+      List<ChildData> success)
     {
       this();
       this.success = success;
@@ -11055,14 +11187,18 @@ public class CuratorService {
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public getPathChildrenCacheDataForPath_result(getPathChildrenCacheDataForPath_result other) {
+    public getPathChildrenCacheData_result(getPathChildrenCacheData_result other) {
       if (other.isSetSuccess()) {
-        this.success = new ChildData(other.success);
+        List<ChildData> __this__success = new ArrayList<ChildData>(other.success.size());
+        for (ChildData other_element : other.success) {
+          __this__success.add(new ChildData(other_element));
+        }
+        this.success = __this__success;
       }
     }
 
-    public getPathChildrenCacheDataForPath_result deepCopy() {
-      return new getPathChildrenCacheDataForPath_result(this);
+    public getPathChildrenCacheData_result deepCopy() {
+      return new getPathChildrenCacheData_result(this);
     }
 
     @Override
@@ -11070,11 +11206,26 @@ public class CuratorService {
       this.success = null;
     }
 
-    public ChildData getSuccess() {
+    public int getSuccessSize() {
+      return (this.success == null) ? 0 : this.success.size();
+    }
+
+    public java.util.Iterator<ChildData> getSuccessIterator() {
+      return (this.success == null) ? null : this.success.iterator();
+    }
+
+    public void addToSuccess(ChildData elem) {
+      if (this.success == null) {
+        this.success = new ArrayList<ChildData>();
+      }
+      this.success.add(elem);
+    }
+
+    public List<ChildData> getSuccess() {
       return this.success;
     }
 
-    public getPathChildrenCacheDataForPath_result setSuccess(ChildData success) {
+    public getPathChildrenCacheData_result setSuccess(List<ChildData> success) {
       this.success = success;
       return this;
     }
@@ -11100,7 +11251,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((ChildData)value);
+          setSuccess((List<ChildData>)value);
         }
         break;
 
@@ -11133,12 +11284,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof getPathChildrenCacheDataForPath_result)
-        return this.equals((getPathChildrenCacheDataForPath_result)that);
+      if (that instanceof getPathChildrenCacheData_result)
+        return this.equals((getPathChildrenCacheData_result)that);
       return false;
     }
 
-    public boolean equals(getPathChildrenCacheDataForPath_result that) {
+    public boolean equals(getPathChildrenCacheData_result that) {
       if (that == null)
         return false;
 
@@ -11160,7 +11311,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(getPathChildrenCacheDataForPath_result other) {
+    public int compareTo(getPathChildrenCacheData_result other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -11194,7 +11345,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("getPathChildrenCacheDataForPath_result(");
+      StringBuilder sb = new StringBuilder("getPathChildrenCacheData_result(");
       boolean first = true;
 
       sb.append("success:");
@@ -11211,9 +11362,6 @@ public class CuratorService {
     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 {
@@ -11232,15 +11380,15 @@ public class CuratorService {
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_resultStandardSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheDataForPath_resultStandardScheme getScheme() {
-        return new getPathChildrenCacheDataForPath_resultStandardScheme();
+    private static class getPathChildrenCacheData_resultStandardSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_resultStandardScheme getScheme() {
+        return new getPathChildrenCacheData_resultStandardScheme();
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_resultStandardScheme extends StandardScheme<getPathChildrenCacheDataForPath_result> {
+    private static class getPathChildrenCacheData_resultStandardScheme extends StandardScheme<getPathChildrenCacheData_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -11251,9 +11399,19 @@ public class CuratorService {
           }
           switch (schemeField.id) {
             case 0: // SUCCESS
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.success = new ChildData();
-                struct.success.read(iprot);
+              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+                {
+                  org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
+                  struct.success = new ArrayList<ChildData>(_list32.size);
+                  for (int _i33 = 0; _i33 < _list32.size; ++_i33)
+                  {
+                    ChildData _elem34;
+                    _elem34 = new ChildData();
+                    _elem34.read(iprot);
+                    struct.success.add(_elem34);
+                  }
+                  iprot.readListEnd();
+                }
                 struct.setSuccessIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -11270,13 +11428,20 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, getPathChildrenCacheData_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.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+            for (ChildData _iter35 : struct.success)
+            {
+              _iter35.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -11285,16 +11450,16 @@ public class CuratorService {
 
     }
 
-    private static class getPathChildrenCacheDataForPath_resultTupleSchemeFactory implements SchemeFactory {
-      public getPathChildrenCacheDataForPath_resultTupleScheme getScheme() {
-        return new getPathChildrenCacheDataForPath_resultTupleScheme();
+    private static class getPathChildrenCacheData_resultTupleSchemeFactory implements SchemeFactory {
+      public getPathChildrenCacheData_resultTupleScheme getScheme() {
+        return new getPathChildrenCacheData_resultTupleScheme();
       }
     }
 
-    private static class getPathChildrenCacheDataForPath_resultTupleScheme extends TupleScheme<getPathChildrenCacheDataForPath_result> {
+    private static class getPathChildrenCacheData_resultTupleScheme extends TupleScheme<getPathChildrenCacheData_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
         if (struct.isSetSuccess()) {
@@ -11302,17 +11467,32 @@ public class CuratorService {
         }
         oprot.writeBitSet(optionals, 1);
         if (struct.isSetSuccess()) {
-          struct.success.write(oprot);
+          {
+            oprot.writeI32(struct.success.size());
+            for (ChildData _iter36 : struct.success)
+            {
+              _iter36.write(oprot);
+            }
+          }
         }
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheDataForPath_result struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, getPathChildrenCacheData_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(1);
         if (incoming.get(0)) {
-          struct.success = new ChildData();
-          struct.success.read(iprot);
+          {
+            org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.success = new ArrayList<ChildData>(_list37.size);
+            for (int _i38 = 0; _i38 < _list37.size; ++_i38)
+            {
+              ChildData _elem39;
+              _elem39 = new ChildData();
+              _elem39.read(iprot);
+              struct.success.add(_elem39);
+            }
+          }
           struct.setSuccessIsSet(true);
         }
       }
@@ -11320,25 +11500,28 @@ public class CuratorService {
 
   }
 
-  public static class isLeader_args implements org.apache.thrift.TBase<isLeader_args, isLeader_args._Fields>, java.io.Serializable, Cloneable, Comparable<isLeader_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isLeader_args");
+  public static class getPathChildrenCacheDataForPath_args implements org.apache.thrift.TBase<getPathChildrenCacheDataForPath_args, getPathChildrenCacheDataForPath_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPathChildrenCacheDataForPath_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPathChildrenCacheDataForPath_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-    private static final org.apache.thrift.protocol.TField LEADER_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("leaderProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField CACHE_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cacheProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)3);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new isLeader_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new isLeader_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new getPathChildrenCacheDataForPath_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getPathChildrenCacheDataForPath_argsTupleSchemeFactory());
     }
 
     public CuratorProjection projection; // required
-    public LeaderProjection leaderProjection; // required
+    public PathChildrenCacheProjection cacheProjection; // required
+    public String path; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
       PROJECTION((short)1, "projection"),
-      LEADER_PROJECTION((short)2, "leaderProjection");
+      CACHE_PROJECTION((short)2, "cacheProjection"),
+      PATH((short)3, "path");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -11355,8 +11538,10 @@ public class CuratorService {
         switch(fieldId) {
           case 1: // PROJECTION
             return PROJECTION;
-          case 2: // LEADER_PROJECTION
-            return LEADER_PROJECTION;
+          case 2: // CACHE_PROJECTION
+            return CACHE_PROJECTION;
+          case 3: // PATH
+            return PATH;
           default:
             return null;
         }
@@ -11402,51 +11587,59 @@ public class CuratorService {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
-      tmpMap.put(_Fields.LEADER_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("leaderProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LeaderProjection.class)));
+      tmpMap.put(_Fields.CACHE_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("cacheProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isLeader_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPathChildrenCacheDataForPath_args.class, metaDataMap);
     }
 
-    public isLeader_args() {
+    public getPathChildrenCacheDataForPath_args() {
     }
 
-    public isLeader_args(
+    public getPathChildrenCacheDataForPath_args(
       CuratorProjection projection,
-      LeaderProjection leaderProjection)
+      PathChildrenCacheProjection cacheProjection,
+      String path)
     {
       this();
       this.projection = projection;
-      this.leaderProjection = leaderProjection;
+      this.cacheProjection = cacheProjection;
+      this.path = path;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public isLeader_args(isLeader_args other) {
+    public getPathChildrenCacheDataForPath_args(getPathChildrenCacheDataForPath_args other) {
       if (other.isSetProjection()) {
         this.projection = new CuratorProjection(other.projection);
       }
-      if (other.isSetLeaderProjection()) {
-        this.leaderProjection = new LeaderProjection(other.leaderProjection);
+      if (other.isSetCacheProjection()) {
+        this.cacheProjection = new PathChildrenCacheProjection(other.cacheProjection);
+      }
+      if (other.isSetPath()) {
+        this.path = other.path;
       }
     }
 
-    public isLeader_args deepCopy() {
-      return new isLeader_args(this);
+    public getPathChildrenCacheDataForPath_args deepCopy() {
+      return new getPathChildrenCacheDataForPath_args(this);
     }
 
     @Override
     public void clear() {
       this.projection = null;
-      this.leaderProjection = null;
+      this.cacheProjection = null;
+      this.path = null;
     }
 
     public CuratorProjection getProjection() {
       return this.projection;
     }
 
-    public isLeader_args setProjection(CuratorProjection projection) {
+    public getPathChildrenCacheDataForPath_args setProjection(CuratorProjection projection) {
       this.projection = projection;
       return this;
     }
@@ -11466,27 +11659,51 @@ public class CuratorService {
       }
     }
 
-    public LeaderProjection getLeaderProjection() {
-      return this.leaderProjection;
+    public PathChildrenCacheProjection getCacheProjection() {
+      return this.cacheProjection;
     }
 
-    public isLeader_args setLeaderProjection(LeaderProjection leaderProjection) {
-      this.leaderProjection = leaderProjection;
+    public getPathChildrenCacheDataForPath_args setCacheProjection(PathChildrenCacheProjection cacheProjection) {
+      this.cacheProjection = cacheProjection;
       return this;
     }
 
-    public void unsetLeaderProjection() {
-      this.leaderProjection = null;
+    public void unsetCacheProjection() {
+      this.cacheProjection = null;
     }
 
-    /** Returns true if field leaderProjection is set (has been assigned a value) and false otherwise */
-    public boolean isSetLeaderProjection() {
-      return this.leaderProjection != null;
+    /** Returns true if field cacheProjection is set (has been assigned a value) and false otherwise */
+    public boolean isSetCacheProjection() {
+      return this.cacheProjection != null;
     }
 
-    public void setLeaderProjectionIsSet(boolean value) {
+    public void setCacheProjectionIsSet(boolean value) {
       if (!value) {
-        this.leaderProjection = null;
+        this.cacheProjection = null;
+      }
+    }
+
+    public String getPath() {
+      return this.path;
+    }
+
+    public getPathChildrenCacheDataForPath_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
+
+    public void unsetPath() {
+      this.path = null;
+    }
+
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
+
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
       }
     }
 
@@ -11500,24 +11717,35 @@ public class CuratorService {
         }
         break;
 
-      case LEADER_PROJECTION:
+      case CACHE_PROJECTION:
         if (value == null) {
-          unsetLeaderProjection();
+          unsetCacheProjection();
         } else {
-          setLeaderProjection((LeaderProjection)value);
+          setCacheProjection((PathChildrenCacheProjection)value);
         }
         break;
 
-      }
-    }
-
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case PROJECTION:
-        return getProjection();
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
 
-      case LEADER_PROJECTION:
-        return getLeaderProjection();
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case CACHE_PROJECTION:
+        return getCacheProjection();
+
+      case PATH:
+        return getPath();
 
       }
       throw new IllegalStateException();
@@ -11532,8 +11760,10 @@ public class CuratorService {
       switch (field) {
       case PROJECTION:
         return isSetProjection();
-      case LEADER_PROJECTION:
-        return isSetLeaderProjection();
+      case CACHE_PROJECTION:
+        return isSetCacheProjection();
+      case PATH:
+        return isSetPath();
       }
       throw new IllegalStateException();
     }
@@ -11542,12 +11772,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof isLeader_args)
-        return this.equals((isLeader_args)that);
+      if (that instanceof getPathChildrenCacheDataForPath_args)
+        return this.equals((getPathChildrenCacheDataForPath_args)that);
       return false;
     }
 
-    public boolean equals(isLeader_args that) {
+    public boolean equals(getPathChildrenCacheDataForPath_args that) {
       if (that == null)
         return false;
 
@@ -11560,12 +11790,21 @@ public class CuratorService {
           return false;
       }
 
-      boolean this_present_leaderProjection = true && this.isSetLeaderProjection();
-      boolean that_present_leaderProjection = true && that.isSetLeaderProjection();
-      if (this_present_leaderProjection || that_present_leaderProjection) {
-        if (!(this_present_leaderProjection && that_present_leaderProjection))
+      boolean this_present_cacheProjection = true && this.isSetCacheProjection();
+      boolean that_present_cacheProjection = true && that.isSetCacheProjection();
+      if (this_present_cacheProjection || that_present_cacheProjection) {
+        if (!(this_present_cacheProjection && that_present_cacheProjection))
           return false;
-        if (!this.leaderProjection.equals(that.leaderProjection))
+        if (!this.cacheProjection.equals(that.cacheProjection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
           return false;
       }
 
@@ -11578,7 +11817,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(isLeader_args other) {
+    public int compareTo(getPathChildrenCacheDataForPath_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -11595,12 +11834,22 @@ public class CuratorService {
           return lastComparison;
         }
       }
-      lastComparison = Boolean.valueOf(isSetLeaderProjection()).compareTo(other.isSetLeaderProjection());
+      lastComparison = Boolean.valueOf(isSetCacheProjection()).compareTo(other.isSetCacheProjection());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetLeaderProjection()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leaderProjection, other.leaderProjection);
+      if (isSetCacheProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cacheProjection, other.cacheProjection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -11622,7 +11871,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("isLeader_args(");
+      StringBuilder sb = new StringBuilder("getPathChildrenCacheDataForPath_args(");
       boolean first = true;
 
       sb.append("projection:");
@@ -11633,11 +11882,19 @@ public class CuratorService {
       }
       first = false;
       if (!first) sb.append(", ");
-      sb.append("leaderProjection:");
-      if (this.leaderProjection == null) {
+      sb.append("cacheProjection:");
+      if (this.cacheProjection == null) {
         sb.append("null");
       } else {
-        sb.append(this.leaderProjection);
+        sb.append(this.cacheProjection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
       }
       first = false;
       sb.append(")");
@@ -11650,8 +11907,8 @@ public class CuratorService {
       if (projection != null) {
         projection.validate();
       }
-      if (leaderProjection != null) {
-        leaderProjection.validate();
+      if (cacheProjection != null) {
+        cacheProjection.validate();
       }
     }
 
@@ -11671,15 +11928,15 @@ public class CuratorService {
       }
     }
 
-    private static class isLeader_argsStandardSchemeFactory implements SchemeFactory {
-      public isLeader_argsStandardScheme getScheme() {
-        return new isLeader_argsStandardScheme();
+    private static class g

<TRUNCATED>

[30/50] [abbrv] git commit: work on packaging and doc

Posted by ra...@apache.org.
work on packaging and doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/eeeea122
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/eeeea122
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/eeeea122

Branch: refs/heads/master
Commit: eeeea122f6b41171dadf26b3d397415a631b597f
Parents: 73decc7
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 13:28:59 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 13:28:59 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/dependency-reduced-pom.xml | 6 ++++++
 curator-x-rpc/pom.xml                    | 6 ++++++
 pom.xml                                  | 2 ++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/eeeea122/curator-x-rpc/dependency-reduced-pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/dependency-reduced-pom.xml b/curator-x-rpc/dependency-reduced-pom.xml
index abb20c7..25e5f68 100644
--- a/curator-x-rpc/dependency-reduced-pom.xml
+++ b/curator-x-rpc/dependency-reduced-pom.xml
@@ -16,6 +16,12 @@
           <include>curator/help.txt</include>
         </includes>
       </resource>
+      <resource>
+        <directory>${project.basedir}/src/main/thrift</directory>
+        <includes>
+          <include>curator.thrift</include>
+        </includes>
+      </resource>
     </resources>
     <plugins>
       <plugin>

http://git-wip-us.apache.org/repos/asf/curator/blob/eeeea122/curator-x-rpc/pom.xml
----------------------------------------------------------------------
diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
index de9bfb0..1bc3b90 100644
--- a/curator-x-rpc/pom.xml
+++ b/curator-x-rpc/pom.xml
@@ -99,6 +99,12 @@
                     <include>curator/help.txt</include>
                 </includes>
             </resource>
+            <resource>
+                <directory>${project.basedir}/src/main/thrift</directory>
+                <includes>
+                    <include>curator.thrift</include>
+                </includes>
+            </resource>
         </resources>
 
         <plugins>

http://git-wip-us.apache.org/repos/asf/curator/blob/eeeea122/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ec3e374..837908e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -703,6 +703,7 @@
                         <exclude>**/help.txt</exclude>
                         <exclude>**/*.rdf</exclude>
                         <exclude>**/.gitignore</exclude>
+                        <exclude>**/.thrift</exclude>
                         <exclude>**/.idea/**</exclude>
                         <exclude>**/DISCLAIMER</exclude>
                         <exclude>**/DEPENDENCIES</exclude>
@@ -746,6 +747,7 @@
                         <exclude>**/*.rdf</exclude>
                         <exclude>**/help.txt</exclude>
                         <exclude>**/.gitignore</exclude>
+                        <exclude>**/.thrift</exclude>
                         <exclude>**/.idea/**</exclude>
                         <exclude>**/DISCLAIMER</exclude>
                         <exclude>**/DEPENDENCIES</exclude>


[06/50] [abbrv] git commit: refactoring

Posted by ra...@apache.org.
refactoring


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6e9fa2a4
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6e9fa2a4
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6e9fa2a4

Branch: refs/heads/master
Commit: 6e9fa2a4bac892c42ed85d1af658c5aff41ffbed
Parents: 985c9ed
Author: randgalt <ra...@apache.org>
Authored: Thu May 29 20:56:38 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu May 29 20:56:38 2014 -0500

----------------------------------------------------------------------
 .../projection/CuratorProjectionService.java    |  27 +-
 .../x/rpc/idl/projection/LeaderProjection.java  |   6 +-
 .../x/rpc/idl/projection/LockProjection.java    |  20 +
 .../rpc/idl/projection/NodeCacheProjection.java |   6 +-
 .../projection/PathChildrenCacheProjection.java |   6 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |  14 +-
 .../curator/generated/CuratorService.java       | 175 ++++-----
 .../curator/generated/LeaderProjection.java     | 111 +++---
 .../curator/generated/LockProjection.java       | 388 +++++++++++++++++++
 .../curator/generated/NodeCacheProjection.java  | 111 +++---
 .../generated/PathChildrenCacheProjection.java  | 111 +++---
 .../org/apache/curator/x/rpc/TestClient.java    |   6 +-
 12 files changed, 686 insertions(+), 295 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index a870447..c82ad5c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -257,20 +257,20 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection) throws Exception
+    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws Exception
     {
         CuratorEntry entry = getEntry(curatorProjection);
-        return entry.closeThing(genericProjection.id);
+        return entry.closeThing(id);
     }
 
     @ThriftMethod
-    public GenericProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
+    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
     {
         CuratorEntry entry = getEntry(projection);
         InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
         if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
         {
-            return new GenericProjection();
+            return new LockProjection();
         }
 
         Closer<InterProcessSemaphoreMutex> closer = new Closer<InterProcessSemaphoreMutex>()
@@ -292,7 +292,7 @@ public class CuratorProjectionService
             }
         };
         String id = entry.addThing(lock, closer);
-        return new GenericProjection(id);
+        return new LockProjection(id);
     }
 
     @ThriftMethod
@@ -341,8 +341,7 @@ public class CuratorProjectionService
             leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
         }
 
-        GenericProjection leaderProjection = new GenericProjection(id);
-        return new LeaderResult(new LeaderProjection(leaderProjection), leaderLatch.hasLeadership());
+        return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
     }
 
     @ThriftMethod
@@ -350,7 +349,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.projection.id, LeaderLatch.class);
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
         Collection<Participant> participants = leaderLatch.getParticipants();
         return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
             {
@@ -367,7 +366,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        LeaderLatch leaderLatch = getThing(entry, leaderProjection.projection.id, LeaderLatch.class);
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
         return leaderLatch.hasLeadership();
     }
 
@@ -406,7 +405,7 @@ public class CuratorProjectionService
         };
         cache.getListenable().addListener(listener);
 
-        return new PathChildrenCacheProjection(new GenericProjection(id));
+        return new PathChildrenCacheProjection(id);
     }
 
     @ThriftMethod
@@ -414,7 +413,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.projection.id, PathChildrenCache.class);
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
         return Lists.transform
         (
             pathChildrenCache.getCurrentData(),
@@ -434,7 +433,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.projection.id, PathChildrenCache.class);
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
         return new RpcChildData(pathChildrenCache.getCurrentData(path));
     }
 
@@ -473,7 +472,7 @@ public class CuratorProjectionService
         };
         cache.getListenable().addListener(listener);
 
-        return new NodeCacheProjection(new GenericProjection(id));
+        return new NodeCacheProjection(id);
     }
 
     @ThriftMethod
@@ -481,7 +480,7 @@ public class CuratorProjectionService
     {
         final CuratorEntry entry = getEntry(projection);
 
-        NodeCache nodeCache = getThing(entry, cacheProjection.projection.id, NodeCache.class);
+        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
         return new RpcChildData(nodeCache.getCurrentData());
     }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
index 51fb56f..bf66497 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
@@ -7,14 +7,14 @@ import com.facebook.swift.codec.ThriftStruct;
 public class LeaderProjection
 {
     @ThriftField(1)
-    public GenericProjection projection;
+    public String id;
 
     public LeaderProjection()
     {
     }
 
-    public LeaderProjection(GenericProjection projection)
+    public LeaderProjection(String id)
     {
-        this.projection = projection;
+        this.id = id;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
new file mode 100644
index 0000000..83bb68b
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.projection;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LockProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public LockProjection()
+    {
+    }
+
+    public LockProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
index 43d1138..7fa8957 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
@@ -7,14 +7,14 @@ import com.facebook.swift.codec.ThriftStruct;
 public class NodeCacheProjection
 {
     @ThriftField(1)
-    public GenericProjection projection;
+    public String id;
 
     public NodeCacheProjection()
     {
     }
 
-    public NodeCacheProjection(GenericProjection projection)
+    public NodeCacheProjection(String id)
     {
-        this.projection = projection;
+        this.id = id;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
index 666f43c..a1ee396 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
@@ -7,14 +7,14 @@ import com.facebook.swift.codec.ThriftStruct;
 public class PathChildrenCacheProjection
 {
     @ThriftField(1)
-    public GenericProjection projection;
+    public String id;
 
     public PathChildrenCacheProjection()
     {
     }
 
-    public PathChildrenCacheProjection(GenericProjection projection)
+    public PathChildrenCacheProjection(String id)
     {
-        this.projection = projection;
+        this.id = id;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 6ed104d..bd4753a 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -55,15 +55,19 @@ struct GetDataSpec {
 }
 
 struct LeaderProjection {
-  1: GenericProjection projection;
+  1: string id;
+}
+
+struct LockProjection {
+  1: string id;
 }
 
 struct NodeCacheProjection {
-  1: GenericProjection projection;
+  1: string id;
 }
 
 struct PathChildrenCacheProjection {
-  1: GenericProjection projection;
+  1: string id;
 }
 
 struct Version {
@@ -183,9 +187,9 @@ struct CuratorEvent {
 }
 
 service CuratorService {
-  GenericProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs);
+  LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs);
   void closeCuratorProjection(1: CuratorProjection projection);
-  bool closeGenericProjection(1: CuratorProjection curatorProjection, 2: GenericProjection genericProjection);
+  bool closeGenericProjection(1: CuratorProjection curatorProjection, 2: string id);
   OptionalPath createNode(1: CuratorProjection projection, 2: CreateSpec spec);
   void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec);
   OptionalStat exists(1: CuratorProjection projection, 2: ExistsSpec spec);

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index da9ae2c..100b6c7 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -36,11 +36,11 @@ public class CuratorService {
 
   public interface Iface {
 
-    public GenericProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException;
+    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException;
 
     public void closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection) throws org.apache.thrift.TException;
+    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException;
 
     public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws org.apache.thrift.TException;
 
@@ -80,7 +80,7 @@ public class CuratorService {
 
     public void closeCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void closeGenericProjection(CuratorProjection curatorProjection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void createNode(CuratorProjection projection, CreateSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -134,7 +134,7 @@ public class CuratorService {
       super(iprot, oprot);
     }
 
-    public GenericProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException
+    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException
     {
       send_acquireLock(projection, path, maxWaitMs);
       return recv_acquireLock();
@@ -149,7 +149,7 @@ public class CuratorService {
       sendBase("acquireLock", args);
     }
 
-    public GenericProjection recv_acquireLock() throws org.apache.thrift.TException
+    public LockProjection recv_acquireLock() throws org.apache.thrift.TException
     {
       acquireLock_result result = new acquireLock_result();
       receiveBase(result, "acquireLock");
@@ -179,17 +179,17 @@ public class CuratorService {
       return;
     }
 
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection) throws org.apache.thrift.TException
+    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException
     {
-      send_closeGenericProjection(curatorProjection, genericProjection);
+      send_closeGenericProjection(curatorProjection, id);
       return recv_closeGenericProjection();
     }
 
-    public void send_closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection) throws org.apache.thrift.TException
+    public void send_closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException
     {
       closeGenericProjection_args args = new closeGenericProjection_args();
       args.setCuratorProjection(curatorProjection);
-      args.setGenericProjection(genericProjection);
+      args.setId(id);
       sendBase("closeGenericProjection", args);
     }
 
@@ -613,7 +613,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public GenericProjection getResult() throws org.apache.thrift.TException {
+      public LockProjection getResult() throws org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -655,27 +655,27 @@ public class CuratorService {
       }
     }
 
-    public void closeGenericProjection(CuratorProjection curatorProjection, GenericProjection genericProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void closeGenericProjection(CuratorProjection curatorProjection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      closeGenericProjection_call method_call = new closeGenericProjection_call(curatorProjection, genericProjection, resultHandler, this, ___protocolFactory, ___transport);
+      closeGenericProjection_call method_call = new closeGenericProjection_call(curatorProjection, id, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class closeGenericProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
       private CuratorProjection curatorProjection;
-      private GenericProjection genericProjection;
-      public closeGenericProjection_call(CuratorProjection curatorProjection, GenericProjection genericProjection, 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 {
+      private String id;
+      public closeGenericProjection_call(CuratorProjection curatorProjection, String id, 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.curatorProjection = curatorProjection;
-        this.genericProjection = genericProjection;
+        this.id = id;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeGenericProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
         closeGenericProjection_args args = new closeGenericProjection_args();
         args.setCuratorProjection(curatorProjection);
-        args.setGenericProjection(genericProjection);
+        args.setId(id);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -1325,7 +1325,7 @@ public class CuratorService {
 
       public closeGenericProjection_result getResult(I iface, closeGenericProjection_args args) throws org.apache.thrift.TException {
         closeGenericProjection_result result = new closeGenericProjection_result();
-        result.success = iface.closeGenericProjection(args.curatorProjection, args.genericProjection);
+        result.success = iface.closeGenericProjection(args.curatorProjection, args.id);
         result.setSuccessIsSet(true);
         return result;
       }
@@ -1666,7 +1666,7 @@ public class CuratorService {
       return processMap;
     }
 
-    public static class acquireLock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, acquireLock_args, GenericProjection> {
+    public static class acquireLock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, acquireLock_args, LockProjection> {
       public acquireLock() {
         super("acquireLock");
       }
@@ -1675,10 +1675,10 @@ public class CuratorService {
         return new acquireLock_args();
       }
 
-      public AsyncMethodCallback<GenericProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<LockProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<GenericProjection>() { 
-          public void onComplete(GenericProjection o) {
+        return new AsyncMethodCallback<LockProjection>() { 
+          public void onComplete(LockProjection o) {
             acquireLock_result result = new acquireLock_result();
             result.success = o;
             try {
@@ -1712,7 +1712,7 @@ public class CuratorService {
         return false;
       }
 
-      public void start(I iface, acquireLock_args args, org.apache.thrift.async.AsyncMethodCallback<GenericProjection> resultHandler) throws TException {
+      public void start(I iface, acquireLock_args args, org.apache.thrift.async.AsyncMethodCallback<LockProjection> resultHandler) throws TException {
         iface.acquireLock(args.projection, args.path, args.maxWaitMs,resultHandler);
       }
     }
@@ -1815,7 +1815,7 @@ public class CuratorService {
       }
 
       public void start(I iface, closeGenericProjection_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
-        iface.closeGenericProjection(args.curatorProjection, args.genericProjection,resultHandler);
+        iface.closeGenericProjection(args.curatorProjection, args.id,resultHandler);
       }
     }
 
@@ -3154,7 +3154,7 @@ public class CuratorService {
       schemes.put(TupleScheme.class, new acquireLock_resultTupleSchemeFactory());
     }
 
-    public GenericProjection success; // required
+    public LockProjection success; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -3219,7 +3219,7 @@ public class CuratorService {
     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, GenericProjection.class)));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LockProjection.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(acquireLock_result.class, metaDataMap);
     }
@@ -3228,7 +3228,7 @@ public class CuratorService {
     }
 
     public acquireLock_result(
-      GenericProjection success)
+      LockProjection success)
     {
       this();
       this.success = success;
@@ -3239,7 +3239,7 @@ public class CuratorService {
      */
     public acquireLock_result(acquireLock_result other) {
       if (other.isSetSuccess()) {
-        this.success = new GenericProjection(other.success);
+        this.success = new LockProjection(other.success);
       }
     }
 
@@ -3252,11 +3252,11 @@ public class CuratorService {
       this.success = null;
     }
 
-    public GenericProjection getSuccess() {
+    public LockProjection getSuccess() {
       return this.success;
     }
 
-    public acquireLock_result setSuccess(GenericProjection success) {
+    public acquireLock_result setSuccess(LockProjection success) {
       this.success = success;
       return this;
     }
@@ -3282,7 +3282,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((GenericProjection)value);
+          setSuccess((LockProjection)value);
         }
         break;
 
@@ -3434,7 +3434,7 @@ public class CuratorService {
           switch (schemeField.id) {
             case 0: // SUCCESS
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.success = new GenericProjection();
+                struct.success = new LockProjection();
                 struct.success.read(iprot);
                 struct.setSuccessIsSet(true);
               } else { 
@@ -3493,7 +3493,7 @@ public class CuratorService {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(1);
         if (incoming.get(0)) {
-          struct.success = new GenericProjection();
+          struct.success = new LockProjection();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
@@ -4111,7 +4111,7 @@ public class CuratorService {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeGenericProjection_args");
 
     private static final org.apache.thrift.protocol.TField CURATOR_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("curatorProjection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-    private static final org.apache.thrift.protocol.TField GENERIC_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("genericProjection", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -4120,12 +4120,12 @@ public class CuratorService {
     }
 
     public CuratorProjection curatorProjection; // required
-    public GenericProjection genericProjection; // required
+    public String id; // 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 {
       CURATOR_PROJECTION((short)1, "curatorProjection"),
-      GENERIC_PROJECTION((short)2, "genericProjection");
+      ID((short)2, "id");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4142,8 +4142,8 @@ public class CuratorService {
         switch(fieldId) {
           case 1: // CURATOR_PROJECTION
             return CURATOR_PROJECTION;
-          case 2: // GENERIC_PROJECTION
-            return GENERIC_PROJECTION;
+          case 2: // ID
+            return ID;
           default:
             return null;
         }
@@ -4189,8 +4189,8 @@ public class CuratorService {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.CURATOR_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("curatorProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
-      tmpMap.put(_Fields.GENERIC_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("genericProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GenericProjection.class)));
+      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeGenericProjection_args.class, metaDataMap);
     }
@@ -4200,11 +4200,11 @@ public class CuratorService {
 
     public closeGenericProjection_args(
       CuratorProjection curatorProjection,
-      GenericProjection genericProjection)
+      String id)
     {
       this();
       this.curatorProjection = curatorProjection;
-      this.genericProjection = genericProjection;
+      this.id = id;
     }
 
     /**
@@ -4214,8 +4214,8 @@ public class CuratorService {
       if (other.isSetCuratorProjection()) {
         this.curatorProjection = new CuratorProjection(other.curatorProjection);
       }
-      if (other.isSetGenericProjection()) {
-        this.genericProjection = new GenericProjection(other.genericProjection);
+      if (other.isSetId()) {
+        this.id = other.id;
       }
     }
 
@@ -4226,7 +4226,7 @@ public class CuratorService {
     @Override
     public void clear() {
       this.curatorProjection = null;
-      this.genericProjection = null;
+      this.id = null;
     }
 
     public CuratorProjection getCuratorProjection() {
@@ -4253,27 +4253,27 @@ public class CuratorService {
       }
     }
 
-    public GenericProjection getGenericProjection() {
-      return this.genericProjection;
+    public String getId() {
+      return this.id;
     }
 
-    public closeGenericProjection_args setGenericProjection(GenericProjection genericProjection) {
-      this.genericProjection = genericProjection;
+    public closeGenericProjection_args setId(String id) {
+      this.id = id;
       return this;
     }
 
-    public void unsetGenericProjection() {
-      this.genericProjection = null;
+    public void unsetId() {
+      this.id = null;
     }
 
-    /** Returns true if field genericProjection is set (has been assigned a value) and false otherwise */
-    public boolean isSetGenericProjection() {
-      return this.genericProjection != null;
+    /** Returns true if field id is set (has been assigned a value) and false otherwise */
+    public boolean isSetId() {
+      return this.id != null;
     }
 
-    public void setGenericProjectionIsSet(boolean value) {
+    public void setIdIsSet(boolean value) {
       if (!value) {
-        this.genericProjection = null;
+        this.id = null;
       }
     }
 
@@ -4287,11 +4287,11 @@ public class CuratorService {
         }
         break;
 
-      case GENERIC_PROJECTION:
+      case ID:
         if (value == null) {
-          unsetGenericProjection();
+          unsetId();
         } else {
-          setGenericProjection((GenericProjection)value);
+          setId((String)value);
         }
         break;
 
@@ -4303,8 +4303,8 @@ public class CuratorService {
       case CURATOR_PROJECTION:
         return getCuratorProjection();
 
-      case GENERIC_PROJECTION:
-        return getGenericProjection();
+      case ID:
+        return getId();
 
       }
       throw new IllegalStateException();
@@ -4319,8 +4319,8 @@ public class CuratorService {
       switch (field) {
       case CURATOR_PROJECTION:
         return isSetCuratorProjection();
-      case GENERIC_PROJECTION:
-        return isSetGenericProjection();
+      case ID:
+        return isSetId();
       }
       throw new IllegalStateException();
     }
@@ -4347,12 +4347,12 @@ public class CuratorService {
           return false;
       }
 
-      boolean this_present_genericProjection = true && this.isSetGenericProjection();
-      boolean that_present_genericProjection = true && that.isSetGenericProjection();
-      if (this_present_genericProjection || that_present_genericProjection) {
-        if (!(this_present_genericProjection && that_present_genericProjection))
+      boolean this_present_id = true && this.isSetId();
+      boolean that_present_id = true && that.isSetId();
+      if (this_present_id || that_present_id) {
+        if (!(this_present_id && that_present_id))
           return false;
-        if (!this.genericProjection.equals(that.genericProjection))
+        if (!this.id.equals(that.id))
           return false;
       }
 
@@ -4382,12 +4382,12 @@ public class CuratorService {
           return lastComparison;
         }
       }
-      lastComparison = Boolean.valueOf(isSetGenericProjection()).compareTo(other.isSetGenericProjection());
+      lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetGenericProjection()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.genericProjection, other.genericProjection);
+      if (isSetId()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -4420,11 +4420,11 @@ public class CuratorService {
       }
       first = false;
       if (!first) sb.append(", ");
-      sb.append("genericProjection:");
-      if (this.genericProjection == null) {
+      sb.append("id:");
+      if (this.id == null) {
         sb.append("null");
       } else {
-        sb.append(this.genericProjection);
+        sb.append(this.id);
       }
       first = false;
       sb.append(")");
@@ -4437,9 +4437,6 @@ public class CuratorService {
       if (curatorProjection != null) {
         curatorProjection.validate();
       }
-      if (genericProjection != null) {
-        genericProjection.validate();
-      }
     }
 
     private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -4485,11 +4482,10 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
-            case 2: // GENERIC_PROJECTION
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.genericProjection = new GenericProjection();
-                struct.genericProjection.read(iprot);
-                struct.setGenericProjectionIsSet(true);
+            case 2: // ID
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.id = iprot.readString();
+                struct.setIdIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
@@ -4514,9 +4510,9 @@ public class CuratorService {
           struct.curatorProjection.write(oprot);
           oprot.writeFieldEnd();
         }
-        if (struct.genericProjection != null) {
-          oprot.writeFieldBegin(GENERIC_PROJECTION_FIELD_DESC);
-          struct.genericProjection.write(oprot);
+        if (struct.id != null) {
+          oprot.writeFieldBegin(ID_FIELD_DESC);
+          oprot.writeString(struct.id);
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -4540,15 +4536,15 @@ public class CuratorService {
         if (struct.isSetCuratorProjection()) {
           optionals.set(0);
         }
-        if (struct.isSetGenericProjection()) {
+        if (struct.isSetId()) {
           optionals.set(1);
         }
         oprot.writeBitSet(optionals, 2);
         if (struct.isSetCuratorProjection()) {
           struct.curatorProjection.write(oprot);
         }
-        if (struct.isSetGenericProjection()) {
-          struct.genericProjection.write(oprot);
+        if (struct.isSetId()) {
+          oprot.writeString(struct.id);
         }
       }
 
@@ -4562,9 +4558,8 @@ public class CuratorService {
           struct.setCuratorProjectionIsSet(true);
         }
         if (incoming.get(1)) {
-          struct.genericProjection = new GenericProjection();
-          struct.genericProjection.read(iprot);
-          struct.setGenericProjectionIsSet(true);
+          struct.id = iprot.readString();
+          struct.setIdIsSet(true);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderProjection.java
index 69c18bd..e5ddff9 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderProjection.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderProjection.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjection, LeaderProjection._Fields>, java.io.Serializable, Cloneable, Comparable<LeaderProjection> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LeaderProjection");
 
-  private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -43,11 +43,11 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
     schemes.put(TupleScheme.class, new LeaderProjectionTupleSchemeFactory());
   }
 
-  public GenericProjection projection; // required
+  public String id; // 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 {
-    PROJECTION((short)1, "projection");
+    ID((short)1, "id");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -62,8 +62,8 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
      */
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
-        case 1: // PROJECTION
-          return PROJECTION;
+        case 1: // ID
+          return ID;
         default:
           return null;
       }
@@ -107,8 +107,8 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
   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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GenericProjection.class)));
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LeaderProjection.class, metaDataMap);
   }
@@ -117,18 +117,18 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
   }
 
   public LeaderProjection(
-    GenericProjection projection)
+    String id)
   {
     this();
-    this.projection = projection;
+    this.id = id;
   }
 
   /**
    * Performs a deep copy on <i>other</i>.
    */
   public LeaderProjection(LeaderProjection other) {
-    if (other.isSetProjection()) {
-      this.projection = new GenericProjection(other.projection);
+    if (other.isSetId()) {
+      this.id = other.id;
     }
   }
 
@@ -138,40 +138,40 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
 
   @Override
   public void clear() {
-    this.projection = null;
+    this.id = null;
   }
 
-  public GenericProjection getProjection() {
-    return this.projection;
+  public String getId() {
+    return this.id;
   }
 
-  public LeaderProjection setProjection(GenericProjection projection) {
-    this.projection = projection;
+  public LeaderProjection setId(String id) {
+    this.id = id;
     return this;
   }
 
-  public void unsetProjection() {
-    this.projection = null;
+  public void unsetId() {
+    this.id = null;
   }
 
-  /** Returns true if field projection is set (has been assigned a value) and false otherwise */
-  public boolean isSetProjection() {
-    return this.projection != null;
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
   }
 
-  public void setProjectionIsSet(boolean value) {
+  public void setIdIsSet(boolean value) {
     if (!value) {
-      this.projection = null;
+      this.id = null;
     }
   }
 
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
-    case PROJECTION:
+    case ID:
       if (value == null) {
-        unsetProjection();
+        unsetId();
       } else {
-        setProjection((GenericProjection)value);
+        setId((String)value);
       }
       break;
 
@@ -180,8 +180,8 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
 
   public Object getFieldValue(_Fields field) {
     switch (field) {
-    case PROJECTION:
-      return getProjection();
+    case ID:
+      return getId();
 
     }
     throw new IllegalStateException();
@@ -194,8 +194,8 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
     }
 
     switch (field) {
-    case PROJECTION:
-      return isSetProjection();
+    case ID:
+      return isSetId();
     }
     throw new IllegalStateException();
   }
@@ -213,12 +213,12 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
     if (that == null)
       return false;
 
-    boolean this_present_projection = true && this.isSetProjection();
-    boolean that_present_projection = true && that.isSetProjection();
-    if (this_present_projection || that_present_projection) {
-      if (!(this_present_projection && that_present_projection))
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
         return false;
-      if (!this.projection.equals(that.projection))
+      if (!this.id.equals(that.id))
         return false;
     }
 
@@ -238,12 +238,12 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
 
     int lastComparison = 0;
 
-    lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetProjection()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -268,11 +268,11 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
     StringBuilder sb = new StringBuilder("LeaderProjection(");
     boolean first = true;
 
-    sb.append("projection:");
-    if (this.projection == null) {
+    sb.append("id:");
+    if (this.id == null) {
       sb.append("null");
     } else {
-      sb.append(this.projection);
+      sb.append(this.id);
     }
     first = false;
     sb.append(")");
@@ -282,9 +282,6 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
     // check for sub-struct validity
-    if (projection != null) {
-      projection.validate();
-    }
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -321,11 +318,10 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
           break;
         }
         switch (schemeField.id) {
-          case 1: // PROJECTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.projection = new GenericProjection();
-              struct.projection.read(iprot);
-              struct.setProjectionIsSet(true);
+          case 1: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
@@ -345,9 +341,9 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.projection != null) {
-        oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
-        struct.projection.write(oprot);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
         oprot.writeFieldEnd();
       }
       oprot.writeFieldStop();
@@ -368,12 +364,12 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
     public void write(org.apache.thrift.protocol.TProtocol prot, LeaderProjection struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
       BitSet optionals = new BitSet();
-      if (struct.isSetProjection()) {
+      if (struct.isSetId()) {
         optionals.set(0);
       }
       oprot.writeBitSet(optionals, 1);
-      if (struct.isSetProjection()) {
-        struct.projection.write(oprot);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
       }
     }
 
@@ -382,9 +378,8 @@ public class LeaderProjection implements org.apache.thrift.TBase<LeaderProjectio
       TTupleProtocol iprot = (TTupleProtocol) prot;
       BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
-        struct.projection = new GenericProjection();
-        struct.projection.read(iprot);
-        struct.setProjectionIsSet(true);
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java
new file mode 100644
index 0000000..4927e72
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/LockProjection.java
@@ -0,0 +1,388 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 LockProjection implements org.apache.thrift.TBase<LockProjection, LockProjection._Fields>, java.io.Serializable, Cloneable, Comparable<LockProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LockProjection");
+
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new LockProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new LockProjectionTupleSchemeFactory());
+  }
+
+  public String id; // 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 {
+    ID((short)1, "id");
+
+    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: // ID
+          return ID;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LockProjection.class, metaDataMap);
+  }
+
+  public LockProjection() {
+  }
+
+  public LockProjection(
+    String id)
+  {
+    this();
+    this.id = id;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public LockProjection(LockProjection other) {
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+  }
+
+  public LockProjection deepCopy() {
+    return new LockProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.id = null;
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public LockProjection setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ID:
+      return getId();
+
+    }
+    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 ID:
+      return isSetId();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof LockProjection)
+      return this.equals((LockProjection)that);
+    return false;
+  }
+
+  public boolean equals(LockProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(LockProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      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("LockProjection(");
+    boolean first = true;
+
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    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 LockProjectionStandardSchemeFactory implements SchemeFactory {
+    public LockProjectionStandardScheme getScheme() {
+      return new LockProjectionStandardScheme();
+    }
+  }
+
+  private static class LockProjectionStandardScheme extends StandardScheme<LockProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, LockProjection 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: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, LockProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class LockProjectionTupleSchemeFactory implements SchemeFactory {
+    public LockProjectionTupleScheme getScheme() {
+      return new LockProjectionTupleScheme();
+    }
+  }
+
+  private static class LockProjectionTupleScheme extends TupleScheme<LockProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, LockProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetId()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, LockProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
index 083b936..c5f6df9 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCacheProjection, NodeCacheProjection._Fields>, java.io.Serializable, Cloneable, Comparable<NodeCacheProjection> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NodeCacheProjection");
 
-  private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -43,11 +43,11 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
     schemes.put(TupleScheme.class, new NodeCacheProjectionTupleSchemeFactory());
   }
 
-  public GenericProjection projection; // required
+  public String id; // 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 {
-    PROJECTION((short)1, "projection");
+    ID((short)1, "id");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -62,8 +62,8 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
      */
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
-        case 1: // PROJECTION
-          return PROJECTION;
+        case 1: // ID
+          return ID;
         default:
           return null;
       }
@@ -107,8 +107,8 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
   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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GenericProjection.class)));
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NodeCacheProjection.class, metaDataMap);
   }
@@ -117,18 +117,18 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
   }
 
   public NodeCacheProjection(
-    GenericProjection projection)
+    String id)
   {
     this();
-    this.projection = projection;
+    this.id = id;
   }
 
   /**
    * Performs a deep copy on <i>other</i>.
    */
   public NodeCacheProjection(NodeCacheProjection other) {
-    if (other.isSetProjection()) {
-      this.projection = new GenericProjection(other.projection);
+    if (other.isSetId()) {
+      this.id = other.id;
     }
   }
 
@@ -138,40 +138,40 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
 
   @Override
   public void clear() {
-    this.projection = null;
+    this.id = null;
   }
 
-  public GenericProjection getProjection() {
-    return this.projection;
+  public String getId() {
+    return this.id;
   }
 
-  public NodeCacheProjection setProjection(GenericProjection projection) {
-    this.projection = projection;
+  public NodeCacheProjection setId(String id) {
+    this.id = id;
     return this;
   }
 
-  public void unsetProjection() {
-    this.projection = null;
+  public void unsetId() {
+    this.id = null;
   }
 
-  /** Returns true if field projection is set (has been assigned a value) and false otherwise */
-  public boolean isSetProjection() {
-    return this.projection != null;
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
   }
 
-  public void setProjectionIsSet(boolean value) {
+  public void setIdIsSet(boolean value) {
     if (!value) {
-      this.projection = null;
+      this.id = null;
     }
   }
 
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
-    case PROJECTION:
+    case ID:
       if (value == null) {
-        unsetProjection();
+        unsetId();
       } else {
-        setProjection((GenericProjection)value);
+        setId((String)value);
       }
       break;
 
@@ -180,8 +180,8 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
 
   public Object getFieldValue(_Fields field) {
     switch (field) {
-    case PROJECTION:
-      return getProjection();
+    case ID:
+      return getId();
 
     }
     throw new IllegalStateException();
@@ -194,8 +194,8 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
     }
 
     switch (field) {
-    case PROJECTION:
-      return isSetProjection();
+    case ID:
+      return isSetId();
     }
     throw new IllegalStateException();
   }
@@ -213,12 +213,12 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
     if (that == null)
       return false;
 
-    boolean this_present_projection = true && this.isSetProjection();
-    boolean that_present_projection = true && that.isSetProjection();
-    if (this_present_projection || that_present_projection) {
-      if (!(this_present_projection && that_present_projection))
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
         return false;
-      if (!this.projection.equals(that.projection))
+      if (!this.id.equals(that.id))
         return false;
     }
 
@@ -238,12 +238,12 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
 
     int lastComparison = 0;
 
-    lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetProjection()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -268,11 +268,11 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
     StringBuilder sb = new StringBuilder("NodeCacheProjection(");
     boolean first = true;
 
-    sb.append("projection:");
-    if (this.projection == null) {
+    sb.append("id:");
+    if (this.id == null) {
       sb.append("null");
     } else {
-      sb.append(this.projection);
+      sb.append(this.id);
     }
     first = false;
     sb.append(")");
@@ -282,9 +282,6 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
     // check for sub-struct validity
-    if (projection != null) {
-      projection.validate();
-    }
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -321,11 +318,10 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
           break;
         }
         switch (schemeField.id) {
-          case 1: // PROJECTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.projection = new GenericProjection();
-              struct.projection.read(iprot);
-              struct.setProjectionIsSet(true);
+          case 1: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
@@ -345,9 +341,9 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.projection != null) {
-        oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
-        struct.projection.write(oprot);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
         oprot.writeFieldEnd();
       }
       oprot.writeFieldStop();
@@ -368,12 +364,12 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
     public void write(org.apache.thrift.protocol.TProtocol prot, NodeCacheProjection struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
       BitSet optionals = new BitSet();
-      if (struct.isSetProjection()) {
+      if (struct.isSetId()) {
         optionals.set(0);
       }
       oprot.writeBitSet(optionals, 1);
-      if (struct.isSetProjection()) {
-        struct.projection.write(oprot);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
       }
     }
 
@@ -382,9 +378,8 @@ public class NodeCacheProjection implements org.apache.thrift.TBase<NodeCachePro
       TTupleProtocol iprot = (TTupleProtocol) prot;
       BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
-        struct.projection = new GenericProjection();
-        struct.projection.read(iprot);
-        struct.setProjectionIsSet(true);
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/generated/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/PathChildrenCacheProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/PathChildrenCacheProjection.java
index dbef1cb..555540a 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/PathChildrenCacheProjection.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/PathChildrenCacheProjection.java
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 public class PathChildrenCacheProjection implements org.apache.thrift.TBase<PathChildrenCacheProjection, PathChildrenCacheProjection._Fields>, java.io.Serializable, Cloneable, Comparable<PathChildrenCacheProjection> {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PathChildrenCacheProjection");
 
-  private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -43,11 +43,11 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
     schemes.put(TupleScheme.class, new PathChildrenCacheProjectionTupleSchemeFactory());
   }
 
-  public GenericProjection projection; // required
+  public String id; // 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 {
-    PROJECTION((short)1, "projection");
+    ID((short)1, "id");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -62,8 +62,8 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
      */
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
-        case 1: // PROJECTION
-          return PROJECTION;
+        case 1: // ID
+          return ID;
         default:
           return null;
       }
@@ -107,8 +107,8 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
   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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GenericProjection.class)));
+    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PathChildrenCacheProjection.class, metaDataMap);
   }
@@ -117,18 +117,18 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
   }
 
   public PathChildrenCacheProjection(
-    GenericProjection projection)
+    String id)
   {
     this();
-    this.projection = projection;
+    this.id = id;
   }
 
   /**
    * Performs a deep copy on <i>other</i>.
    */
   public PathChildrenCacheProjection(PathChildrenCacheProjection other) {
-    if (other.isSetProjection()) {
-      this.projection = new GenericProjection(other.projection);
+    if (other.isSetId()) {
+      this.id = other.id;
     }
   }
 
@@ -138,40 +138,40 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
 
   @Override
   public void clear() {
-    this.projection = null;
+    this.id = null;
   }
 
-  public GenericProjection getProjection() {
-    return this.projection;
+  public String getId() {
+    return this.id;
   }
 
-  public PathChildrenCacheProjection setProjection(GenericProjection projection) {
-    this.projection = projection;
+  public PathChildrenCacheProjection setId(String id) {
+    this.id = id;
     return this;
   }
 
-  public void unsetProjection() {
-    this.projection = null;
+  public void unsetId() {
+    this.id = null;
   }
 
-  /** Returns true if field projection is set (has been assigned a value) and false otherwise */
-  public boolean isSetProjection() {
-    return this.projection != null;
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
   }
 
-  public void setProjectionIsSet(boolean value) {
+  public void setIdIsSet(boolean value) {
     if (!value) {
-      this.projection = null;
+      this.id = null;
     }
   }
 
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
-    case PROJECTION:
+    case ID:
       if (value == null) {
-        unsetProjection();
+        unsetId();
       } else {
-        setProjection((GenericProjection)value);
+        setId((String)value);
       }
       break;
 
@@ -180,8 +180,8 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
 
   public Object getFieldValue(_Fields field) {
     switch (field) {
-    case PROJECTION:
-      return getProjection();
+    case ID:
+      return getId();
 
     }
     throw new IllegalStateException();
@@ -194,8 +194,8 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
     }
 
     switch (field) {
-    case PROJECTION:
-      return isSetProjection();
+    case ID:
+      return isSetId();
     }
     throw new IllegalStateException();
   }
@@ -213,12 +213,12 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
     if (that == null)
       return false;
 
-    boolean this_present_projection = true && this.isSetProjection();
-    boolean that_present_projection = true && that.isSetProjection();
-    if (this_present_projection || that_present_projection) {
-      if (!(this_present_projection && that_present_projection))
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
         return false;
-      if (!this.projection.equals(that.projection))
+      if (!this.id.equals(that.id))
         return false;
     }
 
@@ -238,12 +238,12 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
 
     int lastComparison = 0;
 
-    lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetProjection()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -268,11 +268,11 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
     StringBuilder sb = new StringBuilder("PathChildrenCacheProjection(");
     boolean first = true;
 
-    sb.append("projection:");
-    if (this.projection == null) {
+    sb.append("id:");
+    if (this.id == null) {
       sb.append("null");
     } else {
-      sb.append(this.projection);
+      sb.append(this.id);
     }
     first = false;
     sb.append(")");
@@ -282,9 +282,6 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
   public void validate() throws org.apache.thrift.TException {
     // check for required fields
     // check for sub-struct validity
-    if (projection != null) {
-      projection.validate();
-    }
   }
 
   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -321,11 +318,10 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
           break;
         }
         switch (schemeField.id) {
-          case 1: // PROJECTION
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-              struct.projection = new GenericProjection();
-              struct.projection.read(iprot);
-              struct.setProjectionIsSet(true);
+          case 1: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
@@ -345,9 +341,9 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
       struct.validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
-      if (struct.projection != null) {
-        oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
-        struct.projection.write(oprot);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
         oprot.writeFieldEnd();
       }
       oprot.writeFieldStop();
@@ -368,12 +364,12 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
     public void write(org.apache.thrift.protocol.TProtocol prot, PathChildrenCacheProjection struct) throws org.apache.thrift.TException {
       TTupleProtocol oprot = (TTupleProtocol) prot;
       BitSet optionals = new BitSet();
-      if (struct.isSetProjection()) {
+      if (struct.isSetId()) {
         optionals.set(0);
       }
       oprot.writeBitSet(optionals, 1);
-      if (struct.isSetProjection()) {
-        struct.projection.write(oprot);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
       }
     }
 
@@ -382,9 +378,8 @@ public class PathChildrenCacheProjection implements org.apache.thrift.TBase<Path
       TTupleProtocol iprot = (TTupleProtocol) prot;
       BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
-        struct.projection = new GenericProjection();
-        struct.projection.read(iprot);
-        struct.setProjectionIsSet(true);
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/curator/blob/6e9fa2a4/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 2ca6e69..8b65beb 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -91,8 +91,8 @@ public class TestClient
         ChildData pathChildrenCacheDataForPath = client.getPathChildrenCacheDataForPath(curatorProjection, pathChildrenCacheProjection, "/a/b/c");
         System.out.println(pathChildrenCacheDataForPath);
 
-        GenericProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
-        client.closeGenericProjection(curatorProjection, lockId);
+        LockProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
+        client.closeGenericProjection(curatorProjection, lockId.id);
 
         GetDataSpec getDataSpec = new GetDataSpec();
         getDataSpec.watched = true;
@@ -119,7 +119,7 @@ public class TestClient
         boolean isLeader = client.isLeader(curatorProjection, leader.projection);
         System.out.println("isLeader: " + isLeader);
 
-        client.closeGenericProjection(curatorProjection, leader.projection.projection);
+        client.closeGenericProjection(curatorProjection, leader.projection.id);
 
         pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
         System.out.println("Child data: " + pathChildrenCacheData);


[15/50] [abbrv] initial stab at exception support

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/c6229cf2/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index ecc0457..e944176 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -36,47 +36,47 @@ public class CuratorService {
 
   public interface Iface {
 
-    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException;
+    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException;
 
     public void closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException;
+    public boolean closeGenericProjection(CuratorProjection projection, String id) throws CuratorException, org.apache.thrift.TException;
 
-    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws org.apache.thrift.TException;
+    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws org.apache.thrift.TException;
+    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws org.apache.thrift.TException;
+    public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws org.apache.thrift.TException;
+    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws org.apache.thrift.TException;
+    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException;
+    public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
 
-    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException;
+    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException;
 
-    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException;
+    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException;
 
-    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException;
+    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws CuratorException, org.apache.thrift.TException;
 
-    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException;
+    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
 
     public CuratorProjection newCuratorProjection(String connectionName) throws org.apache.thrift.TException;
 
     public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
-    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws org.apache.thrift.TException;
+    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
 
-    public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws org.apache.thrift.TException;
+    public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws CuratorException, org.apache.thrift.TException;
 
-    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException;
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws CuratorException, org.apache.thrift.TException;
 
-    public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException;
+    public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws CuratorException, org.apache.thrift.TException;
 
-    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException;
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws CuratorException, org.apache.thrift.TException;
 
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException;
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException;
 
   }
 
@@ -86,7 +86,7 @@ public class CuratorService {
 
     public void closeCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void closeGenericProjection(CuratorProjection curatorProjection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void closeGenericProjection(CuratorProjection projection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void createNode(CuratorProjection projection, CreateSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -146,7 +146,7 @@ public class CuratorService {
       super(iprot, oprot);
     }
 
-    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException
+    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException
     {
       send_acquireLock(projection, path, maxWaitMs);
       return recv_acquireLock();
@@ -161,13 +161,16 @@ public class CuratorService {
       sendBase("acquireLock", args);
     }
 
-    public LockProjection recv_acquireLock() throws org.apache.thrift.TException
+    public LockProjection recv_acquireLock() throws CuratorException, org.apache.thrift.TException
     {
       acquireLock_result result = new acquireLock_result();
       receiveBase(result, "acquireLock");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "acquireLock failed: unknown result");
     }
 
@@ -183,31 +186,34 @@ public class CuratorService {
       sendBase("closeCuratorProjection", args);
     }
 
-    public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException
+    public boolean closeGenericProjection(CuratorProjection projection, String id) throws CuratorException, org.apache.thrift.TException
     {
-      send_closeGenericProjection(curatorProjection, id);
+      send_closeGenericProjection(projection, id);
       return recv_closeGenericProjection();
     }
 
-    public void send_closeGenericProjection(CuratorProjection curatorProjection, String id) throws org.apache.thrift.TException
+    public void send_closeGenericProjection(CuratorProjection projection, String id) throws org.apache.thrift.TException
     {
       closeGenericProjection_args args = new closeGenericProjection_args();
-      args.setCuratorProjection(curatorProjection);
+      args.setProjection(projection);
       args.setId(id);
       sendBase("closeGenericProjection", args);
     }
 
-    public boolean recv_closeGenericProjection() throws org.apache.thrift.TException
+    public boolean recv_closeGenericProjection() throws CuratorException, org.apache.thrift.TException
     {
       closeGenericProjection_result result = new closeGenericProjection_result();
       receiveBase(result, "closeGenericProjection");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closeGenericProjection failed: unknown result");
     }
 
-    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws org.apache.thrift.TException
+    public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_createNode(projection, spec);
       return recv_createNode();
@@ -221,17 +227,20 @@ public class CuratorService {
       sendBase("createNode", args);
     }
 
-    public OptionalPath recv_createNode() throws org.apache.thrift.TException
+    public OptionalPath recv_createNode() throws CuratorException, org.apache.thrift.TException
     {
       createNode_result result = new createNode_result();
       receiveBase(result, "createNode");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createNode failed: unknown result");
     }
 
-    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws org.apache.thrift.TException
+    public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_deleteNode(projection, spec);
       recv_deleteNode();
@@ -245,14 +254,17 @@ public class CuratorService {
       sendBase("deleteNode", args);
     }
 
-    public void recv_deleteNode() throws org.apache.thrift.TException
+    public void recv_deleteNode() throws CuratorException, org.apache.thrift.TException
     {
       deleteNode_result result = new deleteNode_result();
       receiveBase(result, "deleteNode");
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       return;
     }
 
-    public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws org.apache.thrift.TException
+    public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_exists(projection, spec);
       return recv_exists();
@@ -266,17 +278,20 @@ public class CuratorService {
       sendBase("exists", args);
     }
 
-    public OptionalStat recv_exists() throws org.apache.thrift.TException
+    public OptionalStat recv_exists() throws CuratorException, org.apache.thrift.TException
     {
       exists_result result = new exists_result();
       receiveBase(result, "exists");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exists failed: unknown result");
     }
 
-    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws org.apache.thrift.TException
+    public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_getChildren(projection, spec);
       return recv_getChildren();
@@ -290,17 +305,20 @@ public class CuratorService {
       sendBase("getChildren", args);
     }
 
-    public OptionalChildrenList recv_getChildren() throws org.apache.thrift.TException
+    public OptionalChildrenList recv_getChildren() throws CuratorException, org.apache.thrift.TException
     {
       getChildren_result result = new getChildren_result();
       receiveBase(result, "getChildren");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChildren failed: unknown result");
     }
 
-    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws org.apache.thrift.TException
+    public ByteBuffer getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_getData(projection, spec);
       return recv_getData();
@@ -314,17 +332,20 @@ public class CuratorService {
       sendBase("getData", args);
     }
 
-    public ByteBuffer recv_getData() throws org.apache.thrift.TException
+    public ByteBuffer recv_getData() throws CuratorException, org.apache.thrift.TException
     {
       getData_result result = new getData_result();
       receiveBase(result, "getData");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getData failed: unknown result");
     }
 
-    public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException
+    public List<Participant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException
     {
       send_getLeaderParticipants(projection, leaderProjection);
       return recv_getLeaderParticipants();
@@ -338,17 +359,20 @@ public class CuratorService {
       sendBase("getLeaderParticipants", args);
     }
 
-    public List<Participant> recv_getLeaderParticipants() throws org.apache.thrift.TException
+    public List<Participant> recv_getLeaderParticipants() throws CuratorException, org.apache.thrift.TException
     {
       getLeaderParticipants_result result = new getLeaderParticipants_result();
       receiveBase(result, "getLeaderParticipants");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLeaderParticipants failed: unknown result");
     }
 
-    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException
+    public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException
     {
       send_getNodeCacheData(projection, cacheProjection);
       return recv_getNodeCacheData();
@@ -362,17 +386,20 @@ public class CuratorService {
       sendBase("getNodeCacheData", args);
     }
 
-    public ChildData recv_getNodeCacheData() throws org.apache.thrift.TException
+    public ChildData recv_getNodeCacheData() throws CuratorException, org.apache.thrift.TException
     {
       getNodeCacheData_result result = new getNodeCacheData_result();
       receiveBase(result, "getNodeCacheData");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNodeCacheData failed: unknown result");
     }
 
-    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException
+    public List<ChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException
     {
       send_getPathChildrenCacheData(projection, cacheProjection);
       return recv_getPathChildrenCacheData();
@@ -386,17 +413,20 @@ public class CuratorService {
       sendBase("getPathChildrenCacheData", args);
     }
 
-    public List<ChildData> recv_getPathChildrenCacheData() throws org.apache.thrift.TException
+    public List<ChildData> recv_getPathChildrenCacheData() throws CuratorException, org.apache.thrift.TException
     {
       getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
       receiveBase(result, "getPathChildrenCacheData");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheData failed: unknown result");
     }
 
-    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException
+    public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws CuratorException, org.apache.thrift.TException
     {
       send_getPathChildrenCacheDataForPath(projection, cacheProjection, path);
       return recv_getPathChildrenCacheDataForPath();
@@ -411,17 +441,20 @@ public class CuratorService {
       sendBase("getPathChildrenCacheDataForPath", args);
     }
 
-    public ChildData recv_getPathChildrenCacheDataForPath() throws org.apache.thrift.TException
+    public ChildData recv_getPathChildrenCacheDataForPath() throws CuratorException, org.apache.thrift.TException
     {
       getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
       receiveBase(result, "getPathChildrenCacheDataForPath");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheDataForPath failed: unknown result");
     }
 
-    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException
+    public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException
     {
       send_isLeader(projection, leaderProjection);
       return recv_isLeader();
@@ -435,13 +468,16 @@ public class CuratorService {
       sendBase("isLeader", args);
     }
 
-    public boolean recv_isLeader() throws org.apache.thrift.TException
+    public boolean recv_isLeader() throws CuratorException, org.apache.thrift.TException
     {
       isLeader_result result = new isLeader_result();
       receiveBase(result, "isLeader");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isLeader failed: unknown result");
     }
 
@@ -480,7 +516,7 @@ public class CuratorService {
       sendBase("pingCuratorProjection", args);
     }
 
-    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws org.apache.thrift.TException
+    public Stat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException
     {
       send_setData(projection, spec);
       return recv_setData();
@@ -494,17 +530,20 @@ public class CuratorService {
       sendBase("setData", args);
     }
 
-    public Stat recv_setData() throws org.apache.thrift.TException
+    public Stat recv_setData() throws CuratorException, org.apache.thrift.TException
     {
       setData_result result = new setData_result();
       receiveBase(result, "setData");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "setData failed: unknown result");
     }
 
-    public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws org.apache.thrift.TException
+    public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws CuratorException, org.apache.thrift.TException
     {
       send_startLeaderSelector(projection, path, participantId, waitForLeadershipMs);
       return recv_startLeaderSelector();
@@ -520,17 +559,20 @@ public class CuratorService {
       sendBase("startLeaderSelector", args);
     }
 
-    public LeaderResult recv_startLeaderSelector() throws org.apache.thrift.TException
+    public LeaderResult recv_startLeaderSelector() throws CuratorException, org.apache.thrift.TException
     {
       startLeaderSelector_result result = new startLeaderSelector_result();
       receiveBase(result, "startLeaderSelector");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startLeaderSelector failed: unknown result");
     }
 
-    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException
+    public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws CuratorException, org.apache.thrift.TException
     {
       send_startNodeCache(projection, path, dataIsCompressed, buildInitial);
       return recv_startNodeCache();
@@ -546,17 +588,20 @@ public class CuratorService {
       sendBase("startNodeCache", args);
     }
 
-    public NodeCacheProjection recv_startNodeCache() throws org.apache.thrift.TException
+    public NodeCacheProjection recv_startNodeCache() throws CuratorException, org.apache.thrift.TException
     {
       startNodeCache_result result = new startNodeCache_result();
       receiveBase(result, "startNodeCache");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startNodeCache failed: unknown result");
     }
 
-    public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException
+    public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws CuratorException, org.apache.thrift.TException
     {
       send_startPathChildrenCache(projection, path, cacheData, dataIsCompressed, startMode);
       return recv_startPathChildrenCache();
@@ -573,17 +618,20 @@ public class CuratorService {
       sendBase("startPathChildrenCache", args);
     }
 
-    public PathChildrenCacheProjection recv_startPathChildrenCache() throws org.apache.thrift.TException
+    public PathChildrenCacheProjection recv_startPathChildrenCache() throws CuratorException, org.apache.thrift.TException
     {
       startPathChildrenCache_result result = new startPathChildrenCache_result();
       receiveBase(result, "startPathChildrenCache");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPathChildrenCache failed: unknown result");
     }
 
-    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException
+    public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws CuratorException, org.apache.thrift.TException
     {
       send_startPersistentEphemeralNode(projection, path, data, mode);
       return recv_startPersistentEphemeralNode();
@@ -599,17 +647,20 @@ public class CuratorService {
       sendBase("startPersistentEphemeralNode", args);
     }
 
-    public PersistentEphemeralNodeProjection recv_startPersistentEphemeralNode() throws org.apache.thrift.TException
+    public PersistentEphemeralNodeProjection recv_startPersistentEphemeralNode() throws CuratorException, org.apache.thrift.TException
     {
       startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
       receiveBase(result, "startPersistentEphemeralNode");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPersistentEphemeralNode failed: unknown result");
     }
 
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException
     {
       send_startSemaphore(projection, path, acquireQty, maxWaitMs, maxLeases);
       return recv_startSemaphore();
@@ -626,13 +677,16 @@ public class CuratorService {
       sendBase("startSemaphore", args);
     }
 
-    public List<LeaseProjection> recv_startSemaphore() throws org.apache.thrift.TException
+    public List<LeaseProjection> recv_startSemaphore() throws CuratorException, org.apache.thrift.TException
     {
       startSemaphore_result result = new startSemaphore_result();
       receiveBase(result, "startSemaphore");
       if (result.isSetSuccess()) {
         return result.success;
       }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startSemaphore failed: unknown result");
     }
 
@@ -682,7 +736,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public LockProjection getResult() throws org.apache.thrift.TException {
+      public LockProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -723,32 +777,32 @@ public class CuratorService {
       }
     }
 
-    public void closeGenericProjection(CuratorProjection curatorProjection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void closeGenericProjection(CuratorProjection projection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      closeGenericProjection_call method_call = new closeGenericProjection_call(curatorProjection, id, resultHandler, this, ___protocolFactory, ___transport);
+      closeGenericProjection_call method_call = new closeGenericProjection_call(projection, id, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class closeGenericProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private CuratorProjection curatorProjection;
+      private CuratorProjection projection;
       private String id;
-      public closeGenericProjection_call(CuratorProjection curatorProjection, String id, 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 {
+      public closeGenericProjection_call(CuratorProjection projection, String id, 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.curatorProjection = curatorProjection;
+        this.projection = projection;
         this.id = id;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeGenericProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
         closeGenericProjection_args args = new closeGenericProjection_args();
-        args.setCuratorProjection(curatorProjection);
+        args.setProjection(projection);
         args.setId(id);
         args.write(prot);
         prot.writeMessageEnd();
       }
 
-      public boolean getResult() throws org.apache.thrift.TException {
+      public boolean getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -783,7 +837,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public OptionalPath getResult() throws org.apache.thrift.TException {
+      public OptionalPath getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -818,7 +872,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public void getResult() throws org.apache.thrift.TException {
+      public void getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -853,7 +907,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public OptionalStat getResult() throws org.apache.thrift.TException {
+      public OptionalStat getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -888,7 +942,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public OptionalChildrenList getResult() throws org.apache.thrift.TException {
+      public OptionalChildrenList getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -923,7 +977,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public ByteBuffer getResult() throws org.apache.thrift.TException {
+      public ByteBuffer getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -958,7 +1012,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public List<Participant> getResult() throws org.apache.thrift.TException {
+      public List<Participant> getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -993,7 +1047,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public ChildData getResult() throws org.apache.thrift.TException {
+      public ChildData getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1028,7 +1082,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public List<ChildData> getResult() throws org.apache.thrift.TException {
+      public List<ChildData> getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1066,7 +1120,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public ChildData getResult() throws org.apache.thrift.TException {
+      public ChildData getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1101,7 +1155,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public boolean getResult() throws org.apache.thrift.TException {
+      public boolean getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1199,7 +1253,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public Stat getResult() throws org.apache.thrift.TException {
+      public Stat getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1240,7 +1294,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public LeaderResult getResult() throws org.apache.thrift.TException {
+      public LeaderResult getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1281,7 +1335,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public NodeCacheProjection getResult() throws org.apache.thrift.TException {
+      public NodeCacheProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1325,7 +1379,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public PathChildrenCacheProjection getResult() throws org.apache.thrift.TException {
+      public PathChildrenCacheProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1366,7 +1420,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public PersistentEphemeralNodeProjection getResult() throws org.apache.thrift.TException {
+      public PersistentEphemeralNodeProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1410,7 +1464,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public List<LeaseProjection> getResult() throws org.apache.thrift.TException {
+      public List<LeaseProjection> getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -1472,7 +1526,11 @@ public class CuratorService {
 
       public acquireLock_result getResult(I iface, acquireLock_args args) throws org.apache.thrift.TException {
         acquireLock_result result = new acquireLock_result();
-        result.success = iface.acquireLock(args.projection, args.path, args.maxWaitMs);
+        try {
+          result.success = iface.acquireLock(args.projection, args.path, args.maxWaitMs);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1511,8 +1569,12 @@ public class CuratorService {
 
       public closeGenericProjection_result getResult(I iface, closeGenericProjection_args args) throws org.apache.thrift.TException {
         closeGenericProjection_result result = new closeGenericProjection_result();
-        result.success = iface.closeGenericProjection(args.curatorProjection, args.id);
-        result.setSuccessIsSet(true);
+        try {
+          result.success = iface.closeGenericProjection(args.projection, args.id);
+          result.setSuccessIsSet(true);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1532,7 +1594,11 @@ public class CuratorService {
 
       public createNode_result getResult(I iface, createNode_args args) throws org.apache.thrift.TException {
         createNode_result result = new createNode_result();
-        result.success = iface.createNode(args.projection, args.spec);
+        try {
+          result.success = iface.createNode(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1552,7 +1618,11 @@ public class CuratorService {
 
       public deleteNode_result getResult(I iface, deleteNode_args args) throws org.apache.thrift.TException {
         deleteNode_result result = new deleteNode_result();
-        iface.deleteNode(args.projection, args.spec);
+        try {
+          iface.deleteNode(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1572,7 +1642,11 @@ public class CuratorService {
 
       public exists_result getResult(I iface, exists_args args) throws org.apache.thrift.TException {
         exists_result result = new exists_result();
-        result.success = iface.exists(args.projection, args.spec);
+        try {
+          result.success = iface.exists(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1592,7 +1666,11 @@ public class CuratorService {
 
       public getChildren_result getResult(I iface, getChildren_args args) throws org.apache.thrift.TException {
         getChildren_result result = new getChildren_result();
-        result.success = iface.getChildren(args.projection, args.spec);
+        try {
+          result.success = iface.getChildren(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1612,7 +1690,11 @@ public class CuratorService {
 
       public getData_result getResult(I iface, getData_args args) throws org.apache.thrift.TException {
         getData_result result = new getData_result();
-        result.success = iface.getData(args.projection, args.spec);
+        try {
+          result.success = iface.getData(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1632,7 +1714,11 @@ public class CuratorService {
 
       public getLeaderParticipants_result getResult(I iface, getLeaderParticipants_args args) throws org.apache.thrift.TException {
         getLeaderParticipants_result result = new getLeaderParticipants_result();
-        result.success = iface.getLeaderParticipants(args.projection, args.leaderProjection);
+        try {
+          result.success = iface.getLeaderParticipants(args.projection, args.leaderProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1652,7 +1738,11 @@ public class CuratorService {
 
       public getNodeCacheData_result getResult(I iface, getNodeCacheData_args args) throws org.apache.thrift.TException {
         getNodeCacheData_result result = new getNodeCacheData_result();
-        result.success = iface.getNodeCacheData(args.projection, args.cacheProjection);
+        try {
+          result.success = iface.getNodeCacheData(args.projection, args.cacheProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1672,7 +1762,11 @@ public class CuratorService {
 
       public getPathChildrenCacheData_result getResult(I iface, getPathChildrenCacheData_args args) throws org.apache.thrift.TException {
         getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
-        result.success = iface.getPathChildrenCacheData(args.projection, args.cacheProjection);
+        try {
+          result.success = iface.getPathChildrenCacheData(args.projection, args.cacheProjection);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1692,7 +1786,11 @@ public class CuratorService {
 
       public getPathChildrenCacheDataForPath_result getResult(I iface, getPathChildrenCacheDataForPath_args args) throws org.apache.thrift.TException {
         getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
-        result.success = iface.getPathChildrenCacheDataForPath(args.projection, args.cacheProjection, args.path);
+        try {
+          result.success = iface.getPathChildrenCacheDataForPath(args.projection, args.cacheProjection, args.path);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1712,8 +1810,12 @@ public class CuratorService {
 
       public isLeader_result getResult(I iface, isLeader_args args) throws org.apache.thrift.TException {
         isLeader_result result = new isLeader_result();
-        result.success = iface.isLeader(args.projection, args.leaderProjection);
-        result.setSuccessIsSet(true);
+        try {
+          result.success = iface.isLeader(args.projection, args.leaderProjection);
+          result.setSuccessIsSet(true);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1772,7 +1874,11 @@ public class CuratorService {
 
       public setData_result getResult(I iface, setData_args args) throws org.apache.thrift.TException {
         setData_result result = new setData_result();
-        result.success = iface.setData(args.projection, args.spec);
+        try {
+          result.success = iface.setData(args.projection, args.spec);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1792,7 +1898,11 @@ public class CuratorService {
 
       public startLeaderSelector_result getResult(I iface, startLeaderSelector_args args) throws org.apache.thrift.TException {
         startLeaderSelector_result result = new startLeaderSelector_result();
-        result.success = iface.startLeaderSelector(args.projection, args.path, args.participantId, args.waitForLeadershipMs);
+        try {
+          result.success = iface.startLeaderSelector(args.projection, args.path, args.participantId, args.waitForLeadershipMs);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1812,7 +1922,11 @@ public class CuratorService {
 
       public startNodeCache_result getResult(I iface, startNodeCache_args args) throws org.apache.thrift.TException {
         startNodeCache_result result = new startNodeCache_result();
-        result.success = iface.startNodeCache(args.projection, args.path, args.dataIsCompressed, args.buildInitial);
+        try {
+          result.success = iface.startNodeCache(args.projection, args.path, args.dataIsCompressed, args.buildInitial);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1832,7 +1946,11 @@ public class CuratorService {
 
       public startPathChildrenCache_result getResult(I iface, startPathChildrenCache_args args) throws org.apache.thrift.TException {
         startPathChildrenCache_result result = new startPathChildrenCache_result();
-        result.success = iface.startPathChildrenCache(args.projection, args.path, args.cacheData, args.dataIsCompressed, args.startMode);
+        try {
+          result.success = iface.startPathChildrenCache(args.projection, args.path, args.cacheData, args.dataIsCompressed, args.startMode);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1852,7 +1970,11 @@ public class CuratorService {
 
       public startPersistentEphemeralNode_result getResult(I iface, startPersistentEphemeralNode_args args) throws org.apache.thrift.TException {
         startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
-        result.success = iface.startPersistentEphemeralNode(args.projection, args.path, args.data, args.mode);
+        try {
+          result.success = iface.startPersistentEphemeralNode(args.projection, args.path, args.data, args.mode);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1872,7 +1994,11 @@ public class CuratorService {
 
       public startSemaphore_result getResult(I iface, startSemaphore_args args) throws org.apache.thrift.TException {
         startSemaphore_result result = new startSemaphore_result();
-        result.success = iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases);
+        try {
+          result.success = iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
         return result;
       }
     }
@@ -1941,6 +2067,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             acquireLock_result result = new acquireLock_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2021,6 +2153,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             closeGenericProjection_result result = new closeGenericProjection_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2041,7 +2179,7 @@ public class CuratorService {
       }
 
       public void start(I iface, closeGenericProjection_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
-        iface.closeGenericProjection(args.curatorProjection, args.id,resultHandler);
+        iface.closeGenericProjection(args.projection, args.id,resultHandler);
       }
     }
 
@@ -2072,6 +2210,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             createNode_result result = new createNode_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2122,6 +2266,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             deleteNode_result result = new deleteNode_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2173,6 +2323,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             exists_result result = new exists_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2224,6 +2380,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getChildren_result result = new getChildren_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2275,6 +2437,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getData_result result = new getData_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2326,6 +2494,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getLeaderParticipants_result result = new getLeaderParticipants_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2377,6 +2551,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getNodeCacheData_result result = new getNodeCacheData_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2428,6 +2608,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2479,6 +2665,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2531,6 +2723,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             isLeader_result result = new isLeader_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2661,6 +2859,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             setData_result result = new setData_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2712,6 +2916,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             startLeaderSelector_result result = new startLeaderSelector_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2763,6 +2973,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             startNodeCache_result result = new startNodeCache_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2814,6 +3030,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             startPathChildrenCache_result result = new startPathChildrenCache_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2865,6 +3087,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -2916,6 +3144,12 @@ public class CuratorService {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
             startSemaphore_result result = new startSemaphore_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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());
@@ -3503,6 +3737,7 @@ public class CuratorService {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("acquireLock_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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -3511,10 +3746,12 @@ public class CuratorService {
     }
 
     public LockProjection success; // required
+    public CuratorException ex1; // 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");
+      SUCCESS((short)0, "success"),
+      EX1((short)1, "ex1");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -3531,6 +3768,8 @@ public class CuratorService {
         switch(fieldId) {
           case 0: // SUCCESS
             return SUCCESS;
+          case 1: // EX1
+            return EX1;
           default:
             return null;
         }
@@ -3576,6 +3815,8 @@ public class CuratorService {
       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, LockProjection.class)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(acquireLock_result.class, metaDataMap);
     }
@@ -3584,10 +3825,12 @@ public class CuratorService {
     }
 
     public acquireLock_result(
-      LockProjection success)
+      LockProjection success,
+      CuratorException ex1)
     {
       this();
       this.success = success;
+      this.ex1 = ex1;
     }
 
     /**
@@ -3597,6 +3840,9 @@ public class CuratorService {
       if (other.isSetSuccess()) {
         this.success = new LockProjection(other.success);
       }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
     }
 
     public acquireLock_result deepCopy() {
@@ -3606,6 +3852,7 @@ public class CuratorService {
     @Override
     public void clear() {
       this.success = null;
+      this.ex1 = null;
     }
 
     public LockProjection getSuccess() {
@@ -3632,6 +3879,30 @@ public class CuratorService {
       }
     }
 
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public acquireLock_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case SUCCESS:
@@ -3642,6 +3913,14 @@ public class CuratorService {
         }
         break;
 
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
       }
     }
 
@@ -3650,6 +3929,9 @@ public class CuratorService {
       case SUCCESS:
         return getSuccess();
 
+      case EX1:
+        return getEx1();
+
       }
       throw new IllegalStateException();
     }
@@ -3663,6 +3945,8 @@ public class CuratorService {
       switch (field) {
       case SUCCESS:
         return isSetSuccess();
+      case EX1:
+        return isSetEx1();
       }
       throw new IllegalStateException();
     }
@@ -3689,6 +3973,15 @@ public class CuratorService {
           return false;
       }
 
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
       return true;
     }
 
@@ -3715,6 +4008,16 @@ public class CuratorService {
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -3742,6 +4045,14 @@ public class CuratorService {
         sb.append(this.success);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -3797,6 +4108,15 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -3817,6 +4137,11 @@ public class CuratorService {
           struct.success.write(oprot);
           oprot.writeFieldEnd();
         }
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -3838,21 +4163,32 @@ public class CuratorService {
         if (struct.isSetSuccess()) {
           optionals.set(0);
         }
-        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
         if (struct.isSetSuccess()) {
           struct.success.write(oprot);
         }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, acquireLock_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
+        BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
           struct.success = new LockProjection();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
       }
     }
 
@@ -4220,7 +4556,7 @@ public class CuratorService {
   public static class closeGenericProjection_args implements org.apache.thrift.TBase<closeGenericProjection_args, closeGenericProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeGenericProjection_args>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeGenericProjection_args");
 
-    private static final org.apache.thrift.protocol.TField CURATOR_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("curatorProjection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
@@ -4229,12 +4565,12 @@ public class CuratorService {
       schemes.put(TupleScheme.class, new closeGenericProjection_argsTupleSchemeFactory());
     }
 
-    public CuratorProjection curatorProjection; // required
+    public CuratorProjection projection; // required
     public String id; // 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 {
-      CURATOR_PROJECTION((short)1, "curatorProjection"),
+      PROJECTION((short)1, "projection"),
       ID((short)2, "id");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -4250,8 +4586,8 @@ public class CuratorService {
        */
       public static _Fields findByThriftId(int fieldId) {
         switch(fieldId) {
-          case 1: // CURATOR_PROJECTION
-            return CURATOR_PROJECTION;
+          case 1: // PROJECTION
+            return PROJECTION;
           case 2: // ID
             return ID;
           default:
@@ -4297,7 +4633,7 @@ public class CuratorService {
     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.CURATOR_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("curatorProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+      tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
       tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
@@ -4309,11 +4645,11 @@ public class CuratorService {
     }
 
     public closeGenericProjection_args(
-      CuratorProjection curatorProjection,
+      CuratorProjection projection,
       String id)
     {
       this();
-      this.curatorProjection = curatorProjection;
+      this.projection = projection;
       this.id = id;
     }
 
@@ -4321,8 +4657,8 @@ public class CuratorService {
      * Performs a deep copy on <i>other</i>.
      */
     public closeGenericProjection_args(closeGenericProjection_args other) {
-      if (other.isSetCuratorProjection()) {
-        this.curatorProjection = new CuratorProjection(other.curatorProjection);
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
       }
       if (other.isSetId()) {
         this.id = other.id;
@@ -4335,31 +4671,31 @@ public class CuratorService {
 
     @Override
     public void clear() {
-      this.curatorProjection = null;
+      this.projection = null;
       this.id = null;
     }
 
-    public CuratorProjection getCuratorProjection() {
-      return this.curatorProjection;
+    public CuratorProjection getProjection() {
+      return this.projection;
     }
 
-    public closeGenericProjection_args setCuratorProjection(CuratorProjection curatorProjection) {
-      this.curatorProjection = curatorProjection;
+    public closeGenericProjection_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
       return this;
     }
 
-    public void unsetCuratorProjection() {
-      this.curatorProjection = null;
+    public void unsetProjection() {
+      this.projection = null;
     }
 
-    /** Returns true if field curatorProjection is set (has been assigned a value) and false otherwise */
-    public boolean isSetCuratorProjection() {
-      return this.curatorProjection != null;
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
     }
 
-    public void setCuratorProjectionIsSet(boolean value) {
+    public void setProjectionIsSet(boolean value) {
       if (!value) {
-        this.curatorProjection = null;
+        this.projection = null;
       }
     }
 
@@ -4389,11 +4725,11 @@ public class CuratorService {
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case CURATOR_PROJECTION:
+      case PROJECTION:
         if (value == null) {
-          unsetCuratorProjection();
+          unsetProjection();
         } else {
-          setCuratorProjection((CuratorProjection)value);
+          setProjection((CuratorProjection)value);
         }
         break;
 
@@ -4410,8 +4746,8 @@ public class CuratorService {
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case CURATOR_PROJECTION:
-        return getCuratorProjection();
+      case PROJECTION:
+        return getProjection();
 
       case ID:
         return getId();
@@ -4427,8 +4763,8 @@ public class CuratorService {
       }
 
       switch (field) {
-      case CURATOR_PROJECTION:
-        return isSetCuratorProjection();
+      case PROJECTION:
+        return isSetProjection();
       case ID:
         return isSetId();
       }
@@ -4448,12 +4784,12 @@ public class CuratorService {
       if (that == null)
         return false;
 
-      boolean this_present_curatorProjection = true && this.isSetCuratorProjection();
-      boolean that_present_curatorProjection = true && that.isSetCuratorProjection();
-      if (this_present_curatorProjection || that_present_curatorProjection) {
-        if (!(this_present_curatorProjection && that_present_curatorProjection))
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
           return false;
-        if (!this.curatorProjection.equals(that.curatorProjection))
+        if (!this.projection.equals(that.projection))
           return false;
       }
 
@@ -4482,12 +4818,12 @@ public class CuratorService {
 
       int lastComparison = 0;
 
-      lastComparison = Boolean.valueOf(isSetCuratorProjection()).compareTo(other.isSetCuratorProjection());
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetCuratorProjection()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.curatorProjection, other.curatorProjection);
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -4522,11 +4858,11 @@ public class CuratorService {
       StringBuilder sb = new StringBuilder("closeGenericProjection_args(");
       boolean first = true;
 
-      sb.append("curatorProjection:");
-      if (this.curatorProjection == null) {
+      sb.append("projection:");
+      if (this.projection == null) {
         sb.append("null");
       } else {
-        sb.append(this.curatorProjection);
+        sb.append(this.projection);
       }
       first = false;
       if (!first) sb.append(", ");
@@ -4544,8 +4880,8 @@ public class CuratorService {
     public void validate() throws org.apache.thrift.TException {
       // check for required fields
       // check for sub-struct validity
-      if (curatorProjection != null) {
-        curatorProjection.validate();
+      if (projection != null) {
+        projection.validate();
       }
     }
 
@@ -4583,11 +4919,11 @@ public class CuratorService {
             break;
           }
           switch (schemeField.id) {
-            case 1: // CURATOR_PROJECTION
+            case 1: // PROJECTION
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.curatorProjection = new CuratorProjection();
-                struct.curatorProjection.read(iprot);
-                struct.setCuratorProjectionIsSet(true);
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
@@ -4615,9 +4951,9 @@ public class CuratorService {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.curatorProjection != null) {
-          oprot.writeFieldBegin(CURATOR_PROJECTION_FIELD_DESC);
-          struct.curatorProjection.write(oprot);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
           oprot.writeFieldEnd();
         }
         if (struct.id != null) {
@@ -4643,15 +4979,15 @@ public class CuratorService {
       public void write(org.apache.thrift.protocol.TProtocol prot, closeGenericProjection_args struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
-        if (struct.isSetCuratorProjection()) {
+        if (struct.isSetProjection()) {
           optionals.set(0);
         }
         if (struct.isSetId()) {
           optionals.set(1);
         }
         oprot.writeBitSet(optionals, 2);
-        if (struct.isSetCuratorProjection()) {
-          struct.curatorProjection.write(oprot);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
         }
         if (struct.isSetId()) {
           oprot.writeString(struct.id);
@@ -4663,9 +4999,9 @@ public class CuratorService {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
-          struct.curatorProjection = new CuratorProjection();
-          struct.curatorProjection.read(iprot);
-          struct.setCuratorProjectionIsSet(true);
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
         }
         if (incoming.get(1)) {
           struct.id = iprot.readString();
@@ -4680,6 +5016,7 @@ public class CuratorService {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeGenericProjection_result");
 
     private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -4688,10 +5025,12 @@ public class CuratorService {
     }
 
     public boolean success; // required
+    public CuratorException ex1; // 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");
+      SUCCESS((short)0, "success"),
+      EX1((short)1, "ex1");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4708,6 +5047,8 @@ public class CuratorService {
         switch(fieldId) {
           case 0: // SUCCESS
             return SUCCESS;
+          case 1: // EX1
+            return EX1;
           default:
             return null;
         }
@@ -4755,6 +5096,8 @@ public class CuratorService {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(closeGenericProjection_result.class, metaDataMap);
     }
@@ -4763,11 +5106,13 @@ public class CuratorService {
     }
 
     public closeGenericProjection_result(
-      boolean success)
+      boolean success,
+      CuratorException ex1)
     {
       this();
       this.success = success;
       setSuccessIsSet(true);
+      this.ex1 = ex1;
     }
 
     /**
@@ -4776,6 +5121,9 @@ public class CuratorService {
     public closeGenericProjection_result(closeGenericProjection_result other) {
       __isset_bitfield = other.__isset_bitfield;
       this.success = other.success;
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
     }
 
     public closeGenericProjection_result deepCopy() {
@@ -4786,6 +5134,7 @@ public class CuratorService {
     public void clear() {
       setSuccessIsSet(false);
       this.success = false;
+      this.ex1 = null;
     }
 
     public boolean isSuccess() {
@@ -4811,6 +5160,30 @@ public class CuratorService {
       __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
     }
 
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public closeGenericProjection_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case SUCCESS:
@@ -4821,6 +5194,14 @@ public class CuratorService {
         }
         break;
 
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
       }
     }
 
@@ -4829,6 +5210,9 @@ public class CuratorService {
       case SUCCESS:
         return Boolean.valueOf(isSuccess());
 
+      case EX1:
+        return getEx1();
+
       }
       throw new IllegalStateException();
     }
@@ -4842,6 +5226,8 @@ public class CuratorService {
       switch (field) {
       case SUCCESS:
         return isSetSuccess();
+      case EX1:
+        return isSetEx1();
       }
       throw new IllegalStateException();
     }
@@ -4868,6 +5254,15 @@ public class CuratorService {
           return false;
       }
 
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
       return true;
     }
 
@@ -4894,6 +5289,16 @@ public class CuratorService {
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -4917,6 +5322,14 @@ public class CuratorService {
       sb.append("success:");
       sb.append(this.success);
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -4970,6 +5383,15 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thr

<TRUNCATED>

[50/50] [abbrv] git commit: refactoring

Posted by ra...@apache.org.
refactoring


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8880417d
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8880417d
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8880417d

Branch: refs/heads/master
Commit: 8880417db8b3325ce024c7e0c3263f61947daa51
Parents: 64e5cfe
Author: randgalt <ra...@apache.org>
Authored: Tue Jun 3 13:34:01 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue Jun 3 13:34:01 2014 -0500

----------------------------------------------------------------------
 .../idl/services/CuratorProjectionService.java  |   6 +-
 .../rpc/idl/structs/OptionalLockProjection.java |  38 ++
 curator-x-rpc/src/main/thrift/curator.thrift    |   6 +-
 .../src/site/confluence/events.confluence       |   2 +-
 .../src/site/confluence/reference.confluence    |   4 +-
 .../src/site/confluence/usage.confluence        |   7 +-
 .../curator/generated/CuratorService.java       |  36 +-
 .../generated/OptionalLockProjection.java       | 393 +++++++++++++++++++
 .../java/org/apache/curator/x/rpc/RpcTests.java |   6 +-
 .../org/apache/curator/x/rpc/TestClient.java    |   4 +-
 10 files changed, 469 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index 257230e..777472c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -352,7 +352,7 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws RpcException
+    public OptionalLockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws RpcException
     {
         try
         {
@@ -360,7 +360,7 @@ public class CuratorProjectionService
             final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
             if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
             {
-                return new LockProjection();
+                return new OptionalLockProjection();
             }
 
             Closer closer = new Closer()
@@ -382,7 +382,7 @@ public class CuratorProjectionService
                 }
             };
             String id = entry.addThing(lock, closer);
-            return new LockProjection(id);
+            return new OptionalLockProjection(new LockProjection(id));
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java
new file mode 100644
index 0000000..cd85494
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.rpc.idl.structs;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class OptionalLockProjection
+{
+    @ThriftField(1)
+    public LockProjection lockProjection;
+
+    public OptionalLockProjection()
+    {
+    }
+
+    public OptionalLockProjection(LockProjection lockProjection)
+    {
+        this.lockProjection = lockProjection;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 4071069..d6bcd94 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -109,6 +109,10 @@ struct OptionalData {
   1: binary data;
 }
 
+struct OptionalLockProjection {
+  1: LockProjection lockProjection;
+}
+
 struct OptionalPath {
   1: string path;
 }
@@ -245,7 +249,7 @@ struct CuratorEvent {
 }
 
 service CuratorService {
-  LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs) throws (1: CuratorException ex1);
+  OptionalLockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs) throws (1: CuratorException ex1);
   list<LeaseProjection> acquireSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases) throws (1: CuratorException ex1);
   void closeCuratorProjection(1: CuratorProjection projection);
   bool closeGenericProjection(1: CuratorProjection projection, 2: string id) throws (1: CuratorException ex1);

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/site/confluence/events.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
index ead5206..8b3f711 100644
--- a/curator-x-rpc/src/site/confluence/events.confluence
+++ b/curator-x-rpc/src/site/confluence/events.confluence
@@ -9,7 +9,7 @@ messages from the EventService. Here is pseudo code:
 
 {code}
 inThread => {
-    while ( isOpen ) {
+    while isOpen {
         event = eventService.getNextEvent(curatorProjection)
         ... process event ...
     }

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index 602906e..a7b1ce5 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -7,7 +7,7 @@ h2. CuratorService
 ||API||Arguments||Return Value||Description||
 |newCuratorProjection|connectionName|CuratorProjection|Allocates a projection to a configured CuratorFramework instance in the RPC server. "connectionName" is the name of a [[configured|configuration.html]] connection.|
 |closeCuratorProjection|CuratorProjection|void|Close a CuratorProjection. Also closes any recipes, etc. create for the projection.|
-|pingCuratorProjection|CuratorProjection|void|Keeps the CuratorProjection from timing out. NOTE: your [[EventService|events.html]] event loop will do this for your.|
+|pingCuratorProjection|CuratorProjection|void|Keeps the CuratorProjection from timing out. NOTE: your [[EventService|events.html]] event loop will do this for you.|
 |createNode|CreateSpec|Created path name|Create a ZNode|
 |deleteNode|DeleteSpec|void|Delete a ZNode|
 |getData|GetDataSpec|bytes|Return a ZNode's data|
@@ -16,7 +16,7 @@ h2. CuratorService
 |getChildren|GetChildrenSpec|List of nodes|Get the child nodes for a ZNode|
 |sync|path and async context|void|Do a ZooKeeper sync|
 |closeGenericProjection|id|void|Closes any projection|
-|acquireLock|path, maxWaitMs|lock projection|Acquire a lock for the given path. Will wait at most maxWaitMs to acquire the lock. If the acquisition fails, LockProjection.id will be null.|
+|acquireLock|path, maxWaitMs|optional lock projection|Acquire a lock for the given path. Will wait at most maxWaitMs to acquire the lock. If the acquisition fails, result will be null.|
 |startLeaderSelector|path, participantId, waitForLeadershipMs|LeaderResult|Start a leader selector on the given path. The instance will be assigned the specified participantId. If waitForLeadershipMs is non\-zero, the method will block for that amount of time waiting for leadership.|
 |getLeaderParticipants|leaderProjection|List of Participant|Return the participants in a leader selector|
 |isLeader|leaderProjection|bool|Return true if the specified projection is the current leader|

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index 57bc14c..36fb04e 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -57,7 +57,7 @@ EventService.Client eventService = new EventService.Client()
 curatorProjection = curatorService.newCuratorProjection(name)
 
 inThread => {
-    while ( isOpen ) {
+    while isOpen {
         event = eventService.getNextEvent(curatorProjection)
         ... process event ...
     }
@@ -72,10 +72,11 @@ h2. Usage
 Once initialized, use recipes/APIs as needed. Here is an example of using the lock recipe:
 
 {code}
-lockId = client.acquireLock(curatorProjection, "/mylock", 10000)
-if lockId.id == null {
+optionalLockId = client.acquireLock(curatorProjection, "/mylock", 10000)
+if optionalLockId.lockProjection == null {
     // lock attempt failed. Throw exception, etc.
 }
+lockId = optionalLockId.lockProjection
 
 // you now own the lock
 

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index cbbe5fc..63d46ee 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -36,7 +36,7 @@ public class CuratorService {
 
   public interface Iface {
 
-    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException;
+    public OptionalLockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException;
 
     public List<LeaseProjection> acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException;
 
@@ -150,7 +150,7 @@ public class CuratorService {
       super(iprot, oprot);
     }
 
-    public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException
+    public OptionalLockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException
     {
       send_acquireLock(projection, path, maxWaitMs);
       return recv_acquireLock();
@@ -165,7 +165,7 @@ public class CuratorService {
       sendBase("acquireLock", args);
     }
 
-    public LockProjection recv_acquireLock() throws CuratorException, org.apache.thrift.TException
+    public OptionalLockProjection recv_acquireLock() throws CuratorException, org.apache.thrift.TException
     {
       acquireLock_result result = new acquireLock_result();
       receiveBase(result, "acquireLock");
@@ -776,7 +776,7 @@ public class CuratorService {
         prot.writeMessageEnd();
       }
 
-      public LockProjection getResult() throws CuratorException, org.apache.thrift.TException {
+      public OptionalLockProjection getResult() throws CuratorException, org.apache.thrift.TException {
         if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
           throw new IllegalStateException("Method call not finished!");
         }
@@ -2150,7 +2150,7 @@ public class CuratorService {
       return processMap;
     }
 
-    public static class acquireLock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, acquireLock_args, LockProjection> {
+    public static class acquireLock<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, acquireLock_args, OptionalLockProjection> {
       public acquireLock() {
         super("acquireLock");
       }
@@ -2159,10 +2159,10 @@ public class CuratorService {
         return new acquireLock_args();
       }
 
-      public AsyncMethodCallback<LockProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<OptionalLockProjection> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<LockProjection>() { 
-          public void onComplete(LockProjection o) {
+        return new AsyncMethodCallback<OptionalLockProjection>() { 
+          public void onComplete(OptionalLockProjection o) {
             acquireLock_result result = new acquireLock_result();
             result.success = o;
             try {
@@ -2202,7 +2202,7 @@ public class CuratorService {
         return false;
       }
 
-      public void start(I iface, acquireLock_args args, org.apache.thrift.async.AsyncMethodCallback<LockProjection> resultHandler) throws TException {
+      public void start(I iface, acquireLock_args args, org.apache.thrift.async.AsyncMethodCallback<OptionalLockProjection> resultHandler) throws TException {
         iface.acquireLock(args.projection, args.path, args.maxWaitMs,resultHandler);
       }
     }
@@ -3939,7 +3939,7 @@ public class CuratorService {
       schemes.put(TupleScheme.class, new acquireLock_resultTupleSchemeFactory());
     }
 
-    public LockProjection success; // required
+    public OptionalLockProjection success; // required
     public CuratorException ex1; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -4008,7 +4008,7 @@ public class CuratorService {
     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, LockProjection.class)));
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OptionalLockProjection.class)));
       tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -4019,7 +4019,7 @@ public class CuratorService {
     }
 
     public acquireLock_result(
-      LockProjection success,
+      OptionalLockProjection success,
       CuratorException ex1)
     {
       this();
@@ -4032,7 +4032,7 @@ public class CuratorService {
      */
     public acquireLock_result(acquireLock_result other) {
       if (other.isSetSuccess()) {
-        this.success = new LockProjection(other.success);
+        this.success = new OptionalLockProjection(other.success);
       }
       if (other.isSetEx1()) {
         this.ex1 = new CuratorException(other.ex1);
@@ -4049,11 +4049,11 @@ public class CuratorService {
       this.ex1 = null;
     }
 
-    public LockProjection getSuccess() {
+    public OptionalLockProjection getSuccess() {
       return this.success;
     }
 
-    public acquireLock_result setSuccess(LockProjection success) {
+    public acquireLock_result setSuccess(OptionalLockProjection success) {
       this.success = success;
       return this;
     }
@@ -4103,7 +4103,7 @@ public class CuratorService {
         if (value == null) {
           unsetSuccess();
         } else {
-          setSuccess((LockProjection)value);
+          setSuccess((OptionalLockProjection)value);
         }
         break;
 
@@ -4295,7 +4295,7 @@ public class CuratorService {
           switch (schemeField.id) {
             case 0: // SUCCESS
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.success = new LockProjection();
+                struct.success = new OptionalLockProjection();
                 struct.success.read(iprot);
                 struct.setSuccessIsSet(true);
               } else { 
@@ -4374,7 +4374,7 @@ public class CuratorService {
         TTupleProtocol iprot = (TTupleProtocol) prot;
         BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
-          struct.success = new LockProjection();
+          struct.success = new OptionalLockProjection();
           struct.success.read(iprot);
           struct.setSuccessIsSet(true);
         }

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java
new file mode 100644
index 0000000..8e9c629
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/OptionalLockProjection.java
@@ -0,0 +1,393 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 OptionalLockProjection implements org.apache.thrift.TBase<OptionalLockProjection, OptionalLockProjection._Fields>, java.io.Serializable, Cloneable, Comparable<OptionalLockProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OptionalLockProjection");
+
+  private static final org.apache.thrift.protocol.TField LOCK_PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("lockProjection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new OptionalLockProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new OptionalLockProjectionTupleSchemeFactory());
+  }
+
+  public LockProjection lockProjection; // 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 {
+    LOCK_PROJECTION((short)1, "lockProjection");
+
+    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: // LOCK_PROJECTION
+          return LOCK_PROJECTION;
+        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.LOCK_PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("lockProjection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LockProjection.class)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OptionalLockProjection.class, metaDataMap);
+  }
+
+  public OptionalLockProjection() {
+  }
+
+  public OptionalLockProjection(
+    LockProjection lockProjection)
+  {
+    this();
+    this.lockProjection = lockProjection;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public OptionalLockProjection(OptionalLockProjection other) {
+    if (other.isSetLockProjection()) {
+      this.lockProjection = new LockProjection(other.lockProjection);
+    }
+  }
+
+  public OptionalLockProjection deepCopy() {
+    return new OptionalLockProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.lockProjection = null;
+  }
+
+  public LockProjection getLockProjection() {
+    return this.lockProjection;
+  }
+
+  public OptionalLockProjection setLockProjection(LockProjection lockProjection) {
+    this.lockProjection = lockProjection;
+    return this;
+  }
+
+  public void unsetLockProjection() {
+    this.lockProjection = null;
+  }
+
+  /** Returns true if field lockProjection is set (has been assigned a value) and false otherwise */
+  public boolean isSetLockProjection() {
+    return this.lockProjection != null;
+  }
+
+  public void setLockProjectionIsSet(boolean value) {
+    if (!value) {
+      this.lockProjection = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case LOCK_PROJECTION:
+      if (value == null) {
+        unsetLockProjection();
+      } else {
+        setLockProjection((LockProjection)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case LOCK_PROJECTION:
+      return getLockProjection();
+
+    }
+    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 LOCK_PROJECTION:
+      return isSetLockProjection();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof OptionalLockProjection)
+      return this.equals((OptionalLockProjection)that);
+    return false;
+  }
+
+  public boolean equals(OptionalLockProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_lockProjection = true && this.isSetLockProjection();
+    boolean that_present_lockProjection = true && that.isSetLockProjection();
+    if (this_present_lockProjection || that_present_lockProjection) {
+      if (!(this_present_lockProjection && that_present_lockProjection))
+        return false;
+      if (!this.lockProjection.equals(that.lockProjection))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(OptionalLockProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetLockProjection()).compareTo(other.isSetLockProjection());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetLockProjection()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lockProjection, other.lockProjection);
+      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("OptionalLockProjection(");
+    boolean first = true;
+
+    sb.append("lockProjection:");
+    if (this.lockProjection == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.lockProjection);
+    }
+    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 (lockProjection != null) {
+      lockProjection.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 OptionalLockProjectionStandardSchemeFactory implements SchemeFactory {
+    public OptionalLockProjectionStandardScheme getScheme() {
+      return new OptionalLockProjectionStandardScheme();
+    }
+  }
+
+  private static class OptionalLockProjectionStandardScheme extends StandardScheme<OptionalLockProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, OptionalLockProjection 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: // LOCK_PROJECTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.lockProjection = new LockProjection();
+              struct.lockProjection.read(iprot);
+              struct.setLockProjectionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, OptionalLockProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.lockProjection != null) {
+        oprot.writeFieldBegin(LOCK_PROJECTION_FIELD_DESC);
+        struct.lockProjection.write(oprot);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class OptionalLockProjectionTupleSchemeFactory implements SchemeFactory {
+    public OptionalLockProjectionTupleScheme getScheme() {
+      return new OptionalLockProjectionTupleScheme();
+    }
+  }
+
+  private static class OptionalLockProjectionTupleScheme extends TupleScheme<OptionalLockProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, OptionalLockProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetLockProjection()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetLockProjection()) {
+        struct.lockProjection.write(oprot);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, OptionalLockProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.lockProjection = new LockProjection();
+        struct.lockProjection.read(iprot);
+        struct.setLockProjectionIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
index b1af720..a0e0a42 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -193,8 +193,8 @@ public class RpcTests extends BaseClassForTests
                 public Void call() throws Exception
                 {
                     CuratorProjection curatorProjection = client.newCuratorProjection("test");
-                    LockProjection lockProjection = client.acquireLock(curatorProjection, "/lock", timing.forWaiting().milliseconds());
-                    if ( lockProjection.id == null )
+                    OptionalLockProjection lockProjection = client.acquireLock(curatorProjection, "/lock", timing.forWaiting().milliseconds());
+                    if ( lockProjection.lockProjection == null )
                     {
                         throw new Exception("Could not acquire lock");
                     }
@@ -211,7 +211,7 @@ public class RpcTests extends BaseClassForTests
                     {
                         hasTheLock.set(false);
                         lockLatch.countDown();
-                        client.closeGenericProjection(curatorProjection, lockProjection.id);
+                        client.closeGenericProjection(curatorProjection, lockProjection.lockProjection.id);
                     }
 
                     return null;

http://git-wip-us.apache.org/repos/asf/curator/blob/8880417d/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index db8bc13..e15351e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -108,8 +108,8 @@ public class TestClient
         ChildData pathChildrenCacheDataForPath = client.getPathChildrenCacheDataForPath(curatorProjection, pathChildrenCacheProjection, "/a/b/c");
         System.out.println(pathChildrenCacheDataForPath);
 
-        LockProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
-        client.closeGenericProjection(curatorProjection, lockId.id);
+        OptionalLockProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
+        client.closeGenericProjection(curatorProjection, lockId.lockProjection.id);
 
         GetDataSpec getDataSpec = new GetDataSpec();
         getDataSpec.watched = true;


[28/50] [abbrv] git commit: Merge branch 'master' into curator-rpc

Posted by ra...@apache.org.
Merge branch 'master' into curator-rpc

Conflicts:
	curator-x-discovery-server/src/site/confluence/index.confluence
	curator-x-discovery/src/site/confluence/index.confluence
	src/site/confluence/getting-started.confluence
	src/site/confluence/index.confluence


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/cb9d8dd9
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/cb9d8dd9
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/cb9d8dd9

Branch: refs/heads/master
Commit: cb9d8dd96e4c625f154f6f15d39801701c2cdab1
Parents: 09f030e de1d38c
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 11:33:29 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 11:33:29 2014 -0500

----------------------------------------------------------------------
 .../src/site/confluence/index.confluence        |  2 +-
 .../src/site/confluence/index.confluence        |  4 +--
 .../distributed-delay-queue.confluence          |  4 +--
 .../confluence/distributed-id-queue.confluence  |  2 +-
 .../distributed-priority-queue.confluence       |  4 +--
 .../confluence/distributed-queue.confluence     |  6 ++--
 .../src/site/confluence/index.confluence        | 38 ++++++++++----------
 .../src/site/confluence/leader-latch.confluence |  2 +-
 .../src/site/confluence/path-cache.confluence   |  2 +-
 .../site/confluence/shared-counter.confluence   |  2 +-
 .../confluence/shared-reentrant-lock.confluence |  2 +-
 .../shared-reentrant-read-write-lock.confluence | 14 ++++----
 .../site/confluence/shared-semaphore.confluence |  2 +-
 .../simple-distributed-queue.confluence         |  4 +--
 .../src/site/confluence/index.confluence        |  4 +--
 .../src/site/confluence/index.confluence        | 18 +++++-----
 .../src/site/confluence/index.confluence        |  2 +-
 src/site/confluence/errors.confluence           |  8 ++---
 src/site/confluence/exhibitor.confluence        | 12 +++----
 src/site/confluence/getting-started.confluence  |  4 +--
 src/site/confluence/index.confluence            | 24 ++++++-------
 src/site/confluence/utilities.confluence        |  8 ++---
 22 files changed, 84 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/cb9d8dd9/curator-client/src/site/confluence/index.confluence
----------------------------------------------------------------------


[17/50] [abbrv] started work on service discovery

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/ProviderStrategyType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/ProviderStrategyType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/ProviderStrategyType.java
new file mode 100644
index 0000000..d34ddab
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/ProviderStrategyType.java
@@ -0,0 +1,51 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum ProviderStrategyType implements org.apache.thrift.TEnum {
+  RANDOM(0),
+  STICKY_RANDOM(1),
+  STICKY_ROUND_ROBIN(2),
+  ROUND_ROBIN(3);
+
+  private final int value;
+
+  private ProviderStrategyType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static ProviderStrategyType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return RANDOM;
+      case 1:
+        return STICKY_RANDOM;
+      case 2:
+        return STICKY_ROUND_ROBIN;
+      case 3:
+        return ROUND_ROBIN;
+      default:
+        return null;
+    }
+  }
+}


[08/50] [abbrv] git commit: added semaphore support

Posted by ra...@apache.org.
added semaphore support


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0e76121e
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0e76121e
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0e76121e

Branch: refs/heads/master
Commit: 0e76121e9903d305fc8d1327a8fdadfb6c7fb02b
Parents: cbd174a
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 00:08:56 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 00:08:56 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/connections/Closer.java       |    4 +-
 .../curator/x/rpc/connections/CuratorEntry.java |    8 +-
 .../projection/CuratorProjectionService.java    |   81 +-
 .../x/rpc/idl/projection/LeaseProjection.java   |   20 +
 curator-x-rpc/src/main/thrift/curator.thrift    |    5 +
 .../curator/generated/CuratorService.java       | 1301 ++++++++++++++++++
 .../curator/generated/LeaseProjection.java      |  388 ++++++
 .../org/apache/curator/x/rpc/TestClient.java    |    7 +
 8 files changed, 1786 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
index 060c7d7..c59c502 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
@@ -1,6 +1,6 @@
 package org.apache.curator.x.rpc.connections;
 
-public interface Closer<T>
+public interface Closer
 {
-    public void close(T thing);
+    public void close();
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index 2613ad0..0df0740 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -56,7 +56,7 @@ public class CuratorEntry implements Closeable
                 {
                     log.debug(String.format("Closing left over thing. Type: %s - Id: %s", entry.thing.getClass(), mapEntry.getKey()));
                     //noinspection unchecked
-                    entry.closer.close(entry.thing);    // lack of generics is safe because addThing() is type-safe
+                    entry.closer.close();    // lack of generics is safe because addThing() is type-safe
                 }
             }
             things.clear();
@@ -88,7 +88,7 @@ public class CuratorEntry implements Closeable
         return (state.get() == State.OPEN) ? client : null;
     }
 
-    public <T> String addThing(T thing, Closer<T> closer)
+    public String addThing(Object thing, Closer closer)
     {
         return addThing(newId(), thing, closer);
     }
@@ -110,12 +110,12 @@ public class CuratorEntry implements Closeable
         if ( entry != null )
         {
             //noinspection unchecked
-            entry.closer.close(entry.thing);
+            entry.closer.close();
         }
         return false;
     }
 
-    private <T> String addThing(String id, T thing, Closer<T> closer)
+    private <T> String addThing(String id, T thing, Closer closer)
     {
         things.put(id, new Entry(thing, closer));
         return id;

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index cb7a3cc..f82384f 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -36,6 +36,8 @@ import org.apache.curator.framework.recipes.leader.LeaderLatch;
 import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
 import org.apache.curator.framework.recipes.leader.Participant;
 import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
+import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2;
+import org.apache.curator.framework.recipes.locks.Lease;
 import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
 import org.apache.curator.framework.state.ConnectionState;
 import org.apache.curator.framework.state.ConnectionStateListener;
@@ -268,22 +270,22 @@ public class CuratorProjectionService
     public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
     {
         CuratorEntry entry = getEntry(projection);
-        InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
+        final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
         if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
         {
             return new LockProjection();
         }
 
-        Closer<InterProcessSemaphoreMutex> closer = new Closer<InterProcessSemaphoreMutex>()
+        Closer closer = new Closer()
         {
             @Override
-            public void close(InterProcessSemaphoreMutex mutex)
+            public void close()
             {
-                if ( mutex.isAcquiredInThisProcess() )
+                if ( lock.isAcquiredInThisProcess() )
                 {
                     try
                     {
-                        mutex.release();
+                        lock.release();
                     }
                     catch ( Exception e )
                     {
@@ -301,17 +303,17 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
+        final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
         leaderLatch.start();
 
-        Closer<LeaderLatch> closer = new Closer<LeaderLatch>()
+        Closer closer = new Closer()
         {
             @Override
-            public void close(LeaderLatch latch)
+            public void close()
             {
                 try
                 {
-                    latch.close();
+                    leaderLatch.close();
                 }
                 catch ( IOException e )
                 {
@@ -376,13 +378,13 @@ public class CuratorProjectionService
     {
         final CuratorEntry entry = getEntry(projection);
 
-        PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
+        final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
         cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
 
-        Closer<PathChildrenCache> closer = new Closer<PathChildrenCache>()
+        Closer closer = new Closer()
         {
             @Override
-            public void close(PathChildrenCache cache)
+            public void close()
             {
                 try
                 {
@@ -446,10 +448,10 @@ public class CuratorProjectionService
         final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
         cache.start(buildInitial);
 
-        Closer<NodeCache> closer = new Closer<NodeCache>()
+        Closer closer = new Closer()
         {
             @Override
-            public void close(NodeCache cache)
+            public void close()
             {
                 try
                 {
@@ -477,17 +479,26 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
+    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
+        return new RpcChildData(nodeCache.getCurrentData());
+    }
+
+    @ThriftMethod
     public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
     {
-        final CuratorEntry entry = getEntry(projection);
+        CuratorEntry entry = getEntry(projection);
 
-        PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
+        final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
         node.start();
 
-        Closer<PersistentEphemeralNode> closer = new Closer<PersistentEphemeralNode>()
+        Closer closer = new Closer()
         {
             @Override
-            public void close(PersistentEphemeralNode node)
+            public void close()
             {
                 try
                 {
@@ -504,12 +515,38 @@ public class CuratorProjectionService
     }
 
     @ThriftMethod
-    public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws Exception
     {
-        final CuratorEntry entry = getEntry(projection);
+        CuratorEntry entry = getEntry(projection);
 
-        NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
-        return new RpcChildData(nodeCache.getCurrentData());
+        final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
+        final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
+        if ( leases == null )
+        {
+            return Lists.newArrayList();
+        }
+
+        List<LeaseProjection> leaseProjections = Lists.newArrayList();
+        for ( final Lease lease : leases )
+        {
+            Closer closer = new Closer()
+            {
+                @Override
+                public void close()
+                {
+                    try
+                    {
+                        semaphore.returnLease(lease);
+                    }
+                    catch ( Exception e )
+                    {
+                        log.error("Could not release semaphore leases for path: " + path, e);
+                    }
+                }
+            };
+            leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
+        }
+        return leaseProjections;
     }
 
     public void addEvent(CuratorProjection projection, RpcCuratorEvent event)

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
new file mode 100644
index 0000000..2faa228
--- /dev/null
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
@@ -0,0 +1,20 @@
+package org.apache.curator.x.rpc.idl.projection;
+
+import com.facebook.swift.codec.ThriftField;
+import com.facebook.swift.codec.ThriftStruct;
+
+@ThriftStruct
+public class LeaseProjection
+{
+    @ThriftField(1)
+    public String id;
+
+    public LeaseProjection()
+    {
+    }
+
+    public LeaseProjection(String id)
+    {
+        this.id = id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 601d775..fc51dba 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -62,6 +62,10 @@ struct LeaderProjection {
   1: string id;
 }
 
+struct LeaseProjection {
+  1: string id;
+}
+
 struct LockProjection {
   1: string id;
 }
@@ -214,6 +218,7 @@ service CuratorService {
   NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial);
   PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode);
   PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode);
+  list<LeaseProjection> startSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases);
 }
 
 service EventService {

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index 4c49c67..d7e52ba 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -74,6 +74,8 @@ public class CuratorService {
 
     public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException;
 
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException;
+
   }
 
   public interface AsyncIface {
@@ -116,6 +118,8 @@ public class CuratorService {
 
     public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
   }
 
   public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -597,6 +601,33 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPersistentEphemeralNode failed: unknown result");
     }
 
+    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException
+    {
+      send_startSemaphore(projection, path, acquireQty, maxWaitMs, maxLeases);
+      return recv_startSemaphore();
+    }
+
+    public void send_startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException
+    {
+      startSemaphore_args args = new startSemaphore_args();
+      args.setProjection(projection);
+      args.setPath(path);
+      args.setAcquireQty(acquireQty);
+      args.setMaxWaitMs(maxWaitMs);
+      args.setMaxLeases(maxLeases);
+      sendBase("startSemaphore", args);
+    }
+
+    public List<LeaseProjection> recv_startSemaphore() throws org.apache.thrift.TException
+    {
+      startSemaphore_result result = new startSemaphore_result();
+      receiveBase(result, "startSemaphore");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startSemaphore failed: unknown result");
+    }
+
   }
   public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
     public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@@ -1307,6 +1338,50 @@ public class CuratorService {
       }
     }
 
+    public void startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      startSemaphore_call method_call = new startSemaphore_call(projection, path, acquireQty, maxWaitMs, maxLeases, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class startSemaphore_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String path;
+      private int acquireQty;
+      private int maxWaitMs;
+      private int maxLeases;
+      public startSemaphore_call(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, 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.projection = projection;
+        this.path = path;
+        this.acquireQty = acquireQty;
+        this.maxWaitMs = maxWaitMs;
+        this.maxLeases = maxLeases;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startSemaphore", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        startSemaphore_args args = new startSemaphore_args();
+        args.setProjection(projection);
+        args.setPath(path);
+        args.setAcquireQty(acquireQty);
+        args.setMaxWaitMs(maxWaitMs);
+        args.setMaxLeases(maxLeases);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<LeaseProjection> getResult() throws 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_startSemaphore();
+      }
+    }
+
   }
 
   public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@@ -1339,6 +1414,7 @@ public class CuratorService {
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
+      processMap.put("startSemaphore", new startSemaphore());
       return processMap;
     }
 
@@ -1724,6 +1800,26 @@ public class CuratorService {
       }
     }
 
+    public static class startSemaphore<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startSemaphore_args> {
+      public startSemaphore() {
+        super("startSemaphore");
+      }
+
+      public startSemaphore_args getEmptyArgsInstance() {
+        return new startSemaphore_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public startSemaphore_result getResult(I iface, startSemaphore_args args) throws org.apache.thrift.TException {
+        startSemaphore_result result = new startSemaphore_result();
+        result.success = iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases);
+        return result;
+      }
+    }
+
   }
 
   public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@@ -1756,6 +1852,7 @@ public class CuratorService {
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
+      processMap.put("startSemaphore", new startSemaphore());
       return processMap;
     }
 
@@ -2728,6 +2825,57 @@ public class CuratorService {
       }
     }
 
+    public static class startSemaphore<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startSemaphore_args, List<LeaseProjection>> {
+      public startSemaphore() {
+        super("startSemaphore");
+      }
+
+      public startSemaphore_args getEmptyArgsInstance() {
+        return new startSemaphore_args();
+      }
+
+      public AsyncMethodCallback<List<LeaseProjection>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<List<LeaseProjection>>() { 
+          public void onComplete(List<LeaseProjection> o) {
+            startSemaphore_result result = new startSemaphore_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;
+            startSemaphore_result result = new startSemaphore_result();
+            {
+              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, startSemaphore_args args, org.apache.thrift.async.AsyncMethodCallback<List<LeaseProjection>> resultHandler) throws TException {
+        iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases,resultHandler);
+      }
+    }
+
   }
 
   public static class acquireLock_args implements org.apache.thrift.TBase<acquireLock_args, acquireLock_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireLock_args>   {
@@ -19113,4 +19261,1157 @@ public class CuratorService {
 
   }
 
+  public static class startSemaphore_args implements org.apache.thrift.TBase<startSemaphore_args, startSemaphore_args._Fields>, java.io.Serializable, Cloneable, Comparable<startSemaphore_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startSemaphore_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField ACQUIRE_QTY_FIELD_DESC = new org.apache.thrift.protocol.TField("acquireQty", org.apache.thrift.protocol.TType.I32, (short)3);
+    private static final org.apache.thrift.protocol.TField MAX_WAIT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxWaitMs", org.apache.thrift.protocol.TType.I32, (short)4);
+    private static final org.apache.thrift.protocol.TField MAX_LEASES_FIELD_DESC = new org.apache.thrift.protocol.TField("maxLeases", org.apache.thrift.protocol.TType.I32, (short)5);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new startSemaphore_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new startSemaphore_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // required
+    public String path; // required
+    public int acquireQty; // required
+    public int maxWaitMs; // required
+    public int maxLeases; // 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 {
+      PROJECTION((short)1, "projection"),
+      PATH((short)2, "path"),
+      ACQUIRE_QTY((short)3, "acquireQty"),
+      MAX_WAIT_MS((short)4, "maxWaitMs"),
+      MAX_LEASES((short)5, "maxLeases");
+
+      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: // PROJECTION
+            return PROJECTION;
+          case 2: // PATH
+            return PATH;
+          case 3: // ACQUIRE_QTY
+            return ACQUIRE_QTY;
+          case 4: // MAX_WAIT_MS
+            return MAX_WAIT_MS;
+          case 5: // MAX_LEASES
+            return MAX_LEASES;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    private static final int __ACQUIREQTY_ISSET_ID = 0;
+    private static final int __MAXWAITMS_ISSET_ID = 1;
+    private static final int __MAXLEASES_ISSET_ID = 2;
+    private byte __isset_bitfield = 0;
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.ACQUIRE_QTY, new org.apache.thrift.meta_data.FieldMetaData("acquireQty", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      tmpMap.put(_Fields.MAX_WAIT_MS, new org.apache.thrift.meta_data.FieldMetaData("maxWaitMs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      tmpMap.put(_Fields.MAX_LEASES, new org.apache.thrift.meta_data.FieldMetaData("maxLeases", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startSemaphore_args.class, metaDataMap);
+    }
+
+    public startSemaphore_args() {
+    }
+
+    public startSemaphore_args(
+      CuratorProjection projection,
+      String path,
+      int acquireQty,
+      int maxWaitMs,
+      int maxLeases)
+    {
+      this();
+      this.projection = projection;
+      this.path = path;
+      this.acquireQty = acquireQty;
+      setAcquireQtyIsSet(true);
+      this.maxWaitMs = maxWaitMs;
+      setMaxWaitMsIsSet(true);
+      this.maxLeases = maxLeases;
+      setMaxLeasesIsSet(true);
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public startSemaphore_args(startSemaphore_args other) {
+      __isset_bitfield = other.__isset_bitfield;
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+      if (other.isSetPath()) {
+        this.path = other.path;
+      }
+      this.acquireQty = other.acquireQty;
+      this.maxWaitMs = other.maxWaitMs;
+      this.maxLeases = other.maxLeases;
+    }
+
+    public startSemaphore_args deepCopy() {
+      return new startSemaphore_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+      this.path = null;
+      setAcquireQtyIsSet(false);
+      this.acquireQty = 0;
+      setMaxWaitMsIsSet(false);
+      this.maxWaitMs = 0;
+      setMaxLeasesIsSet(false);
+      this.maxLeases = 0;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public startSemaphore_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public String getPath() {
+      return this.path;
+    }
+
+    public startSemaphore_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
+
+    public void unsetPath() {
+      this.path = null;
+    }
+
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
+
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
+      }
+    }
+
+    public int getAcquireQty() {
+      return this.acquireQty;
+    }
+
+    public startSemaphore_args setAcquireQty(int acquireQty) {
+      this.acquireQty = acquireQty;
+      setAcquireQtyIsSet(true);
+      return this;
+    }
+
+    public void unsetAcquireQty() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID);
+    }
+
+    /** Returns true if field acquireQty is set (has been assigned a value) and false otherwise */
+    public boolean isSetAcquireQty() {
+      return EncodingUtils.testBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID);
+    }
+
+    public void setAcquireQtyIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID, value);
+    }
+
+    public int getMaxWaitMs() {
+      return this.maxWaitMs;
+    }
+
+    public startSemaphore_args setMaxWaitMs(int maxWaitMs) {
+      this.maxWaitMs = maxWaitMs;
+      setMaxWaitMsIsSet(true);
+      return this;
+    }
+
+    public void unsetMaxWaitMs() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXWAITMS_ISSET_ID);
+    }
+
+    /** Returns true if field maxWaitMs is set (has been assigned a value) and false otherwise */
+    public boolean isSetMaxWaitMs() {
+      return EncodingUtils.testBit(__isset_bitfield, __MAXWAITMS_ISSET_ID);
+    }
+
+    public void setMaxWaitMsIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXWAITMS_ISSET_ID, value);
+    }
+
+    public int getMaxLeases() {
+      return this.maxLeases;
+    }
+
+    public startSemaphore_args setMaxLeases(int maxLeases) {
+      this.maxLeases = maxLeases;
+      setMaxLeasesIsSet(true);
+      return this;
+    }
+
+    public void unsetMaxLeases() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXLEASES_ISSET_ID);
+    }
+
+    /** Returns true if field maxLeases is set (has been assigned a value) and false otherwise */
+    public boolean isSetMaxLeases() {
+      return EncodingUtils.testBit(__isset_bitfield, __MAXLEASES_ISSET_ID);
+    }
+
+    public void setMaxLeasesIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXLEASES_ISSET_ID, value);
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
+
+      case ACQUIRE_QTY:
+        if (value == null) {
+          unsetAcquireQty();
+        } else {
+          setAcquireQty((Integer)value);
+        }
+        break;
+
+      case MAX_WAIT_MS:
+        if (value == null) {
+          unsetMaxWaitMs();
+        } else {
+          setMaxWaitMs((Integer)value);
+        }
+        break;
+
+      case MAX_LEASES:
+        if (value == null) {
+          unsetMaxLeases();
+        } else {
+          setMaxLeases((Integer)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PATH:
+        return getPath();
+
+      case ACQUIRE_QTY:
+        return Integer.valueOf(getAcquireQty());
+
+      case MAX_WAIT_MS:
+        return Integer.valueOf(getMaxWaitMs());
+
+      case MAX_LEASES:
+        return Integer.valueOf(getMaxLeases());
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PATH:
+        return isSetPath();
+      case ACQUIRE_QTY:
+        return isSetAcquireQty();
+      case MAX_WAIT_MS:
+        return isSetMaxWaitMs();
+      case MAX_LEASES:
+        return isSetMaxLeases();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof startSemaphore_args)
+        return this.equals((startSemaphore_args)that);
+      return false;
+    }
+
+    public boolean equals(startSemaphore_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
+          return false;
+      }
+
+      boolean this_present_acquireQty = true;
+      boolean that_present_acquireQty = true;
+      if (this_present_acquireQty || that_present_acquireQty) {
+        if (!(this_present_acquireQty && that_present_acquireQty))
+          return false;
+        if (this.acquireQty != that.acquireQty)
+          return false;
+      }
+
+      boolean this_present_maxWaitMs = true;
+      boolean that_present_maxWaitMs = true;
+      if (this_present_maxWaitMs || that_present_maxWaitMs) {
+        if (!(this_present_maxWaitMs && that_present_maxWaitMs))
+          return false;
+        if (this.maxWaitMs != that.maxWaitMs)
+          return false;
+      }
+
+      boolean this_present_maxLeases = true;
+      boolean that_present_maxLeases = true;
+      if (this_present_maxLeases || that_present_maxLeases) {
+        if (!(this_present_maxLeases && that_present_maxLeases))
+          return false;
+        if (this.maxLeases != that.maxLeases)
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(startSemaphore_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetAcquireQty()).compareTo(other.isSetAcquireQty());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAcquireQty()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acquireQty, other.acquireQty);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetMaxWaitMs()).compareTo(other.isSetMaxWaitMs());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetMaxWaitMs()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxWaitMs, other.maxWaitMs);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetMaxLeases()).compareTo(other.isSetMaxLeases());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetMaxLeases()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxLeases, other.maxLeases);
+        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("startSemaphore_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("acquireQty:");
+      sb.append(this.acquireQty);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("maxWaitMs:");
+      sb.append(this.maxWaitMs);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("maxLeases:");
+      sb.append(this.maxLeases);
+      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 (projection != null) {
+        projection.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class startSemaphore_argsStandardSchemeFactory implements SchemeFactory {
+      public startSemaphore_argsStandardScheme getScheme() {
+        return new startSemaphore_argsStandardScheme();
+      }
+    }
+
+    private static class startSemaphore_argsStandardScheme extends StandardScheme<startSemaphore_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, startSemaphore_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PATH
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.path = iprot.readString();
+                struct.setPathIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // ACQUIRE_QTY
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.acquireQty = iprot.readI32();
+                struct.setAcquireQtyIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 4: // MAX_WAIT_MS
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.maxWaitMs = iprot.readI32();
+                struct.setMaxWaitMsIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 5: // MAX_LEASES
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.maxLeases = iprot.readI32();
+                struct.setMaxLeasesIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, startSemaphore_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.path != null) {
+          oprot.writeFieldBegin(PATH_FIELD_DESC);
+          oprot.writeString(struct.path);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldBegin(ACQUIRE_QTY_FIELD_DESC);
+        oprot.writeI32(struct.acquireQty);
+        oprot.writeFieldEnd();
+        oprot.writeFieldBegin(MAX_WAIT_MS_FIELD_DESC);
+        oprot.writeI32(struct.maxWaitMs);
+        oprot.writeFieldEnd();
+        oprot.writeFieldBegin(MAX_LEASES_FIELD_DESC);
+        oprot.writeI32(struct.maxLeases);
+        oprot.writeFieldEnd();
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class startSemaphore_argsTupleSchemeFactory implements SchemeFactory {
+      public startSemaphore_argsTupleScheme getScheme() {
+        return new startSemaphore_argsTupleScheme();
+      }
+    }
+
+    private static class startSemaphore_argsTupleScheme extends TupleScheme<startSemaphore_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, startSemaphore_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetPath()) {
+          optionals.set(1);
+        }
+        if (struct.isSetAcquireQty()) {
+          optionals.set(2);
+        }
+        if (struct.isSetMaxWaitMs()) {
+          optionals.set(3);
+        }
+        if (struct.isSetMaxLeases()) {
+          optionals.set(4);
+        }
+        oprot.writeBitSet(optionals, 5);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetPath()) {
+          oprot.writeString(struct.path);
+        }
+        if (struct.isSetAcquireQty()) {
+          oprot.writeI32(struct.acquireQty);
+        }
+        if (struct.isSetMaxWaitMs()) {
+          oprot.writeI32(struct.maxWaitMs);
+        }
+        if (struct.isSetMaxLeases()) {
+          oprot.writeI32(struct.maxLeases);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, startSemaphore_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(5);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.path = iprot.readString();
+          struct.setPathIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.acquireQty = iprot.readI32();
+          struct.setAcquireQtyIsSet(true);
+        }
+        if (incoming.get(3)) {
+          struct.maxWaitMs = iprot.readI32();
+          struct.setMaxWaitMsIsSet(true);
+        }
+        if (incoming.get(4)) {
+          struct.maxLeases = iprot.readI32();
+          struct.setMaxLeasesIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class startSemaphore_result implements org.apache.thrift.TBase<startSemaphore_result, startSemaphore_result._Fields>, java.io.Serializable, Cloneable, Comparable<startSemaphore_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startSemaphore_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new startSemaphore_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new startSemaphore_resultTupleSchemeFactory());
+    }
+
+    public List<LeaseProjection> success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      private static final 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;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LeaseProjection.class))));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startSemaphore_result.class, metaDataMap);
+    }
+
+    public startSemaphore_result() {
+    }
+
+    public startSemaphore_result(
+      List<LeaseProjection> success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public startSemaphore_result(startSemaphore_result other) {
+      if (other.isSetSuccess()) {
+        List<LeaseProjection> __this__success = new ArrayList<LeaseProjection>(other.success.size());
+        for (LeaseProjection other_element : other.success) {
+          __this__success.add(new LeaseProjection(other_element));
+        }
+        this.success = __this__success;
+      }
+    }
+
+    public startSemaphore_result deepCopy() {
+      return new startSemaphore_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public int getSuccessSize() {
+      return (this.success == null) ? 0 : this.success.size();
+    }
+
+    public java.util.Iterator<LeaseProjection> getSuccessIterator() {
+      return (this.success == null) ? null : this.success.iterator();
+    }
+
+    public void addToSuccess(LeaseProjection elem) {
+      if (this.success == null) {
+        this.success = new ArrayList<LeaseProjection>();
+      }
+      this.success.add(elem);
+    }
+
+    public List<LeaseProjection> getSuccess() {
+      return this.success;
+    }
+
+    public startSemaphore_result setSuccess(List<LeaseProjection> success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((List<LeaseProjection>)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof startSemaphore_result)
+        return this.equals((startSemaphore_result)that);
+      return false;
+    }
+
+    public boolean equals(startSemaphore_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(startSemaphore_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      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("startSemaphore_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 startSemaphore_resultStandardSchemeFactory implements SchemeFactory {
+      public startSemaphore_resultStandardScheme getScheme() {
+        return new startSemaphore_resultStandardScheme();
+      }
+    }
+
+    private static class startSemaphore_resultStandardScheme extends StandardScheme<startSemaphore_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, startSemaphore_result struct) throws org.apache.thrift.TException {
+        org.apache.thrift.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+                {
+                  org.apache.thrift.protocol.TList _list40 = iprot.readListBegin();
+                  struct.success = new ArrayList<LeaseProjection>(_list40.size);
+                  for (int _i41 = 0; _i41 < _list40.size; ++_i41)
+                  {
+                    LeaseProjection _elem42;
+                    _elem42 = new LeaseProjection();
+                    _elem42.read(iprot);
+                    struct.success.add(_elem42);
+                  }
+                  iprot.readListEnd();
+                }
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, startSemaphore_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+            for (LeaseProjection _iter43 : struct.success)
+            {
+              _iter43.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class startSemaphore_resultTupleSchemeFactory implements SchemeFactory {
+      public startSemaphore_resultTupleScheme getScheme() {
+        return new startSemaphore_resultTupleScheme();
+      }
+    }
+
+    private static class startSemaphore_resultTupleScheme extends TupleScheme<startSemaphore_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, startSemaphore_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          {
+            oprot.writeI32(struct.success.size());
+            for (LeaseProjection _iter44 : struct.success)
+            {
+              _iter44.write(oprot);
+            }
+          }
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, startSemaphore_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          {
+            org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.success = new ArrayList<LeaseProjection>(_list45.size);
+            for (int _i46 = 0; _i46 < _list45.size; ++_i46)
+            {
+              LeaseProjection _elem47;
+              _elem47 = new LeaseProjection();
+              _elem47.read(iprot);
+              struct.success.add(_elem47);
+            }
+          }
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java
new file mode 100644
index 0000000..d14f14d
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaseProjection.java
@@ -0,0 +1,388 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 LeaseProjection implements org.apache.thrift.TBase<LeaseProjection, LeaseProjection._Fields>, java.io.Serializable, Cloneable, Comparable<LeaseProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LeaseProjection");
+
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new LeaseProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new LeaseProjectionTupleSchemeFactory());
+  }
+
+  public String id; // 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 {
+    ID((short)1, "id");
+
+    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: // ID
+          return ID;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LeaseProjection.class, metaDataMap);
+  }
+
+  public LeaseProjection() {
+  }
+
+  public LeaseProjection(
+    String id)
+  {
+    this();
+    this.id = id;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public LeaseProjection(LeaseProjection other) {
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+  }
+
+  public LeaseProjection deepCopy() {
+    return new LeaseProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.id = null;
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public LeaseProjection setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ID:
+      return getId();
+
+    }
+    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 ID:
+      return isSetId();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof LeaseProjection)
+      return this.equals((LeaseProjection)that);
+    return false;
+  }
+
+  public boolean equals(LeaseProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(LeaseProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      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("LeaseProjection(");
+    boolean first = true;
+
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    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 LeaseProjectionStandardSchemeFactory implements SchemeFactory {
+    public LeaseProjectionStandardScheme getScheme() {
+      return new LeaseProjectionStandardScheme();
+    }
+  }
+
+  private static class LeaseProjectionStandardScheme extends StandardScheme<LeaseProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, LeaseProjection 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: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, LeaseProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class LeaseProjectionTupleSchemeFactory implements SchemeFactory {
+    public LeaseProjectionTupleScheme getScheme() {
+      return new LeaseProjectionTupleScheme();
+    }
+  }
+
+  private static class LeaseProjectionTupleScheme extends TupleScheme<LeaseProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, LeaseProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetId()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, LeaseProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/0e76121e/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 9da935c..5e1451e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -132,5 +132,12 @@ public class TestClient
         OptionalStat nodeExists = client.exists(curatorProjection, existsSpec);
         System.out.println("nodeExists: " + nodeExists);
         client.closeGenericProjection(curatorProjection, node.id);
+
+        List<LeaseProjection> leaseProjections = client.startSemaphore(curatorProjection, "/semi", 3, 1000, 10);
+        System.out.println("leaseProjections: " + leaseProjections);
+        for ( LeaseProjection leaseProjection : leaseProjections )
+        {
+            client.closeGenericProjection(curatorProjection, leaseProjection.id);
+        }
     }
 }


[43/50] [abbrv] git commit: doc wip

Posted by ra...@apache.org.
doc wip


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/b583407d
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/b583407d
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/b583407d

Branch: refs/heads/master
Commit: b583407d4e010935d01e09c3cb52bd20c741e107
Parents: 29ef0c8
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 14:56:28 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 14:56:28 2014 -0500

----------------------------------------------------------------------
 .../site/confluence/configuration.confluence    | 26 ++++----
 .../src/site/confluence/deploy.confluence       |  4 +-
 .../src/site/confluence/reference.confluence    | 68 ++++++++++----------
 .../src/site/confluence/usage.confluence        |  8 +--
 4 files changed, 53 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/b583407d/curator-x-rpc/src/site/confluence/configuration.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
index 21912ae..72d2af0 100644
--- a/curator-x-rpc/src/site/confluence/configuration.confluence
+++ b/curator-x-rpc/src/site/confluence/configuration.confluence
@@ -98,12 +98,12 @@ Durations are strings that specify a time duration. Examples:
 
 h3. Thrift
 
-||Name||Type||Default Value||Description||
-|bindAddress|string|"bindAddress"|Address for server to bind to|
-|port|int|_none_|port to listen on. *required*|
-|idleConnectionTimeout|int|60 seconds|timeout period between receiving requests from a client connection. If the timeout is exceeded (no complete requests have arrived from the client within the timeout), the server will disconnect the idle client.|
-|transportName|string|"framed"|the name of the transport (frame codec) that this server will handle. The available options by default are 'unframed', 'buffered', and 'framed'. Additional modules may install other options.|
-|protocolName|string|"binary"|name of the protocol that this server will speak. The available options by default are 'binary' and 'compact'. Additional modules may install other options.|
+||Name||Type||Default Value||Required||Description||
+|port|int|_none_|*Y*|port to listen on.|
+|bindAddress|string|"localhost"|\-|Address for server to bind to|
+|idleConnectionTimeout|int|60 seconds|\-|timeout period between receiving requests from a client connection. If the timeout is exceeded (no complete requests have arrived from the client within the timeout), the server will disconnect the idle client.|
+|transportName|string|"framed"|\-|the name of the transport (frame codec) that this server will handle. The available options by default are 'unframed', 'buffered', and 'framed'. Additional modules may install other options.|
+|protocolName|string|"binary"|\-|name of the protocol that this server will speak. The available options by default are 'binary' and 'compact'. Additional modules may install other options.|
 
 h3. Logging
 
@@ -112,13 +112,13 @@ on specifying the logging configuration.
 
 h3. Connection
 
-||Name||Type||Default Value||Description||
-|name|string|_none_|Unique name for the connection. *required*|
-|connectionString|string|_none_|ZooKeeper connection string (e.g. "host1:2181,host2:2181"). *required*|
-|sessionLength|Duration|1 minute|duration for the ZooKeeper session|
-|connectionTimeout|Duration|15 seconds|duration for connecting|
-|retry|Retry|an exponential\-backoff policy|The Retry Policy to use|
-|authorization|Authorization|null|Authorization spec|
+||Name||Type||Default Value||Required||Description||
+|name|string|_none_|*Y*|Unique name for the connection.|
+|connectionString|string|_none_|*Y*|ZooKeeper connection string (e.g. "host1:2181,host2:2181").|
+|sessionLength|Duration|1 minute|\-|duration for the ZooKeeper session|
+|connectionTimeout|Duration|15 seconds|\-|duration for connecting|
+|retry|Retry|an exponential\-backoff policy|\-|The Retry Policy to use|
+|authorization|Authorization|null|\-|Authorization spec|
 
 h3. Retry
 

http://git-wip-us.apache.org/repos/asf/curator/blob/b583407d/curator-x-rpc/src/site/confluence/deploy.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
index 8c93cb8..3f5053b 100644
--- a/curator-x-rpc/src/site/confluence/deploy.confluence
+++ b/curator-x-rpc/src/site/confluence/deploy.confluence
@@ -4,8 +4,8 @@ h1. Deployment
 
 h2. Running
 
-Curator RPC is built as an "uber" Java JAR and can be downloaded from Maven Central. Go to [[http://search.maven.org/]] and search for
-"curator\-x\-rpc" and download the JAR for the latest version. This JAR can be run directly ala:
+Curator RPC is built as an "uber" Java JAR and can be downloaded from Maven Central. Go to [[http://search.maven.org/|http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.curator%22%20AND%20a%3A%22curator-x-rpc%22]]
+and search for "curator\-x\-rpc" and download the JAR for the latest version. This JAR can be run directly ala:
 
 {noformat}
 java -jar curator-x-rpc-VERSION.jar <argument>

http://git-wip-us.apache.org/repos/asf/curator/blob/b583407d/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index dde323f..602906e 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -49,55 +49,55 @@ h1. Struct Reference
 
 h2. CreateSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|data|bytes|data for the node|
-|mode|CreateMode|PERSISTENT, PERSISTENT\_SEQUENTIAL, EPHEMERAL, or EPHEMERAL\_SEQUENTIAL|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
-|compressed|bool|if true, compress the data|
-|creatingParentsIfNeeded|bool|if true, create any needed parent nodes|
-|withProtection|bool|if true, use Curator protection|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|data|bytes|\-|data for the node|
+|mode|CreateMode|\-|PERSISTENT, PERSISTENT\_SEQUENTIAL, EPHEMERAL, or EPHEMERAL\_SEQUENTIAL|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|\-|if true, compress the data|
+|creatingParentsIfNeeded|bool|\-|if true, create any needed parent nodes|
+|withProtection|bool|\-|if true, use Curator protection|
 
 h2. DeleteSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|guaranteed|bool|if true, use guaranteed deletion|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
-|compressed|bool|if true, compress the data|
-|version|Version|if not null, uses Version.version when deleting the node. Otherwise, \-1 is used.|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|guaranteed|bool|\-|if true, use guaranteed deletion|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|\-|if true, compress the data|
+|version|Version|\-|if not null, uses Version.version when deleting the node. Otherwise, \-1 is used.|
 
 h2. GetDataSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|watched|bool|if true, trigger watch events for this node|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
-|decompressed|bool|if true, decompress the data|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|watched|bool|\-|if true, trigger watch events for this node|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|decompressed|bool|\-|if true, decompress the data|
 
 h2. SetDataSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|data|bytes|data for the node \- *required*|
-|watched|bool|if true, trigger watch events for this node|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
-|compressed|bool|if true, compress the data|
-|version|Version|if not null, uses Version.version when setting the node data. Otherwise, \-1 is used.|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|data|bytes|*Y*|data for the node|
+|watched|bool|\-|if true, trigger watch events for this node|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|\-|if true, compress the data|
+|version|Version|\-|if not null, uses Version.version when setting the node data. Otherwise, \-1 is used.|
 
 h2. ExistsSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|watched|bool|if true, trigger watch events for this node|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|watched|bool|\-|if true, trigger watch events for this node|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 
 h2. GetChildrenSpec
 
-||Field||Type||Description||
-|path|string|the ZNode path \- *required*|
-|watched|bool|if true, trigger watch events for this node|
-|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+||Field||Type||Required||Description||
+|path|string|*Y*|the ZNode path|
+|watched|bool|\-|if true, trigger watch events for this node|
+|asyncContext|string|\-|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 
 h2. LeaderResult
 

http://git-wip-us.apache.org/repos/asf/curator/blob/b583407d/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index e9da75f..57bc14c 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -72,14 +72,14 @@ h2. Usage
 Once initialized, use recipes/APIs as needed. Here is an example of using the lock recipe:
 
 {code}
-lockId = client.acquireLock(curatorProjection, "/mylock", 10000);
+lockId = client.acquireLock(curatorProjection, "/mylock", 10000)
 if lockId.id == null {
     // lock attempt failed. Throw exception, etc.
 }
 
 // you now own the lock
 
-client.closeGenericProjection(curatorProjection, lockId.id);
+client.closeGenericProjection(curatorProjection, lockId.id)
 {code}
 
 Here is an example of using the path cache:
@@ -89,7 +89,7 @@ cacheProjection = client.startPathChildrenCache(curatorProjection, "/path", true
 
 ...
 
-data = client.getPathChildrenCacheDataForPath(curatorProjection, cacheProjection, "/path/child");
+data = client.getPathChildrenCacheDataForPath(curatorProjection, cacheProjection, "/path/child")
 
 ...
 
@@ -105,7 +105,7 @@ if event.type == PATH_CHILDREN_CACHE {
 ...
 
 // when done with the cache, close it
-client.closeGenericProjection(curatorProjection, cacheProjection.id);
+client.closeGenericProjection(curatorProjection, cacheProjection.id)
 {code}
 
 h2. Reference


[20/50] [abbrv] started work on service discovery

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstanceType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstanceType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstanceType.java
new file mode 100644
index 0000000..26ae413
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryInstanceType.java
@@ -0,0 +1,48 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum DiscoveryInstanceType implements org.apache.thrift.TEnum {
+  DYNAMIC(0),
+  STATIC(1),
+  PERMANENT(2);
+
+  private final int value;
+
+  private DiscoveryInstanceType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static DiscoveryInstanceType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return DYNAMIC;
+      case 1:
+        return STATIC;
+      case 2:
+        return PERMANENT;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProjection.java
new file mode 100644
index 0000000..e8e2813
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProjection.java
@@ -0,0 +1,388 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 DiscoveryProjection implements org.apache.thrift.TBase<DiscoveryProjection, DiscoveryProjection._Fields>, java.io.Serializable, Cloneable, Comparable<DiscoveryProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DiscoveryProjection");
+
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new DiscoveryProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new DiscoveryProjectionTupleSchemeFactory());
+  }
+
+  public String id; // 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 {
+    ID((short)1, "id");
+
+    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: // ID
+          return ID;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DiscoveryProjection.class, metaDataMap);
+  }
+
+  public DiscoveryProjection() {
+  }
+
+  public DiscoveryProjection(
+    String id)
+  {
+    this();
+    this.id = id;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public DiscoveryProjection(DiscoveryProjection other) {
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+  }
+
+  public DiscoveryProjection deepCopy() {
+    return new DiscoveryProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.id = null;
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public DiscoveryProjection setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ID:
+      return getId();
+
+    }
+    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 ID:
+      return isSetId();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof DiscoveryProjection)
+      return this.equals((DiscoveryProjection)that);
+    return false;
+  }
+
+  public boolean equals(DiscoveryProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(DiscoveryProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      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("DiscoveryProjection(");
+    boolean first = true;
+
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    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 DiscoveryProjectionStandardSchemeFactory implements SchemeFactory {
+    public DiscoveryProjectionStandardScheme getScheme() {
+      return new DiscoveryProjectionStandardScheme();
+    }
+  }
+
+  private static class DiscoveryProjectionStandardScheme extends StandardScheme<DiscoveryProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, DiscoveryProjection 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: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, DiscoveryProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class DiscoveryProjectionTupleSchemeFactory implements SchemeFactory {
+    public DiscoveryProjectionTupleScheme getScheme() {
+      return new DiscoveryProjectionTupleScheme();
+    }
+  }
+
+  private static class DiscoveryProjectionTupleScheme extends TupleScheme<DiscoveryProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, DiscoveryProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetId()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, DiscoveryProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/87582a9b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProviderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProviderProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProviderProjection.java
new file mode 100644
index 0000000..f6233ec
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryProviderProjection.java
@@ -0,0 +1,388 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 DiscoveryProviderProjection implements org.apache.thrift.TBase<DiscoveryProviderProjection, DiscoveryProviderProjection._Fields>, java.io.Serializable, Cloneable, Comparable<DiscoveryProviderProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DiscoveryProviderProjection");
+
+  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new DiscoveryProviderProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new DiscoveryProviderProjectionTupleSchemeFactory());
+  }
+
+  public String id; // 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 {
+    ID((short)1, "id");
+
+    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: // ID
+          return ID;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DiscoveryProviderProjection.class, metaDataMap);
+  }
+
+  public DiscoveryProviderProjection() {
+  }
+
+  public DiscoveryProviderProjection(
+    String id)
+  {
+    this();
+    this.id = id;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public DiscoveryProviderProjection(DiscoveryProviderProjection other) {
+    if (other.isSetId()) {
+      this.id = other.id;
+    }
+  }
+
+  public DiscoveryProviderProjection deepCopy() {
+    return new DiscoveryProviderProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.id = null;
+  }
+
+  public String getId() {
+    return this.id;
+  }
+
+  public DiscoveryProviderProjection setId(String id) {
+    this.id = id;
+    return this;
+  }
+
+  public void unsetId() {
+    this.id = null;
+  }
+
+  /** Returns true if field id is set (has been assigned a value) and false otherwise */
+  public boolean isSetId() {
+    return this.id != null;
+  }
+
+  public void setIdIsSet(boolean value) {
+    if (!value) {
+      this.id = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case ID:
+      if (value == null) {
+        unsetId();
+      } else {
+        setId((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case ID:
+      return getId();
+
+    }
+    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 ID:
+      return isSetId();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof DiscoveryProviderProjection)
+      return this.equals((DiscoveryProviderProjection)that);
+    return false;
+  }
+
+  public boolean equals(DiscoveryProviderProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_id = true && this.isSetId();
+    boolean that_present_id = true && that.isSetId();
+    if (this_present_id || that_present_id) {
+      if (!(this_present_id && that_present_id))
+        return false;
+      if (!this.id.equals(that.id))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(DiscoveryProviderProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
+      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("DiscoveryProviderProjection(");
+    boolean first = true;
+
+    sb.append("id:");
+    if (this.id == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.id);
+    }
+    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 DiscoveryProviderProjectionStandardSchemeFactory implements SchemeFactory {
+    public DiscoveryProviderProjectionStandardScheme getScheme() {
+      return new DiscoveryProviderProjectionStandardScheme();
+    }
+  }
+
+  private static class DiscoveryProviderProjectionStandardScheme extends StandardScheme<DiscoveryProviderProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, DiscoveryProviderProjection 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: // ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.id = iprot.readString();
+              struct.setIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, DiscoveryProviderProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.id != null) {
+        oprot.writeFieldBegin(ID_FIELD_DESC);
+        oprot.writeString(struct.id);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class DiscoveryProviderProjectionTupleSchemeFactory implements SchemeFactory {
+    public DiscoveryProviderProjectionTupleScheme getScheme() {
+      return new DiscoveryProviderProjectionTupleScheme();
+    }
+  }
+
+  private static class DiscoveryProviderProjectionTupleScheme extends TupleScheme<DiscoveryProviderProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, DiscoveryProviderProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetId()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetId()) {
+        oprot.writeString(struct.id);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, DiscoveryProviderProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.id = iprot.readString();
+        struct.setIdIsSet(true);
+      }
+    }
+  }
+
+}
+


[03/50] [abbrv] node cache support

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
new file mode 100644
index 0000000..083b936
--- /dev/null
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/NodeCacheProjection.java
@@ -0,0 +1,393 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.curator.generated;
+
+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 NodeCacheProjection implements org.apache.thrift.TBase<NodeCacheProjection, NodeCacheProjection._Fields>, java.io.Serializable, Cloneable, Comparable<NodeCacheProjection> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NodeCacheProjection");
+
+  private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new NodeCacheProjectionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new NodeCacheProjectionTupleSchemeFactory());
+  }
+
+  public GenericProjection projection; // 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 {
+    PROJECTION((short)1, "projection");
+
+    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: // PROJECTION
+          return PROJECTION;
+        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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GenericProjection.class)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(NodeCacheProjection.class, metaDataMap);
+  }
+
+  public NodeCacheProjection() {
+  }
+
+  public NodeCacheProjection(
+    GenericProjection projection)
+  {
+    this();
+    this.projection = projection;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public NodeCacheProjection(NodeCacheProjection other) {
+    if (other.isSetProjection()) {
+      this.projection = new GenericProjection(other.projection);
+    }
+  }
+
+  public NodeCacheProjection deepCopy() {
+    return new NodeCacheProjection(this);
+  }
+
+  @Override
+  public void clear() {
+    this.projection = null;
+  }
+
+  public GenericProjection getProjection() {
+    return this.projection;
+  }
+
+  public NodeCacheProjection setProjection(GenericProjection projection) {
+    this.projection = projection;
+    return this;
+  }
+
+  public void unsetProjection() {
+    this.projection = null;
+  }
+
+  /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+  public boolean isSetProjection() {
+    return this.projection != null;
+  }
+
+  public void setProjectionIsSet(boolean value) {
+    if (!value) {
+      this.projection = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case PROJECTION:
+      if (value == null) {
+        unsetProjection();
+      } else {
+        setProjection((GenericProjection)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case PROJECTION:
+      return getProjection();
+
+    }
+    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 PROJECTION:
+      return isSetProjection();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof NodeCacheProjection)
+      return this.equals((NodeCacheProjection)that);
+    return false;
+  }
+
+  public boolean equals(NodeCacheProjection that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_projection = true && this.isSetProjection();
+    boolean that_present_projection = true && that.isSetProjection();
+    if (this_present_projection || that_present_projection) {
+      if (!(this_present_projection && that_present_projection))
+        return false;
+      if (!this.projection.equals(that.projection))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(NodeCacheProjection other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetProjection()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+      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("NodeCacheProjection(");
+    boolean first = true;
+
+    sb.append("projection:");
+    if (this.projection == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.projection);
+    }
+    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 (projection != null) {
+      projection.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 NodeCacheProjectionStandardSchemeFactory implements SchemeFactory {
+    public NodeCacheProjectionStandardScheme getScheme() {
+      return new NodeCacheProjectionStandardScheme();
+    }
+  }
+
+  private static class NodeCacheProjectionStandardScheme extends StandardScheme<NodeCacheProjection> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, NodeCacheProjection 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: // PROJECTION
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.projection = new GenericProjection();
+              struct.projection.read(iprot);
+              struct.setProjectionIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, NodeCacheProjection struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.projection != null) {
+        oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+        struct.projection.write(oprot);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class NodeCacheProjectionTupleSchemeFactory implements SchemeFactory {
+    public NodeCacheProjectionTupleScheme getScheme() {
+      return new NodeCacheProjectionTupleScheme();
+    }
+  }
+
+  private static class NodeCacheProjectionTupleScheme extends TupleScheme<NodeCacheProjection> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, NodeCacheProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetProjection()) {
+        optionals.set(0);
+      }
+      oprot.writeBitSet(optionals, 1);
+      if (struct.isSetProjection()) {
+        struct.projection.write(oprot);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, NodeCacheProjection struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(1);
+      if (incoming.get(0)) {
+        struct.projection = new GenericProjection();
+        struct.projection.read(iprot);
+        struct.setProjectionIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/curator/blob/985c9ed0/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index a1c07bd..2ca6e69 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -76,6 +76,10 @@ public class TestClient
 
         PathChildrenCacheProjection pathChildrenCacheProjection = client.startPathChildrenCache(curatorProjection, "/a/b", true, false, PathChildrenCacheStartMode.BUILD_INITIAL_CACHE);
 
+        NodeCacheProjection nodeCache = client.startNodeCache(curatorProjection, "/a/b/c", false, true);
+        ChildData nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
+        System.out.println("nodeCacheData: " + nodeCacheData);
+
         List<ChildData> pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
         System.out.println("Child data: " + pathChildrenCacheData);
 
@@ -119,5 +123,8 @@ public class TestClient
 
         pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
         System.out.println("Child data: " + pathChildrenCacheData);
+
+        nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
+        System.out.println("nodeCacheData: " + nodeCacheData);
     }
 }


[09/50] [abbrv] git commit: consolidation and removal of old unused lines

Posted by ra...@apache.org.
consolidation and removal of old unused lines


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/48d3e31e
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/48d3e31e
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/48d3e31e

Branch: refs/heads/master
Commit: 48d3e31e1355ff193eecff713c2e2b3278882800
Parents: 0e76121
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 10:58:17 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 10:58:17 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/src/main/scripts/generate.sh | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/48d3e31e/curator-x-rpc/src/main/scripts/generate.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
index 5fab478..15f6546 100755
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ b/curator-x-rpc/src/main/scripts/generate.sh
@@ -31,22 +31,12 @@ RPC_PATH="$BASE_DIR/curator-x-rpc/target/classes"
 
 CLASSES=""
 
-PROJECTION_CLASSES=""
-for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/projection/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`;
-    do
+for p in projection event; do
+    for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/$p/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`; do
         if [[ $f != *[\$]* ]]; then
-            PROJECTION_CLASSES="$PROJECTION_CLASSES $f";
-            CLASSES="$CLASSES org.apache.curator.x.rpc.idl.projection.$f";
-        fi;
-done;
-
-EVENT_CLASSES=""
-for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/event/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`;
-    do
-        if [[ $f != *[\$]* ]]; then
-            EVENT_CLASSES="$EVENT_CLASSES $f";
-            CLASSES="$CLASSES org.apache.curator.x.rpc.idl.event.$f";
+            CLASSES="$CLASSES org.apache.curator.x.rpc.idl.$p.$f";
         fi;
+    done;
 done;
 
 THRIFT_DIR="$BASE_DIR/curator-x-rpc/src/main/thrift"
@@ -57,10 +47,6 @@ PATHS="$PATHS:$BASE_DIR/curator-framework/target/classes"
 PATHS="$PATHS:$BASE_DIR/curator-recipes/target/classes"
 PATHS="$PATHS:$RPC_PATH"
 
-PACKAGE="org.apache.curator.x.rpc.idl"
-PROJECTION_PACKAGE="org.apache.curator.x.rpc.idl.projection"
-EVENT_PACKAGE="org.apache.curator.x.rpc.idl.event"
-
 java -cp $PATHS com.facebook.swift.generator.swift2thrift.Main \
     -allow_multiple_packages org.apache.curator \
     -namespace cpp org.apache.curator.generated \


[02/50] [abbrv] git commit: Finished path children cache

Posted by ra...@apache.org.
Finished path children cache


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/6f9a9ab4
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/6f9a9ab4
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/6f9a9ab4

Branch: refs/heads/master
Commit: 6f9a9ab4ff218fb4aa8e961239bee45fe647f416
Parents: 4c626a7
Author: randgalt <ra...@apache.org>
Authored: Thu May 29 15:54:10 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu May 29 15:54:10 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/idl/event/RpcChildData.java   |   11 +
 .../idl/event/RpcPathChildrenCacheEvent.java    |    2 +-
 .../projection/CuratorProjectionService.java    |   46 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |    2 +
 .../curator/generated/CuratorService.java       | 2071 ++++++++++++++++++
 .../org/apache/curator/x/rpc/TestClient.java    |    9 +
 6 files changed, 2128 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
index 4c7827b..e490493 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
@@ -2,6 +2,7 @@ package org.apache.curator.x.rpc.idl.event;
 
 import com.facebook.swift.codec.ThriftField;
 import com.facebook.swift.codec.ThriftStruct;
+import org.apache.curator.framework.recipes.cache.ChildData;
 
 @ThriftStruct("ChildData")
 public class RpcChildData
@@ -19,6 +20,16 @@ public class RpcChildData
     {
     }
 
+    public RpcChildData(ChildData data)
+    {
+        if ( data != null )
+        {
+            this.path = data.getPath();
+            this.stat = RpcCuratorEvent.toRpcStat(data.getStat());
+            this.data = data.getData();
+        }
+    }
+
     public RpcChildData(String path, RpcStat stat, byte[] data)
     {
         this.path = path;

http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
index 9321157..59be6e2 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
@@ -24,7 +24,7 @@ public class RpcPathChildrenCacheEvent
     {
         this.cachedPath = cachedPath;
         type = RpcPathChildrenCacheEventType.valueOf(event.getType().name());
-        data = (event.getData() != null) ? new RpcChildData(event.getData().getPath(), RpcCuratorEvent.toRpcStat(event.getData().getStat()), event.getData().getData()) : null;
+        data = (event.getData() != null) ? new RpcChildData(event.getData()) : null;
     }
 
     public RpcPathChildrenCacheEvent(String cachedPath, RpcPathChildrenCacheEventType type, RpcChildData data)

http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index 1084507..8b41353 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -26,6 +26,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.api.*;
+import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.curator.framework.recipes.cache.PathChildrenCache;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
@@ -41,15 +42,7 @@ import org.apache.curator.x.rpc.connections.ConnectionManager;
 import org.apache.curator.x.rpc.connections.CuratorEntry;
 import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
 import org.apache.curator.x.rpc.details.RpcWatcher;
-import org.apache.curator.x.rpc.idl.event.LeaderEvent;
-import org.apache.curator.x.rpc.idl.event.LeaderResult;
-import org.apache.curator.x.rpc.idl.event.OptionalChildrenList;
-import org.apache.curator.x.rpc.idl.event.OptionalPath;
-import org.apache.curator.x.rpc.idl.event.OptionalRpcStat;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.event.RpcParticipant;
-import org.apache.curator.x.rpc.idl.event.RpcPathChildrenCacheEvent;
-import org.apache.curator.x.rpc.idl.event.RpcStat;
+import org.apache.curator.x.rpc.idl.event.*;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
@@ -356,7 +349,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        LeaderLatch leaderLatch = getThis(entry, leaderProjection.projection.id, LeaderLatch.class);
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.projection.id, LeaderLatch.class);
         Collection<Participant> participants = leaderLatch.getParticipants();
         return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
             {
@@ -373,7 +366,7 @@ public class CuratorProjectionService
     {
         CuratorEntry entry = getEntry(projection);
 
-        LeaderLatch leaderLatch = getThis(entry, leaderProjection.projection.id, LeaderLatch.class);
+        LeaderLatch leaderLatch = getThing(entry, leaderProjection.projection.id, LeaderLatch.class);
         return leaderLatch.hasLeadership();
     }
 
@@ -416,6 +409,35 @@ public class CuratorProjectionService
         return new PathChildrenCacheProjection(new GenericProjection(id));
     }
 
+    @ThriftMethod
+    public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.projection.id, PathChildrenCache.class);
+        return Lists.transform
+        (
+            pathChildrenCache.getCurrentData(),
+            new Function<ChildData, RpcChildData>()
+            {
+                @Override
+                public RpcChildData apply(ChildData childData)
+                {
+                    return new RpcChildData(childData);
+                }
+            }
+        );
+    }
+
+    @ThriftMethod
+    public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws Exception
+    {
+        CuratorEntry entry = getEntry(projection);
+
+        PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.projection.id, PathChildrenCache.class);
+        return new RpcChildData(pathChildrenCache.getCurrentData(path));
+    }
+
     public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
     {
         CuratorEntry entry = connectionManager.get(projection.id);
@@ -444,7 +466,7 @@ public class CuratorProjectionService
         throw new Exception("That operation is not available");
     }
 
-    private <T> T getThis(CuratorEntry entry, String id, Class<T> clazz)
+    private <T> T getThing(CuratorEntry entry, String id, Class<T> clazz)
     {
         T thing = entry.getThing(id, clazz);
         Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);

http://git-wip-us.apache.org/repos/asf/curator/blob/6f9a9ab4/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 765b93c..2b5e115 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -188,6 +188,8 @@ service CuratorService {
   OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec);
   binary getData(1: CuratorProjection projection, 2: GetDataSpec spec);
   list<Participant> getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
+  list<ChildData> getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection);
+  ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path);
   bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
   CuratorProjection newCuratorProjection(1: string connectionName);
   Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec);


[31/50] [abbrv] git commit: doc wip

Posted by ra...@apache.org.
doc wip


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bf4ceb42
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bf4ceb42
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bf4ceb42

Branch: refs/heads/master
Commit: bf4ceb42945669e791389ad5096a90178d7602bb
Parents: eeeea12
Author: randgalt <ra...@apache.org>
Authored: Sat May 31 13:42:25 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat May 31 13:42:25 2014 -0500

----------------------------------------------------------------------
 curator-x-rpc/src/site/confluence/deploy.confluence | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/bf4ceb42/curator-x-rpc/src/site/confluence/deploy.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
index 20c3ace..cb4612a 100644
--- a/curator-x-rpc/src/site/confluence/deploy.confluence
+++ b/curator-x-rpc/src/site/confluence/deploy.confluence
@@ -2,11 +2,16 @@
 
 h1. Deployment
 
-Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper.
-Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more ZooKeeper clusters. The Curator
-Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by ID.
+Curator RPC is built as an "uber" Java JAR and can be downloaded from Maven Central. Go to [[http://search.maven.org/]] and search for
+"curator\-x\-rpc" and download the JAR for the latest version. This JAR can be run directly ala:
 
-!images/topology.png!
+{noformat}
+java -jar curator-x-rpc-VERSION.jar
+{noformat}
+
+Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper
+(see the figure below). Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more
+ZooKeeper clusters. The Curator Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by ID.
 
 How you configure your server to launch depends on your environment and other needs. Here are some suggestions:
 
@@ -14,3 +19,5 @@ How you configure your server to launch depends on your environment and other ne
 * [Docker|https://www.docker.io/]
 * [One-JAR|http://one-jar.sourceforge.net/]
 * [Capsule|https://github.com/puniverse/capsule]
+
+!images/topology.png!


[47/50] [abbrv] git commit: Added license header

Posted by ra...@apache.org.
Added license header


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7016d176
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7016d176
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7016d176

Branch: refs/heads/master
Commit: 7016d1760abff0e0ee22d0b1ff5d489cc88f898d
Parents: 3a0f647
Author: randgalt <ra...@apache.org>
Authored: Tue Jun 3 12:40:22 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue Jun 3 12:40:22 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/x/rpc/RpcTests.java   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/7016d176/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
index 84b31de..b1af720 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.curator.x.rpc;
 
 import org.apache.curator.framework.CuratorFramework;


[44/50] [abbrv] more tests

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/test/java/org/apache/curator/generated/DeleteSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DeleteSpec.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DeleteSpec.java
index 96d9edb..f278e6e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/DeleteSpec.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DeleteSpec.java
@@ -38,8 +38,7 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
   private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField GUARANTEED_FIELD_DESC = new org.apache.thrift.protocol.TField("guaranteed", org.apache.thrift.protocol.TType.BOOL, (short)2);
   private static final org.apache.thrift.protocol.TField ASYNC_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("asyncContext", org.apache.thrift.protocol.TType.STRING, (short)3);
-  private static final org.apache.thrift.protocol.TField COMPRESSED_FIELD_DESC = new org.apache.thrift.protocol.TField("compressed", org.apache.thrift.protocol.TType.BOOL, (short)4);
-  private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRUCT, (short)5);
+  private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRUCT, (short)4);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -50,7 +49,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
   public String path; // required
   public boolean guaranteed; // required
   public String asyncContext; // required
-  public boolean compressed; // required
   public Version version; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@@ -58,8 +56,7 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     PATH((short)1, "path"),
     GUARANTEED((short)2, "guaranteed"),
     ASYNC_CONTEXT((short)3, "asyncContext"),
-    COMPRESSED((short)4, "compressed"),
-    VERSION((short)5, "version");
+    VERSION((short)4, "version");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -80,9 +77,7 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
           return GUARANTEED;
         case 3: // ASYNC_CONTEXT
           return ASYNC_CONTEXT;
-        case 4: // COMPRESSED
-          return COMPRESSED;
-        case 5: // VERSION
+        case 4: // VERSION
           return VERSION;
         default:
           return null;
@@ -125,7 +120,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
 
   // isset id assignments
   private static final int __GUARANTEED_ISSET_ID = 0;
-  private static final int __COMPRESSED_ISSET_ID = 1;
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
@@ -136,8 +130,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     tmpMap.put(_Fields.ASYNC_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("asyncContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-    tmpMap.put(_Fields.COMPRESSED, new org.apache.thrift.meta_data.FieldMetaData("compressed", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Version.class)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -151,7 +143,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     String path,
     boolean guaranteed,
     String asyncContext,
-    boolean compressed,
     Version version)
   {
     this();
@@ -159,8 +150,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     this.guaranteed = guaranteed;
     setGuaranteedIsSet(true);
     this.asyncContext = asyncContext;
-    this.compressed = compressed;
-    setCompressedIsSet(true);
     this.version = version;
   }
 
@@ -176,7 +165,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     if (other.isSetAsyncContext()) {
       this.asyncContext = other.asyncContext;
     }
-    this.compressed = other.compressed;
     if (other.isSetVersion()) {
       this.version = new Version(other.version);
     }
@@ -192,8 +180,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     setGuaranteedIsSet(false);
     this.guaranteed = false;
     this.asyncContext = null;
-    setCompressedIsSet(false);
-    this.compressed = false;
     this.version = null;
   }
 
@@ -268,29 +254,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     }
   }
 
-  public boolean isCompressed() {
-    return this.compressed;
-  }
-
-  public DeleteSpec setCompressed(boolean compressed) {
-    this.compressed = compressed;
-    setCompressedIsSet(true);
-    return this;
-  }
-
-  public void unsetCompressed() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPRESSED_ISSET_ID);
-  }
-
-  /** Returns true if field compressed is set (has been assigned a value) and false otherwise */
-  public boolean isSetCompressed() {
-    return EncodingUtils.testBit(__isset_bitfield, __COMPRESSED_ISSET_ID);
-  }
-
-  public void setCompressedIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPRESSED_ISSET_ID, value);
-  }
-
   public Version getVersion() {
     return this.version;
   }
@@ -341,14 +304,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
       }
       break;
 
-    case COMPRESSED:
-      if (value == null) {
-        unsetCompressed();
-      } else {
-        setCompressed((Boolean)value);
-      }
-      break;
-
     case VERSION:
       if (value == null) {
         unsetVersion();
@@ -371,9 +326,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     case ASYNC_CONTEXT:
       return getAsyncContext();
 
-    case COMPRESSED:
-      return Boolean.valueOf(isCompressed());
-
     case VERSION:
       return getVersion();
 
@@ -394,8 +346,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
       return isSetGuaranteed();
     case ASYNC_CONTEXT:
       return isSetAsyncContext();
-    case COMPRESSED:
-      return isSetCompressed();
     case VERSION:
       return isSetVersion();
     }
@@ -442,15 +392,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
         return false;
     }
 
-    boolean this_present_compressed = true;
-    boolean that_present_compressed = true;
-    if (this_present_compressed || that_present_compressed) {
-      if (!(this_present_compressed && that_present_compressed))
-        return false;
-      if (this.compressed != that.compressed)
-        return false;
-    }
-
     boolean this_present_version = true && this.isSetVersion();
     boolean that_present_version = true && that.isSetVersion();
     if (this_present_version || that_present_version) {
@@ -506,16 +447,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetCompressed()).compareTo(other.isSetCompressed());
-    if (lastComparison != 0) {
-      return lastComparison;
-    }
-    if (isSetCompressed()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compressed, other.compressed);
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-    }
     lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion());
     if (lastComparison != 0) {
       return lastComparison;
@@ -566,10 +497,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     }
     first = false;
     if (!first) sb.append(", ");
-    sb.append("compressed:");
-    sb.append(this.compressed);
-    first = false;
-    if (!first) sb.append(", ");
     sb.append("version:");
     if (this.version == null) {
       sb.append("null");
@@ -649,15 +576,7 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 4: // COMPRESSED
-            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
-              struct.compressed = iprot.readBool();
-              struct.setCompressedIsSet(true);
-            } else { 
-              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-            }
-            break;
-          case 5: // VERSION
+          case 4: // VERSION
             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
               struct.version = new Version();
               struct.version.read(iprot);
@@ -694,9 +613,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
         oprot.writeString(struct.asyncContext);
         oprot.writeFieldEnd();
       }
-      oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
-      oprot.writeBool(struct.compressed);
-      oprot.writeFieldEnd();
       if (struct.version != null) {
         oprot.writeFieldBegin(VERSION_FIELD_DESC);
         struct.version.write(oprot);
@@ -729,13 +645,10 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
       if (struct.isSetAsyncContext()) {
         optionals.set(2);
       }
-      if (struct.isSetCompressed()) {
-        optionals.set(3);
-      }
       if (struct.isSetVersion()) {
-        optionals.set(4);
+        optionals.set(3);
       }
-      oprot.writeBitSet(optionals, 5);
+      oprot.writeBitSet(optionals, 4);
       if (struct.isSetPath()) {
         oprot.writeString(struct.path);
       }
@@ -745,9 +658,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
       if (struct.isSetAsyncContext()) {
         oprot.writeString(struct.asyncContext);
       }
-      if (struct.isSetCompressed()) {
-        oprot.writeBool(struct.compressed);
-      }
       if (struct.isSetVersion()) {
         struct.version.write(oprot);
       }
@@ -756,7 +666,7 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, DeleteSpec struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(5);
+      BitSet incoming = iprot.readBitSet(4);
       if (incoming.get(0)) {
         struct.path = iprot.readString();
         struct.setPathIsSet(true);
@@ -770,10 +680,6 @@ public class DeleteSpec implements org.apache.thrift.TBase<DeleteSpec, DeleteSpe
         struct.setAsyncContextIsSet(true);
       }
       if (incoming.get(3)) {
-        struct.compressed = iprot.readBool();
-        struct.setCompressedIsSet(true);
-      }
-      if (incoming.get(4)) {
         struct.version = new Version();
         struct.version.read(iprot);
         struct.setVersionIsSet(true);

http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderResult.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderResult.java
index 83c3dc8..4fba9d6 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderResult.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/LeaderResult.java
@@ -36,7 +36,7 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LeaderResult");
 
   private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-  private static final org.apache.thrift.protocol.TField HAS_LEADERSHIP_FIELD_DESC = new org.apache.thrift.protocol.TField("hasLeadership", org.apache.thrift.protocol.TType.BOOL, (short)2);
+  private static final org.apache.thrift.protocol.TField IS_LEADER_FIELD_DESC = new org.apache.thrift.protocol.TField("isLeader", org.apache.thrift.protocol.TType.BOOL, (short)2);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -45,12 +45,12 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
   }
 
   public LeaderProjection projection; // required
-  public boolean hasLeadership; // required
+  public boolean isLeader; // 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 {
     PROJECTION((short)1, "projection"),
-    HAS_LEADERSHIP((short)2, "hasLeadership");
+    IS_LEADER((short)2, "isLeader");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -67,8 +67,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
       switch(fieldId) {
         case 1: // PROJECTION
           return PROJECTION;
-        case 2: // HAS_LEADERSHIP
-          return HAS_LEADERSHIP;
+        case 2: // IS_LEADER
+          return IS_LEADER;
         default:
           return null;
       }
@@ -109,14 +109,14 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
   }
 
   // isset id assignments
-  private static final int __HASLEADERSHIP_ISSET_ID = 0;
+  private static final int __ISLEADER_ISSET_ID = 0;
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LeaderProjection.class)));
-    tmpMap.put(_Fields.HAS_LEADERSHIP, new org.apache.thrift.meta_data.FieldMetaData("hasLeadership", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+    tmpMap.put(_Fields.IS_LEADER, new org.apache.thrift.meta_data.FieldMetaData("isLeader", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LeaderResult.class, metaDataMap);
@@ -127,12 +127,12 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
 
   public LeaderResult(
     LeaderProjection projection,
-    boolean hasLeadership)
+    boolean isLeader)
   {
     this();
     this.projection = projection;
-    this.hasLeadership = hasLeadership;
-    setHasLeadershipIsSet(true);
+    this.isLeader = isLeader;
+    setIsLeaderIsSet(true);
   }
 
   /**
@@ -143,7 +143,7 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
     if (other.isSetProjection()) {
       this.projection = new LeaderProjection(other.projection);
     }
-    this.hasLeadership = other.hasLeadership;
+    this.isLeader = other.isLeader;
   }
 
   public LeaderResult deepCopy() {
@@ -153,8 +153,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
   @Override
   public void clear() {
     this.projection = null;
-    setHasLeadershipIsSet(false);
-    this.hasLeadership = false;
+    setIsLeaderIsSet(false);
+    this.isLeader = false;
   }
 
   public LeaderProjection getProjection() {
@@ -181,27 +181,27 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
     }
   }
 
-  public boolean isHasLeadership() {
-    return this.hasLeadership;
+  public boolean isIsLeader() {
+    return this.isLeader;
   }
 
-  public LeaderResult setHasLeadership(boolean hasLeadership) {
-    this.hasLeadership = hasLeadership;
-    setHasLeadershipIsSet(true);
+  public LeaderResult setIsLeader(boolean isLeader) {
+    this.isLeader = isLeader;
+    setIsLeaderIsSet(true);
     return this;
   }
 
-  public void unsetHasLeadership() {
-    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASLEADERSHIP_ISSET_ID);
+  public void unsetIsLeader() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISLEADER_ISSET_ID);
   }
 
-  /** Returns true if field hasLeadership is set (has been assigned a value) and false otherwise */
-  public boolean isSetHasLeadership() {
-    return EncodingUtils.testBit(__isset_bitfield, __HASLEADERSHIP_ISSET_ID);
+  /** Returns true if field isLeader is set (has been assigned a value) and false otherwise */
+  public boolean isSetIsLeader() {
+    return EncodingUtils.testBit(__isset_bitfield, __ISLEADER_ISSET_ID);
   }
 
-  public void setHasLeadershipIsSet(boolean value) {
-    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASLEADERSHIP_ISSET_ID, value);
+  public void setIsLeaderIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISLEADER_ISSET_ID, value);
   }
 
   public void setFieldValue(_Fields field, Object value) {
@@ -214,11 +214,11 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
       }
       break;
 
-    case HAS_LEADERSHIP:
+    case IS_LEADER:
       if (value == null) {
-        unsetHasLeadership();
+        unsetIsLeader();
       } else {
-        setHasLeadership((Boolean)value);
+        setIsLeader((Boolean)value);
       }
       break;
 
@@ -230,8 +230,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
     case PROJECTION:
       return getProjection();
 
-    case HAS_LEADERSHIP:
-      return Boolean.valueOf(isHasLeadership());
+    case IS_LEADER:
+      return Boolean.valueOf(isIsLeader());
 
     }
     throw new IllegalStateException();
@@ -246,8 +246,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
     switch (field) {
     case PROJECTION:
       return isSetProjection();
-    case HAS_LEADERSHIP:
-      return isSetHasLeadership();
+    case IS_LEADER:
+      return isSetIsLeader();
     }
     throw new IllegalStateException();
   }
@@ -274,12 +274,12 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
         return false;
     }
 
-    boolean this_present_hasLeadership = true;
-    boolean that_present_hasLeadership = true;
-    if (this_present_hasLeadership || that_present_hasLeadership) {
-      if (!(this_present_hasLeadership && that_present_hasLeadership))
+    boolean this_present_isLeader = true;
+    boolean that_present_isLeader = true;
+    if (this_present_isLeader || that_present_isLeader) {
+      if (!(this_present_isLeader && that_present_isLeader))
         return false;
-      if (this.hasLeadership != that.hasLeadership)
+      if (this.isLeader != that.isLeader)
         return false;
     }
 
@@ -309,12 +309,12 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
         return lastComparison;
       }
     }
-    lastComparison = Boolean.valueOf(isSetHasLeadership()).compareTo(other.isSetHasLeadership());
+    lastComparison = Boolean.valueOf(isSetIsLeader()).compareTo(other.isSetIsLeader());
     if (lastComparison != 0) {
       return lastComparison;
     }
-    if (isSetHasLeadership()) {
-      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasLeadership, other.hasLeadership);
+    if (isSetIsLeader()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isLeader, other.isLeader);
       if (lastComparison != 0) {
         return lastComparison;
       }
@@ -347,8 +347,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
     }
     first = false;
     if (!first) sb.append(", ");
-    sb.append("hasLeadership:");
-    sb.append(this.hasLeadership);
+    sb.append("isLeader:");
+    sb.append(this.isLeader);
     first = false;
     sb.append(")");
     return sb.toString();
@@ -407,10 +407,10 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 2: // HAS_LEADERSHIP
+          case 2: // IS_LEADER
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
-              struct.hasLeadership = iprot.readBool();
-              struct.setHasLeadershipIsSet(true);
+              struct.isLeader = iprot.readBool();
+              struct.setIsLeaderIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
@@ -435,8 +435,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
         struct.projection.write(oprot);
         oprot.writeFieldEnd();
       }
-      oprot.writeFieldBegin(HAS_LEADERSHIP_FIELD_DESC);
-      oprot.writeBool(struct.hasLeadership);
+      oprot.writeFieldBegin(IS_LEADER_FIELD_DESC);
+      oprot.writeBool(struct.isLeader);
       oprot.writeFieldEnd();
       oprot.writeFieldStop();
       oprot.writeStructEnd();
@@ -459,15 +459,15 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
       if (struct.isSetProjection()) {
         optionals.set(0);
       }
-      if (struct.isSetHasLeadership()) {
+      if (struct.isSetIsLeader()) {
         optionals.set(1);
       }
       oprot.writeBitSet(optionals, 2);
       if (struct.isSetProjection()) {
         struct.projection.write(oprot);
       }
-      if (struct.isSetHasLeadership()) {
-        oprot.writeBool(struct.hasLeadership);
+      if (struct.isSetIsLeader()) {
+        oprot.writeBool(struct.isLeader);
       }
     }
 
@@ -481,8 +481,8 @@ public class LeaderResult implements org.apache.thrift.TBase<LeaderResult, Leade
         struct.setProjectionIsSet(true);
       }
       if (incoming.get(1)) {
-        struct.hasLeadership = iprot.readBool();
-        struct.setHasLeadershipIsSet(true);
+        struct.isLeader = iprot.readBool();
+        struct.setIsLeaderIsSet(true);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
index 0862b11..84b31de 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -1,13 +1,19 @@
 package org.apache.curator.x.rpc;
 
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.CuratorFrameworkFactory;
 import org.apache.curator.generated.*;
+import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.BaseClassForTests;
 import org.apache.curator.test.InstanceSpec;
 import org.apache.curator.test.Timing;
+import org.apache.curator.utils.CloseableUtils;
 import org.apache.curator.utils.ThreadUtils;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocol;
 import org.apache.thrift.transport.TSocket;
+import org.apache.zookeeper.WatchedEvent;
+import org.apache.zookeeper.Watcher;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.node.ArrayNode;
 import org.codehaus.jackson.node.ObjectNode;
@@ -223,4 +229,43 @@ public class RpcTests extends BaseClassForTests
             Assert.assertEquals(e.nodeException, NodeExceptionType.NONODE);
         }
     }
+
+    @Test
+    public void testEphemeralCleanup() throws Exception
+    {
+        CuratorProjection curatorProjection = curatorServiceClient.newCuratorProjection("test");
+        CreateSpec spec = new CreateSpec();
+        spec.path = "/test";
+        spec.data = ByteBuffer.wrap("value".getBytes());
+        spec.mode = CreateMode.EPHEMERAL;
+        OptionalPath node = curatorServiceClient.createNode(curatorProjection, spec);
+        System.out.println(node);
+
+        final CountDownLatch latch = new CountDownLatch(1);
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        try
+        {
+            client.start();
+            Watcher watcher = new Watcher()
+            {
+                @Override
+                public void process(WatchedEvent event)
+                {
+                    if ( event.getType() == Event.EventType.NodeDeleted )
+                    {
+                        latch.countDown();
+                    }
+                }
+            };
+            client.checkExists().usingWatcher(watcher).forPath("/test");
+
+            curatorServiceClient.closeCuratorProjection(curatorProjection);
+
+            Assert.assertTrue(timing.awaitLatch(latch));
+        }
+        finally
+        {
+            CloseableUtils.closeQuietly(client);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index 931cb8d..db8bc13 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -129,7 +129,7 @@ public class TestClient
         System.out.println("exists: " + client.exists(curatorProjection, existsSpec));
 
         LeaderResult leader = client.startLeaderSelector(curatorProjection, "/leader", "me", 10000);
-        System.out.println("Has Leader: " + leader.hasLeadership);
+        System.out.println("Has Leader: " + leader.isLeader);
 
         List<Participant> leaderParticipants = client.getLeaderParticipants(curatorProjection, leader.projection);
         System.out.println("Participants: " + leaderParticipants);
@@ -151,7 +151,7 @@ public class TestClient
         System.out.println("nodeExists: " + nodeExists);
         client.closeGenericProjection(curatorProjection, node.id);
 
-        List<LeaseProjection> leaseProjections = client.startSemaphore(curatorProjection, "/semi", 3, 1000, 10);
+        List<LeaseProjection> leaseProjections = client.acquireSemaphore(curatorProjection, "/semi", 3, 1000, 10);
         System.out.println("leaseProjections: " + leaseProjections);
         for ( LeaseProjection leaseProjection : leaseProjections )
         {


[45/50] [abbrv] more tests

Posted by ra...@apache.org.
http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index 6c722c6..cbbe5fc 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -38,6 +38,8 @@ public class CuratorService {
 
     public LockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException;
 
+    public List<LeaseProjection> acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException;
+
     public void closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
 
     public boolean closeGenericProjection(CuratorProjection projection, String id) throws CuratorException, org.apache.thrift.TException;
@@ -76,8 +78,6 @@ public class CuratorService {
 
     public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws CuratorException, org.apache.thrift.TException;
 
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException;
-
     public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException;
 
   }
@@ -86,6 +86,8 @@ public class CuratorService {
 
     public void acquireLock(CuratorProjection projection, String path, int maxWaitMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void closeCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void closeGenericProjection(CuratorProjection projection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -124,8 +126,6 @@ public class CuratorService {
 
     public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
     public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
   }
@@ -178,9 +178,40 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "acquireLock failed: unknown result");
     }
 
+    public List<LeaseProjection> acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException
+    {
+      send_acquireSemaphore(projection, path, acquireQty, maxWaitMs, maxLeases);
+      return recv_acquireSemaphore();
+    }
+
+    public void send_acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException
+    {
+      acquireSemaphore_args args = new acquireSemaphore_args();
+      args.setProjection(projection);
+      args.setPath(path);
+      args.setAcquireQty(acquireQty);
+      args.setMaxWaitMs(maxWaitMs);
+      args.setMaxLeases(maxLeases);
+      sendBase("acquireSemaphore", args);
+    }
+
+    public List<LeaseProjection> recv_acquireSemaphore() throws CuratorException, org.apache.thrift.TException
+    {
+      acquireSemaphore_result result = new acquireSemaphore_result();
+      receiveBase(result, "acquireSemaphore");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "acquireSemaphore failed: unknown result");
+    }
+
     public void closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
     {
       send_closeCuratorProjection(projection);
+      recv_closeCuratorProjection();
     }
 
     public void send_closeCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
@@ -190,6 +221,13 @@ public class CuratorService {
       sendBase("closeCuratorProjection", args);
     }
 
+    public void recv_closeCuratorProjection() throws org.apache.thrift.TException
+    {
+      closeCuratorProjection_result result = new closeCuratorProjection_result();
+      receiveBase(result, "closeCuratorProjection");
+      return;
+    }
+
     public boolean closeGenericProjection(CuratorProjection projection, String id) throws CuratorException, org.apache.thrift.TException
     {
       send_closeGenericProjection(projection, id);
@@ -667,36 +705,6 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPersistentEphemeralNode failed: unknown result");
     }
 
-    public List<LeaseProjection> startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws CuratorException, org.apache.thrift.TException
-    {
-      send_startSemaphore(projection, path, acquireQty, maxWaitMs, maxLeases);
-      return recv_startSemaphore();
-    }
-
-    public void send_startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases) throws org.apache.thrift.TException
-    {
-      startSemaphore_args args = new startSemaphore_args();
-      args.setProjection(projection);
-      args.setPath(path);
-      args.setAcquireQty(acquireQty);
-      args.setMaxWaitMs(maxWaitMs);
-      args.setMaxLeases(maxLeases);
-      sendBase("startSemaphore", args);
-    }
-
-    public List<LeaseProjection> recv_startSemaphore() throws CuratorException, org.apache.thrift.TException
-    {
-      startSemaphore_result result = new startSemaphore_result();
-      receiveBase(result, "startSemaphore");
-      if (result.isSetSuccess()) {
-        return result.success;
-      }
-      if (result.ex1 != null) {
-        throw result.ex1;
-      }
-      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startSemaphore failed: unknown result");
-    }
-
     public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException
     {
       send_sync(projection, path, asyncContext);
@@ -778,6 +786,50 @@ public class CuratorService {
       }
     }
 
+    public void acquireSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      acquireSemaphore_call method_call = new acquireSemaphore_call(projection, path, acquireQty, maxWaitMs, maxLeases, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class acquireSemaphore_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      private String path;
+      private int acquireQty;
+      private int maxWaitMs;
+      private int maxLeases;
+      public acquireSemaphore_call(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, 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.projection = projection;
+        this.path = path;
+        this.acquireQty = acquireQty;
+        this.maxWaitMs = maxWaitMs;
+        this.maxLeases = maxLeases;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("acquireSemaphore", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        acquireSemaphore_args args = new acquireSemaphore_args();
+        args.setProjection(projection);
+        args.setPath(path);
+        args.setAcquireQty(acquireQty);
+        args.setMaxWaitMs(maxWaitMs);
+        args.setMaxLeases(maxLeases);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public List<LeaseProjection> getResult() throws CuratorException, 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_acquireSemaphore();
+      }
+    }
+
     public void closeCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       closeCuratorProjection_call method_call = new closeCuratorProjection_call(projection, resultHandler, this, ___protocolFactory, ___transport);
@@ -788,7 +840,7 @@ public class CuratorService {
     public static class closeCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
       private CuratorProjection projection;
       public closeCuratorProjection_call(CuratorProjection projection, 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, true);
+        super(client, protocolFactory, transport, resultHandler, false);
         this.projection = projection;
       }
 
@@ -806,6 +858,7 @@ public class CuratorService {
         }
         org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
         org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        (new Client(prot)).recv_closeCuratorProjection();
       }
     }
 
@@ -1462,50 +1515,6 @@ public class CuratorService {
       }
     }
 
-    public void startSemaphore(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
-      checkReady();
-      startSemaphore_call method_call = new startSemaphore_call(projection, path, acquireQty, maxWaitMs, maxLeases, resultHandler, this, ___protocolFactory, ___transport);
-      this.___currentMethod = method_call;
-      ___manager.call(method_call);
-    }
-
-    public static class startSemaphore_call extends org.apache.thrift.async.TAsyncMethodCall {
-      private CuratorProjection projection;
-      private String path;
-      private int acquireQty;
-      private int maxWaitMs;
-      private int maxLeases;
-      public startSemaphore_call(CuratorProjection projection, String path, int acquireQty, int maxWaitMs, int maxLeases, 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.projection = projection;
-        this.path = path;
-        this.acquireQty = acquireQty;
-        this.maxWaitMs = maxWaitMs;
-        this.maxLeases = maxLeases;
-      }
-
-      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
-        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startSemaphore", org.apache.thrift.protocol.TMessageType.CALL, 0));
-        startSemaphore_args args = new startSemaphore_args();
-        args.setProjection(projection);
-        args.setPath(path);
-        args.setAcquireQty(acquireQty);
-        args.setMaxWaitMs(maxWaitMs);
-        args.setMaxLeases(maxLeases);
-        args.write(prot);
-        prot.writeMessageEnd();
-      }
-
-      public List<LeaseProjection> getResult() throws CuratorException, 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_startSemaphore();
-      }
-    }
-
     public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       sync_call method_call = new sync_call(projection, path, asyncContext, resultHandler, this, ___protocolFactory, ___transport);
@@ -1558,6 +1567,7 @@ public class CuratorService {
 
     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("acquireLock", new acquireLock());
+      processMap.put("acquireSemaphore", new acquireSemaphore());
       processMap.put("closeCuratorProjection", new closeCuratorProjection());
       processMap.put("closeGenericProjection", new closeGenericProjection());
       processMap.put("createNode", new createNode());
@@ -1577,7 +1587,6 @@ public class CuratorService {
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
-      processMap.put("startSemaphore", new startSemaphore());
       processMap.put("sync", new sync());
       return processMap;
     }
@@ -1606,6 +1615,30 @@ public class CuratorService {
       }
     }
 
+    public static class acquireSemaphore<I extends Iface> extends org.apache.thrift.ProcessFunction<I, acquireSemaphore_args> {
+      public acquireSemaphore() {
+        super("acquireSemaphore");
+      }
+
+      public acquireSemaphore_args getEmptyArgsInstance() {
+        return new acquireSemaphore_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public acquireSemaphore_result getResult(I iface, acquireSemaphore_args args) throws org.apache.thrift.TException {
+        acquireSemaphore_result result = new acquireSemaphore_result();
+        try {
+          result.success = iface.acquireSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
     public static class closeCuratorProjection<I extends Iface> extends org.apache.thrift.ProcessFunction<I, closeCuratorProjection_args> {
       public closeCuratorProjection() {
         super("closeCuratorProjection");
@@ -1616,12 +1649,13 @@ public class CuratorService {
       }
 
       protected boolean isOneway() {
-        return true;
+        return false;
       }
 
-      public org.apache.thrift.TBase getResult(I iface, closeCuratorProjection_args args) throws org.apache.thrift.TException {
+      public closeCuratorProjection_result getResult(I iface, closeCuratorProjection_args args) throws org.apache.thrift.TException {
+        closeCuratorProjection_result result = new closeCuratorProjection_result();
         iface.closeCuratorProjection(args.projection);
-        return null;
+        return result;
       }
     }
 
@@ -2054,30 +2088,6 @@ public class CuratorService {
       }
     }
 
-    public static class startSemaphore<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startSemaphore_args> {
-      public startSemaphore() {
-        super("startSemaphore");
-      }
-
-      public startSemaphore_args getEmptyArgsInstance() {
-        return new startSemaphore_args();
-      }
-
-      protected boolean isOneway() {
-        return false;
-      }
-
-      public startSemaphore_result getResult(I iface, startSemaphore_args args) throws org.apache.thrift.TException {
-        startSemaphore_result result = new startSemaphore_result();
-        try {
-          result.success = iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases);
-        } catch (CuratorException ex1) {
-          result.ex1 = ex1;
-        }
-        return result;
-      }
-    }
-
     public static class sync<I extends Iface> extends org.apache.thrift.ProcessFunction<I, sync_args> {
       public sync() {
         super("sync");
@@ -2116,6 +2126,7 @@ public class CuratorService {
 
     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("acquireLock", new acquireLock());
+      processMap.put("acquireSemaphore", new acquireSemaphore());
       processMap.put("closeCuratorProjection", new closeCuratorProjection());
       processMap.put("closeGenericProjection", new closeGenericProjection());
       processMap.put("createNode", new createNode());
@@ -2135,7 +2146,6 @@ public class CuratorService {
       processMap.put("startNodeCache", new startNodeCache());
       processMap.put("startPathChildrenCache", new startPathChildrenCache());
       processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
-      processMap.put("startSemaphore", new startSemaphore());
       processMap.put("sync", new sync());
       return processMap;
     }
@@ -2197,6 +2207,63 @@ public class CuratorService {
       }
     }
 
+    public static class acquireSemaphore<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, acquireSemaphore_args, List<LeaseProjection>> {
+      public acquireSemaphore() {
+        super("acquireSemaphore");
+      }
+
+      public acquireSemaphore_args getEmptyArgsInstance() {
+        return new acquireSemaphore_args();
+      }
+
+      public AsyncMethodCallback<List<LeaseProjection>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<List<LeaseProjection>>() { 
+          public void onComplete(List<LeaseProjection> o) {
+            acquireSemaphore_result result = new acquireSemaphore_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;
+            acquireSemaphore_result result = new acquireSemaphore_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, acquireSemaphore_args args, org.apache.thrift.async.AsyncMethodCallback<List<LeaseProjection>> resultHandler) throws TException {
+        iface.acquireSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases,resultHandler);
+      }
+    }
+
     public static class closeCuratorProjection<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, closeCuratorProjection_args, Void> {
       public closeCuratorProjection() {
         super("closeCuratorProjection");
@@ -2210,14 +2277,36 @@ public class CuratorService {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
         return new AsyncMethodCallback<Void>() { 
           public void onComplete(Void o) {
+            closeCuratorProjection_result result = new closeCuratorProjection_result();
+            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;
+            closeCuratorProjection_result result = new closeCuratorProjection_result();
+            {
+              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 true;
+        return false;
       }
 
       public void start(I iface, closeCuratorProjection_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
@@ -3223,21 +3312,20 @@ public class CuratorService {
       }
     }
 
-    public static class startSemaphore<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startSemaphore_args, List<LeaseProjection>> {
-      public startSemaphore() {
-        super("startSemaphore");
+    public static class sync<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sync_args, Void> {
+      public sync() {
+        super("sync");
       }
 
-      public startSemaphore_args getEmptyArgsInstance() {
-        return new startSemaphore_args();
+      public sync_args getEmptyArgsInstance() {
+        return new sync_args();
       }
 
-      public AsyncMethodCallback<List<LeaseProjection>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
         final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<List<LeaseProjection>>() { 
-          public void onComplete(List<LeaseProjection> o) {
-            startSemaphore_result result = new startSemaphore_result();
-            result.success = o;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+            sync_result result = new sync_result();
             try {
               fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
               return;
@@ -3249,7 +3337,7 @@ public class CuratorService {
           public void onError(Exception e) {
             byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
             org.apache.thrift.TBase msg;
-            startSemaphore_result result = new startSemaphore_result();
+            sync_result result = new sync_result();
             if (e instanceof CuratorException) {
                         result.ex1 = (CuratorException) e;
                         result.setEx1IsSet(true);
@@ -3275,71 +3363,15 @@ public class CuratorService {
         return false;
       }
 
-      public void start(I iface, startSemaphore_args args, org.apache.thrift.async.AsyncMethodCallback<List<LeaseProjection>> resultHandler) throws TException {
-        iface.startSemaphore(args.projection, args.path, args.acquireQty, args.maxWaitMs, args.maxLeases,resultHandler);
+      public void start(I iface, sync_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.sync(args.projection, args.path, args.asyncContext,resultHandler);
       }
     }
 
-    public static class sync<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, sync_args, Void> {
-      public sync() {
-        super("sync");
-      }
+  }
 
-      public sync_args getEmptyArgsInstance() {
-        return new sync_args();
-      }
-
-      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
-        final org.apache.thrift.AsyncProcessFunction fcall = this;
-        return new AsyncMethodCallback<Void>() { 
-          public void onComplete(Void o) {
-            sync_result result = new sync_result();
-            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;
-            sync_result result = new sync_result();
-            if (e instanceof CuratorException) {
-                        result.ex1 = (CuratorException) e;
-                        result.setEx1IsSet(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, sync_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
-        iface.sync(args.projection, args.path, args.asyncContext,resultHandler);
-      }
-    }
-
-  }
-
-  public static class acquireLock_args implements org.apache.thrift.TBase<acquireLock_args, acquireLock_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireLock_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("acquireLock_args");
+  public static class acquireLock_args implements org.apache.thrift.TBase<acquireLock_args, acquireLock_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireLock_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("acquireLock_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
     private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
@@ -4356,22 +4388,34 @@ public class CuratorService {
 
   }
 
-  public static class closeCuratorProjection_args implements org.apache.thrift.TBase<closeCuratorProjection_args, closeCuratorProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeCuratorProjection_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeCuratorProjection_args");
+  public static class acquireSemaphore_args implements org.apache.thrift.TBase<acquireSemaphore_args, acquireSemaphore_args._Fields>, java.io.Serializable, Cloneable, Comparable<acquireSemaphore_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("acquireSemaphore_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField ACQUIRE_QTY_FIELD_DESC = new org.apache.thrift.protocol.TField("acquireQty", org.apache.thrift.protocol.TType.I32, (short)3);
+    private static final org.apache.thrift.protocol.TField MAX_WAIT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxWaitMs", org.apache.thrift.protocol.TType.I32, (short)4);
+    private static final org.apache.thrift.protocol.TField MAX_LEASES_FIELD_DESC = new org.apache.thrift.protocol.TField("maxLeases", org.apache.thrift.protocol.TType.I32, (short)5);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
-      schemes.put(StandardScheme.class, new closeCuratorProjection_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new closeCuratorProjection_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new acquireSemaphore_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new acquireSemaphore_argsTupleSchemeFactory());
     }
 
     public CuratorProjection projection; // required
+    public String path; // required
+    public int acquireQty; // required
+    public int maxWaitMs; // required
+    public int maxLeases; // 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 {
-      PROJECTION((short)1, "projection");
+      PROJECTION((short)1, "projection"),
+      PATH((short)2, "path"),
+      ACQUIRE_QTY((short)3, "acquireQty"),
+      MAX_WAIT_MS((short)4, "maxWaitMs"),
+      MAX_LEASES((short)5, "maxLeases");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4388,6 +4432,14 @@ public class CuratorService {
         switch(fieldId) {
           case 1: // PROJECTION
             return PROJECTION;
+          case 2: // PATH
+            return PATH;
+          case 3: // ACQUIRE_QTY
+            return ACQUIRE_QTY;
+          case 4: // MAX_WAIT_MS
+            return MAX_WAIT_MS;
+          case 5: // MAX_LEASES
+            return MAX_LEASES;
           default:
             return null;
         }
@@ -4428,48 +4480,85 @@ public class CuratorService {
     }
 
     // isset id assignments
+    private static final int __ACQUIREQTY_ISSET_ID = 0;
+    private static final int __MAXWAITMS_ISSET_ID = 1;
+    private static final int __MAXLEASES_ISSET_ID = 2;
+    private byte __isset_bitfield = 0;
     public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
     static {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.ACQUIRE_QTY, new org.apache.thrift.meta_data.FieldMetaData("acquireQty", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      tmpMap.put(_Fields.MAX_WAIT_MS, new org.apache.thrift.meta_data.FieldMetaData("maxWaitMs", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      tmpMap.put(_Fields.MAX_LEASES, new org.apache.thrift.meta_data.FieldMetaData("maxLeases", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeCuratorProjection_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(acquireSemaphore_args.class, metaDataMap);
     }
 
-    public closeCuratorProjection_args() {
+    public acquireSemaphore_args() {
     }
 
-    public closeCuratorProjection_args(
-      CuratorProjection projection)
+    public acquireSemaphore_args(
+      CuratorProjection projection,
+      String path,
+      int acquireQty,
+      int maxWaitMs,
+      int maxLeases)
     {
       this();
       this.projection = projection;
+      this.path = path;
+      this.acquireQty = acquireQty;
+      setAcquireQtyIsSet(true);
+      this.maxWaitMs = maxWaitMs;
+      setMaxWaitMsIsSet(true);
+      this.maxLeases = maxLeases;
+      setMaxLeasesIsSet(true);
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public closeCuratorProjection_args(closeCuratorProjection_args other) {
+    public acquireSemaphore_args(acquireSemaphore_args other) {
+      __isset_bitfield = other.__isset_bitfield;
       if (other.isSetProjection()) {
         this.projection = new CuratorProjection(other.projection);
       }
+      if (other.isSetPath()) {
+        this.path = other.path;
+      }
+      this.acquireQty = other.acquireQty;
+      this.maxWaitMs = other.maxWaitMs;
+      this.maxLeases = other.maxLeases;
     }
 
-    public closeCuratorProjection_args deepCopy() {
-      return new closeCuratorProjection_args(this);
+    public acquireSemaphore_args deepCopy() {
+      return new acquireSemaphore_args(this);
     }
 
     @Override
     public void clear() {
       this.projection = null;
+      this.path = null;
+      setAcquireQtyIsSet(false);
+      this.acquireQty = 0;
+      setMaxWaitMsIsSet(false);
+      this.maxWaitMs = 0;
+      setMaxLeasesIsSet(false);
+      this.maxLeases = 0;
     }
 
     public CuratorProjection getProjection() {
       return this.projection;
     }
 
-    public closeCuratorProjection_args setProjection(CuratorProjection projection) {
+    public acquireSemaphore_args setProjection(CuratorProjection projection) {
       this.projection = projection;
       return this;
     }
@@ -4489,126 +4578,908 @@ public class CuratorService {
       }
     }
 
-    public void setFieldValue(_Fields field, Object value) {
-      switch (field) {
-      case PROJECTION:
-        if (value == null) {
-          unsetProjection();
-        } else {
-          setProjection((CuratorProjection)value);
-        }
-        break;
-
-      }
+    public String getPath() {
+      return this.path;
     }
 
-    public Object getFieldValue(_Fields field) {
-      switch (field) {
-      case PROJECTION:
-        return getProjection();
+    public acquireSemaphore_args setPath(String path) {
+      this.path = path;
+      return this;
+    }
 
-      }
-      throw new IllegalStateException();
+    public void unsetPath() {
+      this.path = null;
     }
 
-    /** 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();
-      }
+    /** Returns true if field path is set (has been assigned a value) and false otherwise */
+    public boolean isSetPath() {
+      return this.path != null;
+    }
 
-      switch (field) {
-      case PROJECTION:
-        return isSetProjection();
+    public void setPathIsSet(boolean value) {
+      if (!value) {
+        this.path = null;
       }
-      throw new IllegalStateException();
     }
 
-    @Override
-    public boolean equals(Object that) {
-      if (that == null)
-        return false;
-      if (that instanceof closeCuratorProjection_args)
-        return this.equals((closeCuratorProjection_args)that);
-      return false;
+    public int getAcquireQty() {
+      return this.acquireQty;
     }
 
-    public boolean equals(closeCuratorProjection_args that) {
-      if (that == null)
-        return false;
-
-      boolean this_present_projection = true && this.isSetProjection();
-      boolean that_present_projection = true && that.isSetProjection();
-      if (this_present_projection || that_present_projection) {
-        if (!(this_present_projection && that_present_projection))
-          return false;
-        if (!this.projection.equals(that.projection))
-          return false;
-      }
+    public acquireSemaphore_args setAcquireQty(int acquireQty) {
+      this.acquireQty = acquireQty;
+      setAcquireQtyIsSet(true);
+      return this;
+    }
 
-      return true;
+    public void unsetAcquireQty() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID);
     }
 
-    @Override
-    public int hashCode() {
-      return 0;
+    /** Returns true if field acquireQty is set (has been assigned a value) and false otherwise */
+    public boolean isSetAcquireQty() {
+      return EncodingUtils.testBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID);
     }
 
-    @Override
-    public int compareTo(closeCuratorProjection_args other) {
-      if (!getClass().equals(other.getClass())) {
-        return getClass().getName().compareTo(other.getClass().getName());
-      }
+    public void setAcquireQtyIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACQUIREQTY_ISSET_ID, value);
+    }
 
-      int lastComparison = 0;
+    public int getMaxWaitMs() {
+      return this.maxWaitMs;
+    }
 
-      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetProjection()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
-      return 0;
+    public acquireSemaphore_args setMaxWaitMs(int maxWaitMs) {
+      this.maxWaitMs = maxWaitMs;
+      setMaxWaitMsIsSet(true);
+      return this;
     }
 
-    public _Fields fieldForId(int fieldId) {
-      return _Fields.findByThriftId(fieldId);
+    public void unsetMaxWaitMs() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXWAITMS_ISSET_ID);
     }
 
-    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
-      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    /** Returns true if field maxWaitMs is set (has been assigned a value) and false otherwise */
+    public boolean isSetMaxWaitMs() {
+      return EncodingUtils.testBit(__isset_bitfield, __MAXWAITMS_ISSET_ID);
     }
 
-    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
-      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    public void setMaxWaitMsIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXWAITMS_ISSET_ID, value);
     }
 
-    @Override
-    public String toString() {
-      StringBuilder sb = new StringBuilder("closeCuratorProjection_args(");
-      boolean first = true;
+    public int getMaxLeases() {
+      return this.maxLeases;
+    }
 
-      sb.append("projection:");
-      if (this.projection == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.projection);
-      }
-      first = false;
-      sb.append(")");
-      return sb.toString();
+    public acquireSemaphore_args setMaxLeases(int maxLeases) {
+      this.maxLeases = maxLeases;
+      setMaxLeasesIsSet(true);
+      return this;
+    }
+
+    public void unsetMaxLeases() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXLEASES_ISSET_ID);
+    }
+
+    /** Returns true if field maxLeases is set (has been assigned a value) and false otherwise */
+    public boolean isSetMaxLeases() {
+      return EncodingUtils.testBit(__isset_bitfield, __MAXLEASES_ISSET_ID);
+    }
+
+    public void setMaxLeasesIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXLEASES_ISSET_ID, value);
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      case PATH:
+        if (value == null) {
+          unsetPath();
+        } else {
+          setPath((String)value);
+        }
+        break;
+
+      case ACQUIRE_QTY:
+        if (value == null) {
+          unsetAcquireQty();
+        } else {
+          setAcquireQty((Integer)value);
+        }
+        break;
+
+      case MAX_WAIT_MS:
+        if (value == null) {
+          unsetMaxWaitMs();
+        } else {
+          setMaxWaitMs((Integer)value);
+        }
+        break;
+
+      case MAX_LEASES:
+        if (value == null) {
+          unsetMaxLeases();
+        } else {
+          setMaxLeases((Integer)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      case PATH:
+        return getPath();
+
+      case ACQUIRE_QTY:
+        return Integer.valueOf(getAcquireQty());
+
+      case MAX_WAIT_MS:
+        return Integer.valueOf(getMaxWaitMs());
+
+      case MAX_LEASES:
+        return Integer.valueOf(getMaxLeases());
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      case PATH:
+        return isSetPath();
+      case ACQUIRE_QTY:
+        return isSetAcquireQty();
+      case MAX_WAIT_MS:
+        return isSetMaxWaitMs();
+      case MAX_LEASES:
+        return isSetMaxLeases();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof acquireSemaphore_args)
+        return this.equals((acquireSemaphore_args)that);
+      return false;
+    }
+
+    public boolean equals(acquireSemaphore_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      boolean this_present_path = true && this.isSetPath();
+      boolean that_present_path = true && that.isSetPath();
+      if (this_present_path || that_present_path) {
+        if (!(this_present_path && that_present_path))
+          return false;
+        if (!this.path.equals(that.path))
+          return false;
+      }
+
+      boolean this_present_acquireQty = true;
+      boolean that_present_acquireQty = true;
+      if (this_present_acquireQty || that_present_acquireQty) {
+        if (!(this_present_acquireQty && that_present_acquireQty))
+          return false;
+        if (this.acquireQty != that.acquireQty)
+          return false;
+      }
+
+      boolean this_present_maxWaitMs = true;
+      boolean that_present_maxWaitMs = true;
+      if (this_present_maxWaitMs || that_present_maxWaitMs) {
+        if (!(this_present_maxWaitMs && that_present_maxWaitMs))
+          return false;
+        if (this.maxWaitMs != that.maxWaitMs)
+          return false;
+      }
+
+      boolean this_present_maxLeases = true;
+      boolean that_present_maxLeases = true;
+      if (this_present_maxLeases || that_present_maxLeases) {
+        if (!(this_present_maxLeases && that_present_maxLeases))
+          return false;
+        if (this.maxLeases != that.maxLeases)
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(acquireSemaphore_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPath()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetAcquireQty()).compareTo(other.isSetAcquireQty());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetAcquireQty()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.acquireQty, other.acquireQty);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetMaxWaitMs()).compareTo(other.isSetMaxWaitMs());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetMaxWaitMs()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxWaitMs, other.maxWaitMs);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetMaxLeases()).compareTo(other.isSetMaxLeases());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetMaxLeases()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxLeases, other.maxLeases);
+        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("acquireSemaphore_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("path:");
+      if (this.path == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.path);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("acquireQty:");
+      sb.append(this.acquireQty);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("maxWaitMs:");
+      sb.append(this.maxWaitMs);
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("maxLeases:");
+      sb.append(this.maxLeases);
+      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 (projection != null) {
+        projection.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class acquireSemaphore_argsStandardSchemeFactory implements SchemeFactory {
+      public acquireSemaphore_argsStandardScheme getScheme() {
+        return new acquireSemaphore_argsStandardScheme();
+      }
+    }
+
+    private static class acquireSemaphore_argsStandardScheme extends StandardScheme<acquireSemaphore_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, acquireSemaphore_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PATH
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.path = iprot.readString();
+                struct.setPathIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // ACQUIRE_QTY
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.acquireQty = iprot.readI32();
+                struct.setAcquireQtyIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 4: // MAX_WAIT_MS
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.maxWaitMs = iprot.readI32();
+                struct.setMaxWaitMsIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 5: // MAX_LEASES
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.maxLeases = iprot.readI32();
+                struct.setMaxLeasesIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, acquireSemaphore_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        if (struct.path != null) {
+          oprot.writeFieldBegin(PATH_FIELD_DESC);
+          oprot.writeString(struct.path);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldBegin(ACQUIRE_QTY_FIELD_DESC);
+        oprot.writeI32(struct.acquireQty);
+        oprot.writeFieldEnd();
+        oprot.writeFieldBegin(MAX_WAIT_MS_FIELD_DESC);
+        oprot.writeI32(struct.maxWaitMs);
+        oprot.writeFieldEnd();
+        oprot.writeFieldBegin(MAX_LEASES_FIELD_DESC);
+        oprot.writeI32(struct.maxLeases);
+        oprot.writeFieldEnd();
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class acquireSemaphore_argsTupleSchemeFactory implements SchemeFactory {
+      public acquireSemaphore_argsTupleScheme getScheme() {
+        return new acquireSemaphore_argsTupleScheme();
+      }
+    }
+
+    private static class acquireSemaphore_argsTupleScheme extends TupleScheme<acquireSemaphore_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, acquireSemaphore_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        if (struct.isSetPath()) {
+          optionals.set(1);
+        }
+        if (struct.isSetAcquireQty()) {
+          optionals.set(2);
+        }
+        if (struct.isSetMaxWaitMs()) {
+          optionals.set(3);
+        }
+        if (struct.isSetMaxLeases()) {
+          optionals.set(4);
+        }
+        oprot.writeBitSet(optionals, 5);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+        if (struct.isSetPath()) {
+          oprot.writeString(struct.path);
+        }
+        if (struct.isSetAcquireQty()) {
+          oprot.writeI32(struct.acquireQty);
+        }
+        if (struct.isSetMaxWaitMs()) {
+          oprot.writeI32(struct.maxWaitMs);
+        }
+        if (struct.isSetMaxLeases()) {
+          oprot.writeI32(struct.maxLeases);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, acquireSemaphore_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(5);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.path = iprot.readString();
+          struct.setPathIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.acquireQty = iprot.readI32();
+          struct.setAcquireQtyIsSet(true);
+        }
+        if (incoming.get(3)) {
+          struct.maxWaitMs = iprot.readI32();
+          struct.setMaxWaitMsIsSet(true);
+        }
+        if (incoming.get(4)) {
+          struct.maxLeases = iprot.readI32();
+          struct.setMaxLeasesIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class acquireSemaphore_result implements org.apache.thrift.TBase<acquireSemaphore_result, acquireSemaphore_result._Fields>, java.io.Serializable, Cloneable, Comparable<acquireSemaphore_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("acquireSemaphore_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
+    private static final org.apache.thrift.protocol.TField EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new acquireSemaphore_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new acquireSemaphore_resultTupleSchemeFactory());
+    }
+
+    public List<LeaseProjection> success; // required
+    public CuratorException ex1; // 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"),
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LeaseProjection.class))));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(acquireSemaphore_result.class, metaDataMap);
+    }
+
+    public acquireSemaphore_result() {
+    }
+
+    public acquireSemaphore_result(
+      List<LeaseProjection> success,
+      CuratorException ex1)
+    {
+      this();
+      this.success = success;
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public acquireSemaphore_result(acquireSemaphore_result other) {
+      if (other.isSetSuccess()) {
+        List<LeaseProjection> __this__success = new ArrayList<LeaseProjection>(other.success.size());
+        for (LeaseProjection other_element : other.success) {
+          __this__success.add(new LeaseProjection(other_element));
+        }
+        this.success = __this__success;
+      }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public acquireSemaphore_result deepCopy() {
+      return new acquireSemaphore_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.ex1 = null;
+    }
+
+    public int getSuccessSize() {
+      return (this.success == null) ? 0 : this.success.size();
+    }
+
+    public java.util.Iterator<LeaseProjection> getSuccessIterator() {
+      return (this.success == null) ? null : this.success.iterator();
+    }
+
+    public void addToSuccess(LeaseProjection elem) {
+      if (this.success == null) {
+        this.success = new ArrayList<LeaseProjection>();
+      }
+      this.success.add(elem);
+    }
+
+    public List<LeaseProjection> getSuccess() {
+      return this.success;
+    }
+
+    public acquireSemaphore_result setSuccess(List<LeaseProjection> success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public acquireSemaphore_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((List<LeaseProjection>)value);
+        }
+        break;
+
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case EX1:
+        return getEx1();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof acquireSemaphore_result)
+        return this.equals((acquireSemaphore_result)that);
+      return false;
+    }
+
+    public boolean equals(acquireSemaphore_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(acquireSemaphore_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("acquireSemaphore_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("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 (projection != null) {
-        projection.validate();
-      }
     }
 
     private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@@ -4627,15 +5498,15 @@ public class CuratorService {
       }
     }
 
-    private static class closeCuratorProjection_argsStandardSchemeFactory implements SchemeFactory {
-      public closeCuratorProjection_argsStandardScheme getScheme() {
-        return new closeCuratorProjection_argsStandardScheme();
+    private static class acquireSemaphore_resultStandardSchemeFactory implements SchemeFactory {
+      public acquireSemaphore_resultStandardScheme getScheme() {
+        return new acquireSemaphore_resultStandardScheme();
       }
     }
 
-    private static class closeCuratorProjection_argsStandardScheme extends StandardScheme<closeCuratorProjection_args> {
+    private static class acquireSemaphore_resultStandardScheme extends StandardScheme<acquireSemaphore_result> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, acquireSemaphore_result struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -4645,11 +5516,30 @@ public class CuratorService {
             break;
           }
           switch (schemeField.id) {
-            case 1: // PROJECTION
+            case 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+                {
+                  org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
+                  struct.success = new ArrayList<LeaseProjection>(_list24.size);
+                  for (int _i25 = 0; _i25 < _list24.size; ++_i25)
+                  {
+                    LeaseProjection _elem26;
+                    _elem26 = new LeaseProjection();
+                    _elem26.read(iprot);
+                    struct.success.add(_elem26);
+                  }
+                  iprot.readListEnd();
+                }
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // EX1
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.projection = new CuratorProjection();
-                struct.projection.read(iprot);
-                struct.setProjectionIsSet(true);
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
@@ -4665,13 +5555,25 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, acquireSemaphore_result struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.projection != null) {
-          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
-          struct.projection.write(oprot);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          {
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
+            for (LeaseProjection _iter27 : struct.success)
+            {
+              _iter27.write(oprot);
+            }
+            oprot.writeListEnd();
+          }
+          oprot.writeFieldEnd();
+        }
+        if (struct.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -4680,60 +5582,83 @@ public class CuratorService {
 
     }
 
-    private static class closeCuratorProjection_argsTupleSchemeFactory implements SchemeFactory {
-      public closeCuratorProjection_argsTupleScheme getScheme() {
-        return new closeCuratorProjection_argsTupleScheme();
+    private static class acquireSemaphore_resultTupleSchemeFactory implements SchemeFactory {
+      public acquireSemaphore_resultTupleScheme getScheme() {
+        return new acquireSemaphore_resultTupleScheme();
       }
     }
 
-    private static class closeCuratorProjection_argsTupleScheme extends TupleScheme<closeCuratorProjection_args> {
+    private static class acquireSemaphore_resultTupleScheme extends TupleScheme<acquireSemaphore_result> {
 
       @Override
-      public void write(org.apache.thrift.protocol.TProtocol prot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol prot, acquireSemaphore_result struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         BitSet optionals = new BitSet();
-        if (struct.isSetProjection()) {
+        if (struct.isSetSuccess()) {
           optionals.set(0);
         }
-        oprot.writeBitSet(optionals, 1);
-        if (struct.isSetProjection()) {
-          struct.projection.write(oprot);
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          {
+            oprot.writeI32(struct.success.size());
+            for (LeaseProjection _iter28 : struct.success)
+            {
+              _iter28.write(oprot);
+            }
+          }
+        }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
         }
       }
 
       @Override
-      public void read(org.apache.thrift.protocol.TProtocol prot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol prot, acquireSemaphore_result struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(1);
+        BitSet incoming = iprot.readBitSet(2);
         if (incoming.get(0)) {
-          struct.projection = new CuratorProjection();
-          struct.projection.read(iprot);
-          struct.setProjectionIsSet(true);
+          {
+            org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.success = new ArrayList<LeaseProjection>(_list29.size);
+            for (int _i30 = 0; _i30 < _list29.size; ++_i30)
+            {
+              LeaseProjection _elem31;
+              _elem31 = new LeaseProjection();
+              _elem31.read(iprot);
+              struct.success.add(_elem31);
+            }
+          }
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
         }
       }
     }
 
   }
 
-  public static class closeGenericProjection_args implements org.apache.thrift.TBase<closeGenericProjection_args, closeGenericProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeGenericProjection_args>   {
-    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeGenericProjection_args");
+  public static class closeCuratorProjection_args implements org.apache.thrift.TBase<closeCuratorProjection_args, closeCuratorProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeCuratorProjection_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("closeCuratorProjection_args");
 
     private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", 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 closeGenericProjection_argsStandardSchemeFactory());
-      schemes.put(TupleScheme.class, new closeGenericProjection_argsTupleSchemeFactory());
+      schemes.put(StandardScheme.class, new closeCuratorProjection_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new closeCuratorProjection_argsTupleSchemeFactory());
     }
 
     public CuratorProjection projection; // required
-    public String id; // 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 {
-      PROJECTION((short)1, "projection"),
-      ID((short)2, "id");
+      PROJECTION((short)1, "projection");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4750,8 +5675,6 @@ public class CuratorService {
         switch(fieldId) {
           case 1: // PROJECTION
             return PROJECTION;
-          case 2: // ID
-            return ID;
           default:
             return null;
         }
@@ -4797,51 +5720,43 @@ public class CuratorService {
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       tmpMap.put(_Fields.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
-      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
-      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeGenericProjection_args.class, metaDataMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(closeCuratorProjection_args.class, metaDataMap);
     }
 
-    public closeGenericProjection_args() {
+    public closeCuratorProjection_args() {
     }
 
-    public closeGenericProjection_args(
-      CuratorProjection projection,
-      String id)
+    public closeCuratorProjection_args(
+      CuratorProjection projection)
     {
       this();
       this.projection = projection;
-      this.id = id;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
-    public closeGenericProjection_args(closeGenericProjection_args other) {
+    public closeCuratorProjection_args(closeCuratorProjection_args other) {
       if (other.isSetProjection()) {
         this.projection = new CuratorProjection(other.projection);
       }
-      if (other.isSetId()) {
-        this.id = other.id;
-      }
     }
 
-    public closeGenericProjection_args deepCopy() {
-      return new closeGenericProjection_args(this);
+    public closeCuratorProjection_args deepCopy() {
+      return new closeCuratorProjection_args(this);
     }
 
     @Override
     public void clear() {
       this.projection = null;
-      this.id = null;
     }
 
     public CuratorProjection getProjection() {
       return this.projection;
     }
 
-    public closeGenericProjection_args setProjection(CuratorProjection projection) {
+    public closeCuratorProjection_args setProjection(CuratorProjection projection) {
       this.projection = projection;
       return this;
     }
@@ -4861,30 +5776,6 @@ public class CuratorService {
       }
     }
 
-    public String getId() {
-      return this.id;
-    }
-
-    public closeGenericProjection_args setId(String id) {
-      this.id = id;
-      return this;
-    }
-
-    public void unsetId() {
-      this.id = null;
-    }
-
-    /** Returns true if field id is set (has been assigned a value) and false otherwise */
-    public boolean isSetId() {
-      return this.id != null;
-    }
-
-    public void setIdIsSet(boolean value) {
-      if (!value) {
-        this.id = null;
-      }
-    }
-
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case PROJECTION:
@@ -4895,14 +5786,6 @@ public class CuratorService {
         }
         break;
 
-      case ID:
-        if (value == null) {
-          unsetId();
-        } else {
-          setId((String)value);
-        }
-        break;
-
       }
     }
 
@@ -4911,9 +5794,6 @@ public class CuratorService {
       case PROJECTION:
         return getProjection();
 
-      case ID:
-        return getId();
-
       }
       throw new IllegalStateException();
     }
@@ -4927,8 +5807,6 @@ public class CuratorService {
       switch (field) {
       case PROJECTION:
         return isSetProjection();
-      case ID:
-        return isSetId();
       }
       throw new IllegalStateException();
     }
@@ -4937,12 +5815,12 @@ public class CuratorService {
     public boolean equals(Object that) {
       if (that == null)
         return false;
-      if (that instanceof closeGenericProjection_args)
-        return this.equals((closeGenericProjection_args)that);
+      if (that instanceof closeCuratorProjection_args)
+        return this.equals((closeCuratorProjection_args)that);
       return false;
     }
 
-    public boolean equals(closeGenericProjection_args that) {
+    public boolean equals(closeCuratorProjection_args that) {
       if (that == null)
         return false;
 
@@ -4955,15 +5833,6 @@ public class CuratorService {
           return false;
       }
 
-      boolean this_present_id = true && this.isSetId();
-      boolean that_present_id = true && that.isSetId();
-      if (this_present_id || that_present_id) {
-        if (!(this_present_id && that_present_id))
-          return false;
-        if (!this.id.equals(that.id))
-          return false;
-      }
-
       return true;
     }
 
@@ -4973,7 +5842,7 @@ public class CuratorService {
     }
 
     @Override
-    public int compareTo(closeGenericProjection_args other) {
+    public int compareTo(closeCuratorProjection_args other) {
       if (!getClass().equals(other.getClass())) {
         return getClass().getName().compareTo(other.getClass().getName());
       }
@@ -4990,16 +5859,6 @@ public class CuratorService {
           return lastComparison;
         }
       }
-      lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
-      if (lastComparison != 0) {
-        return lastComparison;
-      }
-      if (isSetId()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
-        if (lastComparison != 0) {
-          return lastComparison;
-        }
-      }
       return 0;
     }
 
@@ -5017,7 +5876,7 @@ public class CuratorService {
 
     @Override
     public String toString() {
-      StringBuilder sb = new StringBuilder("closeGenericProjection_args(");
+      StringBuilder sb = new StringBuilder("closeCuratorProjection_args(");
       boolean first = true;
 
       sb.append("projection:");
@@ -5027,14 +5886,6 @@ public class CuratorService {
         sb.append(this.projection);
       }
       first = false;
-      if (!first) sb.append(", ");
-      sb.append("id:");
-      if (this.id == null) {
-        sb.append("null");
-      } else {
-        sb.append(this.id);
-      }
-      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -5063,15 +5914,15 @@ public class CuratorService {
       }
     }
 
-    private static class closeGenericProjection_argsStandardSchemeFactory implements SchemeFactory {
-      public closeGenericProjection_argsStandardScheme getScheme() {
-        return new closeGenericProjection_argsStandardScheme();
+    private static class closeCuratorProjection_argsStandardSchemeFactory implements SchemeFactory {
+      public closeCuratorProjection_argsStandardScheme getScheme() {
+        return new closeCuratorProjection_argsStandardScheme();
       }
     }
 
-    private static class closeGenericProjection_argsStandardScheme extends StandardScheme<closeGenericProjection_args> {
+    private static class closeCuratorProjection_argsStandardScheme extends StandardScheme<closeCuratorProjection_args> {
 
-      public void read(org.apache.thrift.protocol.TProtocol iprot, closeGenericProjection_args struct) throws org.apache.thrift.TException {
+      public void read(org.apache.thrift.protocol.TProtocol iprot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
         org.apache.thrift.protocol.TField schemeField;
         iprot.readStructBegin();
         while (true)
@@ -5090,14 +5941,6 @@ public class CuratorService {
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
-            case 2: // ID
-              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-                struct.id = iprot.readString();
-                struct.setIdIsSet(true);
-              } else { 
-                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
-              }
-              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -5109,7 +5952,7 @@ public class CuratorService {
         struct.validate();
       }
 
-      public void write(org.apache.thrift.protocol.TProtocol oprot, closeGenericProjection_args struct) throws org.apache.thrift.TException {
+      public void write(org.apache.thrift.protocol.TProtocol oprot, closeCuratorProjection_args struct) throws org.apache.thrift.TException {
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
@@ -5118,81 +5961,61 @@ public class CuratorService {
           struct.projection.write(oprot);
           oprot.writeFieldEnd();
         }
-        if (struct.id != null) {
-          oprot.writeFieldBegin(ID_FIELD_DESC);
-          oprot.writeString(struct.id);
-          oprot.writeFieldEnd();
-        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
 
     }
 
-    private static class closeGenericProjection_argsTupleSchemeFactory implements SchemeFactory {
-      public closeGenericProjection_argsTupleScheme getScheme() {
-        return new closeGenericProjection_argsTupleScheme();
+    private static class closeCuratorProjection_argsTupleSchemeFactory implements SchemeFactory {
+      public closeCuratorProjection_ar

<TRUNCATED>

[38/50] [abbrv] git commit: completed initial doc

Posted by ra...@apache.org.
completed initial doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f3ec63cb
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f3ec63cb
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f3ec63cb

Branch: refs/heads/master
Commit: f3ec63cb6b29d6c9bf586f706596a2800407a488
Parents: 673e6dc
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 14:53:23 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 14:53:23 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/idl/structs/DeleteSpec.java   |  6 +-
 .../curator/x/rpc/idl/structs/LeaderResult.java |  6 +-
 .../src/site/confluence/reference.confluence    | 81 +++++++++++++++++++-
 3 files changed, 82 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/f3ec63cb/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
index 2d418ee..18f8dd2 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
@@ -34,21 +34,17 @@ public class DeleteSpec
     public String asyncContext;
 
     @ThriftField(4)
-    public boolean compressed;
-
-    @ThriftField(5)
     public Version version;
 
     public DeleteSpec()
     {
     }
 
-    public DeleteSpec(String path, boolean guaranteed, String asyncContext, boolean compressed, Version version)
+    public DeleteSpec(String path, boolean guaranteed, String asyncContext, Version version)
     {
         this.path = path;
         this.guaranteed = guaranteed;
         this.asyncContext = asyncContext;
-        this.compressed = compressed;
         this.version = version;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/f3ec63cb/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
index 3616f3c..429294b 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
@@ -28,15 +28,15 @@ public class LeaderResult
     public LeaderProjection projection;
 
     @ThriftField(2)
-    public boolean hasLeadership;
+    public boolean isLeader;
 
     public LeaderResult()
     {
     }
 
-    public LeaderResult(LeaderProjection projection, boolean hasLeadership)
+    public LeaderResult(LeaderProjection projection, boolean isLeader)
     {
         this.projection = projection;
-        this.hasLeadership = hasLeadership;
+        this.isLeader = isLeader;
     }
 }

http://git-wip-us.apache.org/repos/asf/curator/blob/f3ec63cb/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index d23e9e1..0ecb26b 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -1,6 +1,6 @@
 [[Curator RPC Proxy|index.html]] / Reference
 
-h1. API and Struct Reference
+h1. API Reference
 
 h2. CuratorService
 
@@ -31,9 +31,9 @@ h2. CuratorService
 h2. EventService
 
 ||API||Arguments||Return Value||Description||
-|getNextEvent|CuratorProjection|Returns the next queued event for the given CuratorProjection. If no events are queued within the [[configured|configuration.html]] ping time, a PING event is returned.|
+|getNextEvent|CuratorProjection|CuratorEvent|Returns the next queued event for the given CuratorProjection. If no events are queued within the [[configured|configuration.html]] ping time, a PING event is returned.|
 
-See the [[Events Page|events.html]] for the Event schema reference.
+See the [[Events Page|events.html]] for the CuratorEvent schema reference.
 
 h2. DiscoveryService
 
@@ -44,3 +44,78 @@ h2. DiscoveryService
 |getInstance|provider projection|DiscoveryInstance|Return a single instance for the given service|
 |getAllInstances|provider projection|list of DiscoveryInstance|Return all instances for the given service|
 |noteError|provider projection, service id|void|Note an error for the given service instance|
+
+h1. Struct Reference
+
+_Required fields have (r) in the description_
+
+h2. CreateSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|data|bytes|data for the node|
+|mode|CreateMode|PERSISTENT, PERSISTENT\_SEQUENTIAL, EPHEMERAL, or EPHEMERAL\_SEQUENTIAL|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|if true, compress the data|
+|creatingParentsIfNeeded|bool|if true, create any needed parent nodes|
+|withProtection|bool|if true, use Curator protection|
+
+h2. DeleteSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|guaranteed|bool|if true, use guaranteed deletion|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|if true, compress the data|
+|version|Version|if not null, uses Version.version when deleting the node. Otherwise, \-1 is used.|
+
+h2. GetDataSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|watched|bool|if true, trigger watch events for this node|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|decompressed|bool|if true, decompress the data|
+
+h2. SetDataSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|data|bytes|(r) data for the node|
+|watched|bool|if true, trigger watch events for this node|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+|compressed|bool|if true, compress the data|
+|version|Version|if not null, uses Version.version when setting the node data. Otherwise, \-1 is used.|
+
+h2. ExistsSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|watched|bool|if true, trigger watch events for this node|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+
+h2. GetChildrenSpec
+
+||Field||Type||Description||
+|path|string|(r) the ZNode path|
+|watched|bool|if true, trigger watch events for this node|
+|asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
+
+h2. LeaderResult
+
+||Field||Type||Description||
+|projection|LeaderProjection|the projection of the leader|
+|isLeader|bool|true if this projection is the leader|
+
+h2. Participant
+
+||Field||Type||Description||
+|id|string|participant id|
+|isLeader|bool|true if this participant is the leader|
+
+h2. ChildData
+
+||Field||Type||Description||
+|path|string|the ZNode path|
+|stat|Stat|ZooKeeper stat for the node|
+|data|bytes|node data or null|


[46/50] [abbrv] git commit: more tests

Posted by ra...@apache.org.
more tests


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/3a0f6472
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/3a0f6472
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/3a0f6472

Branch: refs/heads/master
Commit: 3a0f6472ec059f4e44b9e79a329326a2cf57fbad
Parents: b583407
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 18:07:13 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 18:07:13 2014 -0500

----------------------------------------------------------------------
 .../idl/services/CuratorProjectionService.java  |    2 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |    9 +-
 .../site/confluence/configuration.confluence    |   16 +-
 .../curator/generated/CuratorService.java       | 7962 +++++++++---------
 .../apache/curator/generated/DeleteSpec.java    |  108 +-
 .../apache/curator/generated/LeaderResult.java  |  104 +-
 .../java/org/apache/curator/x/rpc/RpcTests.java |   45 +
 .../org/apache/curator/x/rpc/TestClient.java    |    4 +-
 8 files changed, 4238 insertions(+), 4012 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index 4fcb450..257230e 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -97,7 +97,7 @@ public class CuratorProjectionService
         return projection;
     }
 
-    @ThriftMethod(oneway = true)
+    @ThriftMethod
     public void closeCuratorProjection(CuratorProjection projection)
     {
         CuratorEntry entry = connectionManager.remove(projection.id);

http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 2f46a93..4071069 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -86,7 +86,7 @@ struct LeaderProjection {
 
 struct LeaderResult {
   1: LeaderProjection projection;
-  2: bool hasLeadership;
+  2: bool isLeader;
 }
 
 struct LeaseProjection {
@@ -177,8 +177,7 @@ struct DeleteSpec {
   1: string path;
   2: bool guaranteed;
   3: string asyncContext;
-  4: bool compressed;
-  5: Version version;
+  4: Version version;
 }
 
 struct OptionalStat {
@@ -247,7 +246,8 @@ struct CuratorEvent {
 
 service CuratorService {
   LockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs) throws (1: CuratorException ex1);
-  oneway void closeCuratorProjection(1: CuratorProjection projection);
+  list<LeaseProjection> acquireSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases) throws (1: CuratorException ex1);
+  void closeCuratorProjection(1: CuratorProjection projection);
   bool closeGenericProjection(1: CuratorProjection projection, 2: string id) throws (1: CuratorException ex1);
   OptionalPath createNode(1: CuratorProjection projection, 2: CreateSpec spec) throws (1: CuratorException ex1);
   void deleteNode(1: CuratorProjection projection, 2: DeleteSpec spec) throws (1: CuratorException ex1);
@@ -266,7 +266,6 @@ service CuratorService {
   NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial) throws (1: CuratorException ex1);
   PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode) throws (1: CuratorException ex1);
   PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode) throws (1: CuratorException ex1);
-  list<LeaseProjection> startSemaphore(1: CuratorProjection projection, 2: string path, 3: i32 acquireQty, 4: i32 maxWaitMs, 5: i32 maxLeases) throws (1: CuratorException ex1);
   void sync(1: CuratorProjection projection, 2: string path, 3: string asyncContext) throws (1: CuratorException ex1);
 }
 

http://git-wip-us.apache.org/repos/asf/curator/blob/3a0f6472/curator-x-rpc/src/site/confluence/configuration.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
index 72d2af0..939ee47 100644
--- a/curator-x-rpc/src/site/confluence/configuration.confluence
+++ b/curator-x-rpc/src/site/confluence/configuration.confluence
@@ -78,9 +78,7 @@ Here is an example JSON configuration file
 {noformat}
 
 
-h2. Reference
-
-h3. Main
+h2. Main
 
 ||Name||Type||Default Value||Description||
 |thrift|Thrift|n/a|Thrift server configuration|
@@ -89,14 +87,14 @@ h3. Main
 |pingTime|Duration|5 seconds|The EventService will return a PING event if this time elapses without some other event being generated|
 |connections|List of Connection|n/a|List of ZooKeeper connections|
 
-h3. Duration
+h2. Duration
 
 Durations are strings that specify a time duration. Examples:
 * "10s" \- 10 seconds
 * "100ms" \- 100 milliseconds
 * "3h" \- 3 hours
 
-h3. Thrift
+h2. Thrift
 
 ||Name||Type||Default Value||Required||Description||
 |port|int|_none_|*Y*|port to listen on.|
@@ -105,12 +103,12 @@ h3. Thrift
 |transportName|string|"framed"|\-|the name of the transport (frame codec) that this server will handle. The available options by default are 'unframed', 'buffered', and 'framed'. Additional modules may install other options.|
 |protocolName|string|"binary"|\-|name of the protocol that this server will speak. The available options by default are 'binary' and 'compact'. Additional modules may install other options.|
 
-h3. Logging
+h2. Logging
 
 Dropwizard's logging module is used. See the [[Dropwizard Logging Doc|http://dropwizard.readthedocs.org/en/latest/manual/configuration.html#logging]] for details
 on specifying the logging configuration.
 
-h3. Connection
+h2. Connection
 
 ||Name||Type||Default Value||Required||Description||
 |name|string|_none_|*Y*|Unique name for the connection.|
@@ -120,7 +118,7 @@ h3. Connection
 |retry|Retry|an exponential\-backoff policy|\-|The Retry Policy to use|
 |authorization|Authorization|null|\-|Authorization spec|
 
-h3. Retry
+h2. Retry
 
 The retry policy configuration depends on what type is used. There 3 types supported:
 
@@ -138,7 +136,7 @@ The retry policy configuration depends on what type is used. There 3 types suppo
 |sleepBetweenRetries|int|100 milliseconds|sleep time between retries|
 |n|int|3|the number of retries|
 
-h3. Authorization
+h2. Authorization
 
 ||Name||Type||Description||
 |scheme|string|the authorization scheme|


[10/50] [abbrv] git commit: Closer doesn't need to pass the value to its method. Thus, it also doesn't need to be generic

Posted by ra...@apache.org.
Closer doesn't need to pass the value to its method. Thus, it also doesn't need to be generic


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/10bf3553
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/10bf3553
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/10bf3553

Branch: refs/heads/master
Commit: 10bf355309ffa4dcf22dfa6205346c804e459647
Parents: 48d3e31
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 10:58:49 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 10:58:49 2014 -0500

----------------------------------------------------------------------
 .../curator/x/rpc/connections/CuratorEntry.java |   4 +-
 .../projection/CuratorProjectionService.java    |   8 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |   1 +
 .../curator/generated/CuratorService.java       | 455 +++++++++++++++++++
 4 files changed, 464 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/10bf3553/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index 0df0740..bb56cfb 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -55,8 +55,7 @@ public class CuratorEntry implements Closeable
                 if ( entry.closer != null )
                 {
                     log.debug(String.format("Closing left over thing. Type: %s - Id: %s", entry.thing.getClass(), mapEntry.getKey()));
-                    //noinspection unchecked
-                    entry.closer.close();    // lack of generics is safe because addThing() is type-safe
+                    entry.closer.close();
                 }
             }
             things.clear();
@@ -109,7 +108,6 @@ public class CuratorEntry implements Closeable
         Entry entry = (id != null) ? things.remove(id) : null;
         if ( entry != null )
         {
-            //noinspection unchecked
             entry.closer.close();
         }
         return false;

http://git-wip-us.apache.org/repos/asf/curator/blob/10bf3553/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
index f82384f..ab9add7 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
@@ -91,7 +91,7 @@ public class CuratorProjectionService
         return projection;
     }
 
-    @ThriftMethod
+    @ThriftMethod(oneway = true)
     public void closeCuratorProjection(CuratorProjection projection)
     {
         CuratorEntry entry = connectionManager.remove(projection.id);
@@ -101,6 +101,12 @@ public class CuratorProjectionService
         }
     }
 
+    @ThriftMethod(oneway = true)
+    public void pingCuratorProjection(CuratorProjection projection)
+    {
+        connectionManager.get(projection.id);
+    }
+
     @ThriftMethod
     public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws Exception
     {

http://git-wip-us.apache.org/repos/asf/curator/blob/10bf3553/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index fc51dba..204ef7d 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -213,6 +213,7 @@ service CuratorService {
   ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path);
   bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection);
   CuratorProjection newCuratorProjection(1: string connectionName);
+  oneway void pingCuratorProjection(1: CuratorProjection projection);
   Stat setData(1: CuratorProjection projection, 2: SetDataSpec spec);
   LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs);
   NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial);

http://git-wip-us.apache.org/repos/asf/curator/blob/10bf3553/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
index d7e52ba..5e85d1e 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
@@ -64,6 +64,8 @@ public class CuratorService {
 
     public CuratorProjection newCuratorProjection(String connectionName) throws org.apache.thrift.TException;
 
+    public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
+
     public Stat setData(CuratorProjection projection, SetDataSpec spec) throws org.apache.thrift.TException;
 
     public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws org.apache.thrift.TException;
@@ -108,6 +110,8 @@ public class CuratorService {
 
     public void newCuratorProjection(String connectionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void pingCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void setData(CuratorProjection projection, SetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -472,6 +476,18 @@ public class CuratorService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "newCuratorProjection failed: unknown result");
     }
 
+    public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
+    {
+      send_pingCuratorProjection(projection);
+    }
+
+    public void send_pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
+    {
+      pingCuratorProjection_args args = new pingCuratorProjection_args();
+      args.setProjection(projection);
+      sendBase("pingCuratorProjection", args);
+    }
+
     public Stat setData(CuratorProjection projection, SetDataSpec spec) throws org.apache.thrift.TException
     {
       send_setData(projection, spec);
@@ -1136,6 +1152,37 @@ public class CuratorService {
       }
     }
 
+    public void pingCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      pingCuratorProjection_call method_call = new pingCuratorProjection_call(projection, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class pingCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private CuratorProjection projection;
+      public pingCuratorProjection_call(CuratorProjection projection, 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, true);
+        this.projection = projection;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pingCuratorProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        pingCuratorProjection_args args = new pingCuratorProjection_args();
+        args.setProjection(projection);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new 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);
+      }
+    }
+
     public void setData(CuratorProjection projection, SetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       setData_call method_call = new setData_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
@@ -1409,6 +1456,7 @@ public class CuratorService {
       processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
+      processMap.put("pingCuratorProjection", new pingCuratorProjection());
       processMap.put("setData", new setData());
       processMap.put("startLeaderSelector", new startLeaderSelector());
       processMap.put("startNodeCache", new startNodeCache());
@@ -1700,6 +1748,25 @@ public class CuratorService {
       }
     }
 
+    public static class pingCuratorProjection<I extends Iface> extends org.apache.thrift.ProcessFunction<I, pingCuratorProjection_args> {
+      public pingCuratorProjection() {
+        super("pingCuratorProjection");
+      }
+
+      public pingCuratorProjection_args getEmptyArgsInstance() {
+        return new pingCuratorProjection_args();
+      }
+
+      protected boolean isOneway() {
+        return true;
+      }
+
+      public org.apache.thrift.TBase getResult(I iface, pingCuratorProjection_args args) throws org.apache.thrift.TException {
+        iface.pingCuratorProjection(args.projection);
+        return null;
+      }
+    }
+
     public static class setData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setData_args> {
       public setData() {
         super("setData");
@@ -1847,6 +1914,7 @@ public class CuratorService {
       processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
       processMap.put("isLeader", new isLeader());
       processMap.put("newCuratorProjection", new newCuratorProjection());
+      processMap.put("pingCuratorProjection", new pingCuratorProjection());
       processMap.put("setData", new setData());
       processMap.put("startLeaderSelector", new startLeaderSelector());
       processMap.put("startNodeCache", new startNodeCache());
@@ -2570,6 +2638,34 @@ public class CuratorService {
       }
     }
 
+    public static class pingCuratorProjection<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, pingCuratorProjection_args, Void> {
+      public pingCuratorProjection() {
+        super("pingCuratorProjection");
+      }
+
+      public pingCuratorProjection_args getEmptyArgsInstance() {
+        return new pingCuratorProjection_args();
+      }
+
+      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<Void>() { 
+          public void onComplete(Void o) {
+          }
+          public void onError(Exception e) {
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return true;
+      }
+
+      public void start(I iface, pingCuratorProjection_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
+        iface.pingCuratorProjection(args.projection,resultHandler);
+      }
+    }
+
     public static class setData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setData_args, Stat> {
       public setData() {
         super("setData");
@@ -14241,6 +14337,365 @@ public class CuratorService {
 
   }
 
+  public static class pingCuratorProjection_args implements org.apache.thrift.TBase<pingCuratorProjection_args, pingCuratorProjection_args._Fields>, java.io.Serializable, Cloneable, Comparable<pingCuratorProjection_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pingCuratorProjection_args");
+
+    private static final org.apache.thrift.protocol.TField PROJECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("projection", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new pingCuratorProjection_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new pingCuratorProjection_argsTupleSchemeFactory());
+    }
+
+    public CuratorProjection projection; // 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 {
+      PROJECTION((short)1, "projection");
+
+      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: // PROJECTION
+            return PROJECTION;
+          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.PROJECTION, new org.apache.thrift.meta_data.FieldMetaData("projection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CuratorProjection.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pingCuratorProjection_args.class, metaDataMap);
+    }
+
+    public pingCuratorProjection_args() {
+    }
+
+    public pingCuratorProjection_args(
+      CuratorProjection projection)
+    {
+      this();
+      this.projection = projection;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public pingCuratorProjection_args(pingCuratorProjection_args other) {
+      if (other.isSetProjection()) {
+        this.projection = new CuratorProjection(other.projection);
+      }
+    }
+
+    public pingCuratorProjection_args deepCopy() {
+      return new pingCuratorProjection_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.projection = null;
+    }
+
+    public CuratorProjection getProjection() {
+      return this.projection;
+    }
+
+    public pingCuratorProjection_args setProjection(CuratorProjection projection) {
+      this.projection = projection;
+      return this;
+    }
+
+    public void unsetProjection() {
+      this.projection = null;
+    }
+
+    /** Returns true if field projection is set (has been assigned a value) and false otherwise */
+    public boolean isSetProjection() {
+      return this.projection != null;
+    }
+
+    public void setProjectionIsSet(boolean value) {
+      if (!value) {
+        this.projection = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case PROJECTION:
+        if (value == null) {
+          unsetProjection();
+        } else {
+          setProjection((CuratorProjection)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case PROJECTION:
+        return getProjection();
+
+      }
+      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 PROJECTION:
+        return isSetProjection();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof pingCuratorProjection_args)
+        return this.equals((pingCuratorProjection_args)that);
+      return false;
+    }
+
+    public boolean equals(pingCuratorProjection_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_projection = true && this.isSetProjection();
+      boolean that_present_projection = true && that.isSetProjection();
+      if (this_present_projection || that_present_projection) {
+        if (!(this_present_projection && that_present_projection))
+          return false;
+        if (!this.projection.equals(that.projection))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(pingCuratorProjection_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetProjection()).compareTo(other.isSetProjection());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetProjection()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projection, other.projection);
+        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("pingCuratorProjection_args(");
+      boolean first = true;
+
+      sb.append("projection:");
+      if (this.projection == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.projection);
+      }
+      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 (projection != null) {
+        projection.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 pingCuratorProjection_argsStandardSchemeFactory implements SchemeFactory {
+      public pingCuratorProjection_argsStandardScheme getScheme() {
+        return new pingCuratorProjection_argsStandardScheme();
+      }
+    }
+
+    private static class pingCuratorProjection_argsStandardScheme extends StandardScheme<pingCuratorProjection_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, pingCuratorProjection_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: // PROJECTION
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.projection = new CuratorProjection();
+                struct.projection.read(iprot);
+                struct.setProjectionIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, pingCuratorProjection_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.projection != null) {
+          oprot.writeFieldBegin(PROJECTION_FIELD_DESC);
+          struct.projection.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class pingCuratorProjection_argsTupleSchemeFactory implements SchemeFactory {
+      public pingCuratorProjection_argsTupleScheme getScheme() {
+        return new pingCuratorProjection_argsTupleScheme();
+      }
+    }
+
+    private static class pingCuratorProjection_argsTupleScheme extends TupleScheme<pingCuratorProjection_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, pingCuratorProjection_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetProjection()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetProjection()) {
+          struct.projection.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, pingCuratorProjection_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.projection = new CuratorProjection();
+          struct.projection.read(iprot);
+          struct.setProjectionIsSet(true);
+        }
+      }
+    }
+
+  }
+
   public static class setData_args implements org.apache.thrift.TBase<setData_args, setData_args._Fields>, java.io.Serializable, Cloneable, Comparable<setData_args>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setData_args");
 


[41/50] [abbrv] git commit: doc wip

Posted by ra...@apache.org.
doc wip


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/9077ad00
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/9077ad00
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/9077ad00

Branch: refs/heads/master
Commit: 9077ad001b32868ac9abcf172438dff9ff82e52f
Parents: 30019cd
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 11:20:34 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 11:20:34 2014 -0500

----------------------------------------------------------------------
 .../src/site/confluence/configuration.confluence    | 15 +++++----------
 .../src/site/confluence/reference.confluence        | 16 +++++++---------
 curator-x-rpc/src/site/confluence/usage.confluence  |  2 +-
 3 files changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/9077ad00/curator-x-rpc/src/site/confluence/configuration.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
index d2ae8c8..21912ae 100644
--- a/curator-x-rpc/src/site/confluence/configuration.confluence
+++ b/curator-x-rpc/src/site/confluence/configuration.confluence
@@ -124,22 +124,17 @@ h3. Retry
 
 The retry policy configuration depends on what type is used. There 3 types supported:
 
-_exponential\-backoff_
 ||Name||Type||Default Value||Description||
-|type|string|n/a|"exponential\-backoff"|
+|type|string|n/a|*exponential\-backoff*|
 |baseSleepTime|Duration|100 milliseconds|The base sleep time|
 |maxRetries|int|3|The max retries|
-
-_bounded\-exponential\-backoff_
-||Name||Type||Default Value||Description||
-|type|string|n/a|"bounded\-exponential\-backoff"|
+|\_|\_|\_|\_|
+|type|string|n/a|*bounded\-exponential\-backoff*|
 |baseSleepTime|Duration|100 milliseconds|The base sleep time|
 |maxSleepTime|Duration|30 seconds|The max sleep time|
 |maxRetries|int|3|The max retries|
-
-_ntimes_
-||Name||Type||Default Value||Description||
-|type|string|n/a|"ntimes"|
+|\_|\_|\_|\_|
+|type|string|n/a|*ntimes*|
 |sleepBetweenRetries|int|100 milliseconds|sleep time between retries|
 |n|int|3|the number of retries|
 

http://git-wip-us.apache.org/repos/asf/curator/blob/9077ad00/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index 0ecb26b..dde323f 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -47,12 +47,10 @@ h2. DiscoveryService
 
 h1. Struct Reference
 
-_Required fields have (r) in the description_
-
 h2. CreateSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
+|path|string|the ZNode path \- *required*|
 |data|bytes|data for the node|
 |mode|CreateMode|PERSISTENT, PERSISTENT\_SEQUENTIAL, EPHEMERAL, or EPHEMERAL\_SEQUENTIAL|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
@@ -63,7 +61,7 @@ h2. CreateSpec
 h2. DeleteSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
+|path|string|the ZNode path \- *required*|
 |guaranteed|bool|if true, use guaranteed deletion|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 |compressed|bool|if true, compress the data|
@@ -72,7 +70,7 @@ h2. DeleteSpec
 h2. GetDataSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
+|path|string|the ZNode path \- *required*|
 |watched|bool|if true, trigger watch events for this node|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 |decompressed|bool|if true, decompress the data|
@@ -80,8 +78,8 @@ h2. GetDataSpec
 h2. SetDataSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
-|data|bytes|(r) data for the node|
+|path|string|the ZNode path \- *required*|
+|data|bytes|data for the node \- *required*|
 |watched|bool|if true, trigger watch events for this node|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 |compressed|bool|if true, compress the data|
@@ -90,14 +88,14 @@ h2. SetDataSpec
 h2. ExistsSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
+|path|string|the ZNode path \- *required*|
 |watched|bool|if true, trigger watch events for this node|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 
 h2. GetChildrenSpec
 
 ||Field||Type||Description||
-|path|string|(r) the ZNode path|
+|path|string|the ZNode path \- *required*|
 |watched|bool|if true, trigger watch events for this node|
 |asyncContext|string|if not null, createNode() is performed asynchronously and this is the context used in the async message|
 

http://git-wip-us.apache.org/repos/asf/curator/blob/9077ad00/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index 86befd1..e9da75f 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -10,7 +10,7 @@ Details on using Apache Thrift can be found here: [[http://thrift.apache.org]].
 
 h2. Prerequisites
 
-It's assumed you already familiar with ZooKeeper and Curator. Also, familiarity with writing Thrift applications is helpful.
+It's assumed you are already familiar with ZooKeeper and Curator. Also, familiarity with writing Thrift applications is helpful.
 
 h2. Services
 


[32/50] [abbrv] git commit: wip on doc

Posted by ra...@apache.org.
wip on doc


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/78460f90
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/78460f90
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/78460f90

Branch: refs/heads/master
Commit: 78460f9041ceb10d641a059773c6b68cab611144
Parents: bf4ceb4
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 11:53:56 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 11:53:56 2014 -0500

----------------------------------------------------------------------
 .../src/main/resources/curator/help.txt         |   1 +
 curator-x-rpc/src/main/scripts/apply-thrift.sh  |  39 +++++
 curator-x-rpc/src/main/scripts/generate-java.sh |  28 ----
 curator-x-rpc/src/main/scripts/generate.sh      |   2 +-
 .../site/confluence/configuration.confluence    | 150 +++++++++++++++++
 .../src/site/confluence/deploy.confluence       |  10 +-
 .../src/site/confluence/index.confluence        |  31 ++--
 .../src/site/confluence/usage.confluence        |  27 +++
 .../org/apache/curator/x/rpc/TestClient.java    | 167 -------------------
 .../org/apache/curator/x/rpc/TestServer.java    |  34 ----
 .../configuration/TestConfigurationBuilder.java |  83 ---------
 11 files changed, 243 insertions(+), 329 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/main/resources/curator/help.txt
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/resources/curator/help.txt b/curator-x-rpc/src/main/resources/curator/help.txt
index 53e751f..7479e23 100644
--- a/curator-x-rpc/src/main/resources/curator/help.txt
+++ b/curator-x-rpc/src/main/resources/curator/help.txt
@@ -29,6 +29,7 @@ the model configuration shown in JSON with added comments. Required fields have
 
     "connections": [ // * list of ZooKeeper connections
         "name": "string", // * unique name for the connection
+        "connectionString": "string", // * ZooKeeper connection string (e.g. "host1:2181,host2:2181")
         "sessionLength": "Duration", // duration for the session. Default is 1 minute.
         "connectionTimeout": "Duration", // duration for connecting. Default is 15 seconds.
         "authorization": { // Authorization spec. Default is NULL.

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/main/scripts/apply-thrift.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/apply-thrift.sh b/curator-x-rpc/src/main/scripts/apply-thrift.sh
new file mode 100755
index 0000000..e2a0d85
--- /dev/null
+++ b/curator-x-rpc/src/main/scripts/apply-thrift.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+
+if (( $# == 0 )); then
+    echo -e "usage:\n\tapply-thrift.sh <language code> <optional target directory>"
+    exit
+fi
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+BASE_DIR="$( cd "$DIR/../../../.." && pwd )"
+
+if (( $# == 2 )); then
+    TARGET_DIR="$2"
+else
+    TARGET_DIR="$BASE_DIR/curator-x-rpc/src/test/java"
+fi
+
+mkdir -p "$TARGET_DIR/"
+rm -fr "$TARGET_DIR/"*
+
+thrift -gen $1 -out "$TARGET_DIR" "$BASE_DIR/curator-x-rpc/src/main/thrift/curator.thrift"

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/main/scripts/generate-java.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate-java.sh b/curator-x-rpc/src/main/scripts/generate-java.sh
deleted file mode 100755
index b667fb1..0000000
--- a/curator-x-rpc/src/main/scripts/generate-java.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-BASE_DIR="$( cd "$DIR/../../../.." && pwd )"
-TARGET_DIR="$BASE_DIR/curator-x-rpc/src/test/java"
-
-rm "$TARGET_DIR/org/apache/curator/generated/"*
-
-thrift -gen java -out "$TARGET_DIR" "$BASE_DIR/curator-x-rpc/src/main/thrift/curator.thrift"

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/main/scripts/generate.sh
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
index 4c76ffa..ddcbff4 100755
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ b/curator-x-rpc/src/main/scripts/generate.sh
@@ -20,7 +20,7 @@
 
 
 if (( $# != 2 )); then
-    echo "usage:\ngenerate.sh <path to swift2thrift-generator-cli-N.N.N-standalone.jar> <path to zookeeper-N.N.N.jar>"
+    echo -e "usage:\n\tgenerate.sh <path to swift2thrift-generator-cli-N.N.N-standalone.jar> <path to zookeeper-N.N.N.jar>"
     exit
 fi
 

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/site/confluence/configuration.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
new file mode 100644
index 0000000..d2ae8c8
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/configuration.confluence
@@ -0,0 +1,150 @@
+[[Curator RPC Proxy|index.html]] / Configuration
+
+h1. Configuration
+
+h2. Introduction
+
+Curator RPC uses [[Dropwizard|http://dropwizard.readthedocs.org/en/latest/]] for configuration. You can write the configuration in JSON or YAML.
+It can be passed to Curator RPC via a file or directly on the command line. i.e.
+
+{noformat}
+# via command line
+java -jar curator-x-rpc-VERSION.jar '{"thrift":{"port": 8080}}'
+{noformat}
+
+{noformat}
+# via file
+java -jar curator-x-rpc-VERSION.jar path/to/config.json
+{noformat}
+
+h2. Example
+
+Here is an example JSON configuration file
+
+{noformat}
+{
+    "projectionExpiration": "15s",
+
+    "thrift": {
+        "port": 1234
+    },
+
+    "pingTime": "10s",
+
+    "logging": {
+        "level": "INFO",
+
+        "appenders": [
+            {
+                "type": "file",
+                "currentLogFilename": "logs/curator-rpc.log",
+                "archivedLogFilenamePattern": "logs/curator-rpc-%d.log.gz",
+                "archivedFileCount": 10,
+                "timeZone": "UTC"
+            },
+
+            {
+                "type": "console"
+            }
+        ]
+    },
+
+    "connections": [
+        {
+            "name": "main",
+            "connectionString": "one:1,two:2",
+            "sessionLength": "3m",
+            "connectionTimeout": "20s",
+            "retry": {
+                "type": "exponential-backoff",
+                "baseSleepTime": "1s",
+                "maxRetries": 10
+            }
+        },
+
+        {
+            "name": "alt",
+            "connectionString": "three:3,four:4",
+            "sessionLength": "4m",
+            "connectionTimeout": "30s",
+            "retry": {
+                "type": "ntimes",
+                "sleepBetweenRetries": "1m",
+                "n": 10
+            }
+        }
+    ]
+}
+{noformat}
+
+
+h2. Reference
+
+h3. Main
+
+||Name||Type||Default Value||Description||
+|thrift|Thrift|n/a|Thrift server configuration|
+|logging|Logging|n/a|log file configuration|
+|projectionExpiration|Duration|3 minutes|Curator Projection instances will be automatically closed if not accessed within this amount of time|
+|pingTime|Duration|5 seconds|The EventService will return a PING event if this time elapses without some other event being generated|
+|connections|List of Connection|n/a|List of ZooKeeper connections|
+
+h3. Duration
+
+Durations are strings that specify a time duration. Examples:
+* "10s" \- 10 seconds
+* "100ms" \- 100 milliseconds
+* "3h" \- 3 hours
+
+h3. Thrift
+
+||Name||Type||Default Value||Description||
+|bindAddress|string|"bindAddress"|Address for server to bind to|
+|port|int|_none_|port to listen on. *required*|
+|idleConnectionTimeout|int|60 seconds|timeout period between receiving requests from a client connection. If the timeout is exceeded (no complete requests have arrived from the client within the timeout), the server will disconnect the idle client.|
+|transportName|string|"framed"|the name of the transport (frame codec) that this server will handle. The available options by default are 'unframed', 'buffered', and 'framed'. Additional modules may install other options.|
+|protocolName|string|"binary"|name of the protocol that this server will speak. The available options by default are 'binary' and 'compact'. Additional modules may install other options.|
+
+h3. Logging
+
+Dropwizard's logging module is used. See the [[Dropwizard Logging Doc|http://dropwizard.readthedocs.org/en/latest/manual/configuration.html#logging]] for details
+on specifying the logging configuration.
+
+h3. Connection
+
+||Name||Type||Default Value||Description||
+|name|string|_none_|Unique name for the connection. *required*|
+|connectionString|string|_none_|ZooKeeper connection string (e.g. "host1:2181,host2:2181"). *required*|
+|sessionLength|Duration|1 minute|duration for the ZooKeeper session|
+|connectionTimeout|Duration|15 seconds|duration for connecting|
+|retry|Retry|an exponential\-backoff policy|The Retry Policy to use|
+|authorization|Authorization|null|Authorization spec|
+
+h3. Retry
+
+The retry policy configuration depends on what type is used. There 3 types supported:
+
+_exponential\-backoff_
+||Name||Type||Default Value||Description||
+|type|string|n/a|"exponential\-backoff"|
+|baseSleepTime|Duration|100 milliseconds|The base sleep time|
+|maxRetries|int|3|The max retries|
+
+_bounded\-exponential\-backoff_
+||Name||Type||Default Value||Description||
+|type|string|n/a|"bounded\-exponential\-backoff"|
+|baseSleepTime|Duration|100 milliseconds|The base sleep time|
+|maxSleepTime|Duration|30 seconds|The max sleep time|
+|maxRetries|int|3|The max retries|
+
+_ntimes_
+||Name||Type||Default Value||Description||
+|type|string|n/a|"ntimes"|
+|sleepBetweenRetries|int|100 milliseconds|sleep time between retries|
+|n|int|3|the number of retries|
+
+h3. Authorization
+
+||Name||Type||Description||
+|scheme|string|the authorization scheme|
+|auth|string|the authorization auth|

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/site/confluence/deploy.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
index cb4612a..af3b682 100644
--- a/curator-x-rpc/src/site/confluence/deploy.confluence
+++ b/curator-x-rpc/src/site/confluence/deploy.confluence
@@ -2,13 +2,19 @@
 
 h1. Deployment
 
+h2. Running
+
 Curator RPC is built as an "uber" Java JAR and can be downloaded from Maven Central. Go to [[http://search.maven.org/]] and search for
 "curator\-x\-rpc" and download the JAR for the latest version. This JAR can be run directly ala:
 
 {noformat}
-java -jar curator-x-rpc-VERSION.jar
+java -jar curator-x-rpc-VERSION.jar <argument>
 {noformat}
 
+The argument is either a configuration file or a JSON or YAML string. See [[Configuration|configuration.html]] for details.
+
+h2. Deploying
+
 Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper
 (see the figure below). Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more
 ZooKeeper clusters. The Curator Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by ID.
@@ -20,4 +26,6 @@ How you configure your server to launch depends on your environment and other ne
 * [One-JAR|http://one-jar.sourceforge.net/]
 * [Capsule|https://github.com/puniverse/capsule]
 
+h2. Topology
+
 !images/topology.png!

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/site/confluence/index.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
index ece5769..f29aff9 100644
--- a/curator-x-rpc/src/site/confluence/index.confluence
+++ b/curator-x-rpc/src/site/confluence/index.confluence
@@ -2,30 +2,31 @@ h1. Curator RPC Proxy
 
 NOTE: Curator RPC Proxy is in its own package in Maven Central: curator\-x\-rpc
 
-The Curator RPC module implements a proxy that bridges non-java environments with the Curator framework and recipes. It uses
+The Curator RPC module implements a proxy that bridges non\-java environments with the Curator framework and recipes. It uses
 [[Apache Thrift|http://thrift.apache.org]] which supports a large set of languages and environments.
 
+The benefits of Curator RPC are:
+
+* Gives access to Curator to non JVM languages/environments
+** Curator has become the de\-facto JVM client library for ZooKeeper
+** Curator makes using Apache ZooKeeper much easier
+** Curator contains well\-tested recipes for many common ZooKeeper usages
+* Organizations can unify their ZooKeeper usage across languages/environments (i.e. use Curator's Service Discovery recipe)
+* The quality of ZooKeeper clients for some non\-JVM languages is lacking
+* There are Thrift implementations for a large number of languages/environments
+
 h2. Thrift File
 The current Curator RPC Thrift File can be found here: [[https://raw.githubusercontent.com/apache/curator/master/curator-x-rpc/src/main/thrift/curator.thrift]]. Use
 this to generate code for the language/environment you need.
 
-h2. Building and Packaging
-
-See the [[Building and Packaging Page|build.html]] for details on building and packaging the REST proxy.
-
 h2. Deployment
 
-See the [[Deployment Page|deploy.html]] for details on deploying the REST proxy.
-
-h2. Your REST Client
-
-See the [[REST Client|client.html]] for details on how to write a REST client that interacts with the proxy.
-
-h2. APIs
+See the [[Deployment Page|deploy.html]] for details on deploying the RPC proxy.
 
-See the [[APIs Page|apis.html]] for list of available APIs.
+h2. Usage
 
-h2. Entities
+See the [[Usage Page|usage.html]] for details on using the RPC proxy.
 
-See the [[Entity Descriptions Page|entities.html]] for details on the Entities used in the APIs.
+h2. Configuration
 
+See the [[Configuration|configuration.html]] for details on configuring the RPC proxy.

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
new file mode 100644
index 0000000..a20c13f
--- /dev/null
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -0,0 +1,27 @@
+[[Curator RPC Proxy|index.html]] / Usage
+
+h1. Usage
+
+h2. Thrift File
+
+The first step in using the RPC Proxy is to process the Curator RPC Thrift file into your desired language/environment.
+The current Curator RPC Thrift File can be found here: [[https://raw.githubusercontent.com/apache/curator/master/curator-x-rpc/src/main/thrift/curator.thrift]].
+Details on using Apache Thrift can be found here: [[http://thrift.apache.org]].
+
+h2. Prerequisites
+
+It's assumed you already familiar with ZooKeeper and Curator. Also, familiarity with writing Thrift applications is helpful.
+
+h2. Services
+
+Three Thrift Services are included with the Curator RPC:
+
+||Service||Description||
+|CuratorService|The main service for accessing the Curator APIs and recipes|
+|EventService|Used to receive out-of-band messages for callbacks, watchers, etc|
+|DiscoveryService|Curator's ServiceDiscovery recipe|
+
+h2. Concepts
+
+_Projections - Many of the Curator RPC APIs refer to "projections" (e.g. CuratorProjection). A projection is an id that refers
+to a real object instance inside of the RPC server.

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
deleted file mode 100644
index 43a2ffc..0000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc;
-
-import org.apache.curator.generated.*;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TSocket;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.concurrent.Executors;
-
-public class TestClient
-{
-    public static void main(String[] args) throws Exception
-    {
-        TSocket clientTransport = new TSocket("localhost", 8899);
-        clientTransport.open();
-        TProtocol clientProtocol = new TBinaryProtocol(clientTransport);
-        final CuratorService.Client client = new CuratorService.Client(clientProtocol);
-
-        TSocket eventTransport = new TSocket("localhost", 8899);
-        eventTransport.open();
-        TProtocol eventProtocol = new TBinaryProtocol(eventTransport);
-        final EventService.Client serviceClient = new EventService.Client(eventProtocol);
-
-        TSocket discoveryTransport = new TSocket("localhost", 8899);
-        discoveryTransport.open();
-        TProtocol discoveryProtocol = new TBinaryProtocol(discoveryTransport);
-        final DiscoveryService.Client discoveryClient = new DiscoveryService.Client(discoveryProtocol);
-
-        final CuratorProjection curatorProjection = client.newCuratorProjection("test");
-
-        Executors.newSingleThreadExecutor().submit
-        (
-            new Runnable()
-            {
-                @Override
-                public void run()
-                {
-                    try
-                    {
-                        //noinspection InfiniteLoopStatement
-                        for(;;)
-                        {
-                            CuratorEvent nextEvent = serviceClient.getNextEvent(curatorProjection);
-                            System.out.println(nextEvent);
-                        }
-                    }
-                    catch ( TException e )
-                    {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        );
-
-        CreateSpec createSpec = new CreateSpec();
-        createSpec.path = "/this/should/fail";
-        createSpec.data = ByteBuffer.wrap("hey".getBytes());
-        try
-        {
-            client.createNode(curatorProjection, createSpec);
-        }
-        catch ( CuratorException e )
-        {
-            System.out.println("Ex: " + e);
-        }
-
-        createSpec = new CreateSpec();
-        createSpec.path = "/a/b/c";
-        createSpec.creatingParentsIfNeeded = true;
-        createSpec.data = ByteBuffer.wrap("hey".getBytes());
-        OptionalPath path = client.createNode(curatorProjection, createSpec);
-        System.out.println("Path: " + path);
-
-        PathChildrenCacheProjection pathChildrenCacheProjection = client.startPathChildrenCache(curatorProjection, "/a/b", true, false, PathChildrenCacheStartMode.BUILD_INITIAL_CACHE);
-
-        NodeCacheProjection nodeCache = client.startNodeCache(curatorProjection, "/a/b/c", false, true);
-        ChildData nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
-        System.out.println("nodeCacheData: " + nodeCacheData);
-
-        List<ChildData> pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
-        System.out.println("Child data: " + pathChildrenCacheData);
-
-        GetChildrenSpec getChildrenSpec = new GetChildrenSpec();
-        getChildrenSpec.path = "/a";
-        OptionalChildrenList children = client.getChildren(curatorProjection, getChildrenSpec);
-        System.out.println("Children: " + children);
-
-        ChildData pathChildrenCacheDataForPath = client.getPathChildrenCacheDataForPath(curatorProjection, pathChildrenCacheProjection, "/a/b/c");
-        System.out.println(pathChildrenCacheDataForPath);
-
-        LockProjection lockId = client.acquireLock(curatorProjection, "/mylock", 1000);
-        client.closeGenericProjection(curatorProjection, lockId.id);
-
-        GetDataSpec getDataSpec = new GetDataSpec();
-        getDataSpec.watched = true;
-        getDataSpec.path = "/a/b/c";
-        ByteBuffer data = client.getData(curatorProjection, getDataSpec);
-        System.out.println("getData: " + new String(data.array()));
-
-        ExistsSpec existsSpec = new ExistsSpec();
-        existsSpec.path = "/a/b/c";
-        System.out.println("exists: " + client.exists(curatorProjection, existsSpec));
-
-        DeleteSpec deleteSpec = new DeleteSpec();
-        deleteSpec.path = "/a/b/c";
-        client.deleteNode(curatorProjection, deleteSpec);
-
-        System.out.println("exists: " + client.exists(curatorProjection, existsSpec));
-
-        LeaderResult leader = client.startLeaderSelector(curatorProjection, "/leader", "me", 10000);
-        System.out.println("Has Leader: " + leader.hasLeadership);
-
-        List<Participant> leaderParticipants = client.getLeaderParticipants(curatorProjection, leader.projection);
-        System.out.println("Participants: " + leaderParticipants);
-
-        boolean isLeader = client.isLeader(curatorProjection, leader.projection);
-        System.out.println("isLeader: " + isLeader);
-
-        client.closeGenericProjection(curatorProjection, leader.projection.id);
-
-        pathChildrenCacheData = client.getPathChildrenCacheData(curatorProjection, pathChildrenCacheProjection);
-        System.out.println("Child data: " + pathChildrenCacheData);
-
-        nodeCacheData = client.getNodeCacheData(curatorProjection, nodeCache);
-        System.out.println("nodeCacheData: " + nodeCacheData);
-
-        PersistentEphemeralNodeProjection node = client.startPersistentEphemeralNode(curatorProjection, "/my/path", ByteBuffer.wrap("hey".getBytes()), PersistentEphemeralNodeMode.EPHEMERAL);
-        existsSpec.path = "/my/path";
-        OptionalStat nodeExists = client.exists(curatorProjection, existsSpec);
-        System.out.println("nodeExists: " + nodeExists);
-        client.closeGenericProjection(curatorProjection, node.id);
-
-        List<LeaseProjection> leaseProjections = client.startSemaphore(curatorProjection, "/semi", 3, 1000, 10);
-        System.out.println("leaseProjections: " + leaseProjections);
-        for ( LeaseProjection leaseProjection : leaseProjections )
-        {
-            client.closeGenericProjection(curatorProjection, leaseProjection.id);
-        }
-
-        DiscoveryInstance yourInstance = discoveryClient.makeDiscoveryInstance("mine", ByteBuffer.wrap(new byte[]{}), 8080);
-        DiscoveryProjection discovery = discoveryClient.startDiscovery(curatorProjection, "/discovery", yourInstance);
-        DiscoveryProviderProjection provider = discoveryClient.startProvider(curatorProjection, discovery, "mine", ProviderStrategyType.ROUND_ROBIN, 1000, 3);
-
-        DiscoveryInstance instance = discoveryClient.getInstance(curatorProjection, provider);
-        System.out.println("Instance: " + instance);
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
deleted file mode 100644
index 3564777..0000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestServer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc;
-
-import com.google.common.io.Resources;
-import org.apache.curator.test.TestingServer;
-import java.nio.charset.Charset;
-
-public class TestServer
-{
-    public static void main(String[] args) throws Exception
-    {
-        new TestingServer(2181);
-
-        String configurationSource = Resources.toString(Resources.getResource("configuration/test.json"), Charset.defaultCharset());
-        CuratorProjectionServer.main(new String[]{configurationSource});
-    }
-}

http://git-wip-us.apache.org/repos/asf/curator/blob/78460f90/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
deleted file mode 100644
index 4ecec35..0000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/configuration/TestConfigurationBuilder.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import ch.qos.logback.classic.Level;
-import com.google.common.collect.Sets;
-import com.google.common.io.Resources;
-import io.airlift.units.Duration;
-import io.dropwizard.logging.AppenderFactory;
-import org.apache.curator.retry.ExponentialBackoffRetry;
-import org.apache.curator.retry.RetryNTimes;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-public class TestConfigurationBuilder
-{
-    @Test
-    public void testSimple() throws Exception
-    {
-        Configuration configuration = loadTestConfiguration("configuration/simple.json");
-        Assert.assertEquals(configuration.getThrift().getPort(), 1234);
-        Assert.assertEquals(configuration.getPingTime(), new Duration(10, TimeUnit.SECONDS));
-    }
-
-    @Test
-    public void testLogging() throws Exception
-    {
-        Configuration configuration = loadTestConfiguration("configuration/logging.json");
-        Assert.assertEquals(configuration.getLogging().getLevel(), Level.INFO);
-        Assert.assertEquals(configuration.getLogging().getAppenders().size(), 2);
-
-        Set<String> types = Sets.newHashSet();
-        for ( AppenderFactory appenderFactory : configuration.getLogging().getAppenders() )
-        {
-            types.add(appenderFactory.getClass().getSimpleName());
-        }
-        Assert.assertEquals(types, Sets.newHashSet("FileAppenderFactory", "ConsoleAppenderFactory"));
-    }
-
-    @Test
-    public void testConnections() throws Exception
-    {
-        Configuration configuration = loadTestConfiguration("configuration/connections.json");
-        Assert.assertEquals(configuration.getConnections().size(), 2);
-
-        Assert.assertEquals(configuration.getConnections().get(0).getName(), "test");
-        Assert.assertEquals(configuration.getConnections().get(0).getConnectionString(), "one:1,two:2");
-        Assert.assertEquals(configuration.getConnections().get(0).getConnectionTimeout(), new Duration(20, TimeUnit.SECONDS));
-        Assert.assertEquals(configuration.getConnections().get(0).getRetry().build().getClass(), ExponentialBackoffRetry.class);
-
-        Assert.assertEquals(configuration.getConnections().get(1).getName(), "alt");
-        Assert.assertEquals(configuration.getConnections().get(1).getConnectionString(), "three:3,four:4");
-        Assert.assertEquals(configuration.getConnections().get(1).getConnectionTimeout(), new Duration(30, TimeUnit.SECONDS));
-        Assert.assertEquals(configuration.getConnections().get(1).getRetry().build().getClass(), RetryNTimes.class);
-    }
-
-    private Configuration loadTestConfiguration(String name) throws Exception
-    {
-        URL resource = Resources.getResource(name);
-        String source = Resources.toString(resource, Charset.defaultCharset());
-        return new ConfigurationBuilder(source).build();
-    }
-}


[25/50] [abbrv] git commit: some testing of service discovery

Posted by ra...@apache.org.
some testing of service discovery


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bdc595a6
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bdc595a6
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bdc595a6

Branch: refs/heads/master
Commit: bdc595a69574b12eccb093687ae331bc43002ef6
Parents: 2998114
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 23:08:47 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 23:08:47 2014 -0500

----------------------------------------------------------------------
 .../curator/x/discovery/ServiceInstance.java    |    2 +-
 .../x/rpc/idl/discovery/DiscoveryInstance.java  |   11 +-
 .../x/rpc/idl/discovery/DiscoveryService.java   |   29 +-
 .../idl/discovery/DiscoveryServiceLowLevel.java |    4 +-
 .../idl/services/CuratorProjectionService.java  |    3 +-
 .../x/rpc/idl/structs/RpcCuratorEvent.java      |    2 +-
 curator-x-rpc/src/main/thrift/curator.thrift    |    1 +
 .../curator/generated/DiscoveryService.java     | 1177 ++++++++++++++++++
 .../org/apache/curator/x/rpc/TestClient.java    |   12 +
 9 files changed, 1228 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
index 29779b1..939e708 100644
--- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
+++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstance.java
@@ -50,7 +50,7 @@ public class ServiceInstance<T>
      * @return builder
      * @throws Exception errors getting the local IP
      */
-    public static<T> ServiceInstanceBuilder<T> builder() throws Exception
+    public static<T> ServiceInstanceBuilder<T>builder() throws Exception
     {
         String                  address = null;
         Collection<InetAddress> ips = ServiceInstanceBuilder.getAllLocalIPs();

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
index a6f35cd..69bfdf8 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
@@ -2,6 +2,7 @@ package org.apache.curator.x.rpc.idl.discovery;
 
 import com.facebook.swift.codec.ThriftField;
 import com.facebook.swift.codec.ThriftStruct;
+import com.google.common.base.Objects;
 import org.apache.curator.x.discovery.ServiceInstance;
 import org.apache.curator.x.discovery.ServiceType;
 import org.apache.curator.x.discovery.UriSpec;
@@ -19,10 +20,10 @@ public class DiscoveryInstance
     public String address;
 
     @ThriftField(4)
-    public Integer port;
+    public int port;
 
     @ThriftField(5)
-    public Integer sslPort;
+    public int sslPort;
 
     @ThriftField(6)
     public byte[] payload;
@@ -47,8 +48,8 @@ public class DiscoveryInstance
             this.name = instance.getName();
             this.id = instance.getId();
             this.address = instance.getAddress();
-            this.port = instance.getPort();
-            this.sslPort = instance.getSslPort();
+            this.port = Objects.firstNonNull(instance.getPort(), 0);
+            this.sslPort = Objects.firstNonNull(instance.getSslPort(), 0);
             this.payload = instance.getPayload();
             this.registrationTimeUTC = instance.getRegistrationTimeUTC();
             this.serviceType = DiscoveryInstanceType.valueOf(instance.getServiceType().name());
@@ -56,7 +57,7 @@ public class DiscoveryInstance
         }
     }
 
-    public DiscoveryInstance(String name, String id, String address, Integer port, Integer sslPort, byte[] payload, long registrationTimeUTC, DiscoveryInstanceType serviceType, String uriSpec)
+    public DiscoveryInstance(String name, String id, String address, int port, int sslPort, byte[] payload, long registrationTimeUTC, DiscoveryInstanceType serviceType, String uriSpec)
     {
         this.name = name;
         this.id = id;

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
index a85f113..d4a6645 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -11,6 +11,7 @@ import org.apache.curator.x.discovery.ServiceDiscovery;
 import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
 import org.apache.curator.x.discovery.ServiceInstance;
 import org.apache.curator.x.discovery.ServiceProvider;
+import org.apache.curator.x.discovery.ServiceType;
 import org.apache.curator.x.discovery.strategies.RandomStrategy;
 import org.apache.curator.x.discovery.strategies.RoundRobinStrategy;
 import org.apache.curator.x.discovery.strategies.StickyStrategy;
@@ -23,7 +24,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.util.Collection;
-import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 @ThriftService
@@ -38,6 +38,25 @@ public class DiscoveryService
     }
 
     @ThriftMethod
+    public DiscoveryInstance makeDiscoveryInstance(String name, byte[] payload, int port) throws RpcException
+    {
+        try
+        {
+            ServiceInstance<byte[]> serviceInstance = ServiceInstance.<byte[]>builder()
+                .serviceType(ServiceType.DYNAMIC)
+                .name(name)
+                .payload(payload)
+                .port(port)
+                .build();
+            return new DiscoveryInstance(serviceInstance);
+        }
+        catch ( Exception e )
+        {
+            throw new RpcException(e);
+        }
+    }
+
+    @ThriftMethod
     public DiscoveryProjection startDiscovery(CuratorProjection projection, final String basePath, DiscoveryInstance yourInstance) throws RpcException
     {
         try
@@ -79,7 +98,7 @@ public class DiscoveryService
     @ThriftMethod
     public DiscoveryProviderProjection startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, final String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws RpcException
     {
-        ProviderStrategy<byte[]> strategy = null;
+        ProviderStrategy<byte[]> strategy;
         switch ( providerStrategy )
         {
             default:
@@ -169,7 +188,7 @@ public class DiscoveryService
         try
         {
             Collection<ServiceInstance<byte[]>> allInstances = serviceProvider.getAllInstances();
-            return Collections2.transform
+            Collection<DiscoveryInstance> transformed = Collections2.transform
             (
                 allInstances,
                 new Function<ServiceInstance<byte[]>, DiscoveryInstance>()
@@ -179,7 +198,9 @@ public class DiscoveryService
                     {
                         return new DiscoveryInstance(instance);
                     }
-                });
+                }
+            );
+            return Lists.newArrayList(transformed);
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
index 4c6945f..7030931 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
@@ -4,6 +4,7 @@ import com.facebook.swift.service.ThriftMethod;
 import com.facebook.swift.service.ThriftService;
 import com.google.common.base.Function;
 import com.google.common.collect.Collections2;
+import com.google.common.collect.Lists;
 import org.apache.curator.x.discovery.ServiceDiscovery;
 import org.apache.curator.x.discovery.ServiceInstance;
 import org.apache.curator.x.rpc.connections.ConnectionManager;
@@ -111,7 +112,7 @@ public class DiscoveryServiceLowLevel
         try
         {
             Collection<ServiceInstance<byte[]>> instances = serviceDiscovery.queryForInstances(name);
-            return Collections2.transform
+            Collection<DiscoveryInstance> transformed = Collections2.transform
             (
                 instances,
                 new Function<ServiceInstance<byte[]>, DiscoveryInstance>()
@@ -123,6 +124,7 @@ public class DiscoveryServiceLowLevel
                     }
                 }
             );
+            return Lists.newArrayList(transformed);
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
index d218e7b..ca5a604 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
@@ -431,7 +431,7 @@ public class CuratorProjectionService
 
             LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
             Collection<Participant> participants = leaderLatch.getParticipants();
-            return Collections2.transform
+            Collection<RpcParticipant> transformed = Collections2.transform
             (
                 participants,
                 new Function<Participant, RpcParticipant>()
@@ -443,6 +443,7 @@ public class CuratorProjectionService
                     }
                 }
             );
+            return Lists.newArrayList(transformed);
         }
         catch ( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
index 52d18df..18591a5 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
@@ -136,7 +136,7 @@ public class RpcCuratorEvent
 
     public RpcCuratorEvent(ConnectionState newState)
     {
-        this.type = RpcCuratorEventType.valueOf(newState.name());
+        this.type = RpcCuratorEventType.valueOf("CONNECTION_" + newState.name());
         this.resultCode = 0;
         this.path = null;
         this.context = null;

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/main/thrift/curator.thrift
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
index 11e5edb..49b860d 100644
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ b/curator-x-rpc/src/main/thrift/curator.thrift
@@ -272,6 +272,7 @@ service EventService {
 service DiscoveryService {
   list<DiscoveryInstance> getAllInstances(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
   DiscoveryInstance getInstance(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
+  DiscoveryInstance makeDiscoveryInstance(1: string name, 2: binary payload, 3: i32 port) throws (1: CuratorException ex1);
   void noteError(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection, 3: string instanceId) throws (1: CuratorException ex1);
   DiscoveryProjection startDiscovery(1: CuratorProjection projection, 2: string basePath, 3: DiscoveryInstance yourInstance) throws (1: CuratorException ex1);
   DiscoveryProviderProjection startProvider(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string serviceName, 4: ProviderStrategyType providerStrategy, 5: i32 downTimeoutMs, 6: i32 downErrorThreshold) throws (1: CuratorException ex1);

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
index 37fbee4..7e64f0f 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/generated/DiscoveryService.java
@@ -40,6 +40,8 @@ public class DiscoveryService {
 
     public DiscoveryInstance getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws CuratorException, org.apache.thrift.TException;
 
+    public DiscoveryInstance makeDiscoveryInstance(String name, ByteBuffer payload, int port) throws CuratorException, org.apache.thrift.TException;
+
     public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws CuratorException, org.apache.thrift.TException;
 
     public DiscoveryProjection startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance) throws CuratorException, org.apache.thrift.TException;
@@ -54,6 +56,8 @@ public class DiscoveryService {
 
     public void getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
+    public void makeDiscoveryInstance(String name, ByteBuffer payload, int port, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
     public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void startDiscovery(CuratorProjection projection, String basePath, DiscoveryInstance yourInstance, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -136,6 +140,34 @@ public class DiscoveryService {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInstance failed: unknown result");
     }
 
+    public DiscoveryInstance makeDiscoveryInstance(String name, ByteBuffer payload, int port) throws CuratorException, org.apache.thrift.TException
+    {
+      send_makeDiscoveryInstance(name, payload, port);
+      return recv_makeDiscoveryInstance();
+    }
+
+    public void send_makeDiscoveryInstance(String name, ByteBuffer payload, int port) throws org.apache.thrift.TException
+    {
+      makeDiscoveryInstance_args args = new makeDiscoveryInstance_args();
+      args.setName(name);
+      args.setPayload(payload);
+      args.setPort(port);
+      sendBase("makeDiscoveryInstance", args);
+    }
+
+    public DiscoveryInstance recv_makeDiscoveryInstance() throws CuratorException, org.apache.thrift.TException
+    {
+      makeDiscoveryInstance_result result = new makeDiscoveryInstance_result();
+      receiveBase(result, "makeDiscoveryInstance");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      if (result.ex1 != null) {
+        throw result.ex1;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "makeDiscoveryInstance failed: unknown result");
+    }
+
     public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws CuratorException, org.apache.thrift.TException
     {
       send_noteError(projection, providerProjection, instanceId);
@@ -308,6 +340,44 @@ public class DiscoveryService {
       }
     }
 
+    public void makeDiscoveryInstance(String name, ByteBuffer payload, int port, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      makeDiscoveryInstance_call method_call = new makeDiscoveryInstance_call(name, payload, port, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class makeDiscoveryInstance_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String name;
+      private ByteBuffer payload;
+      private int port;
+      public makeDiscoveryInstance_call(String name, ByteBuffer payload, int port, 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.name = name;
+        this.payload = payload;
+        this.port = port;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("makeDiscoveryInstance", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        makeDiscoveryInstance_args args = new makeDiscoveryInstance_args();
+        args.setName(name);
+        args.setPayload(payload);
+        args.setPort(port);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public DiscoveryInstance getResult() throws CuratorException, 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_makeDiscoveryInstance();
+      }
+    }
+
     public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
       noteError_call method_call = new noteError_call(projection, providerProjection, instanceId, resultHandler, this, ___protocolFactory, ___transport);
@@ -446,6 +516,7 @@ public class DiscoveryService {
     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("getAllInstances", new getAllInstances());
       processMap.put("getInstance", new getInstance());
+      processMap.put("makeDiscoveryInstance", new makeDiscoveryInstance());
       processMap.put("noteError", new noteError());
       processMap.put("startDiscovery", new startDiscovery());
       processMap.put("startProvider", new startProvider());
@@ -500,6 +571,30 @@ public class DiscoveryService {
       }
     }
 
+    public static class makeDiscoveryInstance<I extends Iface> extends org.apache.thrift.ProcessFunction<I, makeDiscoveryInstance_args> {
+      public makeDiscoveryInstance() {
+        super("makeDiscoveryInstance");
+      }
+
+      public makeDiscoveryInstance_args getEmptyArgsInstance() {
+        return new makeDiscoveryInstance_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public makeDiscoveryInstance_result getResult(I iface, makeDiscoveryInstance_args args) throws org.apache.thrift.TException {
+        makeDiscoveryInstance_result result = new makeDiscoveryInstance_result();
+        try {
+          result.success = iface.makeDiscoveryInstance(args.name, args.payload, args.port);
+        } catch (CuratorException ex1) {
+          result.ex1 = ex1;
+        }
+        return result;
+      }
+    }
+
     public static class noteError<I extends Iface> extends org.apache.thrift.ProcessFunction<I, noteError_args> {
       public noteError() {
         super("noteError");
@@ -587,6 +682,7 @@ public class DiscoveryService {
     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("getAllInstances", new getAllInstances());
       processMap.put("getInstance", new getInstance());
+      processMap.put("makeDiscoveryInstance", new makeDiscoveryInstance());
       processMap.put("noteError", new noteError());
       processMap.put("startDiscovery", new startDiscovery());
       processMap.put("startProvider", new startProvider());
@@ -707,6 +803,63 @@ public class DiscoveryService {
       }
     }
 
+    public static class makeDiscoveryInstance<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, makeDiscoveryInstance_args, DiscoveryInstance> {
+      public makeDiscoveryInstance() {
+        super("makeDiscoveryInstance");
+      }
+
+      public makeDiscoveryInstance_args getEmptyArgsInstance() {
+        return new makeDiscoveryInstance_args();
+      }
+
+      public AsyncMethodCallback<DiscoveryInstance> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<DiscoveryInstance>() { 
+          public void onComplete(DiscoveryInstance o) {
+            makeDiscoveryInstance_result result = new makeDiscoveryInstance_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;
+            makeDiscoveryInstance_result result = new makeDiscoveryInstance_result();
+            if (e instanceof CuratorException) {
+                        result.ex1 = (CuratorException) e;
+                        result.setEx1IsSet(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, makeDiscoveryInstance_args args, org.apache.thrift.async.AsyncMethodCallback<DiscoveryInstance> resultHandler) throws TException {
+        iface.makeDiscoveryInstance(args.name, args.payload, args.port,resultHandler);
+      }
+    }
+
     public static class noteError<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, noteError_args, Void> {
       public noteError() {
         super("noteError");
@@ -2778,6 +2931,1030 @@ public class DiscoveryService {
 
   }
 
+  public static class makeDiscoveryInstance_args implements org.apache.thrift.TBase<makeDiscoveryInstance_args, makeDiscoveryInstance_args._Fields>, java.io.Serializable, Cloneable, Comparable<makeDiscoveryInstance_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("makeDiscoveryInstance_args");
+
+    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
+    private static final org.apache.thrift.protocol.TField PAYLOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("payload", org.apache.thrift.protocol.TType.STRING, (short)2);
+    private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)3);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new makeDiscoveryInstance_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new makeDiscoveryInstance_argsTupleSchemeFactory());
+    }
+
+    public String name; // required
+    public ByteBuffer payload; // required
+    public int port; // 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 {
+      NAME((short)1, "name"),
+      PAYLOAD((short)2, "payload"),
+      PORT((short)3, "port");
+
+      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: // NAME
+            return NAME;
+          case 2: // PAYLOAD
+            return PAYLOAD;
+          case 3: // PORT
+            return PORT;
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+
+    // isset id assignments
+    private static final int __PORT_ISSET_ID = 0;
+    private byte __isset_bitfield = 0;
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.PAYLOAD, new org.apache.thrift.meta_data.FieldMetaData("payload", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING          , true)));
+      tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(makeDiscoveryInstance_args.class, metaDataMap);
+    }
+
+    public makeDiscoveryInstance_args() {
+    }
+
+    public makeDiscoveryInstance_args(
+      String name,
+      ByteBuffer payload,
+      int port)
+    {
+      this();
+      this.name = name;
+      this.payload = payload;
+      this.port = port;
+      setPortIsSet(true);
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public makeDiscoveryInstance_args(makeDiscoveryInstance_args other) {
+      __isset_bitfield = other.__isset_bitfield;
+      if (other.isSetName()) {
+        this.name = other.name;
+      }
+      if (other.isSetPayload()) {
+        this.payload = org.apache.thrift.TBaseHelper.copyBinary(other.payload);
+;
+      }
+      this.port = other.port;
+    }
+
+    public makeDiscoveryInstance_args deepCopy() {
+      return new makeDiscoveryInstance_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.name = null;
+      this.payload = null;
+      setPortIsSet(false);
+      this.port = 0;
+    }
+
+    public String getName() {
+      return this.name;
+    }
+
+    public makeDiscoveryInstance_args setName(String name) {
+      this.name = name;
+      return this;
+    }
+
+    public void unsetName() {
+      this.name = null;
+    }
+
+    /** Returns true if field name is set (has been assigned a value) and false otherwise */
+    public boolean isSetName() {
+      return this.name != null;
+    }
+
+    public void setNameIsSet(boolean value) {
+      if (!value) {
+        this.name = null;
+      }
+    }
+
+    public byte[] getPayload() {
+      setPayload(org.apache.thrift.TBaseHelper.rightSize(payload));
+      return payload == null ? null : payload.array();
+    }
+
+    public ByteBuffer bufferForPayload() {
+      return payload;
+    }
+
+    public makeDiscoveryInstance_args setPayload(byte[] payload) {
+      setPayload(payload == null ? (ByteBuffer)null : ByteBuffer.wrap(payload));
+      return this;
+    }
+
+    public makeDiscoveryInstance_args setPayload(ByteBuffer payload) {
+      this.payload = payload;
+      return this;
+    }
+
+    public void unsetPayload() {
+      this.payload = null;
+    }
+
+    /** Returns true if field payload is set (has been assigned a value) and false otherwise */
+    public boolean isSetPayload() {
+      return this.payload != null;
+    }
+
+    public void setPayloadIsSet(boolean value) {
+      if (!value) {
+        this.payload = null;
+      }
+    }
+
+    public int getPort() {
+      return this.port;
+    }
+
+    public makeDiscoveryInstance_args setPort(int port) {
+      this.port = port;
+      setPortIsSet(true);
+      return this;
+    }
+
+    public void unsetPort() {
+      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
+    }
+
+    /** Returns true if field port is set (has been assigned a value) and false otherwise */
+    public boolean isSetPort() {
+      return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
+    }
+
+    public void setPortIsSet(boolean value) {
+      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case NAME:
+        if (value == null) {
+          unsetName();
+        } else {
+          setName((String)value);
+        }
+        break;
+
+      case PAYLOAD:
+        if (value == null) {
+          unsetPayload();
+        } else {
+          setPayload((ByteBuffer)value);
+        }
+        break;
+
+      case PORT:
+        if (value == null) {
+          unsetPort();
+        } else {
+          setPort((Integer)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case NAME:
+        return getName();
+
+      case PAYLOAD:
+        return getPayload();
+
+      case PORT:
+        return Integer.valueOf(getPort());
+
+      }
+      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 NAME:
+        return isSetName();
+      case PAYLOAD:
+        return isSetPayload();
+      case PORT:
+        return isSetPort();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof makeDiscoveryInstance_args)
+        return this.equals((makeDiscoveryInstance_args)that);
+      return false;
+    }
+
+    public boolean equals(makeDiscoveryInstance_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_name = true && this.isSetName();
+      boolean that_present_name = true && that.isSetName();
+      if (this_present_name || that_present_name) {
+        if (!(this_present_name && that_present_name))
+          return false;
+        if (!this.name.equals(that.name))
+          return false;
+      }
+
+      boolean this_present_payload = true && this.isSetPayload();
+      boolean that_present_payload = true && that.isSetPayload();
+      if (this_present_payload || that_present_payload) {
+        if (!(this_present_payload && that_present_payload))
+          return false;
+        if (!this.payload.equals(that.payload))
+          return false;
+      }
+
+      boolean this_present_port = true;
+      boolean that_present_port = true;
+      if (this_present_port || that_present_port) {
+        if (!(this_present_port && that_present_port))
+          return false;
+        if (this.port != that.port)
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(makeDiscoveryInstance_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetName()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPayload()).compareTo(other.isSetPayload());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPayload()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payload, other.payload);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetPort()).compareTo(other.isSetPort());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetPort()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
+        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("makeDiscoveryInstance_args(");
+      boolean first = true;
+
+      sb.append("name:");
+      if (this.name == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.name);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("payload:");
+      if (this.payload == null) {
+        sb.append("null");
+      } else {
+        org.apache.thrift.TBaseHelper.toString(this.payload, sb);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("port:");
+      sb.append(this.port);
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
+        __isset_bitfield = 0;
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class makeDiscoveryInstance_argsStandardSchemeFactory implements SchemeFactory {
+      public makeDiscoveryInstance_argsStandardScheme getScheme() {
+        return new makeDiscoveryInstance_argsStandardScheme();
+      }
+    }
+
+    private static class makeDiscoveryInstance_argsStandardScheme extends StandardScheme<makeDiscoveryInstance_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, makeDiscoveryInstance_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: // NAME
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.name = iprot.readString();
+                struct.setNameIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // PAYLOAD
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.payload = iprot.readBinary();
+                struct.setPayloadIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 3: // PORT
+              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+                struct.port = iprot.readI32();
+                struct.setPortIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, makeDiscoveryInstance_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.name != null) {
+          oprot.writeFieldBegin(NAME_FIELD_DESC);
+          oprot.writeString(struct.name);
+          oprot.writeFieldEnd();
+        }
+        if (struct.payload != null) {
+          oprot.writeFieldBegin(PAYLOAD_FIELD_DESC);
+          oprot.writeBinary(struct.payload);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldBegin(PORT_FIELD_DESC);
+        oprot.writeI32(struct.port);
+        oprot.writeFieldEnd();
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class makeDiscoveryInstance_argsTupleSchemeFactory implements SchemeFactory {
+      public makeDiscoveryInstance_argsTupleScheme getScheme() {
+        return new makeDiscoveryInstance_argsTupleScheme();
+      }
+    }
+
+    private static class makeDiscoveryInstance_argsTupleScheme extends TupleScheme<makeDiscoveryInstance_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, makeDiscoveryInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetName()) {
+          optionals.set(0);
+        }
+        if (struct.isSetPayload()) {
+          optionals.set(1);
+        }
+        if (struct.isSetPort()) {
+          optionals.set(2);
+        }
+        oprot.writeBitSet(optionals, 3);
+        if (struct.isSetName()) {
+          oprot.writeString(struct.name);
+        }
+        if (struct.isSetPayload()) {
+          oprot.writeBinary(struct.payload);
+        }
+        if (struct.isSetPort()) {
+          oprot.writeI32(struct.port);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, makeDiscoveryInstance_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(3);
+        if (incoming.get(0)) {
+          struct.name = iprot.readString();
+          struct.setNameIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.payload = iprot.readBinary();
+          struct.setPayloadIsSet(true);
+        }
+        if (incoming.get(2)) {
+          struct.port = iprot.readI32();
+          struct.setPortIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class makeDiscoveryInstance_result implements org.apache.thrift.TBase<makeDiscoveryInstance_result, makeDiscoveryInstance_result._Fields>, java.io.Serializable, Cloneable, Comparable<makeDiscoveryInstance_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("makeDiscoveryInstance_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 EX1_FIELD_DESC = new org.apache.thrift.protocol.TField("ex1", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new makeDiscoveryInstance_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new makeDiscoveryInstance_resultTupleSchemeFactory());
+    }
+
+    public DiscoveryInstance success; // required
+    public CuratorException ex1; // 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"),
+      EX1((short)1, "ex1");
+
+      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: // EX1
+            return EX1;
+          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, DiscoveryInstance.class)));
+      tmpMap.put(_Fields.EX1, new org.apache.thrift.meta_data.FieldMetaData("ex1", 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(makeDiscoveryInstance_result.class, metaDataMap);
+    }
+
+    public makeDiscoveryInstance_result() {
+    }
+
+    public makeDiscoveryInstance_result(
+      DiscoveryInstance success,
+      CuratorException ex1)
+    {
+      this();
+      this.success = success;
+      this.ex1 = ex1;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public makeDiscoveryInstance_result(makeDiscoveryInstance_result other) {
+      if (other.isSetSuccess()) {
+        this.success = new DiscoveryInstance(other.success);
+      }
+      if (other.isSetEx1()) {
+        this.ex1 = new CuratorException(other.ex1);
+      }
+    }
+
+    public makeDiscoveryInstance_result deepCopy() {
+      return new makeDiscoveryInstance_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+      this.ex1 = null;
+    }
+
+    public DiscoveryInstance getSuccess() {
+      return this.success;
+    }
+
+    public makeDiscoveryInstance_result setSuccess(DiscoveryInstance success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public CuratorException getEx1() {
+      return this.ex1;
+    }
+
+    public makeDiscoveryInstance_result setEx1(CuratorException ex1) {
+      this.ex1 = ex1;
+      return this;
+    }
+
+    public void unsetEx1() {
+      this.ex1 = null;
+    }
+
+    /** Returns true if field ex1 is set (has been assigned a value) and false otherwise */
+    public boolean isSetEx1() {
+      return this.ex1 != null;
+    }
+
+    public void setEx1IsSet(boolean value) {
+      if (!value) {
+        this.ex1 = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((DiscoveryInstance)value);
+        }
+        break;
+
+      case EX1:
+        if (value == null) {
+          unsetEx1();
+        } else {
+          setEx1((CuratorException)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      case EX1:
+        return getEx1();
+
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      case SUCCESS:
+        return isSetSuccess();
+      case EX1:
+        return isSetEx1();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof makeDiscoveryInstance_result)
+        return this.equals((makeDiscoveryInstance_result)that);
+      return false;
+    }
+
+    public boolean equals(makeDiscoveryInstance_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      boolean this_present_ex1 = true && this.isSetEx1();
+      boolean that_present_ex1 = true && that.isSetEx1();
+      if (this_present_ex1 || that_present_ex1) {
+        if (!(this_present_ex1 && that_present_ex1))
+          return false;
+        if (!this.ex1.equals(that.ex1))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(makeDiscoveryInstance_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetEx1()).compareTo(other.isSetEx1());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetEx1()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex1, other.ex1);
+        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("makeDiscoveryInstance_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("ex1:");
+      if (this.ex1 == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.ex1);
+      }
+      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 makeDiscoveryInstance_resultStandardSchemeFactory implements SchemeFactory {
+      public makeDiscoveryInstance_resultStandardScheme getScheme() {
+        return new makeDiscoveryInstance_resultStandardScheme();
+      }
+    }
+
+    private static class makeDiscoveryInstance_resultStandardScheme extends StandardScheme<makeDiscoveryInstance_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, makeDiscoveryInstance_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 DiscoveryInstance();
+                struct.success.read(iprot);
+                struct.setSuccessIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 1: // EX1
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.ex1 = new CuratorException();
+                struct.ex1.read(iprot);
+                struct.setEx1IsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            default:
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.thrift.protocol.TProtocol oprot, makeDiscoveryInstance_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.ex1 != null) {
+          oprot.writeFieldBegin(EX1_FIELD_DESC);
+          struct.ex1.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class makeDiscoveryInstance_resultTupleSchemeFactory implements SchemeFactory {
+      public makeDiscoveryInstance_resultTupleScheme getScheme() {
+        return new makeDiscoveryInstance_resultTupleScheme();
+      }
+    }
+
+    private static class makeDiscoveryInstance_resultTupleScheme extends TupleScheme<makeDiscoveryInstance_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, makeDiscoveryInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        if (struct.isSetEx1()) {
+          optionals.set(1);
+        }
+        oprot.writeBitSet(optionals, 2);
+        if (struct.isSetSuccess()) {
+          struct.success.write(oprot);
+        }
+        if (struct.isSetEx1()) {
+          struct.ex1.write(oprot);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, makeDiscoveryInstance_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(2);
+        if (incoming.get(0)) {
+          struct.success = new DiscoveryInstance();
+          struct.success.read(iprot);
+          struct.setSuccessIsSet(true);
+        }
+        if (incoming.get(1)) {
+          struct.ex1 = new CuratorException();
+          struct.ex1.read(iprot);
+          struct.setEx1IsSet(true);
+        }
+      }
+    }
+
+  }
+
   public static class noteError_args implements org.apache.thrift.TBase<noteError_args, noteError_args._Fields>, java.io.Serializable, Cloneable, Comparable<noteError_args>   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("noteError_args");
 

http://git-wip-us.apache.org/repos/asf/curator/blob/bdc595a6/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
index dbd5643..43a2ffc 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/TestClient.java
@@ -41,6 +41,11 @@ public class TestClient
         TProtocol eventProtocol = new TBinaryProtocol(eventTransport);
         final EventService.Client serviceClient = new EventService.Client(eventProtocol);
 
+        TSocket discoveryTransport = new TSocket("localhost", 8899);
+        discoveryTransport.open();
+        TProtocol discoveryProtocol = new TBinaryProtocol(discoveryTransport);
+        final DiscoveryService.Client discoveryClient = new DiscoveryService.Client(discoveryProtocol);
+
         final CuratorProjection curatorProjection = client.newCuratorProjection("test");
 
         Executors.newSingleThreadExecutor().submit
@@ -151,5 +156,12 @@ public class TestClient
         {
             client.closeGenericProjection(curatorProjection, leaseProjection.id);
         }
+
+        DiscoveryInstance yourInstance = discoveryClient.makeDiscoveryInstance("mine", ByteBuffer.wrap(new byte[]{}), 8080);
+        DiscoveryProjection discovery = discoveryClient.startDiscovery(curatorProjection, "/discovery", yourInstance);
+        DiscoveryProviderProjection provider = discoveryClient.startProvider(curatorProjection, discovery, "mine", ProviderStrategyType.ROUND_ROBIN, 1000, 3);
+
+        DiscoveryInstance instance = discoveryClient.getInstance(curatorProjection, provider);
+        System.out.println("Instance: " + instance);
     }
 }


[42/50] [abbrv] git commit: test recoverable exceptions

Posted by ra...@apache.org.
test recoverable exceptions


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/29ef0c8c
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/29ef0c8c
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/29ef0c8c

Branch: refs/heads/master
Commit: 29ef0c8cb3f4092f24c2c99911a69d2805d7a2bd
Parents: 9077ad0
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 2 11:26:17 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 2 11:26:17 2014 -0500

----------------------------------------------------------------------
 .../java/org/apache/curator/x/rpc/RpcTests.java | 21 +++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/29ef0c8c/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
index 5a83b25..0862b11 100644
--- a/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
+++ b/curator-x-rpc/src/test/java/org/apache/curator/x/rpc/RpcTests.java
@@ -203,5 +203,24 @@ public class RpcTests extends BaseClassForTests
 
         service.shutdownNow();
     }
-}
 
+    @Test
+    public void testRecoverableException() throws Exception
+    {
+        CuratorProjection curatorProjection = curatorServiceClient.newCuratorProjection("test");
+        CreateSpec spec = new CreateSpec();
+        spec.path = "/this/wont/work";
+        spec.data = ByteBuffer.wrap("value".getBytes());
+        try
+        {
+            curatorServiceClient.createNode(curatorProjection, spec);
+            Assert.fail("Should have failed");
+        }
+        catch ( CuratorException e )
+        {
+            Assert.assertEquals(e.getType(), ExceptionType.NODE);
+            Assert.assertNotNull(e.nodeException);
+            Assert.assertEquals(e.nodeException, NodeExceptionType.NONODE);
+        }
+    }
+}


[37/50] [abbrv] git commit: reference doc wip

Posted by ra...@apache.org.
reference doc wip


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/673e6dce
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/673e6dce
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/673e6dce

Branch: refs/heads/master
Commit: 673e6dcee810b468bbf4398869ba641ad341ee5b
Parents: e118ad0
Author: randgalt <ra...@apache.org>
Authored: Sun Jun 1 14:36:46 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jun 1 14:36:46 2014 -0500

----------------------------------------------------------------------
 .../x/rpc/idl/discovery/DiscoveryService.java   |  2 +-
 .../src/site/confluence/reference.confluence    | 21 ++++++++++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/673e6dce/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
index 22083d8..ca9f4b0 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
@@ -84,7 +84,7 @@ public class DiscoveryService
                 .builder(byte[].class)
                 .basePath(basePath)
                 .client(entry.getClient())
-                .thisInstance(yourInstance.toReal())
+                .thisInstance((yourInstance != null) ? yourInstance.toReal() : null)
                 .build();
             serviceDiscovery.start();
 

http://git-wip-us.apache.org/repos/asf/curator/blob/673e6dce/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index 1a41800..d23e9e1 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -1,8 +1,8 @@
 [[Curator RPC Proxy|index.html]] / Reference
 
-h1. Reference
+h1. API and Struct Reference
 
-h2. CuratorService Reference
+h2. CuratorService
 
 ||API||Arguments||Return Value||Description||
 |newCuratorProjection|connectionName|CuratorProjection|Allocates a projection to a configured CuratorFramework instance in the RPC server. "connectionName" is the name of a [[configured|configuration.html]] connection.|
@@ -27,3 +27,20 @@ h2. CuratorService Reference
 |getNodeCacheData|node cache projection|ChildData|Return the data for the cached node. If the node doesn't exist, the fields of the ChildData object will be null.|
 |startPersistentEphemeralNode|path, data, mode|projection|Start a PersistentEphemeralNode for the given path using the given data and mode.|
 |acquireSemaphore|path, acquireQty, maxWaitMs, maxLeases|List of lease projections|Acquire one or more leases for a semaphore on the given path. acquireQty is the number of leases to acquire. maxWaitMs is the max time to wait to get the leases. maxLeases is the maximum leases to allow for the semaphore. If the number of leases cannot be acquired within the max time, an empty list is returned.|
+
+h2. EventService
+
+||API||Arguments||Return Value||Description||
+|getNextEvent|CuratorProjection|Returns the next queued event for the given CuratorProjection. If no events are queued within the [[configured|configuration.html]] ping time, a PING event is returned.|
+
+See the [[Events Page|events.html]] for the Event schema reference.
+
+h2. DiscoveryService
+
+||API||Arguments||Return Value||Description||
+|makeDiscoveryInstance|name, payload, port|DiscoveryInstance|Return a completed DiscoveryInstance using the RPC server's address and the given name, payload and port.|
+|startDiscovery|basePath, yourInstance|discovery projection|Start a Service Discovery instance on the given path. If yourInstance is not null it will be registered as the local service.|
+|startProvider|discoveryProjection, serviceName, providerStrategy, downTimeoutMs, downErrorThreshold|provider projection|start a Service Discovery Provider to return instances for the given service name using the given provider strategy. Specify "down" instance characteristics with downTimeoutMs and downErrorThreshold.|
+|getInstance|provider projection|DiscoveryInstance|Return a single instance for the given service|
+|getAllInstances|provider projection|list of DiscoveryInstance|Return all instances for the given service|
+|noteError|provider projection, service id|void|Note an error for the given service instance|