test_class.declarator: LOG = LogFactory.getLog(ConstantTimeBackoffTest.class)
test_class.modifier: final static private
test_class.original_string: final static private Log LOG = LogFactory.getLog(ConstantTimeBackoffTest.class);
test_class.type: Log
test_class.var_name: LOG
test_class.file: utils/src/test/java/com/cloud/utils/backoff/impl/ConstantTimeBackoffTest.java
test_class.identifier: ConstantTimeBackoffTest
test_case.body: @Test
      public void waitBeforeRetry() throws InterruptedException {
          final ConstantTimeBackoff backoff = new ConstantTimeBackoff();
          // let's not wait too much in a test
          backoff.setTimeToWait(0);
          // check if the list of waiters is empty
          Assert.assertTrue(backoff.getWaiters().isEmpty());
          // call the waitBeforeRetry which will wait 0 ms and return
          backoff.waitBeforeRetry();
          // on normal exit the list of waiters should be cleared
          Assert.assertTrue(backoff.getWaiters().isEmpty());
      }
test_case.class_method_signature: ConstantTimeBackoffTest.waitBeforeRetry()
test_case.full_signature: @Test public void waitBeforeRetry()
test_case.identifier: waitBeforeRetry
test_case.invocations: setTimeToWait assertTrue isEmpty getWaiters waitBeforeRetry assertTrue isEmpty getWaiters
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void waitBeforeRetry()
focal_class.declarator: _time
focal_class.original_string: long _time;
focal_class.type: long
focal_class.var_name: _time
focal_class.declarator: _asleep = new ConcurrentHashMap<String, Thread>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Thread> _asleep = new ConcurrentHashMap<String, Thread>();
focal_class.type: Map<String, Thread>
focal_class.var_name: _asleep
focal_class.declarator: LOG = LogFactory.getLog(ConstantTimeBackoff.class)
focal_class.modifier: private final static
focal_class.original_string: private final static Log LOG = LogFactory.getLog(ConstantTimeBackoff.class);
focal_class.type: Log
focal_class.var_name: LOG
focal_class.file: utils/src/main/java/com/cloud/utils/backoff/impl/ConstantTimeBackoff.java
focal_class.identifier: ConstantTimeBackoff
focal_class.interfaces: implements BackoffAlgorithm, ConstantTimeBackoffMBean
focal_class.class_method_signature: ConstantTimeBackoff.waitBeforeRetry()
focal_class.full_signature: @Override public void waitBeforeRetry()
focal_class.identifier: waitBeforeRetry
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void waitBeforeRetry()
focal_class.class_method_signature: ConstantTimeBackoff.reset()
focal_class.full_signature: @Override public void reset()
focal_class.identifier: reset
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: ConstantTimeBackoff.configure(String name, Map<String, Object> params)
focal_class.full_signature: @Override public boolean configure(String name, Map<String, Object> params)
focal_class.identifier: configure
focal_class.modifiers: @Override public
focal_class.parameters: (String name, Map<String, Object> params)
focal_class.return: boolean
focal_class.signature: boolean configure(String name, Map<String, Object> params)
focal_class.class_method_signature: ConstantTimeBackoff.getWaiters()
focal_class.full_signature: @Override public Collection<String> getWaiters()
focal_class.identifier: getWaiters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<String>
focal_class.signature: Collection<String> getWaiters()
focal_class.class_method_signature: ConstantTimeBackoff.wakeup(String threadName)
focal_class.full_signature: @Override public boolean wakeup(String threadName)
focal_class.identifier: wakeup
focal_class.modifiers: @Override public
focal_class.parameters: (String threadName)
focal_class.return: boolean
focal_class.signature: boolean wakeup(String threadName)
focal_class.class_method_signature: ConstantTimeBackoff.getTimeToWait()
focal_class.full_signature: @Override public long getTimeToWait()
focal_class.identifier: getTimeToWait
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getTimeToWait()
focal_class.class_method_signature: ConstantTimeBackoff.setTimeToWait(long seconds)
focal_class.full_signature: @Override public void setTimeToWait(long seconds)
focal_class.identifier: setTimeToWait
focal_class.modifiers: @Override public
focal_class.parameters: (long seconds)
focal_class.return: void
focal_class.signature: void setTimeToWait(long seconds)
focal_class.superclass: extends AdapterBase
focal_method.body: @Override
      public void waitBeforeRetry() {
          Thread current = Thread.currentThread();
          try {
              _asleep.put(current.getName(), current);
              Thread.sleep(_time);
          } catch (InterruptedException e) {
              // JMX or other threads may interrupt this thread, but let's log it
              // anyway, no exception to log as this is not an error
              LOG.info("Thread " + current.getName() + " interrupted while waiting for retry");
          } finally {
              _asleep.remove(current.getName());
          }
          return;
      }
focal_method.class_method_signature: ConstantTimeBackoff.waitBeforeRetry()
focal_method.full_signature: @Override public void waitBeforeRetry()
focal_method.identifier: waitBeforeRetry
focal_method.invocations: currentThread put getName sleep info getName remove getName
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void waitBeforeRetry()