hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "binlijin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8720) Only one snapshot region tasks that can run at a time
Date Wed, 12 Jun 2013 15:40:21 GMT

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

binlijin commented on HBASE-8720:
---------------------------------

hi Matteo Bertozzi :
Queuing:
Any BlockingQueue may be used to transfer and hold submitted tasks. The use of this queue
interacts with pool sizing:
If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread
rather than queuing.
If corePoolSize or more threads are running, the Executor always prefers queuing a request
rather than adding a new thread.
If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize,
in which case, the task will be rejected.
so when a new task submit to the ThreadPoolExecutor, if there is a task is running, the new
task is queued in the queue, so all snapshot region tasks execute one by one.

And i think CONCURENT_SNAPSHOT_TASKS_KEY makes people misunderstanding.
  /** Maximum number of snapshot region tasks that can run concurrently */
  private static final String CONCURENT_SNAPSHOT_TASKS_KEY = "hbase.snapshot.region.concurrentTasks";
  private static final int DEFAULT_CONCURRENT_SNAPSHOT_TASKS = 3;

                
> Only one snapshot region tasks that can run at a time
> -----------------------------------------------------
>
>                 Key: HBASE-8720
>                 URL: https://issues.apache.org/jira/browse/HBASE-8720
>             Project: HBase
>          Issue Type: Bug
>          Components: snapshots
>    Affects Versions: 0.94.8, 0.95.0
>            Reporter: binlijin
>         Attachments: 8720-v2.txt, HBASE-8720.patch
>
>
> {code}
>     SnapshotSubprocedurePool(String name, Configuration conf) {
>       // configure the executor service
>       long keepAlive = conf.getLong(
>         RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_KEY,
>         RegionServerSnapshotManager.SNAPSHOT_TIMEOUT_MILLIS_DEFAULT);
>       int threads = conf.getInt(CONCURENT_SNAPSHOT_TASKS_KEY, DEFAULT_CONCURRENT_SNAPSHOT_TASKS);
>       this.name = name;
>       executor = new ThreadPoolExecutor(1, threads, keepAlive, TimeUnit.MILLISECONDS,
>           new LinkedBlockingQueue<Runnable>(), new DaemonThreadFactory("rs("
>               + name + ")-snapshot-pool"));
>       taskPool = new ExecutorCompletionService<Void>(executor);
>     }
> {code}
> ThreadPoolExecutor: 
> corePoolSize:1
> maximumPoolSize:3
> workQueue:LinkedBlockingQueue,unlimited
> so when a new task submit to the ThreadPoolExecutor, if there is a task is running, the
new task is queued in the queue, so all snapshot region tasks execute one by one.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message