[
https://issues.apache.org/jira/browse/TEPHRA-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858799#comment-15858799
]
ASF GitHub Bot commented on TEPHRA-215:
---------------------------------------
Github user poornachandra commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/32#discussion_r100208194
--- Diff:
tephra-hbase-compat-1.1-base/src/test/java/org/apache/tephra/hbase/txprune/PruneUpperBoundWriterSupplierTest.java
---
@@ -74,30 +81,35 @@ public Void call() throws Exception {
futureList.clear();
numOps.set(NUM_OPS);
// Start thread that release PruneUpperBoundWriters
- executor = Executors.newFixedThreadPool(3);
- for (int i = 0; i < 3; i++) {
- futureList.add(executor.submit(new Callable<Void>() {
+ executor = Executors.newFixedThreadPool(NUM_THREADS);
+ for (int i = 0; i < NUM_THREADS; i++) {
+ futureList.add(executor.submit(new Runnable() {
@Override
- public Void call() throws Exception {
+ public void run() {
// We need to release all NUM_OPS 'gets' that were executed to
trigger shutdown of the single instance of
// PruneUpperBoundWriter
- while (numOps.decrementAndGet() >= 0) {
+ while (numOps.decrementAndGet() > 0) {
supplier.release();
- TimeUnit.MICROSECONDS.sleep(random.nextInt(10));
+ try {
+ TimeUnit.MICROSECONDS.sleep(random.nextInt(10));
+ } catch (InterruptedException e) {
+ LOG.warn("Received an exception.", e);
+ }
}
- return null;
}
}));
}
for (Future future : futureList) {
future.get(1, TimeUnit.SECONDS);
}
+ // Since we got one instance in the beginning, we need to release it
+ supplier.release();
--- End diff --
It would be good to assert that the writer is running and alive before we
do the final release
> Share PruneUpperBoundWriter across all TransactionProcessors on the same
> region server
> --------------------------------------------------------------------------------------
>
> Key: TEPHRA-215
> URL: https://issues.apache.org/jira/browse/TEPHRA-215
> Project: Tephra
> Issue Type: Improvement
> Affects Versions: 0.11.0-incubating
> Reporter: Gokul Gunasekaran
> Assignee: Gokul Gunasekaran
> Fix For: 0.11.0-incubating
>
>
> Currently we start one prune upperbound writer thread per
> TransactionProcessor coprocessor. Instead we should be able to share only one
> thread that flushes writes to the prune state table periodically.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)