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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.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(Curator curator)
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 Detail
-
and
org.apache.curator.framework.api.transaction.CuratorTransaction and(org.apache.curator.framework.api.transaction.CuratorTransaction transaction) throws java.lang.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:
java.lang.Exception
- if unable to create transaction for this operation.
-
check
default void check(Curator curator)
Check if this operation can be performed by calling check(curator, new TransactionChanges()).- Throws:
java.lang.IllegalStateException
- if it cannot
-
check
void check(Curator curator, TransactionChanges changes)
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:
java.lang.IllegalStateException
- if it cannot be performed
-
-