diff --git a/curator-x-rpc/pom.xml b/curator-x-rpc/pom.xml
deleted file mode 100644
index e831e1f407..0000000000
--- a/curator-x-rpc/pom.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-
-
-
-
-
- apache-curator
- org.apache.curator
- 3.3.1-SNAPSHOT
-
- 4.0.0
-
- curator-x-rpc
- 3.3.1-SNAPSHOT
-
- Curator RPC Proxy
- A proxy that bridges non-java environments with the Curator framework and recipes
- 2014
-
-
-
- org.apache.curator
- curator-recipes
-
-
- org.slf4j
- log4j-over-slf4j
-
-
- org.slf4j
- slf4j-log4j12
-
-
- log4j
- log4j
-
-
-
-
-
- org.apache.curator
- curator-x-discovery
-
-
- org.slf4j
- log4j-over-slf4j
-
-
- org.slf4j
- slf4j-log4j12
-
-
- log4j
- log4j
-
-
-
-
-
- com.facebook.swift
- swift-service
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
-
-
-
- io.dropwizard
- dropwizard-configuration
-
-
-
- io.dropwizard
- dropwizard-logging
-
-
-
- org.apache.curator
- curator-test
-
-
- org.slf4j
- log4j-over-slf4j
-
-
- org.slf4j
- slf4j-log4j12
-
-
- log4j
- log4j
-
-
- test
-
-
-
- org.testng
- testng
- test
-
-
-
- org.slf4j
- slf4j-log4j12
- test
-
-
-
-
-
-
- ${project.basedir}/src/main/resources
-
- curator/help.txt
-
-
-
- ${project.basedir}/src/main/thrift
-
- curator.thrift
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
-
- false
-
-
- *:*
-
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
-
-
-
-
-
-
- package
-
- shade
-
-
-
-
-
- org.apache.curator.x.rpc.CuratorProjectionServer
-
-
-
-
-
-
-
-
- org.codehaus.mojo
- clirr-maven-plugin
-
- true
-
-
-
-
-
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
deleted file mode 100644
index a01f462210..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc;
-
-import com.codahale.metrics.MetricRegistry;
-import com.facebook.swift.codec.ThriftCodecManager;
-import com.facebook.swift.service.ThriftEventHandler;
-import com.facebook.swift.service.ThriftServer;
-import com.facebook.swift.service.ThriftServiceProcessor;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.io.Files;
-import com.google.common.io.Resources;
-import org.apache.curator.x.rpc.configuration.Configuration;
-import org.apache.curator.x.rpc.configuration.ConfigurationBuilder;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.discovery.DiscoveryService;
-import org.apache.curator.x.rpc.idl.discovery.DiscoveryServiceLowLevel;
-import org.apache.curator.x.rpc.idl.services.EventService;
-import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class CuratorProjectionServer
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final ConnectionManager connectionManager;
- private final ThriftServer server;
- private final AtomicReference state = new AtomicReference(State.LATENT);
- private final Configuration configuration;
-
- private enum State
- {
- LATENT,
- STARTED,
- STOPPED
- }
-
- public static void main(String[] args) throws Exception
- {
- if ( (args.length != 1) || args[0].equalsIgnoreCase("?") || args[0].equalsIgnoreCase("-h") || args[0].equalsIgnoreCase("--help") )
- {
- printHelp();
- return;
- }
-
- String configurationSource;
- File f = new File(args[0]);
- if ( f.exists() )
- {
- configurationSource = Files.toString(f, Charset.defaultCharset());
- }
- else
- {
- System.out.println("First argument is not a file. Treating the command line as a json/yaml object");
- configurationSource = args[0];
- }
-
- final CuratorProjectionServer server = startServer(configurationSource);
-
- Runnable shutdown = new Runnable()
- {
- @Override
- public void run()
- {
- server.stop();
- }
- };
- Thread hook = new Thread(shutdown);
- Runtime.getRuntime().addShutdownHook(hook);
- }
-
- public static CuratorProjectionServer startServer(String configurationSource) throws Exception
- {
- Configuration configuration = new ConfigurationBuilder(configurationSource).build();
-
- final CuratorProjectionServer server = new CuratorProjectionServer(configuration);
- server.start();
- return server;
- }
-
- public CuratorProjectionServer(Configuration configuration)
- {
- this.configuration = configuration;
- connectionManager = new ConnectionManager(configuration.getConnections(), configuration.getProjectionExpiration().toMillis());
- EventService eventService = new EventService(connectionManager, configuration.getPingTime().toMillis());
- DiscoveryService discoveryService = new DiscoveryService(connectionManager);
- CuratorProjectionService projectionService = new CuratorProjectionService(connectionManager);
- DiscoveryServiceLowLevel discoveryServiceLowLevel = new DiscoveryServiceLowLevel(connectionManager);
- ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), Lists.newArrayList(), projectionService, eventService, discoveryService, discoveryServiceLowLevel);
- server = new ThriftServer(processor, configuration.getThrift());
- }
-
- public void start()
- {
- Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Already started");
-
- configuration.getLogging().configure(new MetricRegistry(), "curator-rpc");
- connectionManager.start();
- server.start();
-
- log.info("Server listening on port: " + configuration.getThrift().getPort());
- }
-
- public void stop()
- {
- if ( state.compareAndSet(State.STARTED, State.STOPPED) )
- {
- log.info("Stopping...");
-
- server.close();
- connectionManager.close();
- configuration.getLogging().stop();
-
- log.info("Stopped");
- }
- }
-
- private static void printHelp() throws IOException
- {
- URL helpUrl = Resources.getResource("curator/help.txt");
- System.out.println(Resources.toString(helpUrl, Charset.defaultCharset()));
-
- System.out.println();
- System.out.println("======= Curator Thrift IDL =======");
- System.out.println();
-
- URL idlUrl = Resources.getResource("curator.thrift");
- System.out.println(Resources.toString(idlUrl, Charset.defaultCharset()));
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
deleted file mode 100644
index d045a80bd6..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/AuthorizationConfiguration.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-public class AuthorizationConfiguration
-{
- private String scheme;
- private String auth;
-
- public String getScheme()
- {
- return scheme;
- }
-
- public void setScheme(String scheme)
- {
- this.scheme = scheme;
- }
-
- public String getAuth()
- {
- return auth;
- }
-
- public void setAuth(String auth)
- {
- this.auth = auth;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
deleted file mode 100644
index 44231b14d9..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/BoundedExponentialBackoffRetryConfiguration.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.airlift.units.Duration;
-import org.apache.curator.RetryPolicy;
-import org.apache.curator.retry.BoundedExponentialBackoffRetry;
-import java.util.concurrent.TimeUnit;
-
-@JsonTypeName("bounded-exponential-backoff")
-public class BoundedExponentialBackoffRetryConfiguration extends RetryPolicyConfiguration
-{
- private Duration baseSleepTime = new Duration(100, TimeUnit.MILLISECONDS);
- private Duration maxSleepTime = new Duration(30, TimeUnit.SECONDS);
- private int maxRetries = 3;
-
- @Override
- public RetryPolicy build()
- {
- return new BoundedExponentialBackoffRetry((int)baseSleepTime.toMillis(), (int)maxSleepTime.toMillis(), maxRetries);
- }
-
- public Duration getBaseSleepTime()
- {
- return baseSleepTime;
- }
-
- public void setBaseSleepTime(Duration baseSleepTime)
- {
- this.baseSleepTime = baseSleepTime;
- }
-
- public int getMaxRetries()
- {
- return maxRetries;
- }
-
- public void setMaxRetries(int maxRetries)
- {
- this.maxRetries = maxRetries;
- }
-
- public Duration getMaxSleepTime()
- {
- return maxSleepTime;
- }
-
- public void setMaxSleepTime(Duration maxSleepTime)
- {
- this.maxSleepTime = maxSleepTime;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
deleted file mode 100644
index 973b6f0849..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/Configuration.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.facebook.swift.service.ThriftServerConfig;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import io.airlift.units.Duration;
-import io.dropwizard.logging.LoggingFactory;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-public class Configuration
-{
- private ThriftServerConfig thrift = new ThriftServerConfig();
- private LoggingFactory logging = new LoggingFactory();
- private Duration projectionExpiration = new Duration(3, TimeUnit.MINUTES);
- private Duration pingTime = new Duration(5, TimeUnit.SECONDS);
- private List connections = Lists.newArrayList();
-
- public LoggingFactory getLogging()
- {
- return logging;
- }
-
- public void setLogging(LoggingFactory logging)
- {
- this.logging = logging;
- }
-
- public ThriftServerConfig getThrift()
- {
- return thrift;
- }
-
- public void setThrift(ThriftServerConfig thrift)
- {
- this.thrift = thrift;
- }
-
- public Duration getProjectionExpiration()
- {
- return projectionExpiration;
- }
-
- public void setProjectionExpiration(Duration projectionExpiration)
- {
- this.projectionExpiration = projectionExpiration;
- }
-
- public Duration getPingTime()
- {
- return pingTime;
- }
-
- public void setPingTime(Duration pingTime)
- {
- this.pingTime = pingTime;
- }
-
- public List getConnections()
- {
- return ImmutableList.copyOf(connections);
- }
-
- public void setConnections(List connections)
- {
- this.connections = connections;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
deleted file mode 100644
index e5cff3e8ad..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConfigurationBuilder.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
-import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver;
-import io.dropwizard.configuration.ConfigurationFactory;
-import io.dropwizard.configuration.ConfigurationFactoryFactory;
-import io.dropwizard.configuration.ConfigurationSourceProvider;
-import io.dropwizard.configuration.DefaultConfigurationFactoryFactory;
-import io.dropwizard.jackson.AnnotationSensitivePropertyNamingStrategy;
-import io.dropwizard.jackson.LogbackModule;
-import io.dropwizard.logging.ConsoleAppenderFactory;
-import io.dropwizard.logging.FileAppenderFactory;
-import io.dropwizard.logging.LoggingFactory;
-import io.dropwizard.logging.SyslogAppenderFactory;
-import org.jboss.netty.logging.InternalLoggerFactory;
-import org.jboss.netty.logging.Slf4JLoggerFactory;
-import javax.validation.Validation;
-import javax.validation.ValidatorFactory;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
-
-public class ConfigurationBuilder
-{
- private final String configurationSource;
-
- static
- {
- LoggingFactory.bootstrap();
- InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
- }
-
- public ConfigurationBuilder(String configurationSource)
- {
- this.configurationSource = configurationSource;
- }
-
- public Configuration build() throws Exception
- {
- ObjectMapper mapper = new ObjectMapper();
- mapper.registerModule(new LogbackModule());
- mapper.setPropertyNamingStrategy(new AnnotationSensitivePropertyNamingStrategy());
- SubtypeResolver subtypeResolver = new StdSubtypeResolver();
- subtypeResolver.registerSubtypes
- (
- ConsoleAppenderFactory.class,
- FileAppenderFactory.class,
- SyslogAppenderFactory.class,
- ExponentialBackoffRetryConfiguration.class,
- RetryNTimesConfiguration.class
- );
- mapper.setSubtypeResolver(subtypeResolver);
-
- ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
- ConfigurationFactoryFactory factoryFactory = new DefaultConfigurationFactoryFactory();
- ConfigurationFactory configurationFactory = factoryFactory.create(Configuration.class, validatorFactory.getValidator(), mapper, "curator");
- ConfigurationSourceProvider provider = new ConfigurationSourceProvider()
- {
- @Override
- public InputStream open(String path) throws IOException
- {
- return new ByteArrayInputStream(configurationSource.getBytes(Charset.defaultCharset()));
- }
- };
- return configurationFactory.build(provider, "");
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
deleted file mode 100644
index c69fdaa794..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ConnectionConfiguration.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.google.common.base.Preconditions;
-import io.airlift.units.Duration;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.CuratorFrameworkFactory;
-import javax.validation.constraints.NotNull;
-import java.util.concurrent.TimeUnit;
-
-public class ConnectionConfiguration
-{
- @NotNull private String name;
- private String connectionString = null;
- private Duration sessionLength = new Duration(1, TimeUnit.MINUTES);
- private Duration connectionTimeout = new Duration(15, TimeUnit.SECONDS);
- private AuthorizationConfiguration authorization = null;
- private String namespace = null;
- private RetryPolicyConfiguration retry = new ExponentialBackoffRetryConfiguration();
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getConnectionString()
- {
- return connectionString;
- }
-
- public void setConnectionString(String connectionString)
- {
- this.connectionString = connectionString;
- }
-
- public Duration getSessionLength()
- {
- return sessionLength;
- }
-
- public void setSessionLength(Duration sessionLength)
- {
- this.sessionLength = sessionLength;
- }
-
- public Duration getConnectionTimeout()
- {
- return connectionTimeout;
- }
-
- public void setConnectionTimeout(Duration connectionTimeout)
- {
- this.connectionTimeout = connectionTimeout;
- }
-
- public AuthorizationConfiguration getAuthorization()
- {
- return authorization;
- }
-
- public void setAuthorization(AuthorizationConfiguration authorization)
- {
- this.authorization = authorization;
- }
-
- public String getNamespace()
- {
- return namespace;
- }
-
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-
- public RetryPolicyConfiguration getRetry()
- {
- return retry;
- }
-
- public void setRetry(RetryPolicyConfiguration retry)
- {
- this.retry = retry;
- }
-
- public CuratorFramework build()
- {
- Preconditions.checkState((connectionString != null) && (connectionString.length() > 0), "You must specify a connection string for connection: " + name);
- Preconditions.checkNotNull(retry, "retry cannot be null");
-
- CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder();
- builder = builder
- .connectString(connectionString)
- .sessionTimeoutMs((int)sessionLength.toMillis())
- .connectionTimeoutMs((int)connectionTimeout.toMillis())
- .retryPolicy(retry.build());
- if ( authorization != null )
- {
- builder = builder.authorization(authorization.getScheme(), authorization.getAuth().getBytes());
- }
- if ( namespace != null )
- {
- builder = builder.namespace(namespace);
- }
- return builder.build();
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
deleted file mode 100644
index 2c68440ef6..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/ExponentialBackoffRetryConfiguration.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.airlift.units.Duration;
-import org.apache.curator.RetryPolicy;
-import org.apache.curator.retry.ExponentialBackoffRetry;
-import java.util.concurrent.TimeUnit;
-
-@JsonTypeName("exponential-backoff")
-public class ExponentialBackoffRetryConfiguration extends RetryPolicyConfiguration
-{
- private Duration baseSleepTime = new Duration(100, TimeUnit.MILLISECONDS);
- private int maxRetries = 3;
-
- @Override
- public RetryPolicy build()
- {
- return new ExponentialBackoffRetry((int)baseSleepTime.toMillis(), maxRetries);
- }
-
- public Duration getBaseSleepTime()
- {
- return baseSleepTime;
- }
-
- public void setBaseSleepTime(Duration baseSleepTime)
- {
- this.baseSleepTime = baseSleepTime;
- }
-
- public int getMaxRetries()
- {
- return maxRetries;
- }
-
- public void setMaxRetries(int maxRetries)
- {
- this.maxRetries = maxRetries;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
deleted file mode 100644
index 448bde3f9b..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryNTimesConfiguration.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.airlift.units.Duration;
-import org.apache.curator.RetryPolicy;
-import org.apache.curator.retry.RetryNTimes;
-import java.util.concurrent.TimeUnit;
-
-@JsonTypeName("ntimes")
-public class RetryNTimesConfiguration extends RetryPolicyConfiguration
-{
- private Duration sleepBetweenRetries = new Duration(100, TimeUnit.MILLISECONDS);
- private int n = 3;
-
- @Override
- public RetryPolicy build()
- {
- return new RetryNTimes(n, (int)sleepBetweenRetries.toMillis());
- }
-
- public Duration getSleepBetweenRetries()
- {
- return sleepBetweenRetries;
- }
-
- public void setSleepBetweenRetries(Duration sleepBetweenRetries)
- {
- this.sleepBetweenRetries = sleepBetweenRetries;
- }
-
- public int getN()
- {
- return n;
- }
-
- public void setN(int n)
- {
- this.n = n;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
deleted file mode 100644
index d5d1d9510c..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/configuration/RetryPolicyConfiguration.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.configuration;
-
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import org.apache.curator.RetryPolicy;
-
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
-public abstract class RetryPolicyConfiguration
-{
- public abstract RetryPolicy build();
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
deleted file mode 100644
index a113879b77..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/Closer.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.connections;
-
-public interface Closer
-{
- public void close();
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
deleted file mode 100644
index d644231a61..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/ConnectionManager.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.connections;
-
-import com.google.common.base.Preconditions;
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.RemovalListener;
-import com.google.common.cache.RemovalNotification;
-import com.google.common.collect.ImmutableMap;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.rpc.configuration.ConnectionConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.Closeable;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class ConnectionManager implements Closeable
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final Cache cache;
- private final AtomicReference state = new AtomicReference(State.LATENT);
- private final Map connections;
- private final ScheduledExecutorService service = ThreadUtils.newSingleThreadScheduledExecutor("ConnectionManager");
-
- private static final int FORCED_CLEANUP_SECONDS = 30;
-
- private enum State
- {
- LATENT,
- STARTED,
- CLOSED
- }
-
- public ConnectionManager(List connections, long expirationMs)
- {
- this.connections = buildConnectionsMap(connections);
-
- RemovalListener listener = new RemovalListener()
- {
- @SuppressWarnings("NullableProblems")
- @Override
- public void onRemoval(RemovalNotification notification)
- {
- if ( notification != null )
- {
- log.debug(String.format("Entry being removed. id (%s), reason (%s)", notification.getKey(), notification.getCause()));
-
- CuratorEntry entry = notification.getValue();
- if ( entry != null )
- {
- entry.close();
- }
- }
- }
- };
- cache = CacheBuilder.newBuilder().expireAfterAccess(expirationMs, TimeUnit.MILLISECONDS).removalListener(listener).build();
- }
-
- public void start()
- {
- Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Already started");
-
- Runnable cleanup = new Runnable()
- {
- @Override
- public void run()
- {
- cache.cleanUp();
- }
- };
- service.scheduleWithFixedDelay(cleanup, FORCED_CLEANUP_SECONDS, 30, TimeUnit.SECONDS);
- }
-
- @Override
- public void close()
- {
- if ( state.compareAndSet(State.STARTED, State.CLOSED) )
- {
- service.shutdownNow();
- cache.invalidateAll();
- cache.cleanUp();
- }
- }
-
- public CuratorFramework newConnection(String name)
- {
- ConnectionConfiguration configuration = connections.get(name);
- return (configuration != null) ? configuration.build() : null;
- }
-
- public void add(String id, CuratorFramework client)
- {
- Preconditions.checkState(state.get() == State.STARTED, "Not started");
- cache.put(id, new CuratorEntry(client));
- }
-
- public CuratorEntry get(String id)
- {
- return (state.get() == State.STARTED) ? cache.getIfPresent(id) : null;
- }
-
- public CuratorEntry remove(String id)
- {
- Preconditions.checkState(state.get() == State.STARTED, "Not started");
- return cache.asMap().remove(id);
- }
-
- private Map buildConnectionsMap(List connections)
- {
- Preconditions.checkArgument(connections.size() > 0, "You must have at least one connection configured");
-
- ImmutableMap.Builder builder = ImmutableMap.builder();
- for ( ConnectionConfiguration configuration : connections )
- {
- builder.put(configuration.getName(), configuration);
- }
- return builder.build();
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
deleted file mode 100644
index b077a76c21..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.connections;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Queues;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.x.rpc.idl.exceptions.ExceptionType;
-import org.apache.curator.x.rpc.idl.exceptions.RpcException;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.Closeable;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class CuratorEntry implements Closeable
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final CuratorFramework client;
- private final BlockingQueue events = Queues.newLinkedBlockingQueue();
- private final AtomicReference state = new AtomicReference(State.OPEN);
- private final Map things = Maps.newConcurrentMap();
-
- public static T mustGetThing(CuratorEntry entry, String id, Class clazz)
- {
- T thing = entry.getThing(id, clazz);
- Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
- return thing;
- }
-
- private static class Entry
- {
- final Object thing;
- final Closer closer;
-
- private Entry(Object thing, Closer closer)
- {
- this.thing = thing;
- this.closer = closer;
- }
- }
-
- private enum State
- {
- OPEN,
- CLOSED
- }
-
- public CuratorEntry(CuratorFramework client)
- {
- this.client = client;
- }
-
- @Override
- public void close()
- {
- if ( state.compareAndSet(State.OPEN, State.CLOSED) )
- {
- for ( Map.Entry mapEntry : things.entrySet() )
- {
- Entry entry = mapEntry.getValue();
- if ( entry.closer != null )
- {
- log.debug(String.format("Closing left over thing. Type: %s - Id: %s", entry.thing.getClass(), mapEntry.getKey()));
- entry.closer.close();
- }
- }
- things.clear();
-
- client.close();
- events.clear();
- }
- }
-
- public RpcCuratorEvent pollForEvent(long maxWaitMs) throws InterruptedException
- {
- if ( state.get() == State.OPEN )
- {
- return events.poll(maxWaitMs, TimeUnit.MILLISECONDS);
- }
- return null;
- }
-
- public void addEvent(RpcCuratorEvent event)
- {
- if ( state.get() == State.OPEN )
- {
- events.offer(event);
- }
- }
-
- public static CuratorEntry mustGetEntry(ConnectionManager connectionManager, CuratorProjection projection) throws RpcException
- {
- CuratorEntry entry = connectionManager.get(projection.id);
- if ( entry == null )
- {
- throw new RpcException(ExceptionType.GENERAL, null, null, "No CuratorProjection found with the id: " + projection.id);
- }
- return entry;
- }
-
- public CuratorFramework getClient()
- {
- return (state.get() == State.OPEN) ? client : null;
- }
-
- public String addThing(Object thing, Closer closer)
- {
- return addThing(newId(), thing, closer);
- }
-
- public static String newId()
- {
- return UUID.randomUUID().toString();
- }
-
- public T getThing(String id, Class clazz)
- {
- Entry entry = (id != null) ? things.get(id) : null;
- return cast(clazz, entry);
- }
-
- public boolean closeThing(String id)
- {
- Entry entry = (id != null) ? things.remove(id) : null;
- if ( entry != null )
- {
- entry.closer.close();
- }
- return false;
- }
-
- private String addThing(String id, T thing, Closer closer)
- {
- things.put(id, new Entry(thing, closer));
- return id;
- }
-
- private T cast(Class clazz, Entry entry)
- {
- if ( entry != null )
- {
- return clazz.cast(entry.thing);
- }
- return null;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
deleted file mode 100644
index 519790c4a1..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.details;
-
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.api.BackgroundCallback;
-import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
-
-public class RpcBackgroundCallback implements BackgroundCallback
-{
- private final CuratorProjection projection;
- private final CuratorProjectionService projectionService;
-
- public RpcBackgroundCallback(CuratorProjectionService projectionService, CuratorProjection projection)
- {
- this.projection = projection;
- this.projectionService = projectionService;
- }
-
- @Override
- public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
- {
- projectionService.addEvent(projection, new RpcCuratorEvent(event));
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
deleted file mode 100644
index 6fa596154c..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.details;
-
-import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.Watcher;
-
-public class RpcWatcher implements Watcher
-{
- private final CuratorProjection projection;
- private final CuratorProjectionService projectionService;
-
- public RpcWatcher(CuratorProjectionService projectionService, CuratorProjection projection)
- {
- this.projection = projection;
- this.projectionService = projectionService;
- }
-
- @Override
- public void process(WatchedEvent event)
- {
- projectionService.addEvent(projection, new RpcCuratorEvent(event));
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
deleted file mode 100644
index 2547467b89..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstance.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import com.google.common.base.Objects;
-import org.apache.curator.x.discovery.ServiceInstance;
-import org.apache.curator.x.discovery.ServiceType;
-import org.apache.curator.x.discovery.UriSpec;
-
-@ThriftStruct
-public class DiscoveryInstance
-{
- @ThriftField(1)
- public String name;
-
- @ThriftField(2)
- public String id;
-
- @ThriftField(3)
- public String address;
-
- @ThriftField(4)
- public int port;
-
- @ThriftField(5)
- public int sslPort;
-
- @ThriftField(6)
- public byte[] payload;
-
- @ThriftField(7)
- public long registrationTimeUTC;
-
- @ThriftField(8)
- public DiscoveryInstanceType serviceType;
-
- @ThriftField(9)
- public String uriSpec;
-
- public DiscoveryInstance()
- {
- }
-
- public DiscoveryInstance(ServiceInstance instance)
- {
- if ( instance != null )
- {
- this.name = instance.getName();
- this.id = instance.getId();
- this.address = instance.getAddress();
- this.port = Objects.firstNonNull(instance.getPort(), 0);
- this.sslPort = Objects.firstNonNull(instance.getSslPort(), 0);
- this.payload = instance.getPayload();
- this.registrationTimeUTC = instance.getRegistrationTimeUTC();
- this.serviceType = DiscoveryInstanceType.valueOf(instance.getServiceType().name());
- this.uriSpec = instance.buildUriSpec();
- }
- }
-
- public DiscoveryInstance(String name, String id, String address, int port, int sslPort, byte[] payload, long registrationTimeUTC, DiscoveryInstanceType serviceType, String uriSpec)
- {
- this.name = name;
- this.id = id;
- this.address = address;
- this.port = port;
- this.sslPort = sslPort;
- this.payload = payload;
- this.registrationTimeUTC = registrationTimeUTC;
- this.serviceType = serviceType;
- this.uriSpec = uriSpec;
- }
-
- public ServiceInstance toReal()
- {
- return new ServiceInstance(name, id, address, port, sslPort, payload, registrationTimeUTC, ServiceType.valueOf(serviceType.name()), new UriSpec(uriSpec));
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
deleted file mode 100644
index 352a12e8a2..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryInstanceType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-public enum DiscoveryInstanceType
-{
- DYNAMIC,
- STATIC,
- PERMANENT
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java
deleted file mode 100644
index 6b1e0f4788..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class DiscoveryProjection
-{
- @ThriftField(1)
- public String id;
-
- public DiscoveryProjection()
- {
- }
-
- public DiscoveryProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java
deleted file mode 100644
index c8655faad6..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryProviderProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class DiscoveryProviderProjection
-{
- @ThriftField(1)
- public String id;
-
- public DiscoveryProviderProjection()
- {
- }
-
- public DiscoveryProviderProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
deleted file mode 100644
index 22f732db78..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryService.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.discovery.DownInstancePolicy;
-import org.apache.curator.x.discovery.ProviderStrategy;
-import org.apache.curator.x.discovery.ServiceDiscovery;
-import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
-import org.apache.curator.x.discovery.ServiceInstance;
-import org.apache.curator.x.discovery.ServiceProvider;
-import org.apache.curator.x.discovery.ServiceType;
-import org.apache.curator.x.discovery.strategies.RandomStrategy;
-import org.apache.curator.x.discovery.strategies.RoundRobinStrategy;
-import org.apache.curator.x.discovery.strategies.StickyStrategy;
-import org.apache.curator.x.rpc.connections.Closer;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.idl.exceptions.RpcException;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
-@ThriftService
-public class DiscoveryService
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final ConnectionManager connectionManager;
-
- public DiscoveryService(ConnectionManager connectionManager)
- {
- this.connectionManager = connectionManager;
- }
-
- @ThriftMethod
- public DiscoveryInstance makeDiscoveryInstance(String name, byte[] payload, int port) throws RpcException
- {
- try
- {
- ServiceInstance serviceInstance = ServiceInstance.builder()
- .serviceType(ServiceType.DYNAMIC)
- .name(name)
- .payload(payload)
- .port(port)
- .build();
- return new DiscoveryInstance(serviceInstance);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public DiscoveryProjection startDiscovery(CuratorProjection projection, final String basePath, DiscoveryInstance yourInstance) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- final ServiceDiscovery serviceDiscovery = ServiceDiscoveryBuilder
- .builder(byte[].class)
- .basePath(basePath)
- .client(entry.getClient())
- .thisInstance((yourInstance != null) ? yourInstance.toReal() : null)
- .build();
- serviceDiscovery.start();
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- serviceDiscovery.close();
- }
- catch ( IOException e )
- {
- log.error("Could not close ServiceDiscovery with basePath: " + basePath, e);
- }
- }
- };
- String id = entry.addThing(serviceDiscovery, closer);
-
- return new DiscoveryProjection(id);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public DiscoveryProviderProjection startProvider(CuratorProjection projection, DiscoveryProjection discoveryProjection, final String serviceName, ProviderStrategyType providerStrategy, int downTimeoutMs, int downErrorThreshold) throws RpcException
- {
- ProviderStrategy strategy;
- switch ( providerStrategy )
- {
- default:
- case RANDOM:
- {
- strategy = new RandomStrategy();
- break;
- }
-
- case STICKY_RANDOM:
- {
- strategy = new StickyStrategy(new RandomStrategy());
- break;
- }
-
- case STICKY_ROUND_ROBIN:
- {
- strategy = new StickyStrategy(new RoundRobinStrategy());
- break;
- }
-
- case ROUND_ROBIN:
- {
- strategy = new RoundRobinStrategy();
- break;
- }
- }
-
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- final ServiceProvider serviceProvider = serviceDiscovery
- .serviceProviderBuilder()
- .downInstancePolicy(new DownInstancePolicy(downTimeoutMs, TimeUnit.MILLISECONDS, downErrorThreshold))
- .providerStrategy(strategy)
- .serviceName(serviceName)
- .build();
- try
- {
- serviceProvider.start();
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- serviceProvider.close();
- }
- catch ( IOException e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not close ServiceProvider with serviceName: " + serviceName, e);
- }
- }
- };
- String id = entry.addThing(serviceProvider, closer);
- return new DiscoveryProviderProjection(id);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public DiscoveryInstance getInstance(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceProvider serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
- try
- {
- return new DiscoveryInstance(serviceProvider.getInstance());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public Collection getAllInstances(CuratorProjection projection, DiscoveryProviderProjection providerProjection) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceProvider serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
- try
- {
- Collection> allInstances = serviceProvider.getAllInstances();
- Collection transformed = Collections2.transform
- (
- allInstances,
- new Function, DiscoveryInstance>()
- {
- @Override
- public DiscoveryInstance apply(ServiceInstance instance)
- {
- return new DiscoveryInstance(instance);
- }
- }
- );
- return Lists.newArrayList(transformed);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public void noteError(CuratorProjection projection, DiscoveryProviderProjection providerProjection, String instanceId) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceProvider serviceProvider = CuratorEntry.mustGetThing(entry, providerProjection.id, ServiceProvider.class);
- try
- {
- for ( ServiceInstance instance : serviceProvider.getAllInstances() )
- {
- if ( instance.getId().equals(instanceId) )
- {
- serviceProvider.noteError(instance);
- break;
- }
- }
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
deleted file mode 100644
index 42c90b9761..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/DiscoveryServiceLowLevel.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.discovery.ServiceDiscovery;
-import org.apache.curator.x.discovery.ServiceInstance;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.idl.exceptions.RpcException;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import java.util.Collection;
-
-@ThriftService
-public class DiscoveryServiceLowLevel
-{
- private final ConnectionManager connectionManager;
-
- public DiscoveryServiceLowLevel(ConnectionManager connectionManager)
- {
- this.connectionManager = connectionManager;
- }
-
- @ThriftMethod
- public void registerInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- serviceDiscovery.registerService(instance.toReal());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public void updateInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- serviceDiscovery.updateService(instance.toReal());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public void unregisterInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, DiscoveryInstance instance) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- serviceDiscovery.unregisterService(instance.toReal());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public Collection queryForNames(CuratorProjection projection, DiscoveryProjection discoveryProjection) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- try
- {
- return serviceDiscovery.queryForNames();
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public DiscoveryInstance queryForInstance(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name, String id) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- try
- {
- return new DiscoveryInstance(serviceDiscovery.queryForInstance(name, id));
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public Collection queryForInstances(CuratorProjection projection, DiscoveryProjection discoveryProjection, String name) throws RpcException
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- @SuppressWarnings("unchecked")
- ServiceDiscovery serviceDiscovery = CuratorEntry.mustGetThing(entry, discoveryProjection.id, ServiceDiscovery.class);
- try
- {
- Collection> instances = serviceDiscovery.queryForInstances(name);
- Collection transformed = Collections2.transform
- (
- instances,
- new Function, DiscoveryInstance>()
- {
- @Override
- public DiscoveryInstance apply(ServiceInstance instance)
- {
- return new DiscoveryInstance(instance);
- }
- }
- );
- return Lists.newArrayList(transformed);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
deleted file mode 100644
index 139e0be486..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/discovery/ProviderStrategyType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.discovery;
-
-public enum ProviderStrategyType
-{
- RANDOM,
- STICKY_RANDOM,
- STICKY_ROUND_ROBIN,
- ROUND_ROBIN
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
deleted file mode 100644
index adf1206d6d..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ExceptionType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.exceptions;
-
-public enum ExceptionType
-{
- GENERAL,
- ZOOKEEPER,
- NODE
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
deleted file mode 100644
index f62756e601..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/NodeExceptionType.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.exceptions;
-
-public enum NodeExceptionType
-{
- NONODE,
- BADVERSION,
- NODEEXISTS,
- NOTEMPTY
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
deleted file mode 100644
index 9032c1c705..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/RpcException.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.exceptions;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import com.facebook.swift.service.ThriftException;
-import org.apache.zookeeper.KeeperException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-@ThriftException(id = 1, type = RpcException.class, name = "CuratorException")
-@ThriftStruct("CuratorException")
-public class RpcException extends Exception
-{
- @ThriftField(1)
- public ExceptionType type;
-
- @ThriftField(2)
- public ZooKeeperExceptionType zooKeeperException;
-
- @ThriftField(3)
- public NodeExceptionType nodeException;
-
- @ThriftField(4)
- public String message;
-
- public RpcException()
- {
- }
-
- public RpcException(Exception e)
- {
- this.message = e.getLocalizedMessage();
- if ( this.message == null )
- {
- StringWriter str = new StringWriter();
- e.printStackTrace(new PrintWriter(str));
- this.message = str.toString();
- }
-
- if ( KeeperException.class.isAssignableFrom(e.getClass()) )
- {
- KeeperException keeperException = (KeeperException)e;
- switch ( keeperException.code() )
- {
- default:
- {
- type = ExceptionType.ZOOKEEPER;
- zooKeeperException = ZooKeeperExceptionType.valueOf(keeperException.code().name());
- nodeException = null;
- break;
- }
-
- case NONODE:
- case NODEEXISTS:
- case NOTEMPTY:
- case BADVERSION:
- {
- type = ExceptionType.NODE;
- zooKeeperException = null;
- nodeException = NodeExceptionType.valueOf(keeperException.code().name());
- break;
- }
- }
- }
- else
- {
- type = ExceptionType.GENERAL;
- }
- }
-
- public RpcException(ExceptionType type, ZooKeeperExceptionType zooKeeperException, NodeExceptionType nodeException, String message)
- {
- this.type = type;
- this.zooKeeperException = zooKeeperException;
- this.nodeException = nodeException;
- this.message = message;
- }
-
-
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
deleted file mode 100644
index 0ce0c1f5c4..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/exceptions/ZooKeeperExceptionType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.exceptions;
-
-public enum ZooKeeperExceptionType
-{
- SYSTEMERROR,
- RUNTIMEINCONSISTENCY,
- DATAINCONSISTENCY,
- CONNECTIONLOSS,
- MARSHALLINGERROR,
- UNIMPLEMENTED,
- OPERATIONTIMEOUT,
- BADARGUMENTS,
- APIERROR,
- NOAUTH,
- NOCHILDRENFOREPHEMERALS,
- INVALIDACL,
- AUTHFAILED,
- SESSIONEXPIRED,
- INVALIDCALLBACK,
- SESSIONMOVED,
- NOTREADONLY
-}
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
deleted file mode 100644
index 794b467727..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java
+++ /dev/null
@@ -1,765 +0,0 @@
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.services;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.api.*;
-import org.apache.curator.framework.recipes.cache.ChildData;
-import org.apache.curator.framework.recipes.cache.NodeCache;
-import org.apache.curator.framework.recipes.cache.NodeCacheListener;
-import org.apache.curator.framework.recipes.cache.PathChildrenCache;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
-import org.apache.curator.framework.recipes.leader.LeaderLatch;
-import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
-import org.apache.curator.framework.recipes.leader.Participant;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2;
-import org.apache.curator.framework.recipes.locks.Lease;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.curator.framework.state.ConnectionStateListener;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.rpc.connections.Closer;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
-import org.apache.curator.x.rpc.details.RpcWatcher;
-import org.apache.curator.x.rpc.idl.exceptions.ExceptionType;
-import org.apache.curator.x.rpc.idl.exceptions.RpcException;
-import org.apache.curator.x.rpc.idl.structs.*;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.data.Stat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-@ThriftService("CuratorService")
-public class CuratorProjectionService
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final ConnectionManager connectionManager;
-
- public CuratorProjectionService(ConnectionManager connectionManager)
- {
- this.connectionManager = connectionManager;
- }
-
- @ThriftMethod
- public CuratorProjection newCuratorProjection(String connectionName) throws RpcException
- {
- CuratorFramework client = connectionManager.newConnection(connectionName);
- if ( client == null )
- {
- throw new RpcException(ExceptionType.GENERAL, null, null, "No connection configuration was found with the name: " + connectionName);
- }
-
- String id = CuratorEntry.newId();
- client.start();
- connectionManager.add(id, client);
- final CuratorProjection projection = new CuratorProjection(id);
-
- ConnectionStateListener listener = new ConnectionStateListener()
- {
- @Override
- public void stateChanged(CuratorFramework client, ConnectionState newState)
- {
- addEvent(projection, new RpcCuratorEvent(newState));
- }
- };
- client.getConnectionStateListenable().addListener(listener);
-
- return projection;
- }
-
- @ThriftMethod
- public void closeCuratorProjection(CuratorProjection projection)
- {
- CuratorEntry entry = connectionManager.remove(projection.id);
- if ( entry != null )
- {
- entry.close();
- }
- }
-
- @ThriftMethod(oneway = true)
- public void pingCuratorProjection(CuratorProjection projection)
- {
- connectionManager.get(projection.id);
- }
-
- @ThriftMethod
- public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.create();
- if ( spec.creatingParentsIfNeeded )
- {
- builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
- }
- if ( spec.creatingParentContainersIfNeeded )
- {
- builder = castBuilder(builder, CreateBuilder.class).creatingParentContainersIfNeeded();
- }
- if ( spec.compressed )
- {
- builder = castBuilder(builder, Compressible.class).compressed();
- }
- if ( spec.withProtection )
- {
- builder = castBuilder(builder, CreateBuilder.class).withProtection();
- }
- if ( spec.mode != null )
- {
- builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
- }
-
- Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
- return new OptionalPath((path != null) ? String.valueOf(path) : null);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.delete();
- if ( spec.guaranteed )
- {
- builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
- }
- if ( spec.version != null )
- {
- builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
- }
-
- castBuilder(builder, Pathable.class).forPath(spec.path);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.getData();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.decompressed )
- {
- builder = castBuilder(builder, Decompressible.class).decompressed();
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = new Stat();
- builder = castBuilder(builder, Statable.class).storingStatIn(stat);
-
- byte[] bytes = (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
- return new OptionalData(bytes);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public OptionalRpcStat setData(CuratorProjection projection, SetDataSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.setData();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
- if ( spec.version != null )
- {
- builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
- }
-
- if ( spec.compressed )
- {
- builder = castBuilder(builder, Compressible.class).compressed();
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
- return new OptionalRpcStat(RpcCuratorEvent.toRpcStat(stat));
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.checkExists();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
- return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws RpcException
- {
- try
- {
- CuratorFramework client = CuratorEntry.mustGetEntry(connectionManager, projection).getClient();
-
- Object builder = client.getChildren();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- @SuppressWarnings("unchecked")
- List children = (List)castBuilder(builder, Pathable.class).forPath(spec.path);
- return new OptionalChildrenList(children);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public void sync(CuratorProjection projection, String path, String asyncContext) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- entry.getClient().sync().inBackground(backgroundCallback, asyncContext).forPath(path);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public boolean closeGenericProjection(CuratorProjection projection, String id) throws RpcException
- {
- try
- {
- if ( id.equals(projection.id) )
- {
- closeCuratorProjection(projection);
- return true;
- }
- else
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- return entry.closeThing(id);
- }
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public OptionalLockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
- if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
- {
- return new OptionalLockProjection();
- }
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- if ( lock.isAcquiredInThisProcess() )
- {
- try
- {
- lock.release();
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not release left-over lock for path: " + path, e);
- }
- }
- }
- };
- String id = entry.addThing(lock, closer);
- return new OptionalLockProjection(new LockProjection(id));
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
- leaderLatch.start();
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- leaderLatch.close();
- }
- catch ( IOException e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not close left-over leader latch for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(leaderLatch, closer);
-
- LeaderLatchListener listener = new LeaderLatchListener()
- {
- @Override
- public void isLeader()
- {
- addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
- }
-
- @Override
- public void notLeader()
- {
- addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
- }
- };
- leaderLatch.addListener(listener);
-
- if ( waitForLeadershipMs > 0 )
- {
- leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
- }
-
- return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public Collection getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
- Collection participants = leaderLatch.getParticipants();
- Collection transformed = Collections2.transform
- (
- participants,
- new Function()
- {
- @Override
- public RpcParticipant apply(Participant participant)
- {
- return new RpcParticipant(participant.getId(), participant.isLeader());
- }
- }
- );
- return Lists.newArrayList(transformed);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- LeaderLatch leaderLatch = CuratorEntry.mustGetThing(entry, leaderProjection.id, LeaderLatch.class);
- return leaderLatch.hasLeadership();
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws RpcException
- {
- try
- {
- final CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
- cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- cache.close();
- }
- catch ( IOException e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not close left-over PathChildrenCache for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(cache, closer);
-
- PathChildrenCacheListener listener = new PathChildrenCacheListener()
- {
- @Override
- public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws RpcException
- {
- entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
- }
- };
- cache.getListenable().addListener(listener);
-
- return new PathChildrenCacheProjection(id);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public List getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- PathChildrenCache pathChildrenCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, PathChildrenCache.class);
- return Lists.transform
- (
- pathChildrenCache.getCurrentData(),
- new Function()
- {
- @Override
- public RpcChildData apply(ChildData childData)
- {
- return new RpcChildData(childData);
- }
- }
- );
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- PathChildrenCache pathChildrenCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, PathChildrenCache.class);
- return new RpcChildData(pathChildrenCache.getCurrentData(path));
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws RpcException
- {
- try
- {
- final CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
- cache.start(buildInitial);
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- cache.close();
- }
- catch ( IOException e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not close left-over NodeCache for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(cache, closer);
-
- NodeCacheListener listener = new NodeCacheListener()
- {
- @Override
- public void nodeChanged()
- {
- entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
- }
- };
- cache.getListenable().addListener(listener);
-
- return new NodeCacheProjection(id);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- NodeCache nodeCache = CuratorEntry.mustGetThing(entry, cacheProjection.id, NodeCache.class);
- return new RpcChildData(nodeCache.getCurrentData());
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
- node.start();
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- node.close();
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(node, closer);
- return new PersistentEphemeralNodeProjection(id);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- @ThriftMethod
- public List acquireSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
-
- final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
- final Collection leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
- if ( leases == null )
- {
- return Lists.newArrayList();
- }
-
- List leaseProjections = Lists.newArrayList();
- for ( final Lease lease : leases )
- {
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- semaphore.returnLease(lease);
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- log.error("Could not release semaphore leases for path: " + path, e);
- }
- }
- };
- leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
- }
- return leaseProjections;
- }
- catch ( Exception e )
- {
- ThreadUtils.checkInterrupted(e);
- throw new RpcException(e);
- }
- }
-
- public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
- {
- CuratorEntry entry = connectionManager.get(projection.id);
- if ( entry != null )
- {
- entry.addEvent(event);
- }
- }
-
- private static T castBuilder(Object createBuilder, Class clazz) throws Exception
- {
- if ( clazz.isAssignableFrom(createBuilder.getClass()) )
- {
- return clazz.cast(createBuilder);
- }
- throw new Exception("That operation is not available");
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
deleted file mode 100644
index 74fb32019e..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/EventService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.services;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.exceptions.RpcException;
-import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
-import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
-
-@ThriftService("EventService")
-public class EventService
-{
- private final ConnectionManager connectionManager;
- private final long pingTimeMs;
-
- public EventService(ConnectionManager connectionManager, long pingTimeMs)
- {
- this.connectionManager = connectionManager;
- this.pingTimeMs = pingTimeMs;
- }
-
- @ThriftMethod
- public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws RpcException
- {
- try
- {
- CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection);
- RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
- return (event != null) ? event : new RpcCuratorEvent();
- }
- catch ( InterruptedException e )
- {
- throw new RpcException(e);
- }
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java
deleted file mode 100644
index a15fe92084..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CreateSpec.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CreateSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public byte[] data;
-
- @ThriftField(3)
- public RpcCreateMode mode;
-
- @ThriftField(4)
- public String asyncContext;
-
- @ThriftField(5)
- public boolean compressed;
-
- @ThriftField(6)
- public boolean creatingParentsIfNeeded;
-
- @ThriftField(7)
- public boolean withProtection;
-
- @ThriftField(8)
- public boolean creatingParentContainersIfNeeded;
-
- public CreateSpec()
- {
- }
-
- public CreateSpec(String path, byte[] data, RpcCreateMode mode, String asyncContext, boolean compressed, boolean creatingParentsIfNeeded, boolean withProtection, boolean creatingParentContainersIfNeeded)
- {
- this.path = path;
- this.data = data;
- this.mode = mode;
- this.asyncContext = asyncContext;
- this.compressed = compressed;
- this.creatingParentsIfNeeded = creatingParentsIfNeeded;
- this.withProtection = withProtection;
- this.creatingParentContainersIfNeeded = creatingParentContainersIfNeeded;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
deleted file mode 100644
index 82ea2a3299..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/CuratorProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CuratorProjection
-{
- @ThriftField(1)
- public String id;
-
- public CuratorProjection()
- {
- }
-
- public CuratorProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
deleted file mode 100644
index 18f8dd2f01..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/DeleteSpec.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class DeleteSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean guaranteed;
-
- @ThriftField(3)
- public String asyncContext;
-
- @ThriftField(4)
- public Version version;
-
- public DeleteSpec()
- {
- }
-
- public DeleteSpec(String path, boolean guaranteed, String asyncContext, Version version)
- {
- this.path = path;
- this.guaranteed = guaranteed;
- this.asyncContext = asyncContext;
- this.version = version;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java
deleted file mode 100644
index f271f7eed2..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/ExistsSpec.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class ExistsSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- public ExistsSpec()
- {
- }
-
- public ExistsSpec(String path, boolean watched, String asyncContext)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java
deleted file mode 100644
index 37dea04f3f..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetChildrenSpec.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetChildrenSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- public GetChildrenSpec()
- {
- }
-
- public GetChildrenSpec(String path, boolean watched, String asyncContext)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java
deleted file mode 100644
index 9b741d0f9b..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/GetDataSpec.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetDataSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- @ThriftField(4)
- public boolean decompressed;
-
- public GetDataSpec()
- {
- }
-
- public GetDataSpec(String path, boolean watched, String asyncContext, boolean decompressed)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- this.decompressed = decompressed;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
deleted file mode 100644
index ebeabab554..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderEvent.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderEvent
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public String participantId;
-
- @ThriftField(3)
- public boolean isLeader;
-
- public LeaderEvent()
- {
- }
-
- public LeaderEvent(String path, String participantId, boolean isLeader)
- {
- this.path = path;
- this.participantId = participantId;
- this.isLeader = isLeader;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
deleted file mode 100644
index d9b3fac7bf..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderProjection
-{
- @ThriftField(1)
- public String id;
-
- public LeaderProjection()
- {
- }
-
- public LeaderProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
deleted file mode 100644
index 429294bab2..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaderResult.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderResult
-{
- @ThriftField(1)
- public LeaderProjection projection;
-
- @ThriftField(2)
- public boolean isLeader;
-
- public LeaderResult()
- {
- }
-
- public LeaderResult(LeaderProjection projection, boolean isLeader)
- {
- this.projection = projection;
- this.isLeader = isLeader;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
deleted file mode 100644
index 1ab1f188ce..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LeaseProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaseProjection
-{
- @ThriftField(1)
- public String id;
-
- public LeaseProjection()
- {
- }
-
- public LeaseProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
deleted file mode 100644
index 1f88d5ebf3..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/LockProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LockProjection
-{
- @ThriftField(1)
- public String id;
-
- public LockProjection()
- {
- }
-
- public LockProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
deleted file mode 100644
index 3cf3be0a01..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/NodeCacheProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class NodeCacheProjection
-{
- @ThriftField(1)
- public String id;
-
- public NodeCacheProjection()
- {
- }
-
- public NodeCacheProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
deleted file mode 100644
index 44a96f2402..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalChildrenList.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import java.util.List;
-
-@ThriftStruct
-public class OptionalChildrenList
-{
- @ThriftField(1)
- public List children;
-
- public OptionalChildrenList()
- {
- }
-
- public OptionalChildrenList(List children)
- {
- this.children = children;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java
deleted file mode 100644
index e46c577936..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalData.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class OptionalData
-{
- @ThriftField(1)
- public byte[] data;
-
- public OptionalData()
- {
- }
-
- public OptionalData(byte[] data)
- {
- this.data = data;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java
deleted file mode 100644
index cd8549471e..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalLockProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class OptionalLockProjection
-{
- @ThriftField(1)
- public LockProjection lockProjection;
-
- public OptionalLockProjection()
- {
- }
-
- public OptionalLockProjection(LockProjection lockProjection)
- {
- this.lockProjection = lockProjection;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
deleted file mode 100644
index f2d5f164cd..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalPath.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class OptionalPath
-{
- @ThriftField(1)
- public String path;
-
- public OptionalPath()
- {
- }
-
- public OptionalPath(String path)
- {
- this.path = path;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java
deleted file mode 100644
index df0c234ee8..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/OptionalRpcStat.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("OptionalStat")
-public class OptionalRpcStat
-{
- @ThriftField(1)
- public RpcStat stat;
-
- public OptionalRpcStat()
- {
- }
-
- public OptionalRpcStat(RpcStat stat)
- {
- this.stat = stat;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
deleted file mode 100644
index 9dd4f02065..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PathChildrenCacheProjection
-{
- @ThriftField(1)
- public String id;
-
- public PathChildrenCacheProjection()
- {
- }
-
- public PathChildrenCacheProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
deleted file mode 100644
index 4989183fa5..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PathChildrenCacheStartMode.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-public enum PathChildrenCacheStartMode
-{
- NORMAL,
- BUILD_INITIAL_CACHE,
- POST_INITIALIZED_EVENT
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
deleted file mode 100644
index 40fefff52a..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/PersistentEphemeralNodeProjection.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PersistentEphemeralNodeProjection
-{
- @ThriftField(1)
- public String id;
-
- public PersistentEphemeralNodeProjection()
- {
- }
-
- public PersistentEphemeralNodeProjection(String id)
- {
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java
deleted file mode 100644
index c4cb9acb15..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcAcl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Acl")
-public class RpcAcl
-{
- @ThriftField(1)
- public int perms;
-
- @ThriftField(2)
- public RpcId id;
-
- public RpcAcl()
- {
- }
-
- public RpcAcl(int perms, RpcId id)
- {
- this.perms = perms;
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
deleted file mode 100644
index 2cb44623fa..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcChildData.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.ChildData;
-
-@ThriftStruct("ChildData")
-public class RpcChildData
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public RpcStat stat;
-
- @ThriftField(3)
- public byte[] data;
-
- public RpcChildData()
- {
- }
-
- public RpcChildData(ChildData data)
- {
- if ( data != null )
- {
- this.path = data.getPath();
- this.stat = RpcCuratorEvent.toRpcStat(data.getStat());
- this.data = data.getData();
- }
- }
-
- public RpcChildData(String path, RpcStat stat, byte[] data)
- {
- this.path = path;
- this.stat = stat;
- this.data = data;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java
deleted file mode 100644
index 020f2830ee..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCreateMode.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("CreateMode")
-public enum RpcCreateMode
-{
- PERSISTENT,
- PERSISTENT_SEQUENTIAL,
- EPHEMERAL,
- EPHEMERAL_SEQUENTIAL,
- CONTAINER
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
deleted file mode 100644
index 18591a580c..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEvent.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.data.ACL;
-import org.apache.zookeeper.data.Stat;
-import javax.annotation.Nullable;
-import java.util.List;
-
-@SuppressWarnings("deprecation")
-@ThriftStruct("CuratorEvent")
-public class RpcCuratorEvent
-{
- @ThriftField(2)
- public RpcCuratorEventType type;
-
- @ThriftField(3)
- public int resultCode;
-
- @ThriftField(4)
- public String path;
-
- @ThriftField(5)
- public String context;
-
- @ThriftField(6)
- public RpcStat stat;
-
- @ThriftField(7)
- public byte[] data;
-
- @ThriftField(8)
- public String name;
-
- @ThriftField(9)
- public List children;
-
- @ThriftField(10)
- public List aclList;
-
- @ThriftField(11)
- public RpcWatchedEvent watchedEvent;
-
- @ThriftField(12)
- public LeaderEvent leaderEvent;
-
- @ThriftField(13)
- public RpcPathChildrenCacheEvent childrenCacheEvent;
-
- public RpcCuratorEvent()
- {
- this.type = RpcCuratorEventType.PING;
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(RpcCuratorEventType type, String path)
- {
- this.type = type;
- this.resultCode = 0;
- this.path = path;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(RpcPathChildrenCacheEvent childrenCacheEvent)
- {
- this.type = RpcCuratorEventType.PATH_CHILDREN_CACHE;
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = childrenCacheEvent;
- }
-
- public RpcCuratorEvent(CuratorEvent event)
- {
- this.type = RpcCuratorEventType.valueOf(event.getType().name());
- this.resultCode = event.getResultCode();
- this.path = event.getPath();
- this.context = (event.getContext() != null) ? String.valueOf(event.getContext()) : null;
- this.stat = toRpcStat(event.getStat());
- this.data = event.getData();
- this.name = event.getName();
- this.children = event.getChildren();
- this.aclList = toRpcAclList(event.getACLList());
- this.watchedEvent = toRpcWatchedEvent(event.getWatchedEvent());
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(ConnectionState newState)
- {
- this.type = RpcCuratorEventType.valueOf("CONNECTION_" + newState.name());
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(WatchedEvent event)
- {
- this.type = RpcCuratorEventType.WATCHED;
- this.resultCode = 0;
- this.path = event.getPath();
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = new RpcWatchedEvent(RpcKeeperState.valueOf(event.getState().name()), RpcEventType.valueOf(event.getType().name()), event.getPath());
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(LeaderEvent event)
- {
- this.type = RpcCuratorEventType.LEADER;
- this.resultCode = 0;
- this.path = event.path;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = event;
- this.childrenCacheEvent = null;
- }
-
- public static RpcStat toRpcStat(Stat stat)
- {
- if ( stat != null )
- {
- return new RpcStat(stat);
- }
- return null;
- }
-
- private List toRpcAclList(List aclList)
- {
- if ( aclList != null )
- {
- return Lists.transform
- (
- aclList,
- new Function()
- {
- @Nullable
- @Override
- public RpcAcl apply(ACL acl)
- {
- RpcId id = new RpcId(acl.getId().getScheme(), acl.getId().getId());
- return new RpcAcl(acl.getPerms(), id);
- }
- }
- );
- }
- return null;
- }
-
- private RpcWatchedEvent toRpcWatchedEvent(WatchedEvent watchedEvent)
- {
- if ( watchedEvent != null )
- {
- return new RpcWatchedEvent(watchedEvent);
- }
- return null;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java
deleted file mode 100644
index 88b4a1ff32..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcCuratorEventType.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("CuratorEventType")
-public enum RpcCuratorEventType
-{
- PING,
- CREATE,
- DELETE,
- EXISTS,
- GET_DATA,
- SET_DATA,
- CHILDREN,
- SYNC,
- GET_ACL,
- SET_ACL,
- WATCHED,
- CLOSING,
- CONNECTION_CONNECTED,
- CONNECTION_SUSPENDED,
- CONNECTION_RECONNECTED,
- CONNECTION_LOST,
- CONNECTION_READ_ONLY,
- LEADER,
- PATH_CHILDREN_CACHE,
- NODE_CACHE
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java
deleted file mode 100644
index d20adb0ed1..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcEventType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("EventType")
-public enum RpcEventType
-{
- None,
- NodeCreated,
- NodeDeleted,
- NodeDataChanged,
- NodeChildrenChanged
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java
deleted file mode 100644
index 233736bcce..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcId.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Id")
-public class RpcId
-{
- @ThriftField(1)
- public String scheme;
-
- @ThriftField(2)
- public String id;
-
- public RpcId()
- {
- }
-
- public RpcId(String scheme, String id)
- {
- this.scheme = scheme;
- this.id = id;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java
deleted file mode 100644
index 8839a1d004..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcKeeperState.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("KeeperState")
-public enum RpcKeeperState
-{
- Unknown,
- Disconnected,
- NoSyncConnected,
- SyncConnected,
- AuthFailed,
- ConnectedReadOnly,
- SaslAuthenticated,
- Expired
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
deleted file mode 100644
index f573b21cdf..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcParticipant.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Participant")
-public class RpcParticipant
-{
- @ThriftField(1)
- public String id;
-
- @ThriftField(2)
- public boolean isLeader;
-
- public RpcParticipant()
- {
- }
-
- public RpcParticipant(String id, boolean isLeader)
- {
- this.id = id;
- this.isLeader = isLeader;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
deleted file mode 100644
index 7f243a7c2b..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-
-@ThriftStruct("PathChildrenCacheEvent")
-public class RpcPathChildrenCacheEvent
-{
- @ThriftField(1)
- public String cachedPath;
-
- @ThriftField(2)
- public RpcPathChildrenCacheEventType type;
-
- @ThriftField(3)
- public RpcChildData data;
-
- public RpcPathChildrenCacheEvent()
- {
- }
-
- public RpcPathChildrenCacheEvent(String cachedPath, PathChildrenCacheEvent event)
- {
- this.cachedPath = cachedPath;
- type = RpcPathChildrenCacheEventType.valueOf(event.getType().name());
- data = (event.getData() != null) ? new RpcChildData(event.getData()) : null;
- }
-
- public RpcPathChildrenCacheEvent(String cachedPath, RpcPathChildrenCacheEventType type, RpcChildData data)
- {
- this.cachedPath = cachedPath;
- this.type = type;
- this.data = data;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
deleted file mode 100644
index 72da6d00e5..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPathChildrenCacheEventType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PathChildrenCacheEventType")
-public enum RpcPathChildrenCacheEventType
-{
- CHILD_ADDED,
- CHILD_UPDATED,
- CHILD_REMOVED,
- CONNECTION_SUSPENDED,
- CONNECTION_RECONNECTED,
- CONNECTION_LOST,
- INITIALIZED
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
deleted file mode 100644
index 0e73dd3e9e..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcPersistentEphemeralNodeMode.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PersistentEphemeralNodeMode")
-public enum RpcPersistentEphemeralNodeMode
-{
- EPHEMERAL,
- EPHEMERAL_SEQUENTIAL,
- PROTECTED_EPHEMERAL,
- PROTECTED_EPHEMERAL_SEQUENTIAL
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java
deleted file mode 100644
index 5e62f155dc..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcStat.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.data.Stat;
-
-@ThriftStruct("Stat")
-public class RpcStat
-{
- @ThriftField(1)
- public long czxid;
-
- @ThriftField(2)
- public long mzxid;
-
- @ThriftField(3)
- public long ctime;
-
- @ThriftField(4)
- public long mtime;
-
- @ThriftField(5)
- public int version;
-
- @ThriftField(6)
- public int cversion;
-
- @ThriftField(7)
- public int aversion;
-
- @ThriftField(8)
- public long ephemeralOwner;
-
- @ThriftField(9)
- public int dataLength;
-
- @ThriftField(10)
- public int numChildren;
-
- @ThriftField(11)
- public long pzxid;
-
- public RpcStat()
- {
- }
-
- public RpcStat(Stat stat)
- {
- czxid = stat.getCzxid();
- mzxid = stat.getMzxid();
- ctime = stat.getCtime();
- mtime = stat.getMtime();
- version = stat.getVersion();
- cversion = stat.getCversion();
- aversion = stat.getAversion();
- ephemeralOwner = stat.getEphemeralOwner();
- dataLength = stat.getDataLength();
- numChildren = stat.getNumChildren();
- pzxid = stat.getPzxid();
- }
-
- public RpcStat(long czxid, long mzxid, long ctime, long mtime, int version, int cversion, int aversion, long ephemeralOwner, int dataLength, int numChildren, long pzxid)
- {
- this.czxid = czxid;
- this.mzxid = mzxid;
- this.ctime = ctime;
- this.mtime = mtime;
- this.version = version;
- this.cversion = cversion;
- this.aversion = aversion;
- this.ephemeralOwner = ephemeralOwner;
- this.dataLength = dataLength;
- this.numChildren = numChildren;
- this.pzxid = pzxid;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java
deleted file mode 100644
index cc7e81865f..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/RpcWatchedEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.WatchedEvent;
-
-@ThriftStruct("WatchedEvent")
-public class RpcWatchedEvent
-{
- @ThriftField(1)
- public RpcKeeperState keeperState;
-
- @ThriftField(2)
- public RpcEventType eventType;
-
- @ThriftField(3)
- public String path;
-
- public RpcWatchedEvent()
- {
- }
-
- public RpcWatchedEvent(WatchedEvent watchedEvent)
- {
- keeperState = RpcKeeperState.valueOf(watchedEvent.getState().name());
- eventType = RpcEventType.valueOf(watchedEvent.getType().name());
- path = watchedEvent.getPath();
- }
-
- public RpcWatchedEvent(RpcKeeperState keeperState, RpcEventType eventType, String path)
- {
- this.keeperState = keeperState;
- this.eventType = eventType;
- this.path = path;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java
deleted file mode 100644
index 081469901a..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/SetDataSpec.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class SetDataSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- @ThriftField(4)
- public boolean compressed;
-
- @ThriftField(5)
- public Version version;
-
- @ThriftField(6)
- public byte[] data;
-
- public SetDataSpec()
- {
- }
-
- public SetDataSpec(String path, boolean watched, String asyncContext, boolean compressed, Version version, byte[] data)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- this.compressed = compressed;
- this.version = version;
- this.data = data;
- }
-}
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
deleted file mode 100644
index 0812cdf2bb..0000000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/structs/Version.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.x.rpc.idl.structs;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class Version
-{
- @ThriftField(1)
- public int version;
-
- public Version()
- {
- }
-
- public Version(int version)
- {
- this.version = version;
- }
-}
diff --git a/curator-x-rpc/src/main/resources/curator/help.txt b/curator-x-rpc/src/main/resources/curator/help.txt
deleted file mode 100644
index 7479e23544..0000000000
--- a/curator-x-rpc/src/main/resources/curator/help.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-Curator RPC - an RPC server for using Apache Curator APIs and recipes from non JVM languages.
-
-Arguments:
- show this help
- either a path to a JSON or YAML configuration file or a JSON/YAML object for
- configuration
-
-Curator RPC uses Dropwizard for configuration. The format is JSON or YAML (your choice). Here is
-the model configuration shown in JSON with added comments. Required fields have "*" in the comment.
-
-{
- "thrift": { // * Thrift server configuration
- "bindAddress": "string", // address to bind to. Default is "localhost"
- "port": int, // * port to listen on
- "acceptBacklog": int, // default is 1024
- "connectionLimit": int, // max concurrent connections. Default is unlimited.
- "acceptorThreadCount": int, // default is 1
- "ioThreadCount": int, // default is 2 * number of processors
- "idleConnectionTimeout": "Duration", // default is 60 seconds
- "transportName": "string", // default is "framed"
- "protocolName": "string" // default is "binary"
- },
-
- "projectionExpiration": "Duration", // time for projections to expire if unused. Default is 3
- // minutes.
-
- "pingTime": "Duration", // time that the EventService will return PING if no other events.
- // Default is 5 seconds.
-
- "connections": [ // * list of ZooKeeper connections
- "name": "string", // * unique name for the connection
- "connectionString": "string", // * ZooKeeper connection string (e.g. "host1:2181,host2:2181")
- "sessionLength": "Duration", // duration for the session. Default is 1 minute.
- "connectionTimeout": "Duration", // duration for connecting. Default is 15 seconds.
- "authorization": { // Authorization spec. Default is NULL.
- "scheme": "string", // * the authorization scheme
- "auth": "string" // * the authorization auth
- },
- "namespace": "string", // Curator namespace. Default is NULL.
- "retry": { // Retry policy. Default is an exponential-backoff policy.
- "type": "string", // Policy type. Either "exponential-backoff",
- // "bounded-exponential-backoff" or "ntimes"
- -- Remaining values depending on type. See below --
- },
- ],
-
- "logging": { // logging config - Dropwizard's logging library is used
- See http://dropwizard.readthedocs.org/en/latest/manual/configuration.html#logging
- }
-}
-
-"Duration" is a string. E.g. "1s" (1 second), "10m" (10 minutes)
-
-Retry Policy Specs:
- For type: "exponential-backoff"
- {
- "baseSleepTime": "Duration", // default is 100 milliseconds
- "maxRetries": int // default is 3
- }
-
- For type: "bounded-exponential-backoff"
- {
- "baseSleepTime": "Duration", // default is 100 milliseconds
- "maxSleepTime": "Duration", // default is 30 seconds
- "maxRetries": int // default is 3
- }
-
- For type: "ntimes"
- {
- "sleepBetweenRetries": "Duration", // default is 100 milliseconds
- "n": int // default is 3
- }
diff --git a/curator-x-rpc/src/main/scripts/apply-thrift.sh b/curator-x-rpc/src/main/scripts/apply-thrift.sh
deleted file mode 100755
index 535765da62..0000000000
--- a/curator-x-rpc/src/main/scripts/apply-thrift.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-if (( $# == 0 )); then
- echo -e "usage:\n\tapply-thrift.sh "
- exit
-fi
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-BASE_DIR="$( cd "$DIR/../../../.." && pwd )"
-
-if (( $# == 2 )); then
- TARGET_DIR="$2"
-else
- TARGET_DIR="$BASE_DIR/curator-x-rpc/src/test/java"
-fi
-
-thrift -gen $1 -out "$TARGET_DIR" "$BASE_DIR/curator-x-rpc/src/main/thrift/curator.thrift"
diff --git a/curator-x-rpc/src/main/scripts/generate.sh b/curator-x-rpc/src/main/scripts/generate.sh
deleted file mode 100755
index ddcbff4fcb..0000000000
--- a/curator-x-rpc/src/main/scripts/generate.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-if (( $# != 2 )); then
- echo -e "usage:\n\tgenerate.sh "
- exit
-fi
-
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-BASE_DIR="$( cd "$DIR/../../../.." && pwd )"
-
-RPC_PATH="$BASE_DIR/curator-x-rpc/target/classes"
-
-CLASSES=""
-
-for p in services structs exceptions discovery; do
- for f in `ls -m1 $RPC_PATH/org/apache/curator/x/rpc/idl/$p/*.class | xargs -n 1 basename | sed s/\.[^\.]*$//`; do
- if [[ $f != *[\$]* ]]; then
- CLASSES="$CLASSES org.apache.curator.x.rpc.idl.$p.$f";
- fi;
- done;
-done;
-
-THRIFT_DIR="$BASE_DIR/curator-x-rpc/src/main/thrift"
-
-PATHS="$1:$2"
-PATHS="$PATHS:$BASE_DIR/curator-client/target/classes"
-PATHS="$PATHS:$BASE_DIR/curator-framework/target/classes"
-PATHS="$PATHS:$BASE_DIR/curator-recipes/target/classes"
-PATHS="$PATHS:$BASE_DIR/curator-x-discovery/target/classes"
-PATHS="$PATHS:$RPC_PATH"
-
-java -cp $PATHS com.facebook.swift.generator.swift2thrift.Main \
- -allow_multiple_packages org.apache.curator \
- -namespace cpp org.apache.curator.generated \
- -namespace java org.apache.curator.generated \
- -out "$THRIFT_DIR/curator.thrift" \
- $CLASSES
diff --git a/curator-x-rpc/src/main/thrift/curator.thrift b/curator-x-rpc/src/main/thrift/curator.thrift
deleted file mode 100644
index 41f23624a2..0000000000
--- a/curator-x-rpc/src/main/thrift/curator.thrift
+++ /dev/null
@@ -1,297 +0,0 @@
-namespace java.swift org.apache.curator
-namespace cpp org.apache.curator.generated
-namespace java org.apache.curator.generated
-
-
-enum PathChildrenCacheStartMode {
- NORMAL, BUILD_INITIAL_CACHE, POST_INITIALIZED_EVENT
-}
-
-enum CreateMode {
- PERSISTENT, PERSISTENT_SEQUENTIAL, EPHEMERAL, EPHEMERAL_SEQUENTIAL, CONTAINER
-}
-
-enum CuratorEventType {
- PING, CREATE, DELETE, EXISTS, GET_DATA, SET_DATA, CHILDREN, SYNC, GET_ACL, SET_ACL, WATCHED, CLOSING, CONNECTION_CONNECTED, CONNECTION_SUSPENDED, CONNECTION_RECONNECTED, CONNECTION_LOST, CONNECTION_READ_ONLY, LEADER, PATH_CHILDREN_CACHE, NODE_CACHE
-}
-
-enum EventType {
- None, NodeCreated, NodeDeleted, NodeDataChanged, NodeChildrenChanged
-}
-
-enum KeeperState {
- Unknown, Disconnected, NoSyncConnected, SyncConnected, AuthFailed, ConnectedReadOnly, SaslAuthenticated, Expired
-}
-
-enum PathChildrenCacheEventType {
- CHILD_ADDED, CHILD_UPDATED, CHILD_REMOVED, CONNECTION_SUSPENDED, CONNECTION_RECONNECTED, CONNECTION_LOST, INITIALIZED
-}
-
-enum PersistentEphemeralNodeMode {
- EPHEMERAL, EPHEMERAL_SEQUENTIAL, PROTECTED_EPHEMERAL, PROTECTED_EPHEMERAL_SEQUENTIAL
-}
-
-enum ExceptionType {
- GENERAL, ZOOKEEPER, NODE
-}
-
-enum NodeExceptionType {
- NONODE, BADVERSION, NODEEXISTS, NOTEMPTY
-}
-
-enum ZooKeeperExceptionType {
- SYSTEMERROR, RUNTIMEINCONSISTENCY, DATAINCONSISTENCY, CONNECTIONLOSS, MARSHALLINGERROR, UNIMPLEMENTED, OPERATIONTIMEOUT, BADARGUMENTS, APIERROR, NOAUTH, NOCHILDRENFOREPHEMERALS, INVALIDACL, AUTHFAILED, SESSIONEXPIRED, INVALIDCALLBACK, SESSIONMOVED, NOTREADONLY
-}
-
-enum DiscoveryInstanceType {
- DYNAMIC, STATIC, PERMANENT
-}
-
-enum ProviderStrategyType {
- RANDOM, STICKY_RANDOM, STICKY_ROUND_ROBIN, ROUND_ROBIN
-}
-
-struct CuratorProjection {
- 1: string id;
-}
-
-struct ExistsSpec {
- 1: string path;
- 2: bool watched;
- 3: string asyncContext;
-}
-
-struct GetChildrenSpec {
- 1: string path;
- 2: bool watched;
- 3: string asyncContext;
-}
-
-struct GetDataSpec {
- 1: string path;
- 2: bool watched;
- 3: string asyncContext;
- 4: bool decompressed;
-}
-
-struct LeaderEvent {
- 1: string path;
- 2: string participantId;
- 3: bool isLeader;
-}
-
-struct LeaderProjection {
- 1: string id;
-}
-
-struct LeaderResult {
- 1: LeaderProjection projection;
- 2: bool isLeader;
-}
-
-struct LeaseProjection {
- 1: string id;
-}
-
-struct LockProjection {
- 1: string id;
-}
-
-struct NodeCacheProjection {
- 1: string id;
-}
-
-struct OptionalChildrenList {
- 1: list children;
-}
-
-struct OptionalData {
- 1: binary data;
-}
-
-struct OptionalLockProjection {
- 1: LockProjection lockProjection;
-}
-
-struct OptionalPath {
- 1: string path;
-}
-
-struct PathChildrenCacheProjection {
- 1: string id;
-}
-
-struct PersistentEphemeralNodeProjection {
- 1: string id;
-}
-
-struct Id {
- 1: string scheme;
- 2: string id;
-}
-
-struct Participant {
- 1: string id;
- 2: bool isLeader;
-}
-
-struct Stat {
- 1: i64 czxid;
- 2: i64 mzxid;
- 3: i64 ctime;
- 4: i64 mtime;
- 5: i32 version;
- 6: i32 cversion;
- 7: i32 aversion;
- 8: i64 ephemeralOwner;
- 9: i32 dataLength;
- 10: i32 numChildren;
- 11: i64 pzxid;
-}
-
-struct WatchedEvent {
- 1: KeeperState keeperState;
- 2: EventType eventType;
- 3: string path;
-}
-
-struct Version {
- 1: i32 version;
-}
-
-struct DiscoveryProjection {
- 1: string id;
-}
-
-struct DiscoveryProviderProjection {
- 1: string id;
-}
-
-struct CreateSpec {
- 1: string path;
- 2: binary data;
- 3: CreateMode mode;
- 4: string asyncContext;
- 5: bool compressed;
- 6: bool creatingParentsIfNeeded;
- 7: bool withProtection;
- 8: bool creatingParentContainersIfNeeded;
-}
-
-struct DeleteSpec {
- 1: string path;
- 2: bool guaranteed;
- 3: string asyncContext;
- 4: Version version;
-}
-
-struct OptionalStat {
- 1: Stat stat;
-}
-
-struct Acl {
- 1: i32 perms;
- 2: Id id;
-}
-
-struct ChildData {
- 1: string path;
- 2: Stat stat;
- 3: binary data;
-}
-
-struct PathChildrenCacheEvent {
- 1: string cachedPath;
- 2: PathChildrenCacheEventType type;
- 3: ChildData data;
-}
-
-struct SetDataSpec {
- 1: string path;
- 2: bool watched;
- 3: string asyncContext;
- 4: bool compressed;
- 5: Version version;
- 6: binary data;
-}
-
-exception CuratorException {
- 1: ExceptionType type;
- 2: ZooKeeperExceptionType zooKeeperException;
- 3: NodeExceptionType nodeException;
- 4: string message;
-}
-
-struct DiscoveryInstance {
- 1: string name;
- 2: string id;
- 3: string address;
- 4: i32 port;
- 5: i32 sslPort;
- 6: binary payload;
- 7: i64 registrationTimeUTC;
- 8: DiscoveryInstanceType serviceType;
- 9: string uriSpec;
-}
-
-struct CuratorEvent {
- 2: CuratorEventType type;
- 3: i32 resultCode;
- 4: string path;
- 5: string context;
- 6: Stat stat;
- 7: binary data;
- 8: string name;
- 9: list children;
- 10: list aclList;
- 11: WatchedEvent watchedEvent;
- 12: LeaderEvent leaderEvent;
- 13: PathChildrenCacheEvent childrenCacheEvent;
-}
-
-service CuratorService {
- OptionalLockProjection acquireLock(1: CuratorProjection projection, 2: string path, 3: i32 maxWaitMs) throws (1: CuratorException ex1);
- list 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);
- OptionalStat exists(1: CuratorProjection projection, 2: ExistsSpec spec) throws (1: CuratorException ex1);
- OptionalChildrenList getChildren(1: CuratorProjection projection, 2: GetChildrenSpec spec) throws (1: CuratorException ex1);
- OptionalData getData(1: CuratorProjection projection, 2: GetDataSpec spec) throws (1: CuratorException ex1);
- list getLeaderParticipants(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
- ChildData getNodeCacheData(1: CuratorProjection projection, 2: NodeCacheProjection cacheProjection) throws (1: CuratorException ex1);
- list getPathChildrenCacheData(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection) throws (1: CuratorException ex1);
- ChildData getPathChildrenCacheDataForPath(1: CuratorProjection projection, 2: PathChildrenCacheProjection cacheProjection, 3: string path) throws (1: CuratorException ex1);
- bool isLeader(1: CuratorProjection projection, 2: LeaderProjection leaderProjection) throws (1: CuratorException ex1);
- CuratorProjection newCuratorProjection(1: string connectionName) throws (1: CuratorException ex1);
- oneway void pingCuratorProjection(1: CuratorProjection projection);
- OptionalStat setData(1: CuratorProjection projection, 2: SetDataSpec spec) throws (1: CuratorException ex1);
- LeaderResult startLeaderSelector(1: CuratorProjection projection, 2: string path, 3: string participantId, 4: i32 waitForLeadershipMs) throws (1: CuratorException ex1);
- NodeCacheProjection startNodeCache(1: CuratorProjection projection, 2: string path, 3: bool dataIsCompressed, 4: bool buildInitial) throws (1: CuratorException ex1);
- PathChildrenCacheProjection startPathChildrenCache(1: CuratorProjection projection, 2: string path, 3: bool cacheData, 4: bool dataIsCompressed, 5: PathChildrenCacheStartMode startMode) throws (1: CuratorException ex1);
- PersistentEphemeralNodeProjection startPersistentEphemeralNode(1: CuratorProjection projection, 2: string path, 3: binary data, 4: PersistentEphemeralNodeMode mode) throws (1: CuratorException ex1);
- void sync(1: CuratorProjection projection, 2: string path, 3: string asyncContext) throws (1: CuratorException ex1);
-}
-
-service EventService {
- CuratorEvent getNextEvent(1: CuratorProjection projection) throws (1: CuratorException ex1);
-}
-
-service DiscoveryService {
- list getAllInstances(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
- DiscoveryInstance getInstance(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection) throws (1: CuratorException ex1);
- DiscoveryInstance makeDiscoveryInstance(1: string name, 2: binary payload, 3: i32 port) throws (1: CuratorException ex1);
- void noteError(1: CuratorProjection projection, 2: DiscoveryProviderProjection providerProjection, 3: string instanceId) throws (1: CuratorException ex1);
- DiscoveryProjection startDiscovery(1: CuratorProjection projection, 2: string basePath, 3: DiscoveryInstance yourInstance) throws (1: CuratorException ex1);
- DiscoveryProviderProjection startProvider(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string serviceName, 4: ProviderStrategyType providerStrategy, 5: i32 downTimeoutMs, 6: i32 downErrorThreshold) throws (1: CuratorException ex1);
-}
-
-service DiscoveryServiceLowLevel {
- DiscoveryInstance queryForInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string name, 4: string id) throws (1: CuratorException ex1);
- list queryForInstances(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: string name) throws (1: CuratorException ex1);
- list queryForNames(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection) throws (1: CuratorException ex1);
- void registerInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
- void unregisterInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
- void updateInstance(1: CuratorProjection projection, 2: DiscoveryProjection discoveryProjection, 3: DiscoveryInstance instance) throws (1: CuratorException ex1);
-}
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
deleted file mode 100644
index 56f6cfe92c..0000000000
--- a/curator-x-rpc/src/site/confluence/configuration.confluence
+++ /dev/null
@@ -1,143 +0,0 @@
-[[Curator RPC Proxy|index.html]] / Configuration
-
-h1. Configuration
-
-h2. Introduction
-
-Curator RPC uses [[Dropwizard|http://dropwizard.readthedocs.org/en/latest/]] for configuration. You can write the configuration in JSON or YAML.
-It can be passed to Curator RPC via a file or directly on the command line. i.e.
-
-{noformat}
-# via command line
-java -jar curator-x-rpc-VERSION.jar '{"thrift":{"port": 8080}}'
-{noformat}
-
-{noformat}
-# via file
-java -jar curator-x-rpc-VERSION.jar path/to/config.json
-{noformat}
-
-h2. Example
-
-Here is an example JSON configuration file
-
-{noformat}
-{
- "projectionExpiration": "15s",
-
- "thrift": {
- "port": 1234
- },
-
- "pingTime": "10s",
-
- "logging": {
- "level": "INFO",
-
- "appenders": [
- {
- "type": "file",
- "currentLogFilename": "logs/curator-rpc.log",
- "archivedLogFilenamePattern": "logs/curator-rpc-%d.log.gz",
- "archivedFileCount": 10,
- "timeZone": "UTC"
- },
-
- {
- "type": "console"
- }
- ]
- },
-
- "connections": [
- {
- "name": "main",
- "connectionString": "one:1,two:2",
- "sessionLength": "3m",
- "connectionTimeout": "20s",
- "retry": {
- "type": "exponential-backoff",
- "baseSleepTime": "1s",
- "maxRetries": 10
- }
- },
-
- {
- "name": "alt",
- "connectionString": "three:3,four:4",
- "sessionLength": "4m",
- "connectionTimeout": "30s",
- "retry": {
- "type": "ntimes",
- "sleepBetweenRetries": "1m",
- "n": 10
- }
- }
- ]
-}
-{noformat}
-
-
-h2. Main
-
-||Name||Type||Default Value||Description||
-|thrift|Thrift|n/a|Thrift server configuration|
-|logging|Logging|n/a|log file configuration|
-|projectionExpiration|Duration|3 minutes|Curator Projection instances will be automatically closed if not accessed within this amount of time|
-|pingTime|Duration|5 seconds|The EventService will return a PING event if this time elapses without some other event being generated|
-|connections|List of Connection|n/a|List of ZooKeeper connections|
-
-h2. Duration
-
-Durations are strings that specify a time duration. Examples:
-* "10s" \- 10 seconds
-* "100ms" \- 100 milliseconds
-* "3h" \- 3 hours
-
-h2. Thrift
-
-||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.|
-
-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.
-
-h2. Connection
-
-||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|
-
-h2. Retry
-
-The retry policy configuration depends on what type is used. There are three types supported:
-
-||Name||Type||Default Value||Description||
-|type|string|n/a|*exponential\-backoff*|
-|baseSleepTime|Duration|100 milliseconds|The base sleep time|
-|maxRetries|int|3|The max retries|
-|\_|\_|\_|\_|
-|type|string|n/a|*bounded\-exponential\-backoff*|
-|baseSleepTime|Duration|100 milliseconds|The base sleep time|
-|maxSleepTime|Duration|30 seconds|The max sleep time|
-|maxRetries|int|3|The max retries|
-|\_|\_|\_|\_|
-|type|string|n/a|*ntimes*|
-|sleepBetweenRetries|int|100 milliseconds|sleep time between retries|
-|n|int|3|the number of retries|
-
-h2. Authorization
-
-||Name||Type||Description||
-|scheme|string|the authorization scheme|
-|auth|string|the authorization auth|
diff --git a/curator-x-rpc/src/site/confluence/deploy.confluence b/curator-x-rpc/src/site/confluence/deploy.confluence
deleted file mode 100644
index 3f5053bd4d..0000000000
--- a/curator-x-rpc/src/site/confluence/deploy.confluence
+++ /dev/null
@@ -1,31 +0,0 @@
-[[Curator RPC Proxy|index.html]] / Deployment
-
-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/|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
-{noformat}
-
-The argument is either a configuration file or a JSON or YAML string. Call without the argument for help text. See [[Configuration|configuration.html]] for details.
-
-h2. Deploying
-
-Curator RPC is designed to have an instance of its Thrift Server co\-located on each client instance that needs to connect to ZooKeeper
-(see the figure below). Each Curator RPC instance is configured (see [[Configuration|configuration.html]]) to connect to one or more
-ZooKeeper clusters. The Curator Framework instances are maintained inside of the Curator RPC instances and RPC clients reference these instances by name.
-
-How you configure your server to launch depends on your environment and other needs. Here are some suggestions:
-
-* [Airlift Launcher|https://github.com/airlift/airlift/tree/master/launcher]
-* [Docker|https://www.docker.io/]
-* [One-JAR|http://one-jar.sourceforge.net/]
-* [Capsule|https://github.com/puniverse/capsule]
-
-h2. Topology
-
-!images/topology.png!
diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence
deleted file mode 100644
index 6a3e29be48..0000000000
--- a/curator-x-rpc/src/site/confluence/events.confluence
+++ /dev/null
@@ -1,90 +0,0 @@
-[[Curator RPC Proxy|index.html]] / Events
-
-h1. Events
-
-h2. Event Loop
-
-In order to receive out\-of\-bounds messages (connection state changes, watcher triggers, etc.) you must have an event loop to recieve
-messages from the EventService. Here is pseudo code:
-
-{code}
-inThread => {
- while isOpen {
- event = eventService.getNextEvent(curatorProjection)
- ... process event ...
- }
-}
-{code}
-
-*IMPORTANT:* your event handling should operate as quickly as possible. You should return to calling getNextEvent() as soon as possible.
-
-h2. Schema
-
-h3. CuratorEvent
-
-||Field||Type||Description||
-|type|CuratorEventType|The event type|
-|resultCode|int|some event types have a result code (i.e. async API calls)|
-|path|string|if there is a path associated with the event|
-|context|string|async context for async API calls|
-|stat|Stat|some event types have a ZooKeeper Stat object|
-|data|bytes|ZNode data if the event type has it|
-|name|string|ZNode name if the event type has it|
-|children|list of string|list of node names if the event type has it|
-|aclList|list of Acl|list of ACL data if the event type has it|
-|watchedEvent|WatchedEvent|if the event type is WATCHED|
-|leaderEvent|LeaderEvent|if the event type is LEADER|
-|childrenCacheEvent|PathChildrenCacheEvent|if the event type is PATH\_CHILDREN\_CACHE|
-
-h3. CuratorEventType
-
-||Value||Description||
-|PING|Returned if no events have been generated within the [[configured|configuration.html]] pingTime|
-|CREATE|Async createNode() API completion|
-|DELETE|Async deleteNode() API completion|
-|EXISTS|Async exists() API completion|
-|GET\_DATA|Async getData() API completion|
-|SET\_DATA|Async setData() API completion|
-|CHILDREN|Async getChildren() API completion|
-|SYNC|Async sync() API completion|
-|WATCHED|A watcher has triggered|
-|CONNECTION\_CONNECTED|A Curator ConnectionStateListener is installed. This event is for the initial successful connection.|
-|CONNECTION\_SUSPENDED|A Curator ConnectionStateListener is installed. This event means the connection has been suspended.|
-|CONNECTION\_RECONNECTED|A Curator ConnectionStateListener is installed. This event means the connection has been reconnected.|
-|CONNECTION\_LOST|A Curator ConnectionStateListener is installed. This event means the connection has been lost.|
-|CONNECTION\_READ\_ONLY|A Curator ConnectionStateListener is installed. This event means the connection has changed to read only.|
-|LEADER|A Leader recipe event|
-|PATH\_CHILDREN\_CACHE|A path children cache event|
-|NODE\_CACHE|The node for a node cache has changed|
-
-h3. LeaderEvent
-
-||Field||Type||Description||
-|path|string|The leader's path|
-|participantId|string|The participant ID for the event being reported|
-|isLeader|bool|if true, this participant is being made leader. If false, it is losing leadership.|
-
-h3. PathChildrenCacheEvent
-
-||Field||Type||Description||
-|cachedPath|name|The path being cached|
-|type|PathChildrenCacheEventType|cache event type|
-|data|ChildData|data for the child ZNode|
-
-h3. PathChildrenCacheEventType
-
-Values: CHILD\_ADDED,
- CHILD\_UPDATED,
- CHILD\_REMOVED,
- CONNECTION\_SUSPENDED,
- CONNECTION\_RECONNECTED,
- CONNECTION\_LOST,
- INITIALIZED
-
-h3. ChildData
-
-||Field||Type||Description||
-|path|string|The ZNode path|
-|stat|Stat|ZooKeeper Stat object|
-|data|bytes|ZNode data (if the cache is configured to cache data)|
-
diff --git a/curator-x-rpc/src/site/confluence/index.confluence b/curator-x-rpc/src/site/confluence/index.confluence
deleted file mode 100644
index 70077ac196..0000000000
--- a/curator-x-rpc/src/site/confluence/index.confluence
+++ /dev/null
@@ -1,49 +0,0 @@
-h1. Curator RPC Proxy
-
-h2. Packaging
-
-Curator RPC Proxy is in its own package in Maven Central: curator\-x\-rpc
-
-h2. What Is a Curator RPC?
-
-The Curator RPC module implements a proxy that bridges non\-java environments with the Curator framework and recipes. It uses
-[[Apache Thrift|http://thrift.apache.org]] which supports a large set of languages and environments.
-
-The benefits of Curator RPC are:
-
-* Gives access to Curator to non JVM languages/environments
-** Curator has become the de\-facto JVM client library for ZooKeeper
-** Curator makes using Apache ZooKeeper much easier
-** Curator contains well\-tested recipes for many common ZooKeeper usages
-* Organizations can unify their ZooKeeper usage across languages/environments (i.e. use Curator's Service Discovery recipe)
-* The quality of ZooKeeper clients for some non\-JVM languages is lacking
-* There are Thrift implementations for a large number of languages/environments
-
-h2. Thrift File
-
-The current Curator RPC Thrift File can be found here: [[https://raw.githubusercontent.com/apache/curator/master/curator-x-rpc/src/main/thrift/curator.thrift]]. Use
-this to generate code for the language/environment you need.
-
-h2. Deployment
-
-See the [[Deployment Page|deploy.html]] for details on deploying the RPC proxy.
-
-h2. Usage
-
-See the [[Usage Page|usage.html]] for details on using the RPC proxy.
-
-h2. Configuration
-
-See [[Configuration|configuration.html]] for details on configuring the RPC proxy.
-
-h2. Events
-
-See [[Events|events.html]] for details on the Curator RPC event loop and its structure.
-
-h2. Reference
-
-See [[API Reference Page|reference.html]] for the API reference.
-
-----
-
-Special thanks to the [[Facebook Swift|https://github.com/facebook/swift/]] project which makes writing a Java Thrift server much easier.
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
deleted file mode 100644
index bb7ea46faa..0000000000
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ /dev/null
@@ -1,120 +0,0 @@
-[[Curator RPC Proxy|index.html]] / Reference
-
-h1. API Reference
-
-h2. CuratorService
-
-||API||Arguments||Return Value||Description||
-|newCuratorProjection|connectionName|CuratorProjection|Allocates a projection to a configured CuratorFramework instance in the RPC server. "connectionName" is the name of a [[configured|configuration.html]] connection.|
-|closeCuratorProjection|CuratorProjection|void|Close a CuratorProjection. Also closes any recipes, etc. created for the projection.|
-|pingCuratorProjection|CuratorProjection|void|Keeps the CuratorProjection from timing out. NOTE: your [[EventService|events.html]] event loop will do this for you.|
-|createNode|CreateSpec|Created path name|Create a ZNode|
-|deleteNode|DeleteSpec|void|Delete a ZNode|
-|getData|GetDataSpec|bytes|Return a ZNode's data|
-|setData|SetDataSpec|Stat|Set a ZNode's data|
-|exists|ExistsSpec|Stat|Check if a ZNode exists|
-|getChildren|GetChildrenSpec|List of nodes|Get the child nodes for a ZNode|
-|sync|path and async context|void|Do a ZooKeeper sync|
-|closeGenericProjection|id|void|Closes any projection. All projections have an "id" field. This is the value to pass.|
-|acquireLock|path, maxWaitMs|optional lock projection|Acquire a lock for the given path. Will wait at most maxWaitMs to acquire the lock. If the acquisition fails, result will be null.|
-|startLeaderSelector|path, participantId, waitForLeadershipMs|LeaderResult|Start a leader selector on the given path. The instance will be assigned the specified participantId. If waitForLeadershipMs is non\-zero, the method will block for that amount of time waiting for leadership.|
-|getLeaderParticipants|leaderProjection|List of Participant|Return the participants in a leader selector|
-|isLeader|leaderProjection|bool|Return true if the specified projection is the current leader|
-|startPathChildrenCache|path, cacheData, dataIsCompressed, startMode|cache projection|Start a PathChildrenCache for the given path. Can optionally cache data, use compressed data.|
-|getPathChildrenCacheData|cacheProjection|List of ChildData|Get all the data for a path cache|
-|getPathChildrenCacheDataForPath|cacheProjection, path|ChildData|Get the data for a single ZNode in a path cache|
-|startNodeCache|path, dataIsCompressed, buildInitial|node cache projection|Start a node cache for the given path. Can optionally use compressed data and build the initial cache.|
-|getNodeCacheData|node cache projection|ChildData|Return the data for the cached node. If the node doesn't exist, the fields of the ChildData object will be null.|
-|startPersistentEphemeralNode|path, data, mode|projection|Start a PersistentEphemeralNode for the given path using the given data and mode.|
-|acquireSemaphore|path, acquireQty, maxWaitMs, maxLeases|List of lease projections|Acquire one or more leases for a semaphore on the given path. acquireQty is the number of leases to acquire. maxWaitMs is the max time to wait to get the leases. maxLeases is the maximum leases to allow for the semaphore. If the number of leases cannot be acquired within the max time, an empty list is returned.|
-
-h2. EventService
-
-||API||Arguments||Return Value||Description||
-|getNextEvent|CuratorProjection|CuratorEvent|Returns the next queued event for the given CuratorProjection. If no events are queued within the [[configured|configuration.html]] ping time, a PING event is returned.|
-
-See the [[Events Page|events.html]] for the CuratorEvent schema reference.
-
-h2. DiscoveryService
-
-||API||Arguments||Return Value||Description||
-|makeDiscoveryInstance|name, payload, port|DiscoveryInstance|Return a completed DiscoveryInstance using the RPC server's address and the given name, payload and port.|
-|startDiscovery|basePath, yourInstance|discovery projection|Start a Service Discovery instance on the given path. If yourInstance is not null it will be registered as the local service.|
-|startProvider|discoveryProjection, serviceName, providerStrategy, downTimeoutMs, downErrorThreshold|provider projection|start a Service Discovery Provider to return instances for the given service name using the given provider strategy. Specify "down" instance characteristics with downTimeoutMs and downErrorThreshold.|
-|getInstance|provider projection|DiscoveryInstance|Return a single instance for the given service|
-|getAllInstances|provider projection|list of DiscoveryInstance|Return all instances for the given service|
-|noteError|provider projection, service id|void|Note an error for the given service instance|
-
-h1. Struct Reference
-
-h2. CreateSpec
-
-||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|
-|creatingParentContainersIfNeeded|bool|\-|if true, create any needed parent nodes as CONTAINERs|
-
-h2. DeleteSpec
-
-||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||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||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||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||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
-
-||Field||Type||Description||
-|projection|LeaderProjection|the projection of the leader|
-|isLeader|bool|true if this projection is the leader|
-
-h2. Participant
-
-||Field||Type||Description||
-|id|string|participant id|
-|isLeader|bool|true if this participant is the leader|
-
-h2. ChildData
-
-||Field||Type||Description||
-|path|string|the ZNode path|
-|stat|Stat|ZooKeeper stat for the node|
-|data|bytes|node data or null|
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
deleted file mode 100644
index 047ae5e4ac..0000000000
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ /dev/null
@@ -1,115 +0,0 @@
-[[Curator RPC Proxy|index.html]] / Usage
-
-h1. Usage
-
-h2. Thrift File
-
-The first step in using the RPC Proxy is to process the Curator RPC Thrift file into your desired language/environment.
-The current Curator RPC Thrift File can be found here: [[https://raw.githubusercontent.com/apache/curator/master/curator-x-rpc/src/main/thrift/curator.thrift]].
-Details on using Apache Thrift can be found here: [[http://thrift.apache.org]].
-
-h2. Prerequisites
-
-It's assumed you are already familiar with ZooKeeper and Curator. Also, familiarity with writing Thrift applications is helpful.
-
-h2. Services
-
-Three Thrift Services are included with the Curator RPC:
-
-||Service||Description||
-|CuratorService|The main service for accessing the Curator APIs and recipes|
-|EventService|Used to receive out\-of\-band messages for callbacks, watchers, etc. See [Events|events.html] for details.|
-|DiscoveryService|Curator's ServiceDiscovery recipe|
-
-h2. Concepts
-
-h4. Projections
-
-Many of the Curator RPC APIs refer to "projections" (e.g. CuratorProjection). A projection is an id that refers
-to a real object instance inside of the RPC server. The projection is a "handle" or "cookie" that directly refers to that instance.
-
-h4. Thrift Client Equals a Thread
-
-It's important to remember that each thrift client is the equivalent of a system thread. i.e. you cannot have multiple outstanding
-calls in multiple threads with a given client. For each thread, you should allocate a separate client. A Thrift Client maps directly
-to a single TCP/IP socket.
-
-h4. Event Loop
-
-You must dedicate a separate thread for getting events via the Curator RPC [EventService|events.html]. Curator will report async results,
-connection state changes, watcher triggers, etc. via this event loop.
-
-h4. CuratorProjection Expiration
-
-If you don't make an API call using a CuratorProjection within the [configured timeout|configuration.html] the projection instance
-will be closed and any open recipes, etc. associated with it will be closed. NOTE: calls to the EventService will cause the
-CuratorProjection to be "touched". So, as long as your event loop is running your CuratorProjection instance will be kept open.
-
-h2. Initialization
-
-After setting up Thrift, create a connection to the CuratorService and the EventService. If you plan on using Curator Discovery, create a connection
-to DiscoveryService. Allocate a CuratorProjection instance and then start a thread watching events for that instance. Here is pseudo code:
-
-{code}
-CuratorService.Client curatorService = new CuratorService.Client()
-EventService.Client eventService = new EventService.Client()
-
-curatorProjection = curatorService.newCuratorProjection(name)
-
-inThread => {
- while isOpen {
- event = eventService.getNextEvent(curatorProjection)
- ... process event ...
- }
-}
-
-... in your application shutdown
-client.closeCuratorProjection(curatorProjection)
-{code}
-
-h2. Usage
-
-Once initialized, use recipes/APIs as needed. Here is an example of using the lock recipe:
-
-{code}
-optionalLock = client.acquireLock(curatorProjection, "/mylock", 10000)
-if optionalLock.lockProjection == null {
- // lock attempt failed. Throw exception, etc.
-}
-lockProjection = optionalLock.lockProjection
-
-try
- // you now own the lock
-finally
- client.closeGenericProjection(curatorProjection, lockProjection.id)
-{code}
-
-Here is an example of using the path cache:
-
-{code}
-cacheProjection = client.startPathChildrenCache(curatorProjection, "/path", true, false, BUILD_INITIAL_CACHE)
-
-...
-
-data = client.getPathChildrenCacheDataForPath(curatorProjection, cacheProjection, "/path/child")
-
-...
-
-// in your event loop, you will get events for the cache. e.g.
-event = eventService.getNextEvent(curatorProjection)
-if event.type == PATH_CHILDREN_CACHE {
- if event.childrenCacheEvent.type == CHILD_UPDATED {
- // node described by event.childrenCacheEvent.data has changed
- // event.childrenCacheEvent.cachedPath is the path that was passed to startPathChildrenCache()
- }
-}
-
-...
-
-// when done with the cache, close it
-client.closeGenericProjection(curatorProjection, cacheProjection.id)
-{code}
-
-h2. Reference
-
-See [[API Reference Page|reference.html]] for the API reference.
diff --git a/curator-x-rpc/src/site/resources/images/topology.png b/curator-x-rpc/src/site/resources/images/topology.png
deleted file mode 100644
index cec7330ae0..0000000000
Binary files a/curator-x-rpc/src/site/resources/images/topology.png and /dev/null differ
diff --git a/curator-x-rpc/src/site/site.xml b/curator-x-rpc/src/site/site.xml
deleted file mode 100644
index fca1e73a7b..0000000000
--- a/curator-x-rpc/src/site/site.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/Acl.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/Acl.java
deleted file mode 100644
index a31e11e01e..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/Acl.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Acl implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Acl");
-
- private static final org.apache.thrift.protocol.TField PERMS_FIELD_DESC = new org.apache.thrift.protocol.TField("perms", org.apache.thrift.protocol.TType.I32, (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.STRUCT, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new AclStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AclTupleSchemeFactory());
- }
-
- public int perms; // required
- public Id 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 {
- PERMS((short)1, "perms"),
- ID((short)2, "id");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // PERMS
- return PERMS;
- case 2: // ID
- return ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- private static final int __PERMS_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.PERMS, new org.apache.thrift.meta_data.FieldMetaData("perms", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Id.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Acl.class, metaDataMap);
- }
-
- public Acl() {
- }
-
- public Acl(
- int perms,
- Id id)
- {
- this();
- this.perms = perms;
- setPermsIsSet(true);
- this.id = id;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public Acl(Acl other) {
- __isset_bitfield = other.__isset_bitfield;
- this.perms = other.perms;
- if (other.isSetId()) {
- this.id = new Id(other.id);
- }
- }
-
- public Acl deepCopy() {
- return new Acl(this);
- }
-
- @Override
- public void clear() {
- setPermsIsSet(false);
- this.perms = 0;
- this.id = null;
- }
-
- public int getPerms() {
- return this.perms;
- }
-
- public Acl setPerms(int perms) {
- this.perms = perms;
- setPermsIsSet(true);
- return this;
- }
-
- public void unsetPerms() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERMS_ISSET_ID);
- }
-
- /** Returns true if field perms is set (has been assigned a value) and false otherwise */
- public boolean isSetPerms() {
- return EncodingUtils.testBit(__isset_bitfield, __PERMS_ISSET_ID);
- }
-
- public void setPermsIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERMS_ISSET_ID, value);
- }
-
- public Id getId() {
- return this.id;
- }
-
- public Acl setId(Id 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 PERMS:
- if (value == null) {
- unsetPerms();
- } else {
- setPerms((Integer)value);
- }
- break;
-
- case ID:
- if (value == null) {
- unsetId();
- } else {
- setId((Id)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case PERMS:
- return Integer.valueOf(getPerms());
-
- case ID:
- return getId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case PERMS:
- return isSetPerms();
- case ID:
- return isSetId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof Acl)
- return this.equals((Acl)that);
- return false;
- }
-
- public boolean equals(Acl that) {
- if (that == null)
- return false;
-
- boolean this_present_perms = true;
- boolean that_present_perms = true;
- if (this_present_perms || that_present_perms) {
- if (!(this_present_perms && that_present_perms))
- return false;
- if (this.perms != that.perms)
- return false;
- }
-
- boolean this_present_id = true && this.isSetId();
- boolean that_present_id = true && that.isSetId();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(Acl other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetPerms()).compareTo(other.isSetPerms());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetPerms()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.perms, other.perms);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("Acl(");
- boolean first = true;
-
- sb.append("perms:");
- sb.append(this.perms);
- first = false;
- if (!first) sb.append(", ");
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (id != null) {
- id.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 AclStandardSchemeFactory implements SchemeFactory {
- public AclStandardScheme getScheme() {
- return new AclStandardScheme();
- }
- }
-
- private static class AclStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, Acl 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: // PERMS
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.perms = iprot.readI32();
- struct.setPermsIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.id = new Id();
- struct.id.read(iprot);
- struct.setIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, Acl struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldBegin(PERMS_FIELD_DESC);
- oprot.writeI32(struct.perms);
- oprot.writeFieldEnd();
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- struct.id.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class AclTupleSchemeFactory implements SchemeFactory {
- public AclTupleScheme getScheme() {
- return new AclTupleScheme();
- }
- }
-
- private static class AclTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, Acl struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetPerms()) {
- optionals.set(0);
- }
- if (struct.isSetId()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetPerms()) {
- oprot.writeI32(struct.perms);
- }
- if (struct.isSetId()) {
- struct.id.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, Acl struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.perms = iprot.readI32();
- struct.setPermsIsSet(true);
- }
- if (incoming.get(1)) {
- struct.id = new Id();
- struct.id.read(iprot);
- struct.setIdIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/ChildData.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/ChildData.java
deleted file mode 100644
index 368fda9d66..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/ChildData.java
+++ /dev/null
@@ -1,604 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChildData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ChildData");
-
- 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 STAT_FIELD_DESC = new org.apache.thrift.protocol.TField("stat", org.apache.thrift.protocol.TType.STRUCT, (short)2);
- private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)3);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ChildDataStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ChildDataTupleSchemeFactory());
- }
-
- public String path; // required
- public Stat stat; // required
- public ByteBuffer data; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- PATH((short)1, "path"),
- STAT((short)2, "stat"),
- DATA((short)3, "data");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // PATH
- return PATH;
- case 2: // STAT
- return STAT;
- case 3: // DATA
- return DATA;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.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.STAT, new org.apache.thrift.meta_data.FieldMetaData("stat", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Stat.class)));
- tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ChildData.class, metaDataMap);
- }
-
- public ChildData() {
- }
-
- public ChildData(
- String path,
- Stat stat,
- ByteBuffer data)
- {
- this();
- this.path = path;
- this.stat = stat;
- this.data = data;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public ChildData(ChildData other) {
- if (other.isSetPath()) {
- this.path = other.path;
- }
- if (other.isSetStat()) {
- this.stat = new Stat(other.stat);
- }
- if (other.isSetData()) {
- this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
-;
- }
- }
-
- public ChildData deepCopy() {
- return new ChildData(this);
- }
-
- @Override
- public void clear() {
- this.path = null;
- this.stat = null;
- this.data = null;
- }
-
- public String getPath() {
- return this.path;
- }
-
- public ChildData setPath(String path) {
- this.path = path;
- return this;
- }
-
- public void unsetPath() {
- this.path = null;
- }
-
- /** Returns true if field path is set (has been assigned a value) and false otherwise */
- public boolean isSetPath() {
- return this.path != null;
- }
-
- public void setPathIsSet(boolean value) {
- if (!value) {
- this.path = null;
- }
- }
-
- public Stat getStat() {
- return this.stat;
- }
-
- public ChildData setStat(Stat stat) {
- this.stat = stat;
- return this;
- }
-
- public void unsetStat() {
- this.stat = null;
- }
-
- /** Returns true if field stat is set (has been assigned a value) and false otherwise */
- public boolean isSetStat() {
- return this.stat != null;
- }
-
- public void setStatIsSet(boolean value) {
- if (!value) {
- this.stat = null;
- }
- }
-
- public byte[] getData() {
- setData(org.apache.thrift.TBaseHelper.rightSize(data));
- return data == null ? null : data.array();
- }
-
- public ByteBuffer bufferForData() {
- return data;
- }
-
- public ChildData setData(byte[] data) {
- setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
- return this;
- }
-
- public ChildData setData(ByteBuffer data) {
- this.data = data;
- return this;
- }
-
- public void unsetData() {
- this.data = null;
- }
-
- /** Returns true if field data is set (has been assigned a value) and false otherwise */
- public boolean isSetData() {
- return this.data != null;
- }
-
- public void setDataIsSet(boolean value) {
- if (!value) {
- this.data = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case PATH:
- if (value == null) {
- unsetPath();
- } else {
- setPath((String)value);
- }
- break;
-
- case STAT:
- if (value == null) {
- unsetStat();
- } else {
- setStat((Stat)value);
- }
- break;
-
- case DATA:
- if (value == null) {
- unsetData();
- } else {
- setData((ByteBuffer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case PATH:
- return getPath();
-
- case STAT:
- return getStat();
-
- case DATA:
- return getData();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case PATH:
- return isSetPath();
- case STAT:
- return isSetStat();
- case DATA:
- return isSetData();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ChildData)
- return this.equals((ChildData)that);
- return false;
- }
-
- public boolean equals(ChildData that) {
- if (that == null)
- 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_stat = true && this.isSetStat();
- boolean that_present_stat = true && that.isSetStat();
- if (this_present_stat || that_present_stat) {
- if (!(this_present_stat && that_present_stat))
- return false;
- if (!this.stat.equals(that.stat))
- return false;
- }
-
- boolean this_present_data = true && this.isSetData();
- boolean that_present_data = true && that.isSetData();
- if (this_present_data || that_present_data) {
- if (!(this_present_data && that_present_data))
- return false;
- if (!this.data.equals(that.data))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(ChildData other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- 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(isSetStat()).compareTo(other.isSetStat());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetStat()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stat, other.stat);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetData()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- 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("ChildData(");
- boolean first = true;
-
- sb.append("path:");
- if (this.path == null) {
- sb.append("null");
- } else {
- sb.append(this.path);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("stat:");
- if (this.stat == null) {
- sb.append("null");
- } else {
- sb.append(this.stat);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("data:");
- if (this.data == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.data, sb);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- if (stat != null) {
- stat.validate();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class ChildDataStandardSchemeFactory implements SchemeFactory {
- public ChildDataStandardScheme getScheme() {
- return new ChildDataStandardScheme();
- }
- }
-
- private static class ChildDataStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ChildData 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: // 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 2: // STAT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.stat = new Stat();
- struct.stat.read(iprot);
- struct.setStatIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- 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, ChildData struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.path != null) {
- oprot.writeFieldBegin(PATH_FIELD_DESC);
- oprot.writeString(struct.path);
- oprot.writeFieldEnd();
- }
- if (struct.stat != null) {
- oprot.writeFieldBegin(STAT_FIELD_DESC);
- struct.stat.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- oprot.writeBinary(struct.data);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ChildDataTupleSchemeFactory implements SchemeFactory {
- public ChildDataTupleScheme getScheme() {
- return new ChildDataTupleScheme();
- }
- }
-
- private static class ChildDataTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ChildData struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetPath()) {
- optionals.set(0);
- }
- if (struct.isSetStat()) {
- optionals.set(1);
- }
- if (struct.isSetData()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.isSetPath()) {
- oprot.writeString(struct.path);
- }
- if (struct.isSetStat()) {
- struct.stat.write(oprot);
- }
- if (struct.isSetData()) {
- oprot.writeBinary(struct.data);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ChildData struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.path = iprot.readString();
- struct.setPathIsSet(true);
- }
- if (incoming.get(1)) {
- struct.stat = new Stat();
- struct.stat.read(iprot);
- struct.setStatIsSet(true);
- }
- if (incoming.get(2)) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateMode.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateMode.java
deleted file mode 100644
index 1d19620210..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateMode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum CreateMode implements org.apache.thrift.TEnum {
- PERSISTENT(0),
- PERSISTENT_SEQUENTIAL(1),
- EPHEMERAL(2),
- EPHEMERAL_SEQUENTIAL(3);
-
- private final int value;
-
- private CreateMode(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static CreateMode findByValue(int value) {
- switch (value) {
- case 0:
- return PERSISTENT;
- case 1:
- return PERSISTENT_SEQUENTIAL;
- case 2:
- return EPHEMERAL;
- case 3:
- return EPHEMERAL_SEQUENTIAL;
- default:
- return null;
- }
- }
-}
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateSpec.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateSpec.java
deleted file mode 100644
index bd5537d920..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CreateSpec.java
+++ /dev/null
@@ -1,1001 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CreateSpec implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateSpec");
-
- 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 DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("mode", org.apache.thrift.protocol.TType.I32, (short)3);
- 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)4);
- 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)5);
- private static final org.apache.thrift.protocol.TField CREATING_PARENTS_IF_NEEDED_FIELD_DESC = new org.apache.thrift.protocol.TField("creatingParentsIfNeeded", org.apache.thrift.protocol.TType.BOOL, (short)6);
- private static final org.apache.thrift.protocol.TField WITH_PROTECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("withProtection", org.apache.thrift.protocol.TType.BOOL, (short)7);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CreateSpecStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CreateSpecTupleSchemeFactory());
- }
-
- public String path; // required
- public ByteBuffer data; // required
- /**
- *
- * @see CreateMode
- */
- public CreateMode mode; // required
- public String asyncContext; // required
- public boolean compressed; // required
- public boolean creatingParentsIfNeeded; // required
- public boolean withProtection; // 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 {
- PATH((short)1, "path"),
- DATA((short)2, "data"),
- /**
- *
- * @see CreateMode
- */
- MODE((short)3, "mode"),
- ASYNC_CONTEXT((short)4, "asyncContext"),
- COMPRESSED((short)5, "compressed"),
- CREATING_PARENTS_IF_NEEDED((short)6, "creatingParentsIfNeeded"),
- WITH_PROTECTION((short)7, "withProtection");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // PATH
- return PATH;
- case 2: // DATA
- return DATA;
- case 3: // MODE
- return MODE;
- case 4: // ASYNC_CONTEXT
- return ASYNC_CONTEXT;
- case 5: // COMPRESSED
- return COMPRESSED;
- case 6: // CREATING_PARENTS_IF_NEEDED
- return CREATING_PARENTS_IF_NEEDED;
- case 7: // WITH_PROTECTION
- return WITH_PROTECTION;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- private static final int __COMPRESSED_ISSET_ID = 0;
- private static final int __CREATINGPARENTSIFNEEDED_ISSET_ID = 1;
- private static final int __WITHPROTECTION_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.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- tmpMap.put(_Fields.MODE, new org.apache.thrift.meta_data.FieldMetaData("mode", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CreateMode.class)));
- 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.CREATING_PARENTS_IF_NEEDED, new org.apache.thrift.meta_data.FieldMetaData("creatingParentsIfNeeded", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.WITH_PROTECTION, new org.apache.thrift.meta_data.FieldMetaData("withProtection", 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(CreateSpec.class, metaDataMap);
- }
-
- public CreateSpec() {
- }
-
- public CreateSpec(
- String path,
- ByteBuffer data,
- CreateMode mode,
- String asyncContext,
- boolean compressed,
- boolean creatingParentsIfNeeded,
- boolean withProtection)
- {
- this();
- this.path = path;
- this.data = data;
- this.mode = mode;
- this.asyncContext = asyncContext;
- this.compressed = compressed;
- setCompressedIsSet(true);
- this.creatingParentsIfNeeded = creatingParentsIfNeeded;
- setCreatingParentsIfNeededIsSet(true);
- this.withProtection = withProtection;
- setWithProtectionIsSet(true);
- }
-
- /**
- * Performs a deep copy on other.
- */
- public CreateSpec(CreateSpec other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.isSetPath()) {
- this.path = other.path;
- }
- if (other.isSetData()) {
- this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
-;
- }
- if (other.isSetMode()) {
- this.mode = other.mode;
- }
- if (other.isSetAsyncContext()) {
- this.asyncContext = other.asyncContext;
- }
- this.compressed = other.compressed;
- this.creatingParentsIfNeeded = other.creatingParentsIfNeeded;
- this.withProtection = other.withProtection;
- }
-
- public CreateSpec deepCopy() {
- return new CreateSpec(this);
- }
-
- @Override
- public void clear() {
- this.path = null;
- this.data = null;
- this.mode = null;
- this.asyncContext = null;
- setCompressedIsSet(false);
- this.compressed = false;
- setCreatingParentsIfNeededIsSet(false);
- this.creatingParentsIfNeeded = false;
- setWithProtectionIsSet(false);
- this.withProtection = false;
- }
-
- public String getPath() {
- return this.path;
- }
-
- public CreateSpec setPath(String path) {
- this.path = path;
- return this;
- }
-
- public void unsetPath() {
- this.path = null;
- }
-
- /** Returns true if field path is set (has been assigned a value) and false otherwise */
- public boolean isSetPath() {
- return this.path != null;
- }
-
- public void setPathIsSet(boolean value) {
- if (!value) {
- this.path = null;
- }
- }
-
- public byte[] getData() {
- setData(org.apache.thrift.TBaseHelper.rightSize(data));
- return data == null ? null : data.array();
- }
-
- public ByteBuffer bufferForData() {
- return data;
- }
-
- public CreateSpec setData(byte[] data) {
- setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
- return this;
- }
-
- public CreateSpec setData(ByteBuffer data) {
- this.data = data;
- return this;
- }
-
- public void unsetData() {
- this.data = null;
- }
-
- /** Returns true if field data is set (has been assigned a value) and false otherwise */
- public boolean isSetData() {
- return this.data != null;
- }
-
- public void setDataIsSet(boolean value) {
- if (!value) {
- this.data = null;
- }
- }
-
- /**
- *
- * @see CreateMode
- */
- public CreateMode getMode() {
- return this.mode;
- }
-
- /**
- *
- * @see CreateMode
- */
- public CreateSpec setMode(CreateMode mode) {
- this.mode = mode;
- return this;
- }
-
- public void unsetMode() {
- this.mode = null;
- }
-
- /** Returns true if field mode is set (has been assigned a value) and false otherwise */
- public boolean isSetMode() {
- return this.mode != null;
- }
-
- public void setModeIsSet(boolean value) {
- if (!value) {
- this.mode = null;
- }
- }
-
- public String getAsyncContext() {
- return this.asyncContext;
- }
-
- public CreateSpec setAsyncContext(String asyncContext) {
- this.asyncContext = asyncContext;
- return this;
- }
-
- public void unsetAsyncContext() {
- this.asyncContext = null;
- }
-
- /** Returns true if field asyncContext is set (has been assigned a value) and false otherwise */
- public boolean isSetAsyncContext() {
- return this.asyncContext != null;
- }
-
- public void setAsyncContextIsSet(boolean value) {
- if (!value) {
- this.asyncContext = null;
- }
- }
-
- public boolean isCompressed() {
- return this.compressed;
- }
-
- public CreateSpec 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 boolean isCreatingParentsIfNeeded() {
- return this.creatingParentsIfNeeded;
- }
-
- public CreateSpec setCreatingParentsIfNeeded(boolean creatingParentsIfNeeded) {
- this.creatingParentsIfNeeded = creatingParentsIfNeeded;
- setCreatingParentsIfNeededIsSet(true);
- return this;
- }
-
- public void unsetCreatingParentsIfNeeded() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATINGPARENTSIFNEEDED_ISSET_ID);
- }
-
- /** Returns true if field creatingParentsIfNeeded is set (has been assigned a value) and false otherwise */
- public boolean isSetCreatingParentsIfNeeded() {
- return EncodingUtils.testBit(__isset_bitfield, __CREATINGPARENTSIFNEEDED_ISSET_ID);
- }
-
- public void setCreatingParentsIfNeededIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATINGPARENTSIFNEEDED_ISSET_ID, value);
- }
-
- public boolean isWithProtection() {
- return this.withProtection;
- }
-
- public CreateSpec setWithProtection(boolean withProtection) {
- this.withProtection = withProtection;
- setWithProtectionIsSet(true);
- return this;
- }
-
- public void unsetWithProtection() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WITHPROTECTION_ISSET_ID);
- }
-
- /** Returns true if field withProtection is set (has been assigned a value) and false otherwise */
- public boolean isSetWithProtection() {
- return EncodingUtils.testBit(__isset_bitfield, __WITHPROTECTION_ISSET_ID);
- }
-
- public void setWithProtectionIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WITHPROTECTION_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case PATH:
- if (value == null) {
- unsetPath();
- } else {
- setPath((String)value);
- }
- break;
-
- case DATA:
- if (value == null) {
- unsetData();
- } else {
- setData((ByteBuffer)value);
- }
- break;
-
- case MODE:
- if (value == null) {
- unsetMode();
- } else {
- setMode((CreateMode)value);
- }
- break;
-
- case ASYNC_CONTEXT:
- if (value == null) {
- unsetAsyncContext();
- } else {
- setAsyncContext((String)value);
- }
- break;
-
- case COMPRESSED:
- if (value == null) {
- unsetCompressed();
- } else {
- setCompressed((Boolean)value);
- }
- break;
-
- case CREATING_PARENTS_IF_NEEDED:
- if (value == null) {
- unsetCreatingParentsIfNeeded();
- } else {
- setCreatingParentsIfNeeded((Boolean)value);
- }
- break;
-
- case WITH_PROTECTION:
- if (value == null) {
- unsetWithProtection();
- } else {
- setWithProtection((Boolean)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case PATH:
- return getPath();
-
- case DATA:
- return getData();
-
- case MODE:
- return getMode();
-
- case ASYNC_CONTEXT:
- return getAsyncContext();
-
- case COMPRESSED:
- return Boolean.valueOf(isCompressed());
-
- case CREATING_PARENTS_IF_NEEDED:
- return Boolean.valueOf(isCreatingParentsIfNeeded());
-
- case WITH_PROTECTION:
- return Boolean.valueOf(isWithProtection());
-
- }
- 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 PATH:
- return isSetPath();
- case DATA:
- return isSetData();
- case MODE:
- return isSetMode();
- case ASYNC_CONTEXT:
- return isSetAsyncContext();
- case COMPRESSED:
- return isSetCompressed();
- case CREATING_PARENTS_IF_NEEDED:
- return isSetCreatingParentsIfNeeded();
- case WITH_PROTECTION:
- return isSetWithProtection();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof CreateSpec)
- return this.equals((CreateSpec)that);
- return false;
- }
-
- public boolean equals(CreateSpec that) {
- if (that == null)
- return false;
-
- boolean this_present_path = true && this.isSetPath();
- boolean that_present_path = true && that.isSetPath();
- if (this_present_path || that_present_path) {
- if (!(this_present_path && that_present_path))
- return false;
- if (!this.path.equals(that.path))
- return false;
- }
-
- boolean this_present_data = true && this.isSetData();
- boolean that_present_data = true && that.isSetData();
- if (this_present_data || that_present_data) {
- if (!(this_present_data && that_present_data))
- return false;
- if (!this.data.equals(that.data))
- return false;
- }
-
- boolean this_present_mode = true && this.isSetMode();
- boolean that_present_mode = true && that.isSetMode();
- if (this_present_mode || that_present_mode) {
- if (!(this_present_mode && that_present_mode))
- return false;
- if (!this.mode.equals(that.mode))
- return false;
- }
-
- boolean this_present_asyncContext = true && this.isSetAsyncContext();
- boolean that_present_asyncContext = true && that.isSetAsyncContext();
- if (this_present_asyncContext || that_present_asyncContext) {
- if (!(this_present_asyncContext && that_present_asyncContext))
- return false;
- if (!this.asyncContext.equals(that.asyncContext))
- return false;
- }
-
- 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_creatingParentsIfNeeded = true;
- boolean that_present_creatingParentsIfNeeded = true;
- if (this_present_creatingParentsIfNeeded || that_present_creatingParentsIfNeeded) {
- if (!(this_present_creatingParentsIfNeeded && that_present_creatingParentsIfNeeded))
- return false;
- if (this.creatingParentsIfNeeded != that.creatingParentsIfNeeded)
- return false;
- }
-
- boolean this_present_withProtection = true;
- boolean that_present_withProtection = true;
- if (this_present_withProtection || that_present_withProtection) {
- if (!(this_present_withProtection && that_present_withProtection))
- return false;
- if (this.withProtection != that.withProtection)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(CreateSpec other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetPath()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetData()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMode()).compareTo(other.isSetMode());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMode()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mode, other.mode);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAsyncContext()).compareTo(other.isSetAsyncContext());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAsyncContext()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.asyncContext, other.asyncContext);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- 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(isSetCreatingParentsIfNeeded()).compareTo(other.isSetCreatingParentsIfNeeded());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetCreatingParentsIfNeeded()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creatingParentsIfNeeded, other.creatingParentsIfNeeded);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetWithProtection()).compareTo(other.isSetWithProtection());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetWithProtection()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.withProtection, other.withProtection);
- 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("CreateSpec(");
- boolean first = true;
-
- sb.append("path:");
- if (this.path == null) {
- sb.append("null");
- } else {
- sb.append(this.path);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("data:");
- if (this.data == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.data, sb);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("mode:");
- if (this.mode == null) {
- sb.append("null");
- } else {
- sb.append(this.mode);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("asyncContext:");
- if (this.asyncContext == null) {
- sb.append("null");
- } else {
- sb.append(this.asyncContext);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("compressed:");
- sb.append(this.compressed);
- first = false;
- if (!first) sb.append(", ");
- sb.append("creatingParentsIfNeeded:");
- sb.append(this.creatingParentsIfNeeded);
- first = false;
- if (!first) sb.append(", ");
- sb.append("withProtection:");
- sb.append(this.withProtection);
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class CreateSpecStandardSchemeFactory implements SchemeFactory {
- public CreateSpecStandardScheme getScheme() {
- return new CreateSpecStandardScheme();
- }
- }
-
- private static class CreateSpecStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, CreateSpec 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: // 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 2: // DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // MODE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.mode = CreateMode.findByValue(iprot.readI32());
- struct.setModeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // ASYNC_CONTEXT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.asyncContext = iprot.readString();
- struct.setAsyncContextIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // 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 6: // CREATING_PARENTS_IF_NEEDED
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.creatingParentsIfNeeded = iprot.readBool();
- struct.setCreatingParentsIfNeededIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // WITH_PROTECTION
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.withProtection = iprot.readBool();
- struct.setWithProtectionIsSet(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, CreateSpec struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.path != null) {
- oprot.writeFieldBegin(PATH_FIELD_DESC);
- oprot.writeString(struct.path);
- oprot.writeFieldEnd();
- }
- if (struct.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- oprot.writeBinary(struct.data);
- oprot.writeFieldEnd();
- }
- if (struct.mode != null) {
- oprot.writeFieldBegin(MODE_FIELD_DESC);
- oprot.writeI32(struct.mode.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.asyncContext != null) {
- oprot.writeFieldBegin(ASYNC_CONTEXT_FIELD_DESC);
- oprot.writeString(struct.asyncContext);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
- oprot.writeBool(struct.compressed);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(CREATING_PARENTS_IF_NEEDED_FIELD_DESC);
- oprot.writeBool(struct.creatingParentsIfNeeded);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(WITH_PROTECTION_FIELD_DESC);
- oprot.writeBool(struct.withProtection);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CreateSpecTupleSchemeFactory implements SchemeFactory {
- public CreateSpecTupleScheme getScheme() {
- return new CreateSpecTupleScheme();
- }
- }
-
- private static class CreateSpecTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, CreateSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetPath()) {
- optionals.set(0);
- }
- if (struct.isSetData()) {
- optionals.set(1);
- }
- if (struct.isSetMode()) {
- optionals.set(2);
- }
- if (struct.isSetAsyncContext()) {
- optionals.set(3);
- }
- if (struct.isSetCompressed()) {
- optionals.set(4);
- }
- if (struct.isSetCreatingParentsIfNeeded()) {
- optionals.set(5);
- }
- if (struct.isSetWithProtection()) {
- optionals.set(6);
- }
- oprot.writeBitSet(optionals, 7);
- if (struct.isSetPath()) {
- oprot.writeString(struct.path);
- }
- if (struct.isSetData()) {
- oprot.writeBinary(struct.data);
- }
- if (struct.isSetMode()) {
- oprot.writeI32(struct.mode.getValue());
- }
- if (struct.isSetAsyncContext()) {
- oprot.writeString(struct.asyncContext);
- }
- if (struct.isSetCompressed()) {
- oprot.writeBool(struct.compressed);
- }
- if (struct.isSetCreatingParentsIfNeeded()) {
- oprot.writeBool(struct.creatingParentsIfNeeded);
- }
- if (struct.isSetWithProtection()) {
- oprot.writeBool(struct.withProtection);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, CreateSpec struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(7);
- if (incoming.get(0)) {
- struct.path = iprot.readString();
- struct.setPathIsSet(true);
- }
- if (incoming.get(1)) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- }
- if (incoming.get(2)) {
- struct.mode = CreateMode.findByValue(iprot.readI32());
- struct.setModeIsSet(true);
- }
- if (incoming.get(3)) {
- struct.asyncContext = iprot.readString();
- struct.setAsyncContextIsSet(true);
- }
- if (incoming.get(4)) {
- struct.compressed = iprot.readBool();
- struct.setCompressedIsSet(true);
- }
- if (incoming.get(5)) {
- struct.creatingParentsIfNeeded = iprot.readBool();
- struct.setCreatingParentsIfNeededIsSet(true);
- }
- if (incoming.get(6)) {
- struct.withProtection = iprot.readBool();
- struct.setWithProtectionIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEvent.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEvent.java
deleted file mode 100644
index 23ecbf468b..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEvent.java
+++ /dev/null
@@ -1,1636 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CuratorEvent implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CuratorEvent");
-
- private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField RESULT_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("resultCode", org.apache.thrift.protocol.TType.I32, (short)3);
- 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)4);
- private static final org.apache.thrift.protocol.TField CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("context", org.apache.thrift.protocol.TType.STRING, (short)5);
- private static final org.apache.thrift.protocol.TField STAT_FIELD_DESC = new org.apache.thrift.protocol.TField("stat", org.apache.thrift.protocol.TType.STRUCT, (short)6);
- private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.STRING, (short)7);
- private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)8);
- private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)9);
- private static final org.apache.thrift.protocol.TField ACL_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("aclList", org.apache.thrift.protocol.TType.LIST, (short)10);
- private static final org.apache.thrift.protocol.TField WATCHED_EVENT_FIELD_DESC = new org.apache.thrift.protocol.TField("watchedEvent", org.apache.thrift.protocol.TType.STRUCT, (short)11);
- private static final org.apache.thrift.protocol.TField LEADER_EVENT_FIELD_DESC = new org.apache.thrift.protocol.TField("leaderEvent", org.apache.thrift.protocol.TType.STRUCT, (short)12);
- private static final org.apache.thrift.protocol.TField CHILDREN_CACHE_EVENT_FIELD_DESC = new org.apache.thrift.protocol.TField("childrenCacheEvent", org.apache.thrift.protocol.TType.STRUCT, (short)13);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CuratorEventStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CuratorEventTupleSchemeFactory());
- }
-
- /**
- *
- * @see CuratorEventType
- */
- public CuratorEventType type; // required
- public int resultCode; // required
- public String path; // required
- public String context; // required
- public Stat stat; // required
- public ByteBuffer data; // required
- public String name; // required
- public List children; // required
- public List aclList; // required
- public WatchedEvent watchedEvent; // required
- public LeaderEvent leaderEvent; // required
- public PathChildrenCacheEvent childrenCacheEvent; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- /**
- *
- * @see CuratorEventType
- */
- TYPE((short)2, "type"),
- RESULT_CODE((short)3, "resultCode"),
- PATH((short)4, "path"),
- CONTEXT((short)5, "context"),
- STAT((short)6, "stat"),
- DATA((short)7, "data"),
- NAME((short)8, "name"),
- CHILDREN((short)9, "children"),
- ACL_LIST((short)10, "aclList"),
- WATCHED_EVENT((short)11, "watchedEvent"),
- LEADER_EVENT((short)12, "leaderEvent"),
- CHILDREN_CACHE_EVENT((short)13, "childrenCacheEvent");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 2: // TYPE
- return TYPE;
- case 3: // RESULT_CODE
- return RESULT_CODE;
- case 4: // PATH
- return PATH;
- case 5: // CONTEXT
- return CONTEXT;
- case 6: // STAT
- return STAT;
- case 7: // DATA
- return DATA;
- case 8: // NAME
- return NAME;
- case 9: // CHILDREN
- return CHILDREN;
- case 10: // ACL_LIST
- return ACL_LIST;
- case 11: // WATCHED_EVENT
- return WATCHED_EVENT;
- case 12: // LEADER_EVENT
- return LEADER_EVENT;
- case 13: // CHILDREN_CACHE_EVENT
- return CHILDREN_CACHE_EVENT;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- private static final int __RESULTCODE_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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CuratorEventType.class)));
- tmpMap.put(_Fields.RESULT_CODE, new org.apache.thrift.meta_data.FieldMetaData("resultCode", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- 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.CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("context", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.STAT, new org.apache.thrift.meta_data.FieldMetaData("stat", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Stat.class)));
- tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
- tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.ACL_LIST, new org.apache.thrift.meta_data.FieldMetaData("aclList", 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, Acl.class))));
- tmpMap.put(_Fields.WATCHED_EVENT, new org.apache.thrift.meta_data.FieldMetaData("watchedEvent", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WatchedEvent.class)));
- tmpMap.put(_Fields.LEADER_EVENT, new org.apache.thrift.meta_data.FieldMetaData("leaderEvent", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LeaderEvent.class)));
- tmpMap.put(_Fields.CHILDREN_CACHE_EVENT, new org.apache.thrift.meta_data.FieldMetaData("childrenCacheEvent", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PathChildrenCacheEvent.class)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CuratorEvent.class, metaDataMap);
- }
-
- public CuratorEvent() {
- }
-
- public CuratorEvent(
- CuratorEventType type,
- int resultCode,
- String path,
- String context,
- Stat stat,
- ByteBuffer data,
- String name,
- List children,
- List aclList,
- WatchedEvent watchedEvent,
- LeaderEvent leaderEvent,
- PathChildrenCacheEvent childrenCacheEvent)
- {
- this();
- this.type = type;
- this.resultCode = resultCode;
- setResultCodeIsSet(true);
- this.path = path;
- this.context = context;
- this.stat = stat;
- this.data = data;
- this.name = name;
- this.children = children;
- this.aclList = aclList;
- this.watchedEvent = watchedEvent;
- this.leaderEvent = leaderEvent;
- this.childrenCacheEvent = childrenCacheEvent;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public CuratorEvent(CuratorEvent other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.isSetType()) {
- this.type = other.type;
- }
- this.resultCode = other.resultCode;
- if (other.isSetPath()) {
- this.path = other.path;
- }
- if (other.isSetContext()) {
- this.context = other.context;
- }
- if (other.isSetStat()) {
- this.stat = new Stat(other.stat);
- }
- if (other.isSetData()) {
- this.data = org.apache.thrift.TBaseHelper.copyBinary(other.data);
-;
- }
- if (other.isSetName()) {
- this.name = other.name;
- }
- if (other.isSetChildren()) {
- List __this__children = new ArrayList(other.children);
- this.children = __this__children;
- }
- if (other.isSetAclList()) {
- List __this__aclList = new ArrayList(other.aclList.size());
- for (Acl other_element : other.aclList) {
- __this__aclList.add(new Acl(other_element));
- }
- this.aclList = __this__aclList;
- }
- if (other.isSetWatchedEvent()) {
- this.watchedEvent = new WatchedEvent(other.watchedEvent);
- }
- if (other.isSetLeaderEvent()) {
- this.leaderEvent = new LeaderEvent(other.leaderEvent);
- }
- if (other.isSetChildrenCacheEvent()) {
- this.childrenCacheEvent = new PathChildrenCacheEvent(other.childrenCacheEvent);
- }
- }
-
- public CuratorEvent deepCopy() {
- return new CuratorEvent(this);
- }
-
- @Override
- public void clear() {
- this.type = null;
- setResultCodeIsSet(false);
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- /**
- *
- * @see CuratorEventType
- */
- public CuratorEventType getType() {
- return this.type;
- }
-
- /**
- *
- * @see CuratorEventType
- */
- public CuratorEvent setType(CuratorEventType type) {
- this.type = type;
- return this;
- }
-
- public void unsetType() {
- this.type = null;
- }
-
- /** Returns true if field type is set (has been assigned a value) and false otherwise */
- public boolean isSetType() {
- return this.type != null;
- }
-
- public void setTypeIsSet(boolean value) {
- if (!value) {
- this.type = null;
- }
- }
-
- public int getResultCode() {
- return this.resultCode;
- }
-
- public CuratorEvent setResultCode(int resultCode) {
- this.resultCode = resultCode;
- setResultCodeIsSet(true);
- return this;
- }
-
- public void unsetResultCode() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESULTCODE_ISSET_ID);
- }
-
- /** Returns true if field resultCode is set (has been assigned a value) and false otherwise */
- public boolean isSetResultCode() {
- return EncodingUtils.testBit(__isset_bitfield, __RESULTCODE_ISSET_ID);
- }
-
- public void setResultCodeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESULTCODE_ISSET_ID, value);
- }
-
- public String getPath() {
- return this.path;
- }
-
- public CuratorEvent setPath(String path) {
- this.path = path;
- return this;
- }
-
- public void unsetPath() {
- this.path = null;
- }
-
- /** Returns true if field path is set (has been assigned a value) and false otherwise */
- public boolean isSetPath() {
- return this.path != null;
- }
-
- public void setPathIsSet(boolean value) {
- if (!value) {
- this.path = null;
- }
- }
-
- public String getContext() {
- return this.context;
- }
-
- public CuratorEvent setContext(String context) {
- this.context = context;
- return this;
- }
-
- public void unsetContext() {
- this.context = null;
- }
-
- /** Returns true if field context is set (has been assigned a value) and false otherwise */
- public boolean isSetContext() {
- return this.context != null;
- }
-
- public void setContextIsSet(boolean value) {
- if (!value) {
- this.context = null;
- }
- }
-
- public Stat getStat() {
- return this.stat;
- }
-
- public CuratorEvent setStat(Stat stat) {
- this.stat = stat;
- return this;
- }
-
- public void unsetStat() {
- this.stat = null;
- }
-
- /** Returns true if field stat is set (has been assigned a value) and false otherwise */
- public boolean isSetStat() {
- return this.stat != null;
- }
-
- public void setStatIsSet(boolean value) {
- if (!value) {
- this.stat = null;
- }
- }
-
- public byte[] getData() {
- setData(org.apache.thrift.TBaseHelper.rightSize(data));
- return data == null ? null : data.array();
- }
-
- public ByteBuffer bufferForData() {
- return data;
- }
-
- public CuratorEvent setData(byte[] data) {
- setData(data == null ? (ByteBuffer)null : ByteBuffer.wrap(data));
- return this;
- }
-
- public CuratorEvent setData(ByteBuffer data) {
- this.data = data;
- return this;
- }
-
- public void unsetData() {
- this.data = null;
- }
-
- /** Returns true if field data is set (has been assigned a value) and false otherwise */
- public boolean isSetData() {
- return this.data != null;
- }
-
- public void setDataIsSet(boolean value) {
- if (!value) {
- this.data = null;
- }
- }
-
- public String getName() {
- return this.name;
- }
-
- public CuratorEvent setName(String name) {
- this.name = name;
- return this;
- }
-
- public void unsetName() {
- this.name = null;
- }
-
- /** Returns true if field name is set (has been assigned a value) and false otherwise */
- public boolean isSetName() {
- return this.name != null;
- }
-
- public void setNameIsSet(boolean value) {
- if (!value) {
- this.name = null;
- }
- }
-
- public int getChildrenSize() {
- return (this.children == null) ? 0 : this.children.size();
- }
-
- public java.util.Iterator getChildrenIterator() {
- return (this.children == null) ? null : this.children.iterator();
- }
-
- public void addToChildren(String elem) {
- if (this.children == null) {
- this.children = new ArrayList();
- }
- this.children.add(elem);
- }
-
- public List getChildren() {
- return this.children;
- }
-
- public CuratorEvent setChildren(List children) {
- this.children = children;
- return this;
- }
-
- public void unsetChildren() {
- this.children = null;
- }
-
- /** Returns true if field children is set (has been assigned a value) and false otherwise */
- public boolean isSetChildren() {
- return this.children != null;
- }
-
- public void setChildrenIsSet(boolean value) {
- if (!value) {
- this.children = null;
- }
- }
-
- public int getAclListSize() {
- return (this.aclList == null) ? 0 : this.aclList.size();
- }
-
- public java.util.Iterator getAclListIterator() {
- return (this.aclList == null) ? null : this.aclList.iterator();
- }
-
- public void addToAclList(Acl elem) {
- if (this.aclList == null) {
- this.aclList = new ArrayList();
- }
- this.aclList.add(elem);
- }
-
- public List getAclList() {
- return this.aclList;
- }
-
- public CuratorEvent setAclList(List aclList) {
- this.aclList = aclList;
- return this;
- }
-
- public void unsetAclList() {
- this.aclList = null;
- }
-
- /** Returns true if field aclList is set (has been assigned a value) and false otherwise */
- public boolean isSetAclList() {
- return this.aclList != null;
- }
-
- public void setAclListIsSet(boolean value) {
- if (!value) {
- this.aclList = null;
- }
- }
-
- public WatchedEvent getWatchedEvent() {
- return this.watchedEvent;
- }
-
- public CuratorEvent setWatchedEvent(WatchedEvent watchedEvent) {
- this.watchedEvent = watchedEvent;
- return this;
- }
-
- public void unsetWatchedEvent() {
- this.watchedEvent = null;
- }
-
- /** Returns true if field watchedEvent is set (has been assigned a value) and false otherwise */
- public boolean isSetWatchedEvent() {
- return this.watchedEvent != null;
- }
-
- public void setWatchedEventIsSet(boolean value) {
- if (!value) {
- this.watchedEvent = null;
- }
- }
-
- public LeaderEvent getLeaderEvent() {
- return this.leaderEvent;
- }
-
- public CuratorEvent setLeaderEvent(LeaderEvent leaderEvent) {
- this.leaderEvent = leaderEvent;
- return this;
- }
-
- public void unsetLeaderEvent() {
- this.leaderEvent = null;
- }
-
- /** Returns true if field leaderEvent is set (has been assigned a value) and false otherwise */
- public boolean isSetLeaderEvent() {
- return this.leaderEvent != null;
- }
-
- public void setLeaderEventIsSet(boolean value) {
- if (!value) {
- this.leaderEvent = null;
- }
- }
-
- public PathChildrenCacheEvent getChildrenCacheEvent() {
- return this.childrenCacheEvent;
- }
-
- public CuratorEvent setChildrenCacheEvent(PathChildrenCacheEvent childrenCacheEvent) {
- this.childrenCacheEvent = childrenCacheEvent;
- return this;
- }
-
- public void unsetChildrenCacheEvent() {
- this.childrenCacheEvent = null;
- }
-
- /** Returns true if field childrenCacheEvent is set (has been assigned a value) and false otherwise */
- public boolean isSetChildrenCacheEvent() {
- return this.childrenCacheEvent != null;
- }
-
- public void setChildrenCacheEventIsSet(boolean value) {
- if (!value) {
- this.childrenCacheEvent = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TYPE:
- if (value == null) {
- unsetType();
- } else {
- setType((CuratorEventType)value);
- }
- break;
-
- case RESULT_CODE:
- if (value == null) {
- unsetResultCode();
- } else {
- setResultCode((Integer)value);
- }
- break;
-
- case PATH:
- if (value == null) {
- unsetPath();
- } else {
- setPath((String)value);
- }
- break;
-
- case CONTEXT:
- if (value == null) {
- unsetContext();
- } else {
- setContext((String)value);
- }
- break;
-
- case STAT:
- if (value == null) {
- unsetStat();
- } else {
- setStat((Stat)value);
- }
- break;
-
- case DATA:
- if (value == null) {
- unsetData();
- } else {
- setData((ByteBuffer)value);
- }
- break;
-
- case NAME:
- if (value == null) {
- unsetName();
- } else {
- setName((String)value);
- }
- break;
-
- case CHILDREN:
- if (value == null) {
- unsetChildren();
- } else {
- setChildren((List)value);
- }
- break;
-
- case ACL_LIST:
- if (value == null) {
- unsetAclList();
- } else {
- setAclList((List)value);
- }
- break;
-
- case WATCHED_EVENT:
- if (value == null) {
- unsetWatchedEvent();
- } else {
- setWatchedEvent((WatchedEvent)value);
- }
- break;
-
- case LEADER_EVENT:
- if (value == null) {
- unsetLeaderEvent();
- } else {
- setLeaderEvent((LeaderEvent)value);
- }
- break;
-
- case CHILDREN_CACHE_EVENT:
- if (value == null) {
- unsetChildrenCacheEvent();
- } else {
- setChildrenCacheEvent((PathChildrenCacheEvent)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TYPE:
- return getType();
-
- case RESULT_CODE:
- return Integer.valueOf(getResultCode());
-
- case PATH:
- return getPath();
-
- case CONTEXT:
- return getContext();
-
- case STAT:
- return getStat();
-
- case DATA:
- return getData();
-
- case NAME:
- return getName();
-
- case CHILDREN:
- return getChildren();
-
- case ACL_LIST:
- return getAclList();
-
- case WATCHED_EVENT:
- return getWatchedEvent();
-
- case LEADER_EVENT:
- return getLeaderEvent();
-
- case CHILDREN_CACHE_EVENT:
- return getChildrenCacheEvent();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case TYPE:
- return isSetType();
- case RESULT_CODE:
- return isSetResultCode();
- case PATH:
- return isSetPath();
- case CONTEXT:
- return isSetContext();
- case STAT:
- return isSetStat();
- case DATA:
- return isSetData();
- case NAME:
- return isSetName();
- case CHILDREN:
- return isSetChildren();
- case ACL_LIST:
- return isSetAclList();
- case WATCHED_EVENT:
- return isSetWatchedEvent();
- case LEADER_EVENT:
- return isSetLeaderEvent();
- case CHILDREN_CACHE_EVENT:
- return isSetChildrenCacheEvent();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof CuratorEvent)
- return this.equals((CuratorEvent)that);
- return false;
- }
-
- public boolean equals(CuratorEvent that) {
- if (that == null)
- return false;
-
- boolean this_present_type = true && this.isSetType();
- boolean that_present_type = true && that.isSetType();
- if (this_present_type || that_present_type) {
- if (!(this_present_type && that_present_type))
- return false;
- if (!this.type.equals(that.type))
- return false;
- }
-
- boolean this_present_resultCode = true;
- boolean that_present_resultCode = true;
- if (this_present_resultCode || that_present_resultCode) {
- if (!(this_present_resultCode && that_present_resultCode))
- return false;
- if (this.resultCode != that.resultCode)
- 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_context = true && this.isSetContext();
- boolean that_present_context = true && that.isSetContext();
- if (this_present_context || that_present_context) {
- if (!(this_present_context && that_present_context))
- return false;
- if (!this.context.equals(that.context))
- return false;
- }
-
- boolean this_present_stat = true && this.isSetStat();
- boolean that_present_stat = true && that.isSetStat();
- if (this_present_stat || that_present_stat) {
- if (!(this_present_stat && that_present_stat))
- return false;
- if (!this.stat.equals(that.stat))
- return false;
- }
-
- boolean this_present_data = true && this.isSetData();
- boolean that_present_data = true && that.isSetData();
- if (this_present_data || that_present_data) {
- if (!(this_present_data && that_present_data))
- return false;
- if (!this.data.equals(that.data))
- return false;
- }
-
- boolean this_present_name = true && this.isSetName();
- boolean that_present_name = true && that.isSetName();
- if (this_present_name || that_present_name) {
- if (!(this_present_name && that_present_name))
- return false;
- if (!this.name.equals(that.name))
- return false;
- }
-
- boolean this_present_children = true && this.isSetChildren();
- boolean that_present_children = true && that.isSetChildren();
- if (this_present_children || that_present_children) {
- if (!(this_present_children && that_present_children))
- return false;
- if (!this.children.equals(that.children))
- return false;
- }
-
- boolean this_present_aclList = true && this.isSetAclList();
- boolean that_present_aclList = true && that.isSetAclList();
- if (this_present_aclList || that_present_aclList) {
- if (!(this_present_aclList && that_present_aclList))
- return false;
- if (!this.aclList.equals(that.aclList))
- return false;
- }
-
- boolean this_present_watchedEvent = true && this.isSetWatchedEvent();
- boolean that_present_watchedEvent = true && that.isSetWatchedEvent();
- if (this_present_watchedEvent || that_present_watchedEvent) {
- if (!(this_present_watchedEvent && that_present_watchedEvent))
- return false;
- if (!this.watchedEvent.equals(that.watchedEvent))
- return false;
- }
-
- boolean this_present_leaderEvent = true && this.isSetLeaderEvent();
- boolean that_present_leaderEvent = true && that.isSetLeaderEvent();
- if (this_present_leaderEvent || that_present_leaderEvent) {
- if (!(this_present_leaderEvent && that_present_leaderEvent))
- return false;
- if (!this.leaderEvent.equals(that.leaderEvent))
- return false;
- }
-
- boolean this_present_childrenCacheEvent = true && this.isSetChildrenCacheEvent();
- boolean that_present_childrenCacheEvent = true && that.isSetChildrenCacheEvent();
- if (this_present_childrenCacheEvent || that_present_childrenCacheEvent) {
- if (!(this_present_childrenCacheEvent && that_present_childrenCacheEvent))
- return false;
- if (!this.childrenCacheEvent.equals(that.childrenCacheEvent))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(CuratorEvent other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetType()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetResultCode()).compareTo(other.isSetResultCode());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetResultCode()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resultCode, other.resultCode);
- 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(isSetContext()).compareTo(other.isSetContext());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetContext()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.context, other.context);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetStat()).compareTo(other.isSetStat());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetStat()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stat, other.stat);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetData()).compareTo(other.isSetData());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetData()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, other.data);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetChildren()).compareTo(other.isSetChildren());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetChildren()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, other.children);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetAclList()).compareTo(other.isSetAclList());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetAclList()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aclList, other.aclList);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetWatchedEvent()).compareTo(other.isSetWatchedEvent());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetWatchedEvent()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.watchedEvent, other.watchedEvent);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetLeaderEvent()).compareTo(other.isSetLeaderEvent());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetLeaderEvent()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leaderEvent, other.leaderEvent);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetChildrenCacheEvent()).compareTo(other.isSetChildrenCacheEvent());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetChildrenCacheEvent()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childrenCacheEvent, other.childrenCacheEvent);
- 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("CuratorEvent(");
- boolean first = true;
-
- sb.append("type:");
- if (this.type == null) {
- sb.append("null");
- } else {
- sb.append(this.type);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("resultCode:");
- sb.append(this.resultCode);
- 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("context:");
- if (this.context == null) {
- sb.append("null");
- } else {
- sb.append(this.context);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("stat:");
- if (this.stat == null) {
- sb.append("null");
- } else {
- sb.append(this.stat);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("data:");
- if (this.data == null) {
- sb.append("null");
- } else {
- org.apache.thrift.TBaseHelper.toString(this.data, sb);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("name:");
- if (this.name == null) {
- sb.append("null");
- } else {
- sb.append(this.name);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("children:");
- if (this.children == null) {
- sb.append("null");
- } else {
- sb.append(this.children);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("aclList:");
- if (this.aclList == null) {
- sb.append("null");
- } else {
- sb.append(this.aclList);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("watchedEvent:");
- if (this.watchedEvent == null) {
- sb.append("null");
- } else {
- sb.append(this.watchedEvent);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("leaderEvent:");
- if (this.leaderEvent == null) {
- sb.append("null");
- } else {
- sb.append(this.leaderEvent);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("childrenCacheEvent:");
- if (this.childrenCacheEvent == null) {
- sb.append("null");
- } else {
- sb.append(this.childrenCacheEvent);
- }
- 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 (stat != null) {
- stat.validate();
- }
- if (watchedEvent != null) {
- watchedEvent.validate();
- }
- if (leaderEvent != null) {
- leaderEvent.validate();
- }
- if (childrenCacheEvent != null) {
- childrenCacheEvent.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 CuratorEventStandardSchemeFactory implements SchemeFactory {
- public CuratorEventStandardScheme getScheme() {
- return new CuratorEventStandardScheme();
- }
- }
-
- private static class CuratorEventStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, CuratorEvent 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 2: // TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.type = CuratorEventType.findByValue(iprot.readI32());
- struct.setTypeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // RESULT_CODE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.resultCode = iprot.readI32();
- struct.setResultCodeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // 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 5: // CONTEXT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.context = iprot.readString();
- struct.setContextIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // STAT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.stat = new Stat();
- struct.stat.read(iprot);
- struct.setStatIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // DATA
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.name = iprot.readString();
- struct.setNameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // CHILDREN
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
- struct.children = new ArrayList(_list8.size);
- for (int _i9 = 0; _i9 < _list8.size; ++_i9)
- {
- String _elem10;
- _elem10 = iprot.readString();
- struct.children.add(_elem10);
- }
- iprot.readListEnd();
- }
- struct.setChildrenIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 10: // ACL_LIST
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list11 = iprot.readListBegin();
- struct.aclList = new ArrayList(_list11.size);
- for (int _i12 = 0; _i12 < _list11.size; ++_i12)
- {
- Acl _elem13;
- _elem13 = new Acl();
- _elem13.read(iprot);
- struct.aclList.add(_elem13);
- }
- iprot.readListEnd();
- }
- struct.setAclListIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 11: // WATCHED_EVENT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.watchedEvent = new WatchedEvent();
- struct.watchedEvent.read(iprot);
- struct.setWatchedEventIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 12: // LEADER_EVENT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.leaderEvent = new LeaderEvent();
- struct.leaderEvent.read(iprot);
- struct.setLeaderEventIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 13: // CHILDREN_CACHE_EVENT
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.childrenCacheEvent = new PathChildrenCacheEvent();
- struct.childrenCacheEvent.read(iprot);
- struct.setChildrenCacheEventIsSet(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, CuratorEvent struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.type != null) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(struct.type.getValue());
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(RESULT_CODE_FIELD_DESC);
- oprot.writeI32(struct.resultCode);
- oprot.writeFieldEnd();
- if (struct.path != null) {
- oprot.writeFieldBegin(PATH_FIELD_DESC);
- oprot.writeString(struct.path);
- oprot.writeFieldEnd();
- }
- if (struct.context != null) {
- oprot.writeFieldBegin(CONTEXT_FIELD_DESC);
- oprot.writeString(struct.context);
- oprot.writeFieldEnd();
- }
- if (struct.stat != null) {
- oprot.writeFieldBegin(STAT_FIELD_DESC);
- struct.stat.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.data != null) {
- oprot.writeFieldBegin(DATA_FIELD_DESC);
- oprot.writeBinary(struct.data);
- oprot.writeFieldEnd();
- }
- if (struct.name != null) {
- oprot.writeFieldBegin(NAME_FIELD_DESC);
- oprot.writeString(struct.name);
- oprot.writeFieldEnd();
- }
- if (struct.children != null) {
- oprot.writeFieldBegin(CHILDREN_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.children.size()));
- for (String _iter14 : struct.children)
- {
- oprot.writeString(_iter14);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.aclList != null) {
- oprot.writeFieldBegin(ACL_LIST_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.aclList.size()));
- for (Acl _iter15 : struct.aclList)
- {
- _iter15.write(oprot);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- if (struct.watchedEvent != null) {
- oprot.writeFieldBegin(WATCHED_EVENT_FIELD_DESC);
- struct.watchedEvent.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.leaderEvent != null) {
- oprot.writeFieldBegin(LEADER_EVENT_FIELD_DESC);
- struct.leaderEvent.write(oprot);
- oprot.writeFieldEnd();
- }
- if (struct.childrenCacheEvent != null) {
- oprot.writeFieldBegin(CHILDREN_CACHE_EVENT_FIELD_DESC);
- struct.childrenCacheEvent.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CuratorEventTupleSchemeFactory implements SchemeFactory {
- public CuratorEventTupleScheme getScheme() {
- return new CuratorEventTupleScheme();
- }
- }
-
- private static class CuratorEventTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, CuratorEvent struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetType()) {
- optionals.set(0);
- }
- if (struct.isSetResultCode()) {
- optionals.set(1);
- }
- if (struct.isSetPath()) {
- optionals.set(2);
- }
- if (struct.isSetContext()) {
- optionals.set(3);
- }
- if (struct.isSetStat()) {
- optionals.set(4);
- }
- if (struct.isSetData()) {
- optionals.set(5);
- }
- if (struct.isSetName()) {
- optionals.set(6);
- }
- if (struct.isSetChildren()) {
- optionals.set(7);
- }
- if (struct.isSetAclList()) {
- optionals.set(8);
- }
- if (struct.isSetWatchedEvent()) {
- optionals.set(9);
- }
- if (struct.isSetLeaderEvent()) {
- optionals.set(10);
- }
- if (struct.isSetChildrenCacheEvent()) {
- optionals.set(11);
- }
- oprot.writeBitSet(optionals, 12);
- if (struct.isSetType()) {
- oprot.writeI32(struct.type.getValue());
- }
- if (struct.isSetResultCode()) {
- oprot.writeI32(struct.resultCode);
- }
- if (struct.isSetPath()) {
- oprot.writeString(struct.path);
- }
- if (struct.isSetContext()) {
- oprot.writeString(struct.context);
- }
- if (struct.isSetStat()) {
- struct.stat.write(oprot);
- }
- if (struct.isSetData()) {
- oprot.writeBinary(struct.data);
- }
- if (struct.isSetName()) {
- oprot.writeString(struct.name);
- }
- if (struct.isSetChildren()) {
- {
- oprot.writeI32(struct.children.size());
- for (String _iter16 : struct.children)
- {
- oprot.writeString(_iter16);
- }
- }
- }
- if (struct.isSetAclList()) {
- {
- oprot.writeI32(struct.aclList.size());
- for (Acl _iter17 : struct.aclList)
- {
- _iter17.write(oprot);
- }
- }
- }
- if (struct.isSetWatchedEvent()) {
- struct.watchedEvent.write(oprot);
- }
- if (struct.isSetLeaderEvent()) {
- struct.leaderEvent.write(oprot);
- }
- if (struct.isSetChildrenCacheEvent()) {
- struct.childrenCacheEvent.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, CuratorEvent struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(12);
- if (incoming.get(0)) {
- struct.type = CuratorEventType.findByValue(iprot.readI32());
- struct.setTypeIsSet(true);
- }
- if (incoming.get(1)) {
- struct.resultCode = iprot.readI32();
- struct.setResultCodeIsSet(true);
- }
- if (incoming.get(2)) {
- struct.path = iprot.readString();
- struct.setPathIsSet(true);
- }
- if (incoming.get(3)) {
- struct.context = iprot.readString();
- struct.setContextIsSet(true);
- }
- if (incoming.get(4)) {
- struct.stat = new Stat();
- struct.stat.read(iprot);
- struct.setStatIsSet(true);
- }
- if (incoming.get(5)) {
- struct.data = iprot.readBinary();
- struct.setDataIsSet(true);
- }
- if (incoming.get(6)) {
- struct.name = iprot.readString();
- struct.setNameIsSet(true);
- }
- if (incoming.get(7)) {
- {
- org.apache.thrift.protocol.TList _list18 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.children = new ArrayList(_list18.size);
- for (int _i19 = 0; _i19 < _list18.size; ++_i19)
- {
- String _elem20;
- _elem20 = iprot.readString();
- struct.children.add(_elem20);
- }
- }
- struct.setChildrenIsSet(true);
- }
- if (incoming.get(8)) {
- {
- org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.aclList = new ArrayList(_list21.size);
- for (int _i22 = 0; _i22 < _list21.size; ++_i22)
- {
- Acl _elem23;
- _elem23 = new Acl();
- _elem23.read(iprot);
- struct.aclList.add(_elem23);
- }
- }
- struct.setAclListIsSet(true);
- }
- if (incoming.get(9)) {
- struct.watchedEvent = new WatchedEvent();
- struct.watchedEvent.read(iprot);
- struct.setWatchedEventIsSet(true);
- }
- if (incoming.get(10)) {
- struct.leaderEvent = new LeaderEvent();
- struct.leaderEvent.read(iprot);
- struct.setLeaderEventIsSet(true);
- }
- if (incoming.get(11)) {
- struct.childrenCacheEvent = new PathChildrenCacheEvent();
- struct.childrenCacheEvent.read(iprot);
- struct.setChildrenCacheEventIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
deleted file mode 100644
index 08013ec70f..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorEventType.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum CuratorEventType implements org.apache.thrift.TEnum {
- PING(0),
- CREATE(1),
- DELETE(2),
- EXISTS(3),
- GET_DATA(4),
- SET_DATA(5),
- CHILDREN(6),
- SYNC(7),
- GET_ACL(8),
- SET_ACL(9),
- WATCHED(10),
- CLOSING(11),
- CONNECTION_CONNECTED(12),
- CONNECTION_SUSPENDED(13),
- CONNECTION_RECONNECTED(14),
- CONNECTION_LOST(15),
- CONNECTION_READ_ONLY(16),
- LEADER(17),
- PATH_CHILDREN_CACHE(18),
- NODE_CACHE(19);
-
- private final int value;
-
- private CuratorEventType(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static CuratorEventType findByValue(int value) {
- switch (value) {
- case 0:
- return PING;
- case 1:
- return CREATE;
- case 2:
- return DELETE;
- case 3:
- return EXISTS;
- case 4:
- return GET_DATA;
- case 5:
- return SET_DATA;
- case 6:
- return CHILDREN;
- case 7:
- return SYNC;
- case 8:
- return GET_ACL;
- case 9:
- return SET_ACL;
- case 10:
- return WATCHED;
- case 11:
- return CLOSING;
- case 12:
- return CONNECTION_CONNECTED;
- case 13:
- return CONNECTION_SUSPENDED;
- case 14:
- return CONNECTION_RECONNECTED;
- case 15:
- return CONNECTION_LOST;
- case 16:
- return CONNECTION_READ_ONLY;
- case 17:
- return LEADER;
- case 18:
- return PATH_CHILDREN_CACHE;
- case 19:
- return NODE_CACHE;
- default:
- return null;
- }
- }
-}
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java
deleted file mode 100644
index b397813b1b..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorException.java
+++ /dev/null
@@ -1,736 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CuratorException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CuratorException");
-
- private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField ZOO_KEEPER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("zooKeeperException", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField NODE_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeException", org.apache.thrift.protocol.TType.I32, (short)3);
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)4);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CuratorExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CuratorExceptionTupleSchemeFactory());
- }
-
- /**
- *
- * @see ExceptionType
- */
- public ExceptionType type; // required
- /**
- *
- * @see ZooKeeperExceptionType
- */
- public ZooKeeperExceptionType zooKeeperException; // required
- /**
- *
- * @see NodeExceptionType
- */
- public NodeExceptionType nodeException; // required
- public String message; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- /**
- *
- * @see ExceptionType
- */
- TYPE((short)1, "type"),
- /**
- *
- * @see ZooKeeperExceptionType
- */
- ZOO_KEEPER_EXCEPTION((short)2, "zooKeeperException"),
- /**
- *
- * @see NodeExceptionType
- */
- NODE_EXCEPTION((short)3, "nodeException"),
- MESSAGE((short)4, "message");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // TYPE
- return TYPE;
- case 2: // ZOO_KEEPER_EXCEPTION
- return ZOO_KEEPER_EXCEPTION;
- case 3: // NODE_EXCEPTION
- return NODE_EXCEPTION;
- case 4: // MESSAGE
- return MESSAGE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ExceptionType.class)));
- tmpMap.put(_Fields.ZOO_KEEPER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("zooKeeperException", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ZooKeeperExceptionType.class)));
- tmpMap.put(_Fields.NODE_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("nodeException", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, NodeExceptionType.class)));
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CuratorException.class, metaDataMap);
- }
-
- public CuratorException() {
- }
-
- public CuratorException(
- ExceptionType type,
- ZooKeeperExceptionType zooKeeperException,
- NodeExceptionType nodeException,
- String message)
- {
- this();
- this.type = type;
- this.zooKeeperException = zooKeeperException;
- this.nodeException = nodeException;
- this.message = message;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public CuratorException(CuratorException other) {
- if (other.isSetType()) {
- this.type = other.type;
- }
- if (other.isSetZooKeeperException()) {
- this.zooKeeperException = other.zooKeeperException;
- }
- if (other.isSetNodeException()) {
- this.nodeException = other.nodeException;
- }
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public CuratorException deepCopy() {
- return new CuratorException(this);
- }
-
- @Override
- public void clear() {
- this.type = null;
- this.zooKeeperException = null;
- this.nodeException = null;
- this.message = null;
- }
-
- /**
- *
- * @see ExceptionType
- */
- public ExceptionType getType() {
- return this.type;
- }
-
- /**
- *
- * @see ExceptionType
- */
- public CuratorException setType(ExceptionType type) {
- this.type = type;
- return this;
- }
-
- public void unsetType() {
- this.type = null;
- }
-
- /** Returns true if field type is set (has been assigned a value) and false otherwise */
- public boolean isSetType() {
- return this.type != null;
- }
-
- public void setTypeIsSet(boolean value) {
- if (!value) {
- this.type = null;
- }
- }
-
- /**
- *
- * @see ZooKeeperExceptionType
- */
- public ZooKeeperExceptionType getZooKeeperException() {
- return this.zooKeeperException;
- }
-
- /**
- *
- * @see ZooKeeperExceptionType
- */
- public CuratorException setZooKeeperException(ZooKeeperExceptionType zooKeeperException) {
- this.zooKeeperException = zooKeeperException;
- return this;
- }
-
- public void unsetZooKeeperException() {
- this.zooKeeperException = null;
- }
-
- /** Returns true if field zooKeeperException is set (has been assigned a value) and false otherwise */
- public boolean isSetZooKeeperException() {
- return this.zooKeeperException != null;
- }
-
- public void setZooKeeperExceptionIsSet(boolean value) {
- if (!value) {
- this.zooKeeperException = null;
- }
- }
-
- /**
- *
- * @see NodeExceptionType
- */
- public NodeExceptionType getNodeException() {
- return this.nodeException;
- }
-
- /**
- *
- * @see NodeExceptionType
- */
- public CuratorException setNodeException(NodeExceptionType nodeException) {
- this.nodeException = nodeException;
- return this;
- }
-
- public void unsetNodeException() {
- this.nodeException = null;
- }
-
- /** Returns true if field nodeException is set (has been assigned a value) and false otherwise */
- public boolean isSetNodeException() {
- return this.nodeException != null;
- }
-
- public void setNodeExceptionIsSet(boolean value) {
- if (!value) {
- this.nodeException = null;
- }
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public CuratorException setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TYPE:
- if (value == null) {
- unsetType();
- } else {
- setType((ExceptionType)value);
- }
- break;
-
- case ZOO_KEEPER_EXCEPTION:
- if (value == null) {
- unsetZooKeeperException();
- } else {
- setZooKeeperException((ZooKeeperExceptionType)value);
- }
- break;
-
- case NODE_EXCEPTION:
- if (value == null) {
- unsetNodeException();
- } else {
- setNodeException((NodeExceptionType)value);
- }
- break;
-
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TYPE:
- return getType();
-
- case ZOO_KEEPER_EXCEPTION:
- return getZooKeeperException();
-
- case NODE_EXCEPTION:
- return getNodeException();
-
- case MESSAGE:
- return getMessage();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case TYPE:
- return isSetType();
- case ZOO_KEEPER_EXCEPTION:
- return isSetZooKeeperException();
- case NODE_EXCEPTION:
- return isSetNodeException();
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof CuratorException)
- return this.equals((CuratorException)that);
- return false;
- }
-
- public boolean equals(CuratorException that) {
- if (that == null)
- return false;
-
- boolean this_present_type = true && this.isSetType();
- boolean that_present_type = true && that.isSetType();
- if (this_present_type || that_present_type) {
- if (!(this_present_type && that_present_type))
- return false;
- if (!this.type.equals(that.type))
- return false;
- }
-
- boolean this_present_zooKeeperException = true && this.isSetZooKeeperException();
- boolean that_present_zooKeeperException = true && that.isSetZooKeeperException();
- if (this_present_zooKeeperException || that_present_zooKeeperException) {
- if (!(this_present_zooKeeperException && that_present_zooKeeperException))
- return false;
- if (!this.zooKeeperException.equals(that.zooKeeperException))
- return false;
- }
-
- boolean this_present_nodeException = true && this.isSetNodeException();
- boolean that_present_nodeException = true && that.isSetNodeException();
- if (this_present_nodeException || that_present_nodeException) {
- if (!(this_present_nodeException && that_present_nodeException))
- return false;
- if (!this.nodeException.equals(that.nodeException))
- return false;
- }
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(CuratorException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetType()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetZooKeeperException()).compareTo(other.isSetZooKeeperException());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetZooKeeperException()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.zooKeeperException, other.zooKeeperException);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetNodeException()).compareTo(other.isSetNodeException());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetNodeException()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeException, other.nodeException);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("CuratorException(");
- boolean first = true;
-
- sb.append("type:");
- if (this.type == null) {
- sb.append("null");
- } else {
- sb.append(this.type);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("zooKeeperException:");
- if (this.zooKeeperException == null) {
- sb.append("null");
- } else {
- sb.append(this.zooKeeperException);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("nodeException:");
- if (this.nodeException == null) {
- sb.append("null");
- } else {
- sb.append(this.nodeException);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class CuratorExceptionStandardSchemeFactory implements SchemeFactory {
- public CuratorExceptionStandardScheme getScheme() {
- return new CuratorExceptionStandardScheme();
- }
- }
-
- private static class CuratorExceptionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, CuratorException struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // TYPE
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.type = ExceptionType.findByValue(iprot.readI32());
- struct.setTypeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // ZOO_KEEPER_EXCEPTION
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.zooKeeperException = ZooKeeperExceptionType.findByValue(iprot.readI32());
- struct.setZooKeeperExceptionIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // NODE_EXCEPTION
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.nodeException = NodeExceptionType.findByValue(iprot.readI32());
- struct.setNodeExceptionIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, CuratorException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.type != null) {
- oprot.writeFieldBegin(TYPE_FIELD_DESC);
- oprot.writeI32(struct.type.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.zooKeeperException != null) {
- oprot.writeFieldBegin(ZOO_KEEPER_EXCEPTION_FIELD_DESC);
- oprot.writeI32(struct.zooKeeperException.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.nodeException != null) {
- oprot.writeFieldBegin(NODE_EXCEPTION_FIELD_DESC);
- oprot.writeI32(struct.nodeException.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CuratorExceptionTupleSchemeFactory implements SchemeFactory {
- public CuratorExceptionTupleScheme getScheme() {
- return new CuratorExceptionTupleScheme();
- }
- }
-
- private static class CuratorExceptionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, CuratorException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetType()) {
- optionals.set(0);
- }
- if (struct.isSetZooKeeperException()) {
- optionals.set(1);
- }
- if (struct.isSetNodeException()) {
- optionals.set(2);
- }
- if (struct.isSetMessage()) {
- optionals.set(3);
- }
- oprot.writeBitSet(optionals, 4);
- if (struct.isSetType()) {
- oprot.writeI32(struct.type.getValue());
- }
- if (struct.isSetZooKeeperException()) {
- oprot.writeI32(struct.zooKeeperException.getValue());
- }
- if (struct.isSetNodeException()) {
- oprot.writeI32(struct.nodeException.getValue());
- }
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, CuratorException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(4);
- if (incoming.get(0)) {
- struct.type = ExceptionType.findByValue(iprot.readI32());
- struct.setTypeIsSet(true);
- }
- if (incoming.get(1)) {
- struct.zooKeeperException = ZooKeeperExceptionType.findByValue(iprot.readI32());
- struct.setZooKeeperExceptionIsSet(true);
- }
- if (incoming.get(2)) {
- struct.nodeException = NodeExceptionType.findByValue(iprot.readI32());
- struct.setNodeExceptionIsSet(true);
- }
- if (incoming.get(3)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorProjection.java b/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorProjection.java
deleted file mode 100644
index a2b18e3f8e..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorProjection.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CuratorProjection implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CuratorProjection");
-
- private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new CuratorProjectionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new CuratorProjectionTupleSchemeFactory());
- }
-
- public String id; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- ID((short)1, "id");
-
- private static final Map byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // ID
- return ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CuratorProjection.class, metaDataMap);
- }
-
- public CuratorProjection() {
- }
-
- public CuratorProjection(
- String id)
- {
- this();
- this.id = id;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public CuratorProjection(CuratorProjection other) {
- if (other.isSetId()) {
- this.id = other.id;
- }
- }
-
- public CuratorProjection deepCopy() {
- return new CuratorProjection(this);
- }
-
- @Override
- public void clear() {
- this.id = null;
- }
-
- public String getId() {
- return this.id;
- }
-
- public CuratorProjection setId(String id) {
- this.id = id;
- return this;
- }
-
- public void unsetId() {
- this.id = null;
- }
-
- /** Returns true if field id is set (has been assigned a value) and false otherwise */
- public boolean isSetId() {
- return this.id != null;
- }
-
- public void setIdIsSet(boolean value) {
- if (!value) {
- this.id = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case ID:
- if (value == null) {
- unsetId();
- } else {
- setId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case ID:
- return getId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case ID:
- return isSetId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof CuratorProjection)
- return this.equals((CuratorProjection)that);
- return false;
- }
-
- public boolean equals(CuratorProjection that) {
- if (that == null)
- return false;
-
- boolean this_present_id = true && this.isSetId();
- boolean that_present_id = true && that.isSetId();
- if (this_present_id || that_present_id) {
- if (!(this_present_id && that_present_id))
- return false;
- if (!this.id.equals(that.id))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(CuratorProjection other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("CuratorProjection(");
- boolean first = true;
-
- sb.append("id:");
- if (this.id == null) {
- sb.append("null");
- } else {
- sb.append(this.id);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class CuratorProjectionStandardSchemeFactory implements SchemeFactory {
- public CuratorProjectionStandardScheme getScheme() {
- return new CuratorProjectionStandardScheme();
- }
- }
-
- private static class CuratorProjectionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, CuratorProjection struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.id = iprot.readString();
- struct.setIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, CuratorProjection struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.id != null) {
- oprot.writeFieldBegin(ID_FIELD_DESC);
- oprot.writeString(struct.id);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class CuratorProjectionTupleSchemeFactory implements SchemeFactory {
- public CuratorProjectionTupleScheme getScheme() {
- return new CuratorProjectionTupleScheme();
- }
- }
-
- private static class CuratorProjectionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, CuratorProjection struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetId()) {
- optionals.set(0);
- }
- oprot.writeBitSet(optionals, 1);
- if (struct.isSetId()) {
- oprot.writeString(struct.id);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, CuratorProjection struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(1);
- if (incoming.get(0)) {
- struct.id = iprot.readString();
- struct.setIdIsSet(true);
- }
- }
- }
-
-}
-
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
deleted file mode 100644
index 63d46eea13..0000000000
--- a/curator-x-rpc/src/test/java/org/apache/curator/generated/CuratorService.java
+++ /dev/null
@@ -1,24123 +0,0 @@
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.curator.generated;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CuratorService {
-
- public interface Iface {
-
- public OptionalLockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException;
-
- public List 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;
-
- public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public List getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
-
- public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException;
-
- public List getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException;
-
- public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws CuratorException, org.apache.thrift.TException;
-
- public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException;
-
- public CuratorProjection newCuratorProjection(String connectionName) throws CuratorException, org.apache.thrift.TException;
-
- public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException;
-
- public OptionalStat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException;
-
- public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws CuratorException, org.apache.thrift.TException;
-
- public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws CuratorException, org.apache.thrift.TException;
-
- public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws CuratorException, org.apache.thrift.TException;
-
- public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws CuratorException, org.apache.thrift.TException;
-
- public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- 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;
-
- public void createNode(CuratorProjection projection, CreateSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void deleteNode(CuratorProjection projection, DeleteSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void exists(CuratorProjection projection, ExistsSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getChildren(CuratorProjection projection, GetChildrenSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getData(CuratorProjection projection, GetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void isLeader(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void newCuratorProjection(String connectionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void pingCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void setData(CuratorProjection projection, SetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public static class Client extends org.apache.thrift.TServiceClient implements Iface {
- public static class Factory implements org.apache.thrift.TServiceClientFactory {
- public Factory() {}
- public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
- return new Client(prot);
- }
- public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- return new Client(iprot, oprot);
- }
- }
-
- public Client(org.apache.thrift.protocol.TProtocol prot)
- {
- super(prot, prot);
- }
-
- public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
- super(iprot, oprot);
- }
-
- public OptionalLockProjection acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws CuratorException, org.apache.thrift.TException
- {
- send_acquireLock(projection, path, maxWaitMs);
- return recv_acquireLock();
- }
-
- public void send_acquireLock(CuratorProjection projection, String path, int maxWaitMs) throws org.apache.thrift.TException
- {
- acquireLock_args args = new acquireLock_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setMaxWaitMs(maxWaitMs);
- sendBase("acquireLock", args);
- }
-
- public OptionalLockProjection recv_acquireLock() throws CuratorException, org.apache.thrift.TException
- {
- acquireLock_result result = new acquireLock_result();
- receiveBase(result, "acquireLock");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "acquireLock failed: unknown result");
- }
-
- public List 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 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
- {
- closeCuratorProjection_args args = new closeCuratorProjection_args();
- args.setProjection(projection);
- 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);
- return recv_closeGenericProjection();
- }
-
- public void send_closeGenericProjection(CuratorProjection projection, String id) throws org.apache.thrift.TException
- {
- closeGenericProjection_args args = new closeGenericProjection_args();
- args.setProjection(projection);
- args.setId(id);
- sendBase("closeGenericProjection", args);
- }
-
- public boolean recv_closeGenericProjection() throws CuratorException, org.apache.thrift.TException
- {
- closeGenericProjection_result result = new closeGenericProjection_result();
- receiveBase(result, "closeGenericProjection");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "closeGenericProjection failed: unknown result");
- }
-
- public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_createNode(projection, spec);
- return recv_createNode();
- }
-
- public void send_createNode(CuratorProjection projection, CreateSpec spec) throws org.apache.thrift.TException
- {
- createNode_args args = new createNode_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("createNode", args);
- }
-
- public OptionalPath recv_createNode() throws CuratorException, org.apache.thrift.TException
- {
- createNode_result result = new createNode_result();
- receiveBase(result, "createNode");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createNode failed: unknown result");
- }
-
- public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_deleteNode(projection, spec);
- recv_deleteNode();
- }
-
- public void send_deleteNode(CuratorProjection projection, DeleteSpec spec) throws org.apache.thrift.TException
- {
- deleteNode_args args = new deleteNode_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("deleteNode", args);
- }
-
- public void recv_deleteNode() throws CuratorException, org.apache.thrift.TException
- {
- deleteNode_result result = new deleteNode_result();
- receiveBase(result, "deleteNode");
- if (result.ex1 != null) {
- throw result.ex1;
- }
- return;
- }
-
- public OptionalStat exists(CuratorProjection projection, ExistsSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_exists(projection, spec);
- return recv_exists();
- }
-
- public void send_exists(CuratorProjection projection, ExistsSpec spec) throws org.apache.thrift.TException
- {
- exists_args args = new exists_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("exists", args);
- }
-
- public OptionalStat recv_exists() throws CuratorException, org.apache.thrift.TException
- {
- exists_result result = new exists_result();
- receiveBase(result, "exists");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "exists failed: unknown result");
- }
-
- public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_getChildren(projection, spec);
- return recv_getChildren();
- }
-
- public void send_getChildren(CuratorProjection projection, GetChildrenSpec spec) throws org.apache.thrift.TException
- {
- getChildren_args args = new getChildren_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("getChildren", args);
- }
-
- public OptionalChildrenList recv_getChildren() throws CuratorException, org.apache.thrift.TException
- {
- getChildren_result result = new getChildren_result();
- receiveBase(result, "getChildren");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getChildren failed: unknown result");
- }
-
- public OptionalData getData(CuratorProjection projection, GetDataSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_getData(projection, spec);
- return recv_getData();
- }
-
- public void send_getData(CuratorProjection projection, GetDataSpec spec) throws org.apache.thrift.TException
- {
- getData_args args = new getData_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("getData", args);
- }
-
- public OptionalData recv_getData() throws CuratorException, org.apache.thrift.TException
- {
- getData_result result = new getData_result();
- receiveBase(result, "getData");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getData failed: unknown result");
- }
-
- public List getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException
- {
- send_getLeaderParticipants(projection, leaderProjection);
- return recv_getLeaderParticipants();
- }
-
- public void send_getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException
- {
- getLeaderParticipants_args args = new getLeaderParticipants_args();
- args.setProjection(projection);
- args.setLeaderProjection(leaderProjection);
- sendBase("getLeaderParticipants", args);
- }
-
- public List recv_getLeaderParticipants() throws CuratorException, org.apache.thrift.TException
- {
- getLeaderParticipants_result result = new getLeaderParticipants_result();
- receiveBase(result, "getLeaderParticipants");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLeaderParticipants failed: unknown result");
- }
-
- public ChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException
- {
- send_getNodeCacheData(projection, cacheProjection);
- return recv_getNodeCacheData();
- }
-
- public void send_getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws org.apache.thrift.TException
- {
- getNodeCacheData_args args = new getNodeCacheData_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- sendBase("getNodeCacheData", args);
- }
-
- public ChildData recv_getNodeCacheData() throws CuratorException, org.apache.thrift.TException
- {
- getNodeCacheData_result result = new getNodeCacheData_result();
- receiveBase(result, "getNodeCacheData");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNodeCacheData failed: unknown result");
- }
-
- public List getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws CuratorException, org.apache.thrift.TException
- {
- send_getPathChildrenCacheData(projection, cacheProjection);
- return recv_getPathChildrenCacheData();
- }
-
- public void send_getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws org.apache.thrift.TException
- {
- getPathChildrenCacheData_args args = new getPathChildrenCacheData_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- sendBase("getPathChildrenCacheData", args);
- }
-
- public List recv_getPathChildrenCacheData() throws CuratorException, org.apache.thrift.TException
- {
- getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
- receiveBase(result, "getPathChildrenCacheData");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheData failed: unknown result");
- }
-
- public ChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws CuratorException, org.apache.thrift.TException
- {
- send_getPathChildrenCacheDataForPath(projection, cacheProjection, path);
- return recv_getPathChildrenCacheDataForPath();
- }
-
- public void send_getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws org.apache.thrift.TException
- {
- getPathChildrenCacheDataForPath_args args = new getPathChildrenCacheDataForPath_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- args.setPath(path);
- sendBase("getPathChildrenCacheDataForPath", args);
- }
-
- public ChildData recv_getPathChildrenCacheDataForPath() throws CuratorException, org.apache.thrift.TException
- {
- getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
- receiveBase(result, "getPathChildrenCacheDataForPath");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPathChildrenCacheDataForPath failed: unknown result");
- }
-
- public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws CuratorException, org.apache.thrift.TException
- {
- send_isLeader(projection, leaderProjection);
- return recv_isLeader();
- }
-
- public void send_isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws org.apache.thrift.TException
- {
- isLeader_args args = new isLeader_args();
- args.setProjection(projection);
- args.setLeaderProjection(leaderProjection);
- sendBase("isLeader", args);
- }
-
- public boolean recv_isLeader() throws CuratorException, org.apache.thrift.TException
- {
- isLeader_result result = new isLeader_result();
- receiveBase(result, "isLeader");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isLeader failed: unknown result");
- }
-
- public CuratorProjection newCuratorProjection(String connectionName) throws CuratorException, org.apache.thrift.TException
- {
- send_newCuratorProjection(connectionName);
- return recv_newCuratorProjection();
- }
-
- public void send_newCuratorProjection(String connectionName) throws org.apache.thrift.TException
- {
- newCuratorProjection_args args = new newCuratorProjection_args();
- args.setConnectionName(connectionName);
- sendBase("newCuratorProjection", args);
- }
-
- public CuratorProjection recv_newCuratorProjection() throws CuratorException, org.apache.thrift.TException
- {
- newCuratorProjection_result result = new newCuratorProjection_result();
- receiveBase(result, "newCuratorProjection");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "newCuratorProjection failed: unknown result");
- }
-
- public void pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
- {
- send_pingCuratorProjection(projection);
- }
-
- public void send_pingCuratorProjection(CuratorProjection projection) throws org.apache.thrift.TException
- {
- pingCuratorProjection_args args = new pingCuratorProjection_args();
- args.setProjection(projection);
- sendBase("pingCuratorProjection", args);
- }
-
- public OptionalStat setData(CuratorProjection projection, SetDataSpec spec) throws CuratorException, org.apache.thrift.TException
- {
- send_setData(projection, spec);
- return recv_setData();
- }
-
- public void send_setData(CuratorProjection projection, SetDataSpec spec) throws org.apache.thrift.TException
- {
- setData_args args = new setData_args();
- args.setProjection(projection);
- args.setSpec(spec);
- sendBase("setData", args);
- }
-
- public OptionalStat recv_setData() throws CuratorException, org.apache.thrift.TException
- {
- setData_result result = new setData_result();
- receiveBase(result, "setData");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "setData failed: unknown result");
- }
-
- public LeaderResult startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws CuratorException, org.apache.thrift.TException
- {
- send_startLeaderSelector(projection, path, participantId, waitForLeadershipMs);
- return recv_startLeaderSelector();
- }
-
- public void send_startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs) throws org.apache.thrift.TException
- {
- startLeaderSelector_args args = new startLeaderSelector_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setParticipantId(participantId);
- args.setWaitForLeadershipMs(waitForLeadershipMs);
- sendBase("startLeaderSelector", args);
- }
-
- public LeaderResult recv_startLeaderSelector() throws CuratorException, org.apache.thrift.TException
- {
- startLeaderSelector_result result = new startLeaderSelector_result();
- receiveBase(result, "startLeaderSelector");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startLeaderSelector failed: unknown result");
- }
-
- public NodeCacheProjection startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws CuratorException, org.apache.thrift.TException
- {
- send_startNodeCache(projection, path, dataIsCompressed, buildInitial);
- return recv_startNodeCache();
- }
-
- public void send_startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial) throws org.apache.thrift.TException
- {
- startNodeCache_args args = new startNodeCache_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setDataIsCompressed(dataIsCompressed);
- args.setBuildInitial(buildInitial);
- sendBase("startNodeCache", args);
- }
-
- public NodeCacheProjection recv_startNodeCache() throws CuratorException, org.apache.thrift.TException
- {
- startNodeCache_result result = new startNodeCache_result();
- receiveBase(result, "startNodeCache");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startNodeCache failed: unknown result");
- }
-
- public PathChildrenCacheProjection startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws CuratorException, org.apache.thrift.TException
- {
- send_startPathChildrenCache(projection, path, cacheData, dataIsCompressed, startMode);
- return recv_startPathChildrenCache();
- }
-
- public void send_startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws org.apache.thrift.TException
- {
- startPathChildrenCache_args args = new startPathChildrenCache_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setCacheData(cacheData);
- args.setDataIsCompressed(dataIsCompressed);
- args.setStartMode(startMode);
- sendBase("startPathChildrenCache", args);
- }
-
- public PathChildrenCacheProjection recv_startPathChildrenCache() throws CuratorException, org.apache.thrift.TException
- {
- startPathChildrenCache_result result = new startPathChildrenCache_result();
- receiveBase(result, "startPathChildrenCache");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPathChildrenCache failed: unknown result");
- }
-
- public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws CuratorException, org.apache.thrift.TException
- {
- send_startPersistentEphemeralNode(projection, path, data, mode);
- return recv_startPersistentEphemeralNode();
- }
-
- public void send_startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode) throws org.apache.thrift.TException
- {
- startPersistentEphemeralNode_args args = new startPersistentEphemeralNode_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setData(data);
- args.setMode(mode);
- sendBase("startPersistentEphemeralNode", args);
- }
-
- public PersistentEphemeralNodeProjection recv_startPersistentEphemeralNode() throws CuratorException, org.apache.thrift.TException
- {
- startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
- receiveBase(result, "startPersistentEphemeralNode");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.ex1 != null) {
- throw result.ex1;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startPersistentEphemeralNode failed: unknown result");
- }
-
- public void sync(CuratorProjection projection, String path, String asyncContext) throws CuratorException, org.apache.thrift.TException
- {
- send_sync(projection, path, asyncContext);
- recv_sync();
- }
-
- public void send_sync(CuratorProjection projection, String path, String asyncContext) throws org.apache.thrift.TException
- {
- sync_args args = new sync_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setAsyncContext(asyncContext);
- sendBase("sync", args);
- }
-
- public void recv_sync() throws CuratorException, org.apache.thrift.TException
- {
- sync_result result = new sync_result();
- receiveBase(result, "sync");
- if (result.ex1 != null) {
- throw result.ex1;
- }
- return;
- }
-
- }
- public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
- public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
- private org.apache.thrift.async.TAsyncClientManager clientManager;
- private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
- public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
- this.clientManager = clientManager;
- this.protocolFactory = protocolFactory;
- }
- public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
- return new AsyncClient(protocolFactory, clientManager, transport);
- }
- }
-
- public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
- super(protocolFactory, clientManager, transport);
- }
-
- public void acquireLock(CuratorProjection projection, String path, int maxWaitMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- acquireLock_call method_call = new acquireLock_call(projection, path, maxWaitMs, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class acquireLock_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private int maxWaitMs;
- public acquireLock_call(CuratorProjection projection, String path, int maxWaitMs, 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.maxWaitMs = maxWaitMs;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("acquireLock", org.apache.thrift.protocol.TMessageType.CALL, 0));
- acquireLock_args args = new acquireLock_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setMaxWaitMs(maxWaitMs);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalLockProjection getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_acquireLock();
- }
- }
-
- 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 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);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class closeCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- public closeCuratorProjection_call(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeCuratorProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
- closeCuratorProjection_args args = new closeCuratorProjection_args();
- args.setProjection(projection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_closeCuratorProjection();
- }
- }
-
- public void closeGenericProjection(CuratorProjection projection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- closeGenericProjection_call method_call = new closeGenericProjection_call(projection, id, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class closeGenericProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String id;
- public closeGenericProjection_call(CuratorProjection projection, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.id = id;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("closeGenericProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
- closeGenericProjection_args args = new closeGenericProjection_args();
- args.setProjection(projection);
- args.setId(id);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_closeGenericProjection();
- }
- }
-
- public void createNode(CuratorProjection projection, CreateSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- createNode_call method_call = new createNode_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class createNode_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private CreateSpec spec;
- public createNode_call(CuratorProjection projection, CreateSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createNode", org.apache.thrift.protocol.TMessageType.CALL, 0));
- createNode_args args = new createNode_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalPath getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_createNode();
- }
- }
-
- public void deleteNode(CuratorProjection projection, DeleteSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- deleteNode_call method_call = new deleteNode_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class deleteNode_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private DeleteSpec spec;
- public deleteNode_call(CuratorProjection projection, DeleteSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteNode", org.apache.thrift.protocol.TMessageType.CALL, 0));
- deleteNode_args args = new deleteNode_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_deleteNode();
- }
- }
-
- public void exists(CuratorProjection projection, ExistsSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- exists_call method_call = new exists_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class exists_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private ExistsSpec spec;
- public exists_call(CuratorProjection projection, ExistsSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("exists", org.apache.thrift.protocol.TMessageType.CALL, 0));
- exists_args args = new exists_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalStat getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_exists();
- }
- }
-
- public void getChildren(CuratorProjection projection, GetChildrenSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getChildren_call method_call = new getChildren_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getChildren_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private GetChildrenSpec spec;
- public getChildren_call(CuratorProjection projection, GetChildrenSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getChildren", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getChildren_args args = new getChildren_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalChildrenList getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_getChildren();
- }
- }
-
- public void getData(CuratorProjection projection, GetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getData_call method_call = new getData_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getData_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private GetDataSpec spec;
- public getData_call(CuratorProjection projection, GetDataSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getData", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getData_args args = new getData_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalData getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_getData();
- }
- }
-
- public void getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getLeaderParticipants_call method_call = new getLeaderParticipants_call(projection, leaderProjection, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getLeaderParticipants_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private LeaderProjection leaderProjection;
- public getLeaderParticipants_call(CuratorProjection projection, LeaderProjection leaderProjection, 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.leaderProjection = leaderProjection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLeaderParticipants", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getLeaderParticipants_args args = new getLeaderParticipants_args();
- args.setProjection(projection);
- args.setLeaderProjection(leaderProjection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List 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_getLeaderParticipants();
- }
- }
-
- public void getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getNodeCacheData_call method_call = new getNodeCacheData_call(projection, cacheProjection, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getNodeCacheData_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private NodeCacheProjection cacheProjection;
- public getNodeCacheData_call(CuratorProjection projection, NodeCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.cacheProjection = cacheProjection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNodeCacheData", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getNodeCacheData_args args = new getNodeCacheData_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public ChildData getResult() throws 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_getNodeCacheData();
- }
- }
-
- public void getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getPathChildrenCacheData_call method_call = new getPathChildrenCacheData_call(projection, cacheProjection, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getPathChildrenCacheData_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private PathChildrenCacheProjection cacheProjection;
- public getPathChildrenCacheData_call(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.cacheProjection = cacheProjection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathChildrenCacheData", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getPathChildrenCacheData_args args = new getPathChildrenCacheData_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List 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_getPathChildrenCacheData();
- }
- }
-
- public void getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getPathChildrenCacheDataForPath_call method_call = new getPathChildrenCacheDataForPath_call(projection, cacheProjection, path, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getPathChildrenCacheDataForPath_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private PathChildrenCacheProjection cacheProjection;
- private String path;
- public getPathChildrenCacheDataForPath_call(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.cacheProjection = cacheProjection;
- this.path = path;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPathChildrenCacheDataForPath", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getPathChildrenCacheDataForPath_args args = new getPathChildrenCacheDataForPath_args();
- args.setProjection(projection);
- args.setCacheProjection(cacheProjection);
- args.setPath(path);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public ChildData getResult() throws 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_getPathChildrenCacheDataForPath();
- }
- }
-
- public void isLeader(CuratorProjection projection, LeaderProjection leaderProjection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- isLeader_call method_call = new isLeader_call(projection, leaderProjection, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class isLeader_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private LeaderProjection leaderProjection;
- public isLeader_call(CuratorProjection projection, LeaderProjection leaderProjection, 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.leaderProjection = leaderProjection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isLeader", org.apache.thrift.protocol.TMessageType.CALL, 0));
- isLeader_args args = new isLeader_args();
- args.setProjection(projection);
- args.setLeaderProjection(leaderProjection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_isLeader();
- }
- }
-
- public void newCuratorProjection(String connectionName, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- newCuratorProjection_call method_call = new newCuratorProjection_call(connectionName, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class newCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String connectionName;
- public newCuratorProjection_call(String connectionName, 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.connectionName = connectionName;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("newCuratorProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
- newCuratorProjection_args args = new newCuratorProjection_args();
- args.setConnectionName(connectionName);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public CuratorProjection getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_newCuratorProjection();
- }
- }
-
- public void pingCuratorProjection(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- pingCuratorProjection_call method_call = new pingCuratorProjection_call(projection, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class pingCuratorProjection_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- public pingCuratorProjection_call(CuratorProjection projection, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, true);
- this.projection = projection;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pingCuratorProjection", org.apache.thrift.protocol.TMessageType.CALL, 0));
- pingCuratorProjection_args args = new pingCuratorProjection_args();
- args.setProjection(projection);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- }
- }
-
- public void setData(CuratorProjection projection, SetDataSpec spec, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- setData_call method_call = new setData_call(projection, spec, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class setData_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private SetDataSpec spec;
- public setData_call(CuratorProjection projection, SetDataSpec spec, 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.spec = spec;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setData", org.apache.thrift.protocol.TMessageType.CALL, 0));
- setData_args args = new setData_args();
- args.setProjection(projection);
- args.setSpec(spec);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public OptionalStat getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_setData();
- }
- }
-
- public void startLeaderSelector(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- startLeaderSelector_call method_call = new startLeaderSelector_call(projection, path, participantId, waitForLeadershipMs, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class startLeaderSelector_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private String participantId;
- private int waitForLeadershipMs;
- public startLeaderSelector_call(CuratorProjection projection, String path, String participantId, int waitForLeadershipMs, 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.participantId = participantId;
- this.waitForLeadershipMs = waitForLeadershipMs;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startLeaderSelector", org.apache.thrift.protocol.TMessageType.CALL, 0));
- startLeaderSelector_args args = new startLeaderSelector_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setParticipantId(participantId);
- args.setWaitForLeadershipMs(waitForLeadershipMs);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public LeaderResult getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_startLeaderSelector();
- }
- }
-
- public void startNodeCache(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- startNodeCache_call method_call = new startNodeCache_call(projection, path, dataIsCompressed, buildInitial, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class startNodeCache_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private boolean dataIsCompressed;
- private boolean buildInitial;
- public startNodeCache_call(CuratorProjection projection, String path, boolean dataIsCompressed, boolean buildInitial, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.path = path;
- this.dataIsCompressed = dataIsCompressed;
- this.buildInitial = buildInitial;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startNodeCache", org.apache.thrift.protocol.TMessageType.CALL, 0));
- startNodeCache_args args = new startNodeCache_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setDataIsCompressed(dataIsCompressed);
- args.setBuildInitial(buildInitial);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public NodeCacheProjection getResult() throws 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_startNodeCache();
- }
- }
-
- public void startPathChildrenCache(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- startPathChildrenCache_call method_call = new startPathChildrenCache_call(projection, path, cacheData, dataIsCompressed, startMode, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class startPathChildrenCache_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private boolean cacheData;
- private boolean dataIsCompressed;
- private PathChildrenCacheStartMode startMode;
- public startPathChildrenCache_call(CuratorProjection projection, String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode, 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.cacheData = cacheData;
- this.dataIsCompressed = dataIsCompressed;
- this.startMode = startMode;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startPathChildrenCache", org.apache.thrift.protocol.TMessageType.CALL, 0));
- startPathChildrenCache_args args = new startPathChildrenCache_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setCacheData(cacheData);
- args.setDataIsCompressed(dataIsCompressed);
- args.setStartMode(startMode);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public PathChildrenCacheProjection getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- 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_startPathChildrenCache();
- }
- }
-
- public void startPersistentEphemeralNode(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- startPersistentEphemeralNode_call method_call = new startPersistentEphemeralNode_call(projection, path, data, mode, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class startPersistentEphemeralNode_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private ByteBuffer data;
- private PersistentEphemeralNodeMode mode;
- public startPersistentEphemeralNode_call(CuratorProjection projection, String path, ByteBuffer data, PersistentEphemeralNodeMode mode, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.path = path;
- this.data = data;
- this.mode = mode;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startPersistentEphemeralNode", org.apache.thrift.protocol.TMessageType.CALL, 0));
- startPersistentEphemeralNode_args args = new startPersistentEphemeralNode_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setData(data);
- args.setMode(mode);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public PersistentEphemeralNodeProjection getResult() throws 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_startPersistentEphemeralNode();
- }
- }
-
- public void sync(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- sync_call method_call = new sync_call(projection, path, asyncContext, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class sync_call extends org.apache.thrift.async.TAsyncMethodCall {
- private CuratorProjection projection;
- private String path;
- private String asyncContext;
- public sync_call(CuratorProjection projection, String path, String asyncContext, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.projection = projection;
- this.path = path;
- this.asyncContext = asyncContext;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sync", org.apache.thrift.protocol.TMessageType.CALL, 0));
- sync_args args = new sync_args();
- args.setProjection(projection);
- args.setPath(path);
- args.setAsyncContext(asyncContext);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public void getResult() throws CuratorException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- (new Client(prot)).recv_sync();
- }
- }
-
- }
-
- public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(I iface) {
- super(iface, getProcessMap(new HashMap>()));
- }
-
- protected Processor(I iface, Map> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static Map> getProcessMap(Map> processMap) {
- processMap.put("acquireLock", new acquireLock());
- processMap.put("acquireSemaphore", new acquireSemaphore());
- processMap.put("closeCuratorProjection", new closeCuratorProjection());
- processMap.put("closeGenericProjection", new closeGenericProjection());
- processMap.put("createNode", new createNode());
- processMap.put("deleteNode", new deleteNode());
- processMap.put("exists", new exists());
- processMap.put("getChildren", new getChildren());
- processMap.put("getData", new getData());
- processMap.put("getLeaderParticipants", new getLeaderParticipants());
- processMap.put("getNodeCacheData", new getNodeCacheData());
- processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
- processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
- processMap.put("isLeader", new isLeader());
- processMap.put("newCuratorProjection", new newCuratorProjection());
- processMap.put("pingCuratorProjection", new pingCuratorProjection());
- processMap.put("setData", new setData());
- processMap.put("startLeaderSelector", new startLeaderSelector());
- processMap.put("startNodeCache", new startNodeCache());
- processMap.put("startPathChildrenCache", new startPathChildrenCache());
- processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
- processMap.put("sync", new sync());
- return processMap;
- }
-
- public static class acquireLock extends org.apache.thrift.ProcessFunction {
- public acquireLock() {
- super("acquireLock");
- }
-
- public acquireLock_args getEmptyArgsInstance() {
- return new acquireLock_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public acquireLock_result getResult(I iface, acquireLock_args args) throws org.apache.thrift.TException {
- acquireLock_result result = new acquireLock_result();
- try {
- result.success = iface.acquireLock(args.projection, args.path, args.maxWaitMs);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class acquireSemaphore extends org.apache.thrift.ProcessFunction {
- 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 extends org.apache.thrift.ProcessFunction {
- public closeCuratorProjection() {
- super("closeCuratorProjection");
- }
-
- public closeCuratorProjection_args getEmptyArgsInstance() {
- return new closeCuratorProjection_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- 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 result;
- }
- }
-
- public static class closeGenericProjection extends org.apache.thrift.ProcessFunction {
- public closeGenericProjection() {
- super("closeGenericProjection");
- }
-
- public closeGenericProjection_args getEmptyArgsInstance() {
- return new closeGenericProjection_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public closeGenericProjection_result getResult(I iface, closeGenericProjection_args args) throws org.apache.thrift.TException {
- closeGenericProjection_result result = new closeGenericProjection_result();
- try {
- result.success = iface.closeGenericProjection(args.projection, args.id);
- result.setSuccessIsSet(true);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class createNode extends org.apache.thrift.ProcessFunction {
- public createNode() {
- super("createNode");
- }
-
- public createNode_args getEmptyArgsInstance() {
- return new createNode_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public createNode_result getResult(I iface, createNode_args args) throws org.apache.thrift.TException {
- createNode_result result = new createNode_result();
- try {
- result.success = iface.createNode(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class deleteNode extends org.apache.thrift.ProcessFunction {
- public deleteNode() {
- super("deleteNode");
- }
-
- public deleteNode_args getEmptyArgsInstance() {
- return new deleteNode_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public deleteNode_result getResult(I iface, deleteNode_args args) throws org.apache.thrift.TException {
- deleteNode_result result = new deleteNode_result();
- try {
- iface.deleteNode(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class exists extends org.apache.thrift.ProcessFunction {
- public exists() {
- super("exists");
- }
-
- public exists_args getEmptyArgsInstance() {
- return new exists_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public exists_result getResult(I iface, exists_args args) throws org.apache.thrift.TException {
- exists_result result = new exists_result();
- try {
- result.success = iface.exists(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getChildren extends org.apache.thrift.ProcessFunction {
- public getChildren() {
- super("getChildren");
- }
-
- public getChildren_args getEmptyArgsInstance() {
- return new getChildren_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getChildren_result getResult(I iface, getChildren_args args) throws org.apache.thrift.TException {
- getChildren_result result = new getChildren_result();
- try {
- result.success = iface.getChildren(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getData extends org.apache.thrift.ProcessFunction {
- public getData() {
- super("getData");
- }
-
- public getData_args getEmptyArgsInstance() {
- return new getData_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getData_result getResult(I iface, getData_args args) throws org.apache.thrift.TException {
- getData_result result = new getData_result();
- try {
- result.success = iface.getData(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getLeaderParticipants extends org.apache.thrift.ProcessFunction {
- public getLeaderParticipants() {
- super("getLeaderParticipants");
- }
-
- public getLeaderParticipants_args getEmptyArgsInstance() {
- return new getLeaderParticipants_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getLeaderParticipants_result getResult(I iface, getLeaderParticipants_args args) throws org.apache.thrift.TException {
- getLeaderParticipants_result result = new getLeaderParticipants_result();
- try {
- result.success = iface.getLeaderParticipants(args.projection, args.leaderProjection);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getNodeCacheData extends org.apache.thrift.ProcessFunction {
- public getNodeCacheData() {
- super("getNodeCacheData");
- }
-
- public getNodeCacheData_args getEmptyArgsInstance() {
- return new getNodeCacheData_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getNodeCacheData_result getResult(I iface, getNodeCacheData_args args) throws org.apache.thrift.TException {
- getNodeCacheData_result result = new getNodeCacheData_result();
- try {
- result.success = iface.getNodeCacheData(args.projection, args.cacheProjection);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getPathChildrenCacheData extends org.apache.thrift.ProcessFunction {
- public getPathChildrenCacheData() {
- super("getPathChildrenCacheData");
- }
-
- public getPathChildrenCacheData_args getEmptyArgsInstance() {
- return new getPathChildrenCacheData_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getPathChildrenCacheData_result getResult(I iface, getPathChildrenCacheData_args args) throws org.apache.thrift.TException {
- getPathChildrenCacheData_result result = new getPathChildrenCacheData_result();
- try {
- result.success = iface.getPathChildrenCacheData(args.projection, args.cacheProjection);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class getPathChildrenCacheDataForPath extends org.apache.thrift.ProcessFunction {
- public getPathChildrenCacheDataForPath() {
- super("getPathChildrenCacheDataForPath");
- }
-
- public getPathChildrenCacheDataForPath_args getEmptyArgsInstance() {
- return new getPathChildrenCacheDataForPath_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getPathChildrenCacheDataForPath_result getResult(I iface, getPathChildrenCacheDataForPath_args args) throws org.apache.thrift.TException {
- getPathChildrenCacheDataForPath_result result = new getPathChildrenCacheDataForPath_result();
- try {
- result.success = iface.getPathChildrenCacheDataForPath(args.projection, args.cacheProjection, args.path);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class isLeader extends org.apache.thrift.ProcessFunction {
- public isLeader() {
- super("isLeader");
- }
-
- public isLeader_args getEmptyArgsInstance() {
- return new isLeader_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public isLeader_result getResult(I iface, isLeader_args args) throws org.apache.thrift.TException {
- isLeader_result result = new isLeader_result();
- try {
- result.success = iface.isLeader(args.projection, args.leaderProjection);
- result.setSuccessIsSet(true);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class newCuratorProjection extends org.apache.thrift.ProcessFunction {
- public newCuratorProjection() {
- super("newCuratorProjection");
- }
-
- public newCuratorProjection_args getEmptyArgsInstance() {
- return new newCuratorProjection_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public newCuratorProjection_result getResult(I iface, newCuratorProjection_args args) throws org.apache.thrift.TException {
- newCuratorProjection_result result = new newCuratorProjection_result();
- try {
- result.success = iface.newCuratorProjection(args.connectionName);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class pingCuratorProjection extends org.apache.thrift.ProcessFunction {
- public pingCuratorProjection() {
- super("pingCuratorProjection");
- }
-
- public pingCuratorProjection_args getEmptyArgsInstance() {
- return new pingCuratorProjection_args();
- }
-
- protected boolean isOneway() {
- return true;
- }
-
- public org.apache.thrift.TBase getResult(I iface, pingCuratorProjection_args args) throws org.apache.thrift.TException {
- iface.pingCuratorProjection(args.projection);
- return null;
- }
- }
-
- public static class setData extends org.apache.thrift.ProcessFunction {
- public setData() {
- super("setData");
- }
-
- public setData_args getEmptyArgsInstance() {
- return new setData_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public setData_result getResult(I iface, setData_args args) throws org.apache.thrift.TException {
- setData_result result = new setData_result();
- try {
- result.success = iface.setData(args.projection, args.spec);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class startLeaderSelector extends org.apache.thrift.ProcessFunction {
- public startLeaderSelector() {
- super("startLeaderSelector");
- }
-
- public startLeaderSelector_args getEmptyArgsInstance() {
- return new startLeaderSelector_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public startLeaderSelector_result getResult(I iface, startLeaderSelector_args args) throws org.apache.thrift.TException {
- startLeaderSelector_result result = new startLeaderSelector_result();
- try {
- result.success = iface.startLeaderSelector(args.projection, args.path, args.participantId, args.waitForLeadershipMs);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class startNodeCache extends org.apache.thrift.ProcessFunction {
- public startNodeCache() {
- super("startNodeCache");
- }
-
- public startNodeCache_args getEmptyArgsInstance() {
- return new startNodeCache_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public startNodeCache_result getResult(I iface, startNodeCache_args args) throws org.apache.thrift.TException {
- startNodeCache_result result = new startNodeCache_result();
- try {
- result.success = iface.startNodeCache(args.projection, args.path, args.dataIsCompressed, args.buildInitial);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class startPathChildrenCache extends org.apache.thrift.ProcessFunction {
- public startPathChildrenCache() {
- super("startPathChildrenCache");
- }
-
- public startPathChildrenCache_args getEmptyArgsInstance() {
- return new startPathChildrenCache_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public startPathChildrenCache_result getResult(I iface, startPathChildrenCache_args args) throws org.apache.thrift.TException {
- startPathChildrenCache_result result = new startPathChildrenCache_result();
- try {
- result.success = iface.startPathChildrenCache(args.projection, args.path, args.cacheData, args.dataIsCompressed, args.startMode);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class startPersistentEphemeralNode extends org.apache.thrift.ProcessFunction {
- public startPersistentEphemeralNode() {
- super("startPersistentEphemeralNode");
- }
-
- public startPersistentEphemeralNode_args getEmptyArgsInstance() {
- return new startPersistentEphemeralNode_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public startPersistentEphemeralNode_result getResult(I iface, startPersistentEphemeralNode_args args) throws org.apache.thrift.TException {
- startPersistentEphemeralNode_result result = new startPersistentEphemeralNode_result();
- try {
- result.success = iface.startPersistentEphemeralNode(args.projection, args.path, args.data, args.mode);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- public static class sync extends org.apache.thrift.ProcessFunction {
- public sync() {
- super("sync");
- }
-
- public sync_args getEmptyArgsInstance() {
- return new sync_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public sync_result getResult(I iface, sync_args args) throws org.apache.thrift.TException {
- sync_result result = new sync_result();
- try {
- iface.sync(args.projection, args.path, args.asyncContext);
- } catch (CuratorException ex1) {
- result.ex1 = ex1;
- }
- return result;
- }
- }
-
- }
-
- public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
- public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap>()));
- }
-
- protected AsyncProcessor(I iface, Map> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static Map> getProcessMap(Map> 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());
- processMap.put("deleteNode", new deleteNode());
- processMap.put("exists", new exists());
- processMap.put("getChildren", new getChildren());
- processMap.put("getData", new getData());
- processMap.put("getLeaderParticipants", new getLeaderParticipants());
- processMap.put("getNodeCacheData", new getNodeCacheData());
- processMap.put("getPathChildrenCacheData", new getPathChildrenCacheData());
- processMap.put("getPathChildrenCacheDataForPath", new getPathChildrenCacheDataForPath());
- processMap.put("isLeader", new isLeader());
- processMap.put("newCuratorProjection", new newCuratorProjection());
- processMap.put("pingCuratorProjection", new pingCuratorProjection());
- processMap.put("setData", new setData());
- processMap.put("startLeaderSelector", new startLeaderSelector());
- processMap.put("startNodeCache", new startNodeCache());
- processMap.put("startPathChildrenCache", new startPathChildrenCache());
- processMap.put("startPersistentEphemeralNode", new startPersistentEphemeralNode());
- processMap.put("sync", new sync());
- return processMap;
- }
-
- public static class acquireLock extends org.apache.thrift.AsyncProcessFunction {
- public acquireLock() {
- super("acquireLock");
- }
-
- public acquireLock_args getEmptyArgsInstance() {
- return new acquireLock_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(OptionalLockProjection o) {
- acquireLock_result result = new acquireLock_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;
- acquireLock_result result = new acquireLock_result();
- if (e instanceof CuratorException) {
- result.ex1 = (CuratorException) e;
- result.setEx1IsSet(true);
- msg = result;
- }
- else
- {
- msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
- msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
- }
- 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, acquireLock_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.acquireLock(args.projection, args.path, args.maxWaitMs,resultHandler);
- }
- }
-
- public static class acquireSemaphore extends org.apache.thrift.AsyncProcessFunction> {
- public acquireSemaphore() {
- super("acquireSemaphore");
- }
-
- public acquireSemaphore_args getEmptyArgsInstance() {
- return new acquireSemaphore_args();
- }
-
- public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback