Package alluxio.util

Class SleepUtils


  • @ThreadSafe
    public final class SleepUtils
    extends java.lang.Object
    Sleep utilities shared by all components in Alluxio.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void sleepMs​(long timeMs)
      Sleeps for the given number of milliseconds.
      static void sleepMs​(org.slf4j.Logger logger, long timeMs)
      Sleeps for the given number of milliseconds, reporting interruptions using the given logger.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sleepMs

        public static void sleepMs​(long timeMs)
        Sleeps for the given number of milliseconds.
        Parameters:
        timeMs - sleep duration in milliseconds
      • sleepMs

        public static void sleepMs​(org.slf4j.Logger logger,
                                   long timeMs)
        Sleeps for the given number of milliseconds, reporting interruptions using the given logger. Unlike Thread.sleep(), this method responds to interrupts by setting the thread interrupt status. This means that callers must check the interrupt status if they need to handle interrupts.
        Parameters:
        logger - logger for reporting interruptions; no reporting is done if the logger is null
        timeMs - sleep duration in milliseconds