Class SetDataBuilderImpl
java.lang.Object
org.apache.curator.framework.imps.SetDataBuilderImpl
- All Implemented Interfaces:
Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
,BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>
,Compressible<SetDataBackgroundVersionable>
,ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
,Idempotentable<SetDataBuilder>
,PathAndBytesable<org.apache.zookeeper.data.Stat>
,SetDataBuilder
,Versionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>
public class SetDataBuilderImpl
extends Object
implements SetDataBuilder, ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
-
Constructor Summary
ConstructorDescriptionSetDataBuilderImpl
(CuratorFrameworkImpl client, Backgrounding backgrounding, int version, boolean compress) -
Method Summary
Modifier and TypeMethodDescriptionCause the data to be compressed using the configured compression providerorg.apache.zookeeper.data.Stat
Commit the currently building operation using the given path and the default data for the client (usually a byte[0] unless changed viaCuratorFrameworkFactory.Builder.defaultData(byte[])
).org.apache.zookeeper.data.Stat
Commit the currently building operation using the given path and dataIf 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> Perform the action in the backgroundErrorListenerPathAndBytesable
<org.apache.zookeeper.data.Stat> inBackground
(Object context) Perform the action in the backgroundErrorListenerPathAndBytesable
<org.apache.zookeeper.data.Stat> inBackground
(BackgroundCallback callback) Perform the action in the backgroundErrorListenerPathAndBytesable
<org.apache.zookeeper.data.Stat> inBackground
(BackgroundCallback callback, Object context) Perform the action in the backgroundErrorListenerPathAndBytesable
<org.apache.zookeeper.data.Stat> inBackground
(BackgroundCallback callback, Object context, Executor executor) Perform the action in the backgroundErrorListenerPathAndBytesable
<org.apache.zookeeper.data.Stat> inBackground
(BackgroundCallback callback, Executor executor) Perform the action in the backgroundvoid
performBackgroundOperation
(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) PathAndBytesable
<org.apache.zookeeper.data.Stat> 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)
-
Constructor Details
-
SetDataBuilderImpl
public SetDataBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, int version, boolean compress)
-
-
Method Details
-
compressed
Description copied from interface:Compressible
Cause the data to be compressed using the configured compression provider- Specified by:
compressed
in interfaceCompressible<SetDataBackgroundVersionable>
- Returns:
- this
-
withVersion
Description copied from interface:Versionable
Use the given version (the default is -1)- Specified by:
withVersion
in interfaceVersionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
version
- version to use- Returns:
- this
-
idempotent
Description copied from interface:Idempotentable
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.- Specified by:
idempotent
in interfaceIdempotentable<SetDataBuilder>
- Returns:
- this:
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Object context) Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
callback
- a functor that will get called when the operation has completedcontext
- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Object context, Executor executor) Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
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 call- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback) Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
callback
- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Returns:
- this
-
inBackground
Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
context
- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Executor executor) Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>
- Parameters:
callback
- a functor that will get called when the operation has completedexecutor
- executor to use for the background call- Returns:
- this
-
withUnhandledErrorListener
public PathAndBytesable<org.apache.zookeeper.data.Stat> withUnhandledErrorListener(UnhandledErrorListener listener) Description copied from interface:ErrorListenerPathAndBytesable
Set an error listener for this background operation. If an exception occurs while processing the call in the background, this listener will be called.- Specified by:
withUnhandledErrorListener
in interfaceErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
- Parameters:
listener
- the listener- Returns:
- this for chaining
-
getBackgroundEventType
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) throws Exception - Throws:
Exception
-
forPath
Description copied from interface:PathAndBytesable
Commit the currently building operation using the given path and the default data for the client (usually a byte[0] unless changed viaCuratorFrameworkFactory.Builder.defaultData(byte[])
).- Specified by:
forPath
in interfacePathAndBytesable<org.apache.zookeeper.data.Stat>
- Parameters:
path
- the path- Returns:
- operation result if any
- Throws:
Exception
- errors
-
forPath
Description copied from interface:PathAndBytesable
Commit the currently building operation using the given path and data- Specified by:
forPath
in interfacePathAndBytesable<org.apache.zookeeper.data.Stat>
- Parameters:
path
- the pathdata
- the data- Returns:
- operation result if any
- Throws:
Exception
- errors
-