Class CuratorOperations

java.lang.Object
com.yahoo.vespa.curator.transaction.CuratorOperations

public class CuratorOperations extends Object
Factory for transactional ZooKeeper operations. This mirrors the operations which are actually available in Curator, which unfortunately does not include variants that deletes children, creates parents etc. in a single operation.
Author:
Ulf Lilleengen, bratseth
  • Constructor Details

    • CuratorOperations

      public CuratorOperations()
  • Method Details

    • setData

      public static CuratorOperation setData(String path, byte[] bytes)
      Sets data at this path.
      Throws:
      IllegalStateException - in check() if the path does not exist
    • create

      public static CuratorOperation create(String path, byte[] bytes)
      Creates this path with data.
      Throws:
      IllegalStateException - in check() if the parent does not exist
    • create

      public static CuratorOperation create(String path)
      Creates this path with no data.
      Throws:
      IllegalStateException - in check() if the parent does not exist
    • delete

      public static CuratorOperation delete(String path)
      Deletes this path. This does not delete children.
      Throws:
      IllegalStateException - in check() if the path does not exist.
    • deleteAll

      public static List<CuratorOperation> deleteAll(String path, Curator curator)
      Returns operations deleting this path and everything below it, in an order where a parent is ordered after all its children, such that the operations will succeed when executed in the returned order. This does not fail, but returns an empty list if the path does not exist.