@InterfaceAudience.Private
  @VisibleForTesting
  static long getShutdownTimeout(Configuration conf) {
    long duration = conf.getTimeDuration(
        SERVICE_SHUTDOWN_TIMEOUT,
        SERVICE_SHUTDOWN_TIMEOUT_DEFAULT,
        TIME_UNIT_DEFAULT);
    if (duration < TIMEOUT_MINIMUM) {
      duration = TIMEOUT_MINIMUM;
    }
    return duration;
  }
@Test
  public void testShutdownTimeoutConfiguration() throws Throwable {
    // set the shutdown timeout and verify it can be read back.
    Configuration conf = new Configuration();
    long shutdownTimeout = 5;
    conf.setTimeDuration(SERVICE_SHUTDOWN_TIMEOUT,
        shutdownTimeout, TimeUnit.SECONDS);
    assertEquals(SERVICE_SHUTDOWN_TIMEOUT,
        shutdownTimeout,
        ShutdownHookManager.getShutdownTimeout(conf));
  }