[ 
https://issues.apache.org/jira/browse/HBASE-6778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14286131#comment-14286131
 ] 

Jonathan Lawlor commented on HBASE-6778:
----------------------------------------

Thanks for answering these questions [~stack].

bq. As I reviewed, I saw you had good javadoc on the methods. What is missing 
is a bit of metadoc on what this service does and when to use it. That should 
go in class comment. Make sense?

Ahh I see what you meant, that makes sense, thanks

bq. Does ExecutorService not expose methods you could make use of? Queued 
chores and how many current threads? Could you do a heuristic based off these? 
Just a suggestion.

The ScheduledThreadPoolExecutor does expose certain methods that reveal things 
like the size of the queue and the number of active threads. The problem with 
these methods is that they don't provide sufficient information to make the 
decision as to whether or not the current core thread pool is large enough. 
This is because being in the Queue does not necessarily mean that you are ready 
to execute (you may be in the queue because you are waiting for the start of 
your next execution). Thus, a large queue size does not indicate that there are 
many tasks that are ready to execute, but rather there are many tasks that are 
either waiting for their next start time OR ready to execute. 

Because of the ambiguity, I thought it would be best for chores to have a means 
by which they could tell the service that the core pool is not large enough, 
since the service cannot make this decision with its information alone.

bq. Has anyone asked for it?
Nobody has asked for the reschedule functionality so I'll be sure to keep it 
internal.

Thanks [~stack]


> Deprecate Chore; its a thread per task when we should have one thread to do 
> all tasks
> -------------------------------------------------------------------------------------
>
>                 Key: HBASE-6778
>                 URL: https://issues.apache.org/jira/browse/HBASE-6778
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Assignee: Jonathan Lawlor
>         Attachments: HBASE_6778_WIP_v1.patch, thread_dump_HMaster.local.out
>
>
> Should use something like ScheduledThreadPoolExecutor instead (Elliott said 
> this first I think; J-D said something similar just now).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to