You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Xiaolin Ha (Jira)" <ji...@apache.org> on 2022/03/07 12:30:00 UTC

[jira] [Resolved] (HBASE-26303) Use priority queue in dir scan pool of cleaner

     [ https://issues.apache.org/jira/browse/HBASE-26303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiaolin Ha resolved HBASE-26303.
--------------------------------
    Resolution: Won't Fix

> Use priority queue in dir scan pool of cleaner
> ----------------------------------------------
>
>                 Key: HBASE-26303
>                 URL: https://issues.apache.org/jira/browse/HBASE-26303
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-alpha-1, 2.0.0
>            Reporter: Xiaolin Ha
>            Assignee: Xiaolin Ha
>            Priority: Major
>
> DirScanPool used normal LinkedBlockingQueue when creating thread pool,
> {code:java}
>  54   private static ThreadPoolExecutor initializePool(int size) {
>  55     return Threads.getBoundedCachedThreadPool(size, 1, TimeUnit.MINUTES,
>  56       new ThreadFactoryBuilder().setNameFormat("dir-scan-pool-%d").setDaemon(true)
>  57         .setUncaughtExceptionHandler(Threads.LOGGING_EXCEPTION_HANDLER).build());
>  58   }
> {code}
> which will not priority scan larger directories and delete files there as expected, though CleanerChore#sortByConsumedSpace() before putting directories to the queue.
> Subdirectories of larger directories and small directories are taken fairly in the queue.
> We should used priority queue here instead, e.g. PriorityBlockingQueue, to make larger directories be cleaned earlier. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)