@Override
      public void run() {
        LOG.debug("Cleaning up hive client cache in ShutDown hook");
        cleanupHandle.cancel(false); // Cancel the maintenance thread.
        closeAllClientsQuietly();
      }
Create the cleanup handle. In addition to cleaning up every cleanupInterval, we add
a slight offset, so that the very first time it runs, it runs with a slight delay, so
as to catch any other connections that were closed when the first timeout happened.
As a result, the time we can expect an unused connection to be reaped is
5 seconds after the first timeout, and then after that, it'll check for whether or not
it can be cleaned every max(DEFAULT_HIVE_CACHE_EXPIRY_TIME_SECONDS,timeout) seconds
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HiveClientCache.java