Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-8003

Threads#getBoundedCachedThreadPool harcodes the time unit to seconds

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 0.98.0
    • 0.98.0
    • None
    • None
    • Reviewed

    Description

      /**

      • Create a new CachedThreadPool with a bounded number as the maximum
      • thread size in the pool.
      • @param maxCachedThread the maximum thread could be created in the pool
      • @param timeout the maximum time to wait
      • @param unit the time unit of the timeout argument
      • @param threadFactory the factory to use when creating new threads
      • @return threadPoolExecutor the cachedThreadPool with a bounded number
      • as the maximum thread size in the pool.
        */
        public static ThreadPoolExecutor getBoundedCachedThreadPool(
        int maxCachedThread, long timeout, TimeUnit unit,
        ThreadFactory threadFactory) { ThreadPoolExecutor boundedCachedThreadPool = new ThreadPoolExecutor(maxCachedThread, maxCachedThread, timeout, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory); // allow the core pool threads timeout and terminate boundedCachedThreadPool.allowCoreThreadTimeOut(true); return boundedCachedThreadPool; }

      Attachments

        1. 8003.v1.patch
          0.8 kB
          Nicolas Liochon
        2. 8003.v1.patch
          0.8 kB
          Nicolas Liochon

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            nkeywal Nicolas Liochon
            nkeywal Nicolas Liochon
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment