public static class CuratorFrameworkFactory.Builder extends Object
public CuratorFramework build()
public CuratorTempFramework buildTemp()
CuratorTempFramework
are limited. Further, the connection will be closed after 3 minutes of inactivity.public CuratorTempFramework buildTemp(long inactiveThreshold, TimeUnit unit)
CuratorTempFramework
are limited. Further, the connection will be closed after inactiveThresholdMs
milliseconds of inactivity.inactiveThreshold
- number of milliseconds of inactivity to cause connection closeunit
- threshold unitpublic CuratorFrameworkFactory.Builder authorization(String scheme, byte[] auth)
scheme
- the schemeauth
- the auth bytespublic CuratorFrameworkFactory.Builder authorization(List<AuthInfo> authInfos)
authorization(java.lang.String, byte[])
for backward compatibility.
Subsequent calls to this method overwrite the prior calls.authInfos
- list of AuthInfo
objects with scheme and authpublic CuratorFrameworkFactory.Builder connectString(String connectString)
ensembleProvider(EnsembleProvider)
but not both.connectString
- list of servers to connect topublic CuratorFrameworkFactory.Builder ensembleProvider(EnsembleProvider ensembleProvider)
connectString(String)
but not both.ensembleProvider
- the ensemble provider to usepublic CuratorFrameworkFactory.Builder defaultData(byte[] defaultData)
PathAndBytesable.forPath(String)
is used.
This is useful for debugging purposes. For example, you could set this to be the IP of the
client.defaultData
- new default data to usepublic CuratorFrameworkFactory.Builder namespace(String namespace)
namespace
- the namespacepublic CuratorFrameworkFactory.Builder sessionTimeoutMs(int sessionTimeoutMs)
sessionTimeoutMs
- session timeoutpublic CuratorFrameworkFactory.Builder connectionTimeoutMs(int connectionTimeoutMs)
connectionTimeoutMs
- connection timeoutpublic CuratorFrameworkFactory.Builder maxCloseWaitMs(int maxCloseWaitMs)
maxCloseWaitMs
- time to wait during close to join background threadspublic CuratorFrameworkFactory.Builder retryPolicy(RetryPolicy retryPolicy)
retryPolicy
- retry policy to usepublic CuratorFrameworkFactory.Builder threadFactory(ThreadFactory threadFactory)
threadFactory
- thread factory used to create Executor Servicespublic CuratorFrameworkFactory.Builder compressionProvider(CompressionProvider compressionProvider)
compressionProvider
- the compression providerpublic CuratorFrameworkFactory.Builder zookeeperFactory(ZookeeperFactory zookeeperFactory)
zookeeperFactory
- the zookeeper factory to usepublic CuratorFrameworkFactory.Builder aclProvider(ACLProvider aclProvider)
aclProvider
- a provider for ACLspublic CuratorFrameworkFactory.Builder canBeReadOnly(boolean canBeReadOnly)
canBeReadOnly
- if true, allow ZooKeeper client to enter
read only mode in case of a network partition. See
ZooKeeper.ZooKeeper(String, int, Watcher, long, byte[], boolean)
for detailspublic CuratorFrameworkFactory.Builder dontUseContainerParents()
CreateBuilder.creatingParentContainersIfNeeded()
if the ZK JAR supports CreateMode#CONTAINER
. Call this method to turn off this behavior.public ACLProvider getAclProvider()
public ZookeeperFactory getZookeeperFactory()
public CompressionProvider getCompressionProvider()
public ThreadFactory getThreadFactory()
public EnsembleProvider getEnsembleProvider()
public int getSessionTimeoutMs()
public int getConnectionTimeoutMs()
public int getMaxCloseWaitMs()
public RetryPolicy getRetryPolicy()
public String getNamespace()
public boolean useContainerParentsIfAvailable()
@Deprecated public String getAuthScheme()
@Deprecated public byte[] getAuthValue()
public byte[] getDefaultData()
public boolean canBeReadOnly()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.