Class MockCuratorFramework

java.lang.Object
com.yahoo.vespa.curator.mock.MockCuratorFramework
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.curator.framework.CuratorFramework

public class MockCuratorFramework extends Object implements org.apache.curator.framework.CuratorFramework
A mock implementation ofCuratorFramework for testing purposes.
Author:
mpolden
  • Field Details

  • Constructor Details

    • MockCuratorFramework

      public MockCuratorFramework(boolean stableOrdering, boolean shouldTimeoutOnEnter)
  • Method Details

    • atomicCounters

      public Map<String,com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter> atomicCounters()
    • fileSystem

      public com.yahoo.vespa.curator.mock.MemoryFileSystem fileSystem()
    • start

      public void start()
      Specified by:
      start in interface org.apache.curator.framework.CuratorFramework
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.curator.framework.CuratorFramework
    • getState

      public org.apache.curator.framework.imps.CuratorFrameworkState getState()
      Specified by:
      getState in interface org.apache.curator.framework.CuratorFramework
    • isStarted

      @Deprecated public boolean isStarted()
      Deprecated.
      Specified by:
      isStarted in interface org.apache.curator.framework.CuratorFramework
    • create

      public org.apache.curator.framework.api.CreateBuilder create()
      Specified by:
      create in interface org.apache.curator.framework.CuratorFramework
    • delete

      public org.apache.curator.framework.api.DeleteBuilder delete()
      Specified by:
      delete in interface org.apache.curator.framework.CuratorFramework
    • checkExists

      public org.apache.curator.framework.api.ExistsBuilder checkExists()
      Specified by:
      checkExists in interface org.apache.curator.framework.CuratorFramework
    • getData

      public org.apache.curator.framework.api.GetDataBuilder getData()
      Specified by:
      getData in interface org.apache.curator.framework.CuratorFramework
    • setData

      public org.apache.curator.framework.api.SetDataBuilder setData()
      Specified by:
      setData in interface org.apache.curator.framework.CuratorFramework
    • getChildren

      public org.apache.curator.framework.api.GetChildrenBuilder getChildren()
      Specified by:
      getChildren in interface org.apache.curator.framework.CuratorFramework
    • getACL

      public org.apache.curator.framework.api.GetACLBuilder getACL()
      Specified by:
      getACL in interface org.apache.curator.framework.CuratorFramework
    • setACL

      public org.apache.curator.framework.api.SetACLBuilder setACL()
      Specified by:
      setACL in interface org.apache.curator.framework.CuratorFramework
    • reconfig

      public org.apache.curator.framework.api.ReconfigBuilder reconfig()
      Specified by:
      reconfig in interface org.apache.curator.framework.CuratorFramework
    • getConfig

      public org.apache.curator.framework.api.GetConfigBuilder getConfig()
      Specified by:
      getConfig in interface org.apache.curator.framework.CuratorFramework
    • inTransaction

      public org.apache.curator.framework.api.transaction.CuratorTransaction inTransaction()
      Specified by:
      inTransaction in interface org.apache.curator.framework.CuratorFramework
    • transaction

      public org.apache.curator.framework.api.transaction.CuratorMultiTransaction transaction()
      Specified by:
      transaction in interface org.apache.curator.framework.CuratorFramework
    • transactionOp

      public org.apache.curator.framework.api.transaction.TransactionOp transactionOp()
      Specified by:
      transactionOp in interface org.apache.curator.framework.CuratorFramework
    • watches

      public org.apache.curator.framework.api.RemoveWatchesBuilder watches()
      Specified by:
      watches in interface org.apache.curator.framework.CuratorFramework
    • watchers

      public org.apache.curator.framework.api.WatchesBuilder watchers()
      Specified by:
      watchers in interface org.apache.curator.framework.CuratorFramework
    • newWatcherRemoveCuratorFramework

      public org.apache.curator.framework.WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework()
      Specified by:
      newWatcherRemoveCuratorFramework in interface org.apache.curator.framework.CuratorFramework
    • getConnectionStateErrorPolicy

      public org.apache.curator.framework.state.ConnectionStateErrorPolicy getConnectionStateErrorPolicy()
      Specified by:
      getConnectionStateErrorPolicy in interface org.apache.curator.framework.CuratorFramework
    • getCurrentConfig

      public org.apache.zookeeper.server.quorum.flexible.QuorumVerifier getCurrentConfig()
      Specified by:
      getCurrentConfig in interface org.apache.curator.framework.CuratorFramework
    • getSchemaSet

      public org.apache.curator.framework.schema.SchemaSet getSchemaSet()
      Specified by:
      getSchemaSet in interface org.apache.curator.framework.CuratorFramework
    • postSafeNotify

      public CompletableFuture<Void> postSafeNotify(Object monitorHolder)
      Specified by:
      postSafeNotify in interface org.apache.curator.framework.CuratorFramework
    • runSafe

      public CompletableFuture<Void> runSafe(Runnable runnable)
      Specified by:
      runSafe in interface org.apache.curator.framework.CuratorFramework
    • sync

      @Deprecated public void sync(String path, Object backgroundContextObject)
      Deprecated.
      Specified by:
      sync in interface org.apache.curator.framework.CuratorFramework
    • createContainers

      public void createContainers(String s)
      Specified by:
      createContainers in interface org.apache.curator.framework.CuratorFramework
    • getConnectionStateListenable

      public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.state.ConnectionStateListener> getConnectionStateListenable()
      Specified by:
      getConnectionStateListenable in interface org.apache.curator.framework.CuratorFramework
    • getCuratorListenable

      public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.CuratorListener> getCuratorListenable()
      Specified by:
      getCuratorListenable in interface org.apache.curator.framework.CuratorFramework
    • getUnhandledErrorListenable

      public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.UnhandledErrorListener> getUnhandledErrorListenable()
      Specified by:
      getUnhandledErrorListenable in interface org.apache.curator.framework.CuratorFramework
    • nonNamespaceView

      @Deprecated public org.apache.curator.framework.CuratorFramework nonNamespaceView()
      Deprecated.
      Specified by:
      nonNamespaceView in interface org.apache.curator.framework.CuratorFramework
    • usingNamespace

      public org.apache.curator.framework.CuratorFramework usingNamespace(String newNamespace)
      Specified by:
      usingNamespace in interface org.apache.curator.framework.CuratorFramework
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface org.apache.curator.framework.CuratorFramework
    • getZookeeperClient

      public org.apache.curator.CuratorZookeeperClient getZookeeperClient()
      Specified by:
      getZookeeperClient in interface org.apache.curator.framework.CuratorFramework
    • newNamespaceAwareEnsurePath

      @Deprecated public org.apache.curator.utils.EnsurePath newNamespaceAwareEnsurePath(String path)
      Deprecated.
      Specified by:
      newNamespaceAwareEnsurePath in interface org.apache.curator.framework.CuratorFramework
    • clearWatcherReferences

      public void clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
      Specified by:
      clearWatcherReferences in interface org.apache.curator.framework.CuratorFramework
    • blockUntilConnected

      public boolean blockUntilConnected(int i, TimeUnit timeUnit)
      Specified by:
      blockUntilConnected in interface org.apache.curator.framework.CuratorFramework
    • blockUntilConnected

      public void blockUntilConnected()
      Specified by:
      blockUntilConnected in interface org.apache.curator.framework.CuratorFramework
    • sync

      public org.apache.curator.framework.api.SyncBuilder sync()
      Specified by:
      sync in interface org.apache.curator.framework.CuratorFramework
    • createMutex

      public org.apache.curator.framework.recipes.locks.InterProcessLock createMutex(String path)
    • createAtomicCounter

      public com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter createAtomicCounter(String path)
    • createCompletionWaiter

      public Curator.CompletionWaiter createCompletionWaiter()
    • createDirectoryCache

      public Curator.DirectoryCache createDirectoryCache(String path)
    • createFileCache

      public Curator.FileCache createFileCache(String path)
    • validatePath

      public static String validatePath(String path) throws IllegalArgumentException
      Validates a path using the same rules as ZooKeeper
      Throws:
      IllegalArgumentException