Repository: incubator-blur Updated Branches: refs/heads/master a5f93e509 -> 66a199235
intermediate doc fix Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/f5cba8f6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f5cba8f6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f5cba8f6 Branch: refs/heads/master Commit: f5cba8f62dcc80ea479554bcc1f101871170c22c Parents: 3cbfe13 Author: twilliams <[email protected]> Authored: Wed Nov 12 20:01:22 2014 -0500 Committer: twilliams <[email protected]> Committed: Wed Nov 12 20:01:22 2014 -0500 ---------------------------------------------------------------------- docs/platform.html | 75 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f5cba8f6/docs/platform.html ---------------------------------------------------------------------- diff --git a/docs/platform.html b/docs/platform.html index 5efe0ee..8f2b160 100644 --- a/docs/platform.html +++ b/docs/platform.html @@ -59,6 +59,10 @@ <li><a href="#motivation">Motivation</a></li> <li><a href="#arch">Blur Architecture Review</a></li> <li><a href="#commands">Command Overview</a></li> + <li><a href="#arguments">Arguments</a></li> + <li><a href="#installation">Installation</a></li> + <li><a href="#docs">Documentation</a></li> + <li><a href="#cli">CLI</a></li> </ul> </div> </div> @@ -172,46 +176,65 @@ public Long execute(IndexContext context) throws IOException { provides us access to the underlying Lucene index, so for our trivial command we can simply return the answer directly from the IndexReader. </p> - <p>To reduce the number of network traffic, Blur asks for a single response for all shards - on a given Shard Server. To let Blur know how to combine the local shard responses together, - we need to implement another method, appropriately named <code>combine</code>. Let's look - at that now. + <p>Now we need to let Blur know how to combine the results from the individual shards + into a single logical response. We do this by implementing the <code>combine</code> method. </p> - <code> + <pre> @Override -public Long combine(CombiningContext context, Map<? extends Location<?>, Long> results) throws IOException, +public Long combine(CombiningContext context, Iterable<Long> results) throws IOException, InterruptedException { Long total = 0l; - for(Long shardTotal: results.values()) { + for(Long shardTotal: results) { total += shardTotal; } return total; } - </code> + </pre> <p> Again, we're given some execution context (which we don't need for our sample command) and we're - given a <code>Map</code> of results that contain a Location as the key and result as the value. - At this point, at this point Location is actually a <code>Shard</code> class that lets you know - where the response came from. For our sample command, all we need to do is add up all the document - counts and return it. - </p> - <p> - So we've found the result on a single index, combined those results for all shards hosted on a given - Shard server, now all there is to do is further combine all the results from all the Shard servers, - right? Well, we've found that for many commands, the combine that would be executed to collapse shards - on a server is actually exactly that same as to combine all the results across the cluster, so - by default Blur just re-uses the combine method. So, we're effectively done with the bulk of the command - implementation, but let's go back now and look at the whole <code>Command</code> together and explore - the house-keeping bits. + given an <code>Iterable</code> of result values. </p> - <pre> - - </pre> - - </section> + + </section> + <section> + <div class="page-header"> + <h2 id="arguments">Arguments</h2> + </div> + <p> + + </p> + + </section> + <section> + <div class="page-header"> + <h2 id="installation">Installation</h2> + </div> + <p> + + </p> + + </section> + <section> + <div class="page-header"> + <h2 id="docs">Documentation</h2> + </div> + <p> + + </p> + + </section> + <section> + <div class="page-header"> + <h2 id="cli">CLI</h2> + </div> + <p> + + </p> + + </section> </div> </div> </div>
