// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.curator.api;

import com.yahoo.path.Path;

import java.time.Duration;

/**
 * A client for a ZooKeeper cluster running inside Vespa. Applications that want to use ZooKeeper can inject this in
 * their code.
 *
 * @author mpolden
 */
public interface VespaCurator {

    /** Create and acquire a re-entrant lock in given path. This blocks until the lock is acquired or timeout elapses. */
    AutoCloseable lock(Path path, Duration timeout);

}

@@ -136,16 +136,71 @@
 r.api;%0A%0A
+import com.yahoo.concurrent.UncheckedTimeoutException;%0A
 import c
@@ -616,13 +616,46 @@
 timeout)
+ throws UncheckedTimeoutException
 ;%0A%0A%7D%0A

Document timeout exception may be thrown