David Smiley created SOLR-6134:
----------------------------------

             Summary: MapReduce GoLive code improvements
                 Key: SOLR-6134
                 URL: https://issues.apache.org/jira/browse/SOLR-6134
             Project: Solr
          Issue Type: Improvement
          Components: contrib - MapReduce
            Reporter: David Smiley
            Priority: Minor


I looked at the GoLive.java source quite a bit and found myself editing the 
source to make it clearer.  It wasn't hard to understand before but I felt it 
could be better.  Furthermore, when not in SolrCloud mode, the commit messages 
are now submitted asynchronously using the same thread pool used for merging.

This refactoring does away with the inner class "Result", the 
CompletionService, and any keeping track of Future's/Result's in collections 
and looping over them.  Fundamentally the code never cared about the result; it 
just wanted to know if it all worked or not.  This refactoring uses Java's 
"Phaser" concurrency utility which may seem advanced (especially with the cool 
name :-) but I find it quite understandable how to use, and is very flexible. I 
added an inner class implementing Runnable to avoid some duplication across the 
merge and commit phases.

The tests pass but I confess to not having used it for real.  I certainly don't 
feel comfortable committing this until someone does try it; especially try and 
break it ;-).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to