public class SetDataBuilderImpl extends Object implements SetDataBuilder, ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
Constructor and Description |
---|
SetDataBuilderImpl(CuratorFrameworkImpl client,
Backgrounding backgrounding,
int version,
boolean compress) |
Modifier and Type | Method and Description |
---|---|
SetDataBackgroundVersionable |
compressed()
Cause the data to be compressed using the configured compression provider
|
org.apache.zookeeper.data.Stat |
forPath(String path)
Commit the currently building operation using the given path and the default data
for the client (usually a byte[0] unless changed via
CuratorFrameworkFactory.Builder#defaultData(byte[]) ). |
org.apache.zookeeper.data.Stat |
forPath(String path,
byte[] data)
Commit the currently building operation using the given path and data
|
SetDataBuilder |
idempotent()
If the first try of this operation gets a transient error, curator will retry
the operation, and treat it as successful so long as the end state of the znode
is the same as if the operation had completed without error on the first try.
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground()
Perform the action in the background
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground(BackgroundCallback callback)
Perform the action in the background
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground(BackgroundCallback callback,
Executor executor)
Perform the action in the background
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground(BackgroundCallback callback,
Object context)
Perform the action in the background
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground(BackgroundCallback callback,
Object context,
Executor executor)
Perform the action in the background
|
ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> |
inBackground(Object context)
Perform the action in the background
|
void |
performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) |
PathAndBytesable<org.apache.zookeeper.data.Stat> |
withUnhandledErrorListener(UnhandledErrorListener listener)
Set an error listener for this background operation.
|
BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat> |
withVersion(int version)
Use the given version (the default is -1)
|
public SetDataBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, int version, boolean compress)
public SetDataBackgroundVersionable compressed()
Compressible
compressed
in interface Compressible<SetDataBackgroundVersionable>
public BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat> withVersion(int version)
Versionable
withVersion
in interface Versionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>
version
- version to usepublic SetDataBuilder idempotent()
Idempotentable
idempotent
in interface Idempotentable<SetDataBuilder>
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Object context)
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
callback
- a functor that will get called when the operation has completedcontext
- context object - will be available from the event sent to the listenerpublic ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Object context, Executor executor)
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
callback
- a functor that will get called when the operation has completedcontext
- context object - will be available from the event sent to the listenerexecutor
- executor to use for the background callpublic ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback)
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
callback
- a functor that will get called when the operation has completedpublic ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground()
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(Object context)
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
context
- context object - will be available from the event sent to the listenerpublic ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Executor executor)
Backgroundable
inBackground
in interface Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
callback
- a functor that will get called when the operation has completedexecutor
- executor to use for the background callpublic PathAndBytesable<org.apache.zookeeper.data.Stat> withUnhandledErrorListener(UnhandledErrorListener listener)
ErrorListenerPathAndBytesable
withUnhandledErrorListener
in interface ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
listener
- the listenerpublic void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) throws Exception
Exception
public org.apache.zookeeper.data.Stat forPath(String path) throws Exception
PathAndBytesable
CuratorFrameworkFactory.Builder#defaultData(byte[])
).forPath
in interface PathAndBytesable<org.apache.zookeeper.data.Stat>
path
- the pathException
- errorspublic org.apache.zookeeper.data.Stat forPath(String path, byte[] data) throws Exception
PathAndBytesable
forPath
in interface PathAndBytesable<org.apache.zookeeper.data.Stat>
path
- the pathdata
- the dataException
- errorsCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.