test_class.declarator: LOG = LoggerFactory.getLogger(RevAwaiterTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RevAwaiterTest.class);
test_class.type: Logger
test_class.var_name: LOG
test_class.declarator: logCaptureRule = new LogCaptureRule()
test_class.modifier: public @Rule
test_class.original_string: public @Rule LogCaptureRule logCaptureRule = new LogCaptureRule();
test_class.type: LogCaptureRule
test_class.var_name: logCaptureRule
test_class.declarator: MS_100 = Duration.ofMillis(100)
test_class.modifier: private static final
test_class.original_string: private static final Duration MS_100 = Duration.ofMillis(100);
test_class.type: Duration
test_class.var_name: MS_100
test_class.declarator: awaiter = new RevAwaiter("TEST")
test_class.original_string: RevAwaiter awaiter = new RevAwaiter("TEST");
test_class.type: RevAwaiter
test_class.var_name: awaiter
test_class.file: ds/src/test/java/org/opendaylight/etcd/ds/impl/RevAwaiterTest.java
test_class.identifier: RevAwaiterTest
test_case.body: @Test public void testAwaitFail() {
          assertThrows(TimeoutException.class, () -> awaiter.await(1, MS_100));
      }
test_case.class_method_signature: RevAwaiterTest.testAwaitFail()
test_case.full_signature: @Test public void testAwaitFail()
test_case.identifier: testAwaitFail
test_case.invocations: assertThrows await
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAwaitFail()
focal_class.declarator: LOG = LoggerFactory.getLogger(RevAwaiter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(RevAwaiter.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: EMPTY_ARRAY = new AwaitableRev[0]
focal_class.modifier: private static final
focal_class.original_string: private static final AwaitableRev[] EMPTY_ARRAY = new AwaitableRev[0];
focal_class.type: AwaitableRev[]
focal_class.var_name: EMPTY_ARRAY
focal_class.declarator: currentRev = new AtomicLong()
focal_class.modifier: private final
focal_class.original_string: private final AtomicLong currentRev = new AtomicLong();
focal_class.type: AtomicLong
focal_class.var_name: currentRev
focal_class.declarator: pq = new PriorityQueue<>((o1, o2) -> Long.compare(o1.rev, o2.rev))
focal_class.modifier: private final
focal_class.original_string: private final Queue<AwaitableRev> pq = new PriorityQueue<>((o1, o2) -> Long.compare(o1.rev, o2.rev));
focal_class.type: Queue<AwaitableRev>
focal_class.var_name: pq
focal_class.declarator: nodeName
focal_class.modifier: private final
focal_class.original_string: private final String nodeName;
focal_class.type: String
focal_class.var_name: nodeName
focal_class.file: ds/src/main/java/org/opendaylight/etcd/ds/impl/RevAwaiter.java
focal_class.identifier: RevAwaiter
focal_class.class_method_signature: RevAwaiter.RevAwaiter(String nodeName)
focal_class.full_signature:   RevAwaiter(String nodeName)
focal_class.identifier: RevAwaiter
focal_class.parameters: (String nodeName)
focal_class.signature:  RevAwaiter(String nodeName)
focal_class.class_method_signature: RevAwaiter.update(long rev)
focal_class.full_signature: @SuppressFBWarnings({ "NO_NOTIFY_NOT_NOTIFYALL", "NN_NAKED_NOTIFY" }) void update(long rev)
focal_class.identifier: update
focal_class.modifiers: @SuppressFBWarnings({ "NO_NOTIFY_NOT_NOTIFYALL", "NN_NAKED_NOTIFY" })
focal_class.parameters: (long rev)
focal_class.return: void
focal_class.signature: void update(long rev)
focal_class.class_method_signature: RevAwaiter.await(long rev, Duration maxWaitTime)
focal_class.full_signature:  void await(long rev, Duration maxWaitTime)
focal_class.identifier: await
focal_class.parameters: (long rev, Duration maxWaitTime)
focal_class.return: void
focal_class.signature: void await(long rev, Duration maxWaitTime)
focal_class.class_method_signature: RevAwaiter.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: void await(long rev, Duration maxWaitTime) throws TimeoutException, InterruptedException {
          if (currentRev.get() >= rev) {
              return;
          }
          AwaitableRev awaitable = new AwaitableRev(rev);
          synchronized (pq) {
              pq.add(awaitable);
          }
          synchronized (awaitable) {
              // account for possible spurious wake up
              @Var long now = System.nanoTime();
              long deadline = now + maxWaitTime.toNanos();
              while (currentRev.get() < rev && now < deadline) {
                  // http://errorprone.info/bugpattern/WaitNotInLoop
                  awaitable.wait((deadline - now) / 1000000);
                  now = System.nanoTime();
              }
              if (now >= deadline) {
                  throw new TimeoutException();
              }
              // else it's a real awaitable.notify(), not spurious nor timeout, and we return to caller.
          }
      }
focal_method.class_method_signature: RevAwaiter.await(long rev, Duration maxWaitTime)
focal_method.full_signature:  void await(long rev, Duration maxWaitTime)
focal_method.identifier: await
focal_method.invocations: get add nanoTime toNanos get wait nanoTime
focal_method.parameters: (long rev, Duration maxWaitTime)
focal_method.return: void
focal_method.signature: void await(long rev, Duration maxWaitTime)