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/03 01:33:06 UTC
[1/5] git commit: test recoverable exceptions
Repository: curator
Updated Branches:
refs/heads/curator-rpc 9077ad001 -> 3a0f6472e
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/curator-rpc
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);
+ }
+ }
+}
[3/5] 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 )
{
[5/5] 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/curator-rpc
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|
[4/5] 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>
[2/5] 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/curator-rpc
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