Interface CuratorOperation
- All Superinterfaces:
com.yahoo.transaction.Transaction.Operation
public interface CuratorOperation
extends com.yahoo.transaction.Transaction.Operation
The ZooKeeper operations that we support doing transactional.
- Author:
- Ulf Lilleengen, bratseth
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.curator.framework.api.transaction.CuratorTransaction
and
(org.apache.curator.framework.api.transaction.CuratorTransaction transaction) Returns the transaction resulting from combining this operation with the input transactiondefault void
Check if this operation can be performed by calling check(curator, new TransactionChanges()).void
check
(Curator curator, TransactionChanges changes) Check if this operation can be performed.
-
Method Details
-
and
org.apache.curator.framework.api.transaction.CuratorTransaction and(org.apache.curator.framework.api.transaction.CuratorTransaction transaction) throws Exception Returns the transaction resulting from combining this operation with the input transaction- Parameters:
transaction
-CuratorTransaction
to append this operation to.- Returns:
- the transaction, for chaining.
- Throws:
Exception
- if unable to create transaction for this operation.
-
check
Check if this operation can be performed by calling check(curator, new TransactionChanges()).- Throws:
IllegalStateException
- if it cannot
-
check
Check if this operation can be performed.- Parameters:
curator
- the curator instance to check againstchanges
- changes which will be done prior to this operation as part of the same transaction. Operations should use both this and the curator instance to check if they can be performed. In addition, they are required to add the change(s) they will perform to the set of changes.- Throws:
IllegalStateException
- if it cannot be performed
-