[
https://issues.apache.org/jira/browse/HBASE-17174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15693900#comment-15693900
]
ChiaPing Tsai commented on HBASE-17174:
---------------------------------------
bq. How about calling pool.shutdowNow() in the case of timeout ?
The BufferedMutatorImpl#close should wait all tasks to complete rather than
stopping currently executing tasks. Otherwise, there will be some problem in
the following code.
try (BufferedMutator mutator = conn.getBufferedMutator()) {
// batch data
// flushing if buffer is full
} // the close() method should forces the remaining data to be flushed,
otherwise, the data will lose.
This logic is similar with
[BufferedOutputStream|https://docs.oracle.com/javase/7/docs/api/java/io/BufferedOutputStream.html]
bq. Is there some statistics showing the benefit of this change ?
Sorry for lacking the statistics. This issue is purposed to provide a way to
share the thread resource.
> Use shared threadpool in BufferedMutatorImpl
> --------------------------------------------
>
> Key: HBASE-17174
> URL: https://issues.apache.org/jira/browse/HBASE-17174
> Project: HBase
> Issue Type: New Feature
> Affects Versions: 2.0.0
> Reporter: ChiaPing Tsai
> Assignee: ChiaPing Tsai
> Priority: Minor
> Fix For: 2.0.0
>
> Attachments: HBASE-17174.v0.patch, HBASE-17174.v1.patch
>
>
> A update-heavy application, for example, loader, creates many BufferedMutator
> for batch updates. But these BufferedMutators can’t share a large threadpool
> because the shutdown() method will be called when closing any
> BufferedMutator. This patch adds a flag into BufferedMutatorParams for
> preventing calling the shutdown() method in BufferedMutatorImpl#close
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)