Package alluxio.util
Class SleepUtils
- java.lang.Object
-
- alluxio.util.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.
-
-
-
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 nulltimeMs
- sleep duration in milliseconds
-
-