incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [5/9] git commit: Adding missing thrift method for getting the location of shards in the cluster. Also added a new attribute to queryargs.
Date Mon, 31 Dec 2012 20:44:03 GMT
Adding missing thrift method for getting the location of shards in the cluster.  Also added
a new attribute to queryargs.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d783db83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d783db83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d783db83

Branch: refs/heads/0.2-dev
Commit: d783db8385224cea3a811c0044d08932fa8e71ee
Parents: 4e1ce95
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Fri Dec 28 13:14:07 2012 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Fri Dec 28 13:14:07 2012 -0500

----------------------------------------------------------------------
 interface/Blur.thrift                              |   92 +-
 interface/gen-html/Blur.html                       |   79 +-
 interface/gen-html/index.html                      |    2 +
 .../org/apache/blur/thrift/generated/Blur.java     | 1601 ++++++++++++---
 .../apache/blur/thrift/generated/QueryArgs.java    |  294 +++-
 .../apache/blur/thrift/generated/ShardLayout.java  |  581 ++++++
 interface/gen-perl/Blur/Blur.pm                    |  573 ++++--
 interface/gen-perl/Blur/Types.pm                   |  133 ++-
 interface/gen-rb/blur.rb                           |   61 +
 interface/gen-rb/blur_types.rb                     |   46 +-
 .../java/org/apache/blur/thrift/BlurServer.java    |    6 +
 .../org/apache/blur/thrift/generated/Blur.java     | 1601 ++++++++++++---
 .../apache/blur/thrift/generated/QueryArgs.java    |  294 +++-
 .../apache/blur/thrift/generated/ShardLayout.java  |  581 ++++++
 14 files changed, 5060 insertions(+), 884 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/Blur.thrift
----------------------------------------------------------------------
diff --git a/interface/Blur.thrift b/interface/Blur.thrift
index 1c76b8c..5998a0d 100644
--- a/interface/Blur.thrift
+++ b/interface/Blur.thrift
@@ -340,15 +340,53 @@ struct ScoreDoc {
 }
 
 struct QueryArgs {
+ /**
+  * Unique id for controlling the given query.
+  */
  1:i64 id,
+ /**
+  * If after is left null then the first N (where N is numberToFetch)
+  * ScoreDocs are fetched.  If after is not null then the first N 
+  * ScoreDocs are fetched that occur after the given ScoreDoc.
+  */
  2:ScoreDoc after,
+ /**
+  * The query to be executed.
+  */
  3:binary query,
+ /**
+  * Filter to be executed.
+  */
  4:binary filter,
+ /**
+  * The number of document locations to fetch.
+  */
  5:i32 numberToFetch = 100,
- 6:Sort sort,
- 7:bool doDocScores = 1,
- 8:bool doMaxScore = 0,
- 9:list<i32> shardIndexes
+ /**
+  * If aggregate results is left true then only a single TopFieldDocs 
+  * object will be returned from the search method.  It will contain 
+  * only the best documents from the given search with all of the 
+  * shards being sorted and aggregated together.
+  */
+ 6:bool aggregateResults = 1,
+ /**
+  * NOT YET IMPLEMENTED.
+  */
+ 7:Sort sort,
+ /**
+  * NOT YET IMPLEMENTED.  Related to sort.
+  */
+ 8:bool doDocScores = 1,
+ /**
+  * Calculate the max score of the search.
+  */
+ 9:bool doMaxScore = 0,
+
+ /**
+  * Shard indexes allows the user to specify which shards of the table to execute 
+  * the query against.  If left null, all the shards of the table are used.
+  */
+ 10:list<i32> shardIndexes
 }
 
 struct TopFieldDocs {
@@ -451,12 +489,25 @@ struct Generation {
  3:i64 generation
 }
 
+struct ShardLayout {
+ /**
+  * The server for this layout.
+  */
+ 1:string server,
+ /**
+  * A list of shard ids for the given server.
+  */
+ 2:list<i32> shards
+}
+
 service Blur {
 
   // Data reading
 
   /**
-   * Creating a session snapshots the readers during search and document fetching.  This
provides a static view of the indexes so the document ids will remain the same during a session.
+   * Creating a session snapshots the readers during search and document 
+   * fetching.  This provides a static view of the indexes so the document
+   * ids will remain the same during a session.
    * @param table the table name.
    * @return the new Session.
    */
@@ -488,37 +539,44 @@ service Blur {
   // Data mutation  
 
   /**
-   * Add Documents to the given table in the provided shard.  If the table or shard is not
found on this shard server a BlurException will be thrown.
+   * Add Documents to the given table in the provided shard.  If the table or 
+   * shard is not found on this shard server a BlurException will be thrown.
    * @param options the MutateOptions provide the table name, shard index, etc.
-   * @param documents the documents to be added.  NOTE: All documents provided to be indexed
in a single segment.
+   * @param documents the documents to be added.  NOTE: All documents 
+   * provided to be indexed in a single segment.
    */
   list<Generation> addDocuments(1:MutateOptions options, 2:list<Document> documents)
throws (1:BlurException e)
 
   /**
-   * Delete Documents to the given table in the provided shard.  If the table or shard is
not found on this shard server a BlurException will be thrown.
+   * Delete Documents to the given table in the provided shard.  If the table 
+   * or shard is not found on this shard server a BlurException will be thrown.
    * @param options the MutateOptions provide the table name, shard index, etc.
    * @param queries the Queries that will executed and mark there resulting documents as
deleted.
    */
   list<Generation> deleteDocumentsByQueries(1:MutateOptions options, 2:list<binary>
queries) throws (1:BlurException e)
 
   /**
-   * Delete Documents to the given table in the provided shard.  If the table or shard is
not found on this shard server a BlurException will be thrown.
+   * Delete Documents to the given table in the provided shard.  If the table 
+   * or shard is not found on this shard server a BlurException will be thrown.
    * @param options the MutateOptions provide the table name, shard index, etc.
    * @param queries the Terms that will be found and mark deleted all the documents to be
deleted.
    */
   list<Generation> deleteDocuments(1:MutateOptions options, 2:list<Term> terms)
throws (1:BlurException e)
 
   /**
-   * Update Documents to the given table in the provided shard.  If the table or shard is
not found on this shard server a BlurException will be thrown.
+   * Update Documents to the given table in the provided shard.  If the table
+   * or shard is not found on this shard server a BlurException will be thrown.
    * @param options the MutateOptions provide the table name, shard index, etc.
-   * @param updatePackages the documents to be updated.  NOTE: All documents within a update
document object are indexed in a single segment.
+   * @param updatePackages the documents to be updated.  NOTE: All documents
+   * within a update document object are indexed in a single segment.
    */
   list<Generation> updateDocuments(1:MutateOptions options, 2:list<UpdatePackage>
updatePackages) throws (1:BlurException e)
 
   /**
    * This method blocks until all the given generations are visible for reading.
    * @param generations the list of Generation objects.
-   * @param forceRefresh forces a refresh of the indexes if true, if false will block until
natural refresh occurs.
+   * @param forceRefresh forces a refresh of the indexes if true, if false will
+   * block until natural refresh occurs.
    */
   void blockUntilGenerationIsVisible(1:list<Generation> generations, 2:bool forceRefresh)
throws (1:BlurException e)
 
@@ -539,6 +597,13 @@ service Blur {
   list<i32> serverLayout(1:string table, 2:string server) throws (1:BlurException ex)
 
   /**
+   * Gets the shard layout for each server in the cluster for the given table.
+   * @param table the table name.
+   * @return map of servers to shard layout object.
+   */
+  map<string,ShardLayout> shardLayout(1:string table) throws (1:BlurException ex)
+
+  /**
    * Gets a list of the table names.
    * @return list of table names.
    */
@@ -586,7 +651,8 @@ service Blur {
   // Query status
 
   /**
-   * Cancels a query that is executing against the given table with the given uuid.  Note,
the cancel call maybe take some time for the query actually stops executing.
+   * Cancels a query that is executing against the given table with the given uuid.
+   * NOTE, the cancel call maybe take some time for the query actually stops executing.
    * @param table the table name.
    * @param uuid the uuid of the query.
    */

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-html/Blur.html
----------------------------------------------------------------------
diff --git a/interface/gen-html/Blur.html b/interface/gen-html/Blur.html
index 42e1bf9..38180c0 100644
--- a/interface/gen-html/Blur.html
+++ b/interface/gen-html/Blur.html
@@ -31,6 +31,7 @@
 <li><a href="Blur.html#Fn_Blur_search">search</a></li>
 <li><a href="Blur.html#Fn_Blur_serverLayout">serverLayout</a></li>
 <li><a href="Blur.html#Fn_Blur_serverList">serverList</a></li>
+<li><a href="Blur.html#Fn_Blur_shardLayout">shardLayout</a></li>
 <li><a href="Blur.html#Fn_Blur_tableList">tableList</a></li>
 <li><a href="Blur.html#Fn_Blur_tableStats">tableStats</a></li>
 <li><a href="Blur.html#Fn_Blur_updateDocuments">updateDocuments</a></li>
@@ -52,6 +53,7 @@
 <a href="Blur.html#Struct_QueryStatus">QueryStatus</a><br/>
 <a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a><br/>
 <a href="Blur.html#Struct_Session">Session</a><br/>
+<a href="Blur.html#Struct_ShardLayout">ShardLayout</a><br/>
 <a href="Blur.html#Struct_Sort">Sort</a><br/>
 <a href="Blur.html#Struct_SortField">SortField</a><br/>
 <a href="Blur.html#Enum_SortType">SortType</a><br/>
@@ -220,15 +222,32 @@ does not open the index for writing, but will refresh the index periodically.
 <tr><td>4</td><td>fields</td><td><code>list&lt;<code>binary</code>&gt;</code></td><td></td><td>default</td><td></td></tr>
 </table><br/></div><div class="definition"><h3 id="Struct_QueryArgs">Struct:
QueryArgs</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default
value</th></thead>
-<tr><td>1</td><td>id</td><td><code>i64</code></td><td></td><td>default</td><td></td></tr>
-<tr><td>2</td><td>after</td><td><code><a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a></code></td><td></td><td>default</td><td></td></tr>
-<tr><td>3</td><td>query</td><td><code>binary</code></td><td></td><td>default</td><td></td></tr>
-<tr><td>4</td><td>filter</td><td><code>binary</code></td><td></td><td>default</td><td></td></tr>
-<tr><td>5</td><td>numberToFetch</td><td><code>i32</code></td><td></td><td>default</td><td>100</td></tr>
-<tr><td>6</td><td>sort</td><td><code><a href="Blur.html#Struct_Sort">Sort</a></code></td><td></td><td>default</td><td></td></tr>
-<tr><td>7</td><td>doDocScores</td><td><code>bool</code></td><td></td><td>default</td><td>1</td></tr>
-<tr><td>8</td><td>doMaxScore</td><td><code>bool</code></td><td></td><td>default</td><td>0</td></tr>
-<tr><td>9</td><td>shardIndexes</td><td><code>list&lt;<code>i32</code>&gt;</code></td><td></td><td>default</td><td></td></tr>
+<tr><td>1</td><td>id</td><td><code>i64</code></td><td>Unique
id for controlling the given query.
+</td><td>default</td><td></td></tr>
+<tr><td>2</td><td>after</td><td><code><a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a></code></td><td>If
after is left null then the first N (where N is numberToFetch)
+ScoreDocs are fetched.  If after is not null then the first N
+ScoreDocs are fetched that occur after the given ScoreDoc.
+</td><td>default</td><td></td></tr>
+<tr><td>3</td><td>query</td><td><code>binary</code></td><td>The
query to be executed.
+</td><td>default</td><td></td></tr>
+<tr><td>4</td><td>filter</td><td><code>binary</code></td><td>Filter
to be executed.
+</td><td>default</td><td></td></tr>
+<tr><td>5</td><td>numberToFetch</td><td><code>i32</code></td><td>The
number of document locations to fetch.
+</td><td>default</td><td>100</td></tr>
+<tr><td>6</td><td>aggregateResults</td><td><code>bool</code></td><td>If
aggregate results is left true then only a single TopFieldDocs
+object will be returned from the search method.  It will contain
+only the best documents from the given search with all of the
+shards being sorted and aggregated together.
+</td><td>default</td><td>1</td></tr>
+<tr><td>7</td><td>sort</td><td><code><a href="Blur.html#Struct_Sort">Sort</a></code></td><td>NOT
YET IMPLEMENTED.
+</td><td>default</td><td></td></tr>
+<tr><td>8</td><td>doDocScores</td><td><code>bool</code></td><td>NOT
YET IMPLEMENTED.  Related to sort.
+</td><td>default</td><td>1</td></tr>
+<tr><td>9</td><td>doMaxScore</td><td><code>bool</code></td><td>Calculate
the max score of the search.
+</td><td>default</td><td>0</td></tr>
+<tr><td>10</td><td>shardIndexes</td><td><code>list&lt;<code>i32</code>&gt;</code></td><td>Shard
indexes allows the user to specify which shards of the table to execute
+the query against.  If left null, all the shards of the table are used.
+</td><td>default</td><td></td></tr>
 </table><br/></div><div class="definition"><h3 id="Struct_TopFieldDocs">Struct:
TopFieldDocs</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default
value</th></thead>
 <tr><td>1</td><td>shardIndex</td><td><code>i32</code></td><td></td><td>default</td><td></td></tr>
@@ -284,12 +303,20 @@ does not open the index for writing, but will refresh the index periodically.
 </td><td>default</td><td></td></tr>
 </table><br/>Generation keeps a reference to the Lucene generation where a mutate
(add/update/delete)
 was performed.  This can be used to wait for that generation to be visible.
-<br/></div><hr/><h2 id="Services">Services</h2>
+<br/></div><div class="definition"><h3 id="Struct_ShardLayout">Struct:
ShardLayout</h3>
+<table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default
value</th></thead>
+<tr><td>1</td><td>server</td><td><code>string</code></td><td>The
server for this layout.
+</td><td>default</td><td></td></tr>
+<tr><td>2</td><td>shards</td><td><code>list&lt;<code>i32</code>&gt;</code></td><td>A
list of shard ids for the given server.
+</td><td>default</td><td></td></tr>
+</table><br/></div><hr/><h2 id="Services">Services</h2>
 <h3 id="Svc_Blur">Service: Blur</h3>
 <div class="definition"><h4 id="Fn_Blur_openReadSession">Function: Blur.openReadSession</h4>
 <pre><code><a href="Blur.html#Struct_Session">Session</a></code>
openReadSession(<code>string</code> table)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Creating a session snapshots the readers during search and document fetching.
 This provides a static view of the indexes so the document ids will remain the same during
a session.
+</pre>Creating a session snapshots the readers during search and document
+fetching.  This provides a static view of the indexes so the document
+ids will remain the same during a session.
 @param table the table name.
 @return the new Session.
 <br/></div><div class="definition"><h4 id="Fn_Blur_search">Function:
Blur.search</h4>
@@ -319,37 +346,44 @@ was performed.  This can be used to wait for that generation to be visible.
 <pre><code>list&lt;<code><a href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code>
addDocuments(<code><a href="Blur.html#Struct_MutateOptions">MutateOptions</a></code>
options,
                               <code>list&lt;<code><a href="Blur.html#Struct_Document">Document</a></code>&gt;</code>
documents)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Add Documents to the given table in the provided shard.  If the table or shard
is not found on this shard server a BlurException will be thrown.
+</pre>Add Documents to the given table in the provided shard.  If the table or
+shard is not found on this shard server a BlurException will be thrown.
 @param options the MutateOptions provide the table name, shard index, etc.
-@param documents the documents to be added.  NOTE: All documents provided to be indexed in
a single segment.
+@param documents the documents to be added.  NOTE: All documents
+provided to be indexed in a single segment.
 <br/></div><div class="definition"><h4 id="Fn_Blur_deleteDocumentsByQueries">Function:
Blur.deleteDocumentsByQueries</h4>
 <pre><code>list&lt;<code><a href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code>
deleteDocumentsByQueries(<code><a href="Blur.html#Struct_MutateOptions">MutateOptions</a></code>
options,
                                           <code>list&lt;<code>binary</code>&gt;</code>
queries)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Delete Documents to the given table in the provided shard.  If the table or shard
is not found on this shard server a BlurException will be thrown.
+</pre>Delete Documents to the given table in the provided shard.  If the table
+or shard is not found on this shard server a BlurException will be thrown.
 @param options the MutateOptions provide the table name, shard index, etc.
 @param queries the Queries that will executed and mark there resulting documents as deleted.
 <br/></div><div class="definition"><h4 id="Fn_Blur_deleteDocuments">Function:
Blur.deleteDocuments</h4>
 <pre><code>list&lt;<code><a href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code>
deleteDocuments(<code><a href="Blur.html#Struct_MutateOptions">MutateOptions</a></code>
options,
                                  <code>list&lt;<code><a href="Blur.html#Struct_Term">Term</a></code>&gt;</code>
terms)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Delete Documents to the given table in the provided shard.  If the table or shard
is not found on this shard server a BlurException will be thrown.
+</pre>Delete Documents to the given table in the provided shard.  If the table
+or shard is not found on this shard server a BlurException will be thrown.
 @param options the MutateOptions provide the table name, shard index, etc.
 @param queries the Terms that will be found and mark deleted all the documents to be deleted.
 <br/></div><div class="definition"><h4 id="Fn_Blur_updateDocuments">Function:
Blur.updateDocuments</h4>
 <pre><code>list&lt;<code><a href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code>
updateDocuments(<code><a href="Blur.html#Struct_MutateOptions">MutateOptions</a></code>
options,
                                  <code>list&lt;<code><a href="Blur.html#Struct_UpdatePackage">UpdatePackage</a></code>&gt;</code>
updatePackages)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Update Documents to the given table in the provided shard.  If the table or shard
is not found on this shard server a BlurException will be thrown.
+</pre>Update Documents to the given table in the provided shard.  If the table
+or shard is not found on this shard server a BlurException will be thrown.
 @param options the MutateOptions provide the table name, shard index, etc.
-@param updatePackages the documents to be updated.  NOTE: All documents within a update document
object are indexed in a single segment.
+@param updatePackages the documents to be updated.  NOTE: All documents
+within a update document object are indexed in a single segment.
 <br/></div><div class="definition"><h4 id="Fn_Blur_blockUntilGenerationIsVisible">Function:
Blur.blockUntilGenerationIsVisible</h4>
 <pre><code>void</code> blockUntilGenerationIsVisible(<code>list&lt;<code><a
href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code>
generations,
                                    <code>bool</code> forceRefresh)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
 </pre>This method blocks until all the given generations are visible for reading.
 @param generations the list of Generation objects.
-@param forceRefresh forces a refresh of the indexes if true, if false will block until natural
refresh occurs.
+@param forceRefresh forces a refresh of the indexes if true, if false will
+block until natural refresh occurs.
 <br/></div><div class="definition"><h4 id="Fn_Blur_serverList">Function:
Blur.serverList</h4>
 <pre><code>list&lt;<code>string</code>&gt;</code> serverList()
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
@@ -363,6 +397,12 @@ was performed.  This can be used to wait for that generation to be visible.
 @param table the table name.
 @param server the server name, e.g. node1:40020
 @return list of shard ids.
+<br/></div><div class="definition"><h4 id="Fn_Blur_shardLayout">Function:
Blur.shardLayout</h4>
+<pre><code>map&lt;<code>string</code>, <code><a href="Blur.html#Struct_ShardLayout">ShardLayout</a></code>&gt;</code>
shardLayout(<code>string</code> table)
+    throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
+</pre>Gets the shard layout for each server in the cluster for the given table.
+@param table the table name.
+@return map of servers to shard layout object.
 <br/></div><div class="definition"><h4 id="Fn_Blur_tableList">Function:
Blur.tableList</h4>
 <pre><code>list&lt;<code>string</code>&gt;</code> tableList()
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
@@ -404,7 +444,8 @@ was performed.  This can be used to wait for that generation to be visible.
 <pre><code>void</code> cancelQuery(<code><a href="Blur.html#Struct_Session">Session</a></code>
session,
                  <code>i64</code> id)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
-</pre>Cancels a query that is executing against the given table with the given uuid.
 Note, the cancel call maybe take some time for the query actually stops executing.
+</pre>Cancels a query that is executing against the given table with the given uuid.
+NOTE, the cancel call maybe take some time for the query actually stops executing.
 @param table the table name.
 @param uuid the uuid of the query.
 <br/></div><div class="definition"><h4 id="Fn_Blur_queryStatusIdList">Function:
Blur.queryStatusIdList</h4>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-html/index.html
----------------------------------------------------------------------
diff --git a/interface/gen-html/index.html b/interface/gen-html/index.html
index 6ec1837..82cfa48 100644
--- a/interface/gen-html/index.html
+++ b/interface/gen-html/index.html
@@ -27,6 +27,7 @@
 <li><a href="Blur.html#Fn_Blur_search">search</a></li>
 <li><a href="Blur.html#Fn_Blur_serverLayout">serverLayout</a></li>
 <li><a href="Blur.html#Fn_Blur_serverList">serverList</a></li>
+<li><a href="Blur.html#Fn_Blur_shardLayout">shardLayout</a></li>
 <li><a href="Blur.html#Fn_Blur_tableList">tableList</a></li>
 <li><a href="Blur.html#Fn_Blur_tableStats">tableStats</a></li>
 <li><a href="Blur.html#Fn_Blur_updateDocuments">updateDocuments</a></li>
@@ -48,6 +49,7 @@
 <a href="Blur.html#Struct_QueryStatus">QueryStatus</a><br/>
 <a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a><br/>
 <a href="Blur.html#Struct_Session">Session</a><br/>
+<a href="Blur.html#Struct_ShardLayout">ShardLayout</a><br/>
 <a href="Blur.html#Struct_Sort">Sort</a><br/>
 <a href="Blur.html#Struct_SortField">SortField</a><br/>
 <a href="Blur.html#Enum_SortType">SortType</a><br/>


Mime
View raw message