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
ConstructorsConstructorDescriptionSetDataBuilderImpl(CuratorFrameworkBase 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.StatCommit 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.StatCommit 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 backgroundvoidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) Cause the data to be uncompressed, even if theCuratorFrameworkhas compressionEnabledwithCompression(boolean compress) 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(CuratorFrameworkBase client, Backgrounding backgrounding, int version, boolean compress)
-
-
Method Details
-
compressed
Description copied from interface:CompressibleCause the data to be compressed using the configured compression provider- Specified by:
compressedin interfaceCompressible<SetDataBackgroundVersionable>- Returns:
- this
-
uncompressed
Description copied from interface:CompressibleCause the data to be uncompressed, even if theCuratorFrameworkhas compressionEnabled- Specified by:
uncompressedin interfaceCompressible<SetDataBackgroundVersionable>- Returns:
- this
-
withCompression
-
withVersion
Description copied from interface:VersionableUse the given version (the default is -1)- Specified by:
withVersionin interfaceVersionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
version- version to use- Returns:
- this
-
idempotent
Description copied from interface:IdempotentableIf 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:
idempotentin interfaceIdempotentable<SetDataBuilder>- Returns:
- this:
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, Object context) Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin 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:BackgroundablePerform the action in the background- Specified by:
inBackgroundin 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:BackgroundablePerform the action in the background- Specified by:
inBackgroundin 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:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Returns:
- this
-
inBackground
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin 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:BackgroundablePerform the action in the background- Specified by:
inBackgroundin 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:ErrorListenerPathAndBytesableSet 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:
withUnhandledErrorListenerin 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:PathAndBytesableCommit 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:
forPathin interfacePathAndBytesable<org.apache.zookeeper.data.Stat>- Parameters:
path- the path- Returns:
- operation result if any
- Throws:
Exception- errors
-
forPath
Description copied from interface:PathAndBytesableCommit the currently building operation using the given path and data- Specified by:
forPathin interfacePathAndBytesable<org.apache.zookeeper.data.Stat>- Parameters:
path- the pathdata- the data- Returns:
- operation result if any
- Throws:
Exception- errors
-