Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/75#discussion_r54590327
  
    --- Diff: 
core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
 ---
    @@ -699,7 +710,33 @@ else if (Tables.getTableState(context.getInstance(), 
table) == TableState.OFFLIN
     
         }
     
    -    void addMutations(MutationSet mutationsToSend) {
    +    void queueMutations(final MutationSet mutationsToSend) throws 
InterruptedException {
    +      if (null == mutationsToSend)
    +        return;
    +      boolean transferred = queue.tryTransfer(new Runnable() {
    --- End diff --
    
    I was playing around with this locally.  I added some prints and noticed 
the background thread was never binning.  This was because the background 
thread was never started (adding vial thread pool API will start it).  I fixed 
this issue by prestarting the threads, however  I think it would be safer to 
add using the Executor API (because threads could idle time out).  I was 
reading and found the following.
    
     * ThreadPoolExecutor javadocs recommend only using the queue for debugging 
and monitoring
     * The same thing can be accomplished using 
ThreadPoolExecutor.CallerRunsPolicy() and a SynchronousQueue()
    
    I got .CallerRunsPolicy+SynchronousQueue working here 
keith-turner/accumulo@bb28195
    
    I made some modifications to BatchWriterFlushIT in 
keith-turner/accumulo@3d3c252 .  Running that I was able to see that sometimes 
the background thread binned and sometimes the foreground thread binned.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to