incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [3/9] 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
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
index 3ce0c09..3746dd8 100644
--- a/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
+++ b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
@@ -57,10 +57,11 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)3);
   private static final org.apache.thrift.protocol.TField FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("filter", org.apache.thrift.protocol.TType.STRING, (short)4);
   private static final org.apache.thrift.protocol.TField NUMBER_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("numberToFetch", org.apache.thrift.protocol.TType.I32, (short)5);
-  private static final org.apache.thrift.protocol.TField SORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sort", org.apache.thrift.protocol.TType.STRUCT, (short)6);
-  private static final org.apache.thrift.protocol.TField DO_DOC_SCORES_FIELD_DESC = new org.apache.thrift.protocol.TField("doDocScores", org.apache.thrift.protocol.TType.BOOL, (short)7);
-  private static final org.apache.thrift.protocol.TField DO_MAX_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("doMaxScore", org.apache.thrift.protocol.TType.BOOL, (short)8);
-  private static final org.apache.thrift.protocol.TField SHARD_INDEXES_FIELD_DESC = new org.apache.thrift.protocol.TField("shardIndexes", org.apache.thrift.protocol.TType.LIST, (short)9);
+  private static final org.apache.thrift.protocol.TField AGGREGATE_RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("aggregateResults", org.apache.thrift.protocol.TType.BOOL, (short)6);
+  private static final org.apache.thrift.protocol.TField SORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sort", org.apache.thrift.protocol.TType.STRUCT, (short)7);
+  private static final org.apache.thrift.protocol.TField DO_DOC_SCORES_FIELD_DESC = new org.apache.thrift.protocol.TField("doDocScores", org.apache.thrift.protocol.TType.BOOL, (short)8);
+  private static final org.apache.thrift.protocol.TField DO_MAX_SCORE_FIELD_DESC = new org.apache.thrift.protocol.TField("doMaxScore", org.apache.thrift.protocol.TType.BOOL, (short)9);
+  private static final org.apache.thrift.protocol.TField SHARD_INDEXES_FIELD_DESC = new org.apache.thrift.protocol.TField("shardIndexes", org.apache.thrift.protocol.TType.LIST, (short)10);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -68,27 +69,101 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     schemes.put(TupleScheme.class, new QueryArgsTupleSchemeFactory());
   }
 
+  /**
+   * Unique id for controlling the given query.
+   */
   public long id; // required
+  /**
+   * 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.
+   */
   public ScoreDoc after; // required
+  /**
+   * The query to be executed.
+   */
   public ByteBuffer query; // required
+  /**
+   * Filter to be executed.
+   */
   public ByteBuffer filter; // required
+  /**
+   * The number of document locations to fetch.
+   */
   public int numberToFetch; // required
+  /**
+   * 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.
+   */
+  public boolean aggregateResults; // required
+  /**
+   * NOT YET IMPLEMENTED.
+   */
   public Sort sort; // required
+  /**
+   * NOT YET IMPLEMENTED.  Related to sort.
+   */
   public boolean doDocScores; // required
+  /**
+   * Calculate the max score of the search.
+   */
   public boolean doMaxScore; // required
+  /**
+   * 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.
+   */
   public List<Integer> shardIndexes; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    /**
+     * Unique id for controlling the given query.
+     */
     ID((short)1, "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.
+     */
     AFTER((short)2, "after"),
+    /**
+     * The query to be executed.
+     */
     QUERY((short)3, "query"),
+    /**
+     * Filter to be executed.
+     */
     FILTER((short)4, "filter"),
+    /**
+     * The number of document locations to fetch.
+     */
     NUMBER_TO_FETCH((short)5, "numberToFetch"),
-    SORT((short)6, "sort"),
-    DO_DOC_SCORES((short)7, "doDocScores"),
-    DO_MAX_SCORE((short)8, "doMaxScore"),
-    SHARD_INDEXES((short)9, "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.
+     */
+    AGGREGATE_RESULTS((short)6, "aggregateResults"),
+    /**
+     * NOT YET IMPLEMENTED.
+     */
+    SORT((short)7, "sort"),
+    /**
+     * NOT YET IMPLEMENTED.  Related to sort.
+     */
+    DO_DOC_SCORES((short)8, "doDocScores"),
+    /**
+     * Calculate the max score of the search.
+     */
+    DO_MAX_SCORE((short)9, "doMaxScore"),
+    /**
+     * 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.
+     */
+    SHARD_INDEXES((short)10, "shardIndexes");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -113,13 +188,15 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
           return FILTER;
         case 5: // NUMBER_TO_FETCH
           return NUMBER_TO_FETCH;
-        case 6: // SORT
+        case 6: // AGGREGATE_RESULTS
+          return AGGREGATE_RESULTS;
+        case 7: // SORT
           return SORT;
-        case 7: // DO_DOC_SCORES
+        case 8: // DO_DOC_SCORES
           return DO_DOC_SCORES;
-        case 8: // DO_MAX_SCORE
+        case 9: // DO_MAX_SCORE
           return DO_MAX_SCORE;
-        case 9: // SHARD_INDEXES
+        case 10: // SHARD_INDEXES
           return SHARD_INDEXES;
         default:
           return null;
@@ -163,8 +240,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   // isset id assignments
   private static final int __ID_ISSET_ID = 0;
   private static final int __NUMBERTOFETCH_ISSET_ID = 1;
-  private static final int __DODOCSCORES_ISSET_ID = 2;
-  private static final int __DOMAXSCORE_ISSET_ID = 3;
+  private static final int __AGGREGATERESULTS_ISSET_ID = 2;
+  private static final int __DODOCSCORES_ISSET_ID = 3;
+  private static final int __DOMAXSCORE_ISSET_ID = 4;
   private byte __isset_bitfield = 0;
   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
   static {
@@ -179,6 +257,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
     tmpMap.put(_Fields.NUMBER_TO_FETCH, new org.apache.thrift.meta_data.FieldMetaData("numberToFetch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
+    tmpMap.put(_Fields.AGGREGATE_RESULTS, new org.apache.thrift.meta_data.FieldMetaData("aggregateResults", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     tmpMap.put(_Fields.SORT, new org.apache.thrift.meta_data.FieldMetaData("sort", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Sort.class)));
     tmpMap.put(_Fields.DO_DOC_SCORES, new org.apache.thrift.meta_data.FieldMetaData("doDocScores", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -195,6 +275,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   public QueryArgs() {
     this.numberToFetch = 100;
 
+    this.aggregateResults = true;
+
     this.doDocScores = true;
 
     this.doMaxScore = false;
@@ -207,6 +289,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     ByteBuffer query,
     ByteBuffer filter,
     int numberToFetch,
+    boolean aggregateResults,
     Sort sort,
     boolean doDocScores,
     boolean doMaxScore,
@@ -220,6 +303,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     this.filter = filter;
     this.numberToFetch = numberToFetch;
     setNumberToFetchIsSet(true);
+    this.aggregateResults = aggregateResults;
+    setAggregateResultsIsSet(true);
     this.sort = sort;
     this.doDocScores = doDocScores;
     setDoDocScoresIsSet(true);
@@ -246,6 +331,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
 ;
     }
     this.numberToFetch = other.numberToFetch;
+    this.aggregateResults = other.aggregateResults;
     if (other.isSetSort()) {
       this.sort = new Sort(other.sort);
     }
@@ -273,6 +359,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     this.filter = null;
     this.numberToFetch = 100;
 
+    this.aggregateResults = true;
+
     this.sort = null;
     this.doDocScores = true;
 
@@ -281,10 +369,16 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     this.shardIndexes = null;
   }
 
+  /**
+   * Unique id for controlling the given query.
+   */
   public long getId() {
     return this.id;
   }
 
+  /**
+   * Unique id for controlling the given query.
+   */
   public QueryArgs setId(long id) {
     this.id = id;
     setIdIsSet(true);
@@ -304,10 +398,20 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value);
   }
 
+  /**
+   * 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.
+   */
   public ScoreDoc getAfter() {
     return this.after;
   }
 
+  /**
+   * 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.
+   */
   public QueryArgs setAfter(ScoreDoc after) {
     this.after = after;
     return this;
@@ -328,6 +432,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     }
   }
 
+  /**
+   * The query to be executed.
+   */
   public byte[] getQuery() {
     setQuery(org.apache.thrift.TBaseHelper.rightSize(query));
     return query == null ? null : query.array();
@@ -337,6 +444,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     return query;
   }
 
+  /**
+   * The query to be executed.
+   */
   public QueryArgs setQuery(byte[] query) {
     setQuery(query == null ? (ByteBuffer)null : ByteBuffer.wrap(query));
     return this;
@@ -362,6 +472,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     }
   }
 
+  /**
+   * Filter to be executed.
+   */
   public byte[] getFilter() {
     setFilter(org.apache.thrift.TBaseHelper.rightSize(filter));
     return filter == null ? null : filter.array();
@@ -371,6 +484,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     return filter;
   }
 
+  /**
+   * Filter to be executed.
+   */
   public QueryArgs setFilter(byte[] filter) {
     setFilter(filter == null ? (ByteBuffer)null : ByteBuffer.wrap(filter));
     return this;
@@ -396,10 +512,16 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     }
   }
 
+  /**
+   * The number of document locations to fetch.
+   */
   public int getNumberToFetch() {
     return this.numberToFetch;
   }
 
+  /**
+   * The number of document locations to fetch.
+   */
   public QueryArgs setNumberToFetch(int numberToFetch) {
     this.numberToFetch = numberToFetch;
     setNumberToFetchIsSet(true);
@@ -419,10 +541,51 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMBERTOFETCH_ISSET_ID, value);
   }
 
+  /**
+   * 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.
+   */
+  public boolean isAggregateResults() {
+    return this.aggregateResults;
+  }
+
+  /**
+   * 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.
+   */
+  public QueryArgs setAggregateResults(boolean aggregateResults) {
+    this.aggregateResults = aggregateResults;
+    setAggregateResultsIsSet(true);
+    return this;
+  }
+
+  public void unsetAggregateResults() {
+    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AGGREGATERESULTS_ISSET_ID);
+  }
+
+  /** Returns true if field aggregateResults is set (has been assigned a value) and false otherwise */
+  public boolean isSetAggregateResults() {
+    return EncodingUtils.testBit(__isset_bitfield, __AGGREGATERESULTS_ISSET_ID);
+  }
+
+  public void setAggregateResultsIsSet(boolean value) {
+    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AGGREGATERESULTS_ISSET_ID, value);
+  }
+
+  /**
+   * NOT YET IMPLEMENTED.
+   */
   public Sort getSort() {
     return this.sort;
   }
 
+  /**
+   * NOT YET IMPLEMENTED.
+   */
   public QueryArgs setSort(Sort sort) {
     this.sort = sort;
     return this;
@@ -443,10 +606,16 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     }
   }
 
+  /**
+   * NOT YET IMPLEMENTED.  Related to sort.
+   */
   public boolean isDoDocScores() {
     return this.doDocScores;
   }
 
+  /**
+   * NOT YET IMPLEMENTED.  Related to sort.
+   */
   public QueryArgs setDoDocScores(boolean doDocScores) {
     this.doDocScores = doDocScores;
     setDoDocScoresIsSet(true);
@@ -466,10 +635,16 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DODOCSCORES_ISSET_ID, value);
   }
 
+  /**
+   * Calculate the max score of the search.
+   */
   public boolean isDoMaxScore() {
     return this.doMaxScore;
   }
 
+  /**
+   * Calculate the max score of the search.
+   */
   public QueryArgs setDoMaxScore(boolean doMaxScore) {
     this.doMaxScore = doMaxScore;
     setDoMaxScoreIsSet(true);
@@ -504,10 +679,18 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     this.shardIndexes.add(elem);
   }
 
+  /**
+   * 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.
+   */
   public List<Integer> getShardIndexes() {
     return this.shardIndexes;
   }
 
+  /**
+   * 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.
+   */
   public QueryArgs setShardIndexes(List<Integer> shardIndexes) {
     this.shardIndexes = shardIndexes;
     return this;
@@ -570,6 +753,14 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       }
       break;
 
+    case AGGREGATE_RESULTS:
+      if (value == null) {
+        unsetAggregateResults();
+      } else {
+        setAggregateResults((Boolean)value);
+      }
+      break;
+
     case SORT:
       if (value == null) {
         unsetSort();
@@ -622,6 +813,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     case NUMBER_TO_FETCH:
       return Integer.valueOf(getNumberToFetch());
 
+    case AGGREGATE_RESULTS:
+      return Boolean.valueOf(isAggregateResults());
+
     case SORT:
       return getSort();
 
@@ -655,6 +849,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       return isSetFilter();
     case NUMBER_TO_FETCH:
       return isSetNumberToFetch();
+    case AGGREGATE_RESULTS:
+      return isSetAggregateResults();
     case SORT:
       return isSetSort();
     case DO_DOC_SCORES:
@@ -725,6 +921,15 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         return false;
     }
 
+    boolean this_present_aggregateResults = true;
+    boolean that_present_aggregateResults = true;
+    if (this_present_aggregateResults || that_present_aggregateResults) {
+      if (!(this_present_aggregateResults && that_present_aggregateResults))
+        return false;
+      if (this.aggregateResults != that.aggregateResults)
+        return false;
+    }
+
     boolean this_present_sort = true && this.isSetSort();
     boolean that_present_sort = true && that.isSetSort();
     if (this_present_sort || that_present_sort) {
@@ -827,6 +1032,16 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetAggregateResults()).compareTo(typedOther.isSetAggregateResults());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetAggregateResults()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aggregateResults, typedOther.aggregateResults);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetSort()).compareTo(typedOther.isSetSort());
     if (lastComparison != 0) {
       return lastComparison;
@@ -919,6 +1134,10 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     sb.append(this.numberToFetch);
     first = false;
     if (!first) sb.append(", ");
+    sb.append("aggregateResults:");
+    sb.append(this.aggregateResults);
+    first = false;
+    if (!first) sb.append(", ");
     sb.append("sort:");
     if (this.sort == null) {
       sb.append("null");
@@ -1034,7 +1253,15 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 6: // SORT
+          case 6: // AGGREGATE_RESULTS
+            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
+              struct.aggregateResults = iprot.readBool();
+              struct.setAggregateResultsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // SORT
             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
               struct.sort = new Sort();
               struct.sort.read(iprot);
@@ -1043,7 +1270,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 7: // DO_DOC_SCORES
+          case 8: // DO_DOC_SCORES
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.doDocScores = iprot.readBool();
               struct.setDoDocScoresIsSet(true);
@@ -1051,7 +1278,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 8: // DO_MAX_SCORE
+          case 9: // DO_MAX_SCORE
             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
               struct.doMaxScore = iprot.readBool();
               struct.setDoMaxScoreIsSet(true);
@@ -1059,7 +1286,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 9: // SHARD_INDEXES
+          case 10: // SHARD_INDEXES
             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
               {
                 org.apache.thrift.protocol.TList _list80 = iprot.readListBegin();
@@ -1113,6 +1340,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       oprot.writeFieldBegin(NUMBER_TO_FETCH_FIELD_DESC);
       oprot.writeI32(struct.numberToFetch);
       oprot.writeFieldEnd();
+      oprot.writeFieldBegin(AGGREGATE_RESULTS_FIELD_DESC);
+      oprot.writeBool(struct.aggregateResults);
+      oprot.writeFieldEnd();
       if (struct.sort != null) {
         oprot.writeFieldBegin(SORT_FIELD_DESC);
         struct.sort.write(oprot);
@@ -1169,19 +1399,22 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       if (struct.isSetNumberToFetch()) {
         optionals.set(4);
       }
-      if (struct.isSetSort()) {
+      if (struct.isSetAggregateResults()) {
         optionals.set(5);
       }
-      if (struct.isSetDoDocScores()) {
+      if (struct.isSetSort()) {
         optionals.set(6);
       }
-      if (struct.isSetDoMaxScore()) {
+      if (struct.isSetDoDocScores()) {
         optionals.set(7);
       }
-      if (struct.isSetShardIndexes()) {
+      if (struct.isSetDoMaxScore()) {
         optionals.set(8);
       }
-      oprot.writeBitSet(optionals, 9);
+      if (struct.isSetShardIndexes()) {
+        optionals.set(9);
+      }
+      oprot.writeBitSet(optionals, 10);
       if (struct.isSetId()) {
         oprot.writeI64(struct.id);
       }
@@ -1197,6 +1430,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       if (struct.isSetNumberToFetch()) {
         oprot.writeI32(struct.numberToFetch);
       }
+      if (struct.isSetAggregateResults()) {
+        oprot.writeBool(struct.aggregateResults);
+      }
       if (struct.isSetSort()) {
         struct.sort.write(oprot);
       }
@@ -1220,7 +1456,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, QueryArgs struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(9);
+      BitSet incoming = iprot.readBitSet(10);
       if (incoming.get(0)) {
         struct.id = iprot.readI64();
         struct.setIdIsSet(true);
@@ -1243,19 +1479,23 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         struct.setNumberToFetchIsSet(true);
       }
       if (incoming.get(5)) {
+        struct.aggregateResults = iprot.readBool();
+        struct.setAggregateResultsIsSet(true);
+      }
+      if (incoming.get(6)) {
         struct.sort = new Sort();
         struct.sort.read(iprot);
         struct.setSortIsSet(true);
       }
-      if (incoming.get(6)) {
+      if (incoming.get(7)) {
         struct.doDocScores = iprot.readBool();
         struct.setDoDocScoresIsSet(true);
       }
-      if (incoming.get(7)) {
+      if (incoming.get(8)) {
         struct.doMaxScore = iprot.readBool();
         struct.setDoMaxScoreIsSet(true);
       }
-      if (incoming.get(8)) {
+      if (incoming.get(9)) {
         {
           org.apache.thrift.protocol.TList _list85 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
           struct.shardIndexes = new ArrayList<Integer>(_list85.size);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-java/org/apache/blur/thrift/generated/ShardLayout.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/ShardLayout.java b/interface/gen-java/org/apache/blur/thrift/generated/ShardLayout.java
new file mode 100644
index 0000000..f4c359e
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/ShardLayout.java
@@ -0,0 +1,581 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ShardLayout implements org.apache.thrift.TBase<ShardLayout, ShardLayout._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ShardLayout");
+
+  private static final org.apache.thrift.protocol.TField SERVER_FIELD_DESC = new org.apache.thrift.protocol.TField("server", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField SHARDS_FIELD_DESC = new org.apache.thrift.protocol.TField("shards", org.apache.thrift.protocol.TType.LIST, (short)2);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new ShardLayoutStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new ShardLayoutTupleSchemeFactory());
+  }
+
+  /**
+   * The server for this layout.
+   */
+  public String server; // required
+  /**
+   * A list of shard ids for the given server.
+   */
+  public List<Integer> shards; // required
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    /**
+     * The server for this layout.
+     */
+    SERVER((short)1, "server"),
+    /**
+     * A list of shard ids for the given server.
+     */
+    SHARDS((short)2, "shards");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // SERVER
+          return SERVER;
+        case 2: // SHARDS
+          return SHARDS;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.SERVER, new org.apache.thrift.meta_data.FieldMetaData("server", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.SHARDS, new org.apache.thrift.meta_data.FieldMetaData("shards", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ShardLayout.class, metaDataMap);
+  }
+
+  public ShardLayout() {
+  }
+
+  public ShardLayout(
+    String server,
+    List<Integer> shards)
+  {
+    this();
+    this.server = server;
+    this.shards = shards;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public ShardLayout(ShardLayout other) {
+    if (other.isSetServer()) {
+      this.server = other.server;
+    }
+    if (other.isSetShards()) {
+      List<Integer> __this__shards = new ArrayList<Integer>();
+      for (Integer other_element : other.shards) {
+        __this__shards.add(other_element);
+      }
+      this.shards = __this__shards;
+    }
+  }
+
+  public ShardLayout deepCopy() {
+    return new ShardLayout(this);
+  }
+
+  @Override
+  public void clear() {
+    this.server = null;
+    this.shards = null;
+  }
+
+  /**
+   * The server for this layout.
+   */
+  public String getServer() {
+    return this.server;
+  }
+
+  /**
+   * The server for this layout.
+   */
+  public ShardLayout setServer(String server) {
+    this.server = server;
+    return this;
+  }
+
+  public void unsetServer() {
+    this.server = null;
+  }
+
+  /** Returns true if field server is set (has been assigned a value) and false otherwise */
+  public boolean isSetServer() {
+    return this.server != null;
+  }
+
+  public void setServerIsSet(boolean value) {
+    if (!value) {
+      this.server = null;
+    }
+  }
+
+  public int getShardsSize() {
+    return (this.shards == null) ? 0 : this.shards.size();
+  }
+
+  public java.util.Iterator<Integer> getShardsIterator() {
+    return (this.shards == null) ? null : this.shards.iterator();
+  }
+
+  public void addToShards(int elem) {
+    if (this.shards == null) {
+      this.shards = new ArrayList<Integer>();
+    }
+    this.shards.add(elem);
+  }
+
+  /**
+   * A list of shard ids for the given server.
+   */
+  public List<Integer> getShards() {
+    return this.shards;
+  }
+
+  /**
+   * A list of shard ids for the given server.
+   */
+  public ShardLayout setShards(List<Integer> shards) {
+    this.shards = shards;
+    return this;
+  }
+
+  public void unsetShards() {
+    this.shards = null;
+  }
+
+  /** Returns true if field shards is set (has been assigned a value) and false otherwise */
+  public boolean isSetShards() {
+    return this.shards != null;
+  }
+
+  public void setShardsIsSet(boolean value) {
+    if (!value) {
+      this.shards = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case SERVER:
+      if (value == null) {
+        unsetServer();
+      } else {
+        setServer((String)value);
+      }
+      break;
+
+    case SHARDS:
+      if (value == null) {
+        unsetShards();
+      } else {
+        setShards((List<Integer>)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case SERVER:
+      return getServer();
+
+    case SHARDS:
+      return getShards();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case SERVER:
+      return isSetServer();
+    case SHARDS:
+      return isSetShards();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof ShardLayout)
+      return this.equals((ShardLayout)that);
+    return false;
+  }
+
+  public boolean equals(ShardLayout that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_server = true && this.isSetServer();
+    boolean that_present_server = true && that.isSetServer();
+    if (this_present_server || that_present_server) {
+      if (!(this_present_server && that_present_server))
+        return false;
+      if (!this.server.equals(that.server))
+        return false;
+    }
+
+    boolean this_present_shards = true && this.isSetShards();
+    boolean that_present_shards = true && that.isSetShards();
+    if (this_present_shards || that_present_shards) {
+      if (!(this_present_shards && that_present_shards))
+        return false;
+      if (!this.shards.equals(that.shards))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  public int compareTo(ShardLayout other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+    ShardLayout typedOther = (ShardLayout)other;
+
+    lastComparison = Boolean.valueOf(isSetServer()).compareTo(typedOther.isSetServer());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetServer()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, typedOther.server);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetShards()).compareTo(typedOther.isSetShards());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetShards()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shards, typedOther.shards);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("ShardLayout(");
+    boolean first = true;
+
+    sb.append("server:");
+    if (this.server == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.server);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("shards:");
+    if (this.shards == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.shards);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class ShardLayoutStandardSchemeFactory implements SchemeFactory {
+    public ShardLayoutStandardScheme getScheme() {
+      return new ShardLayoutStandardScheme();
+    }
+  }
+
+  private static class ShardLayoutStandardScheme extends StandardScheme<ShardLayout> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, ShardLayout struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // SERVER
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.server = iprot.readString();
+              struct.setServerIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // SHARDS
+            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+              {
+                org.apache.thrift.protocol.TList _list120 = iprot.readListBegin();
+                struct.shards = new ArrayList<Integer>(_list120.size);
+                for (int _i121 = 0; _i121 < _list120.size; ++_i121)
+                {
+                  int _elem122; // required
+                  _elem122 = iprot.readI32();
+                  struct.shards.add(_elem122);
+                }
+                iprot.readListEnd();
+              }
+              struct.setShardsIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, ShardLayout struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.server != null) {
+        oprot.writeFieldBegin(SERVER_FIELD_DESC);
+        oprot.writeString(struct.server);
+        oprot.writeFieldEnd();
+      }
+      if (struct.shards != null) {
+        oprot.writeFieldBegin(SHARDS_FIELD_DESC);
+        {
+          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.shards.size()));
+          for (int _iter123 : struct.shards)
+          {
+            oprot.writeI32(_iter123);
+          }
+          oprot.writeListEnd();
+        }
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class ShardLayoutTupleSchemeFactory implements SchemeFactory {
+    public ShardLayoutTupleScheme getScheme() {
+      return new ShardLayoutTupleScheme();
+    }
+  }
+
+  private static class ShardLayoutTupleScheme extends TupleScheme<ShardLayout> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, ShardLayout struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetServer()) {
+        optionals.set(0);
+      }
+      if (struct.isSetShards()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetServer()) {
+        oprot.writeString(struct.server);
+      }
+      if (struct.isSetShards()) {
+        {
+          oprot.writeI32(struct.shards.size());
+          for (int _iter124 : struct.shards)
+          {
+            oprot.writeI32(_iter124);
+          }
+        }
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, ShardLayout struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        struct.server = iprot.readString();
+        struct.setServerIsSet(true);
+      }
+      if (incoming.get(1)) {
+        {
+          org.apache.thrift.protocol.TList _list125 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
+          struct.shards = new ArrayList<Integer>(_list125.size);
+          for (int _i126 = 0; _i126 < _list125.size; ++_i126)
+          {
+            int _elem127; // required
+            _elem127 = iprot.readI32();
+            struct.shards.add(_elem127);
+          }
+        }
+        struct.setShardsIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-perl/Blur/Blur.pm
----------------------------------------------------------------------
diff --git a/interface/gen-perl/Blur/Blur.pm b/interface/gen-perl/Blur/Blur.pm
index e626758..339a8c5 100644
--- a/interface/gen-perl/Blur/Blur.pm
+++ b/interface/gen-perl/Blur/Blur.pm
@@ -280,16 +280,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size106 = 0;
+          my $_size113 = 0;
           $self->{success} = [];
-          my $_etype109 = 0;
-          $xfer += $input->readListBegin(\$_etype109, \$_size106);
-          for (my $_i110 = 0; $_i110 < $_size106; ++$_i110)
+          my $_etype116 = 0;
+          $xfer += $input->readListBegin(\$_etype116, \$_size113);
+          for (my $_i117 = 0; $_i117 < $_size113; ++$_i117)
           {
-            my $elem111 = undef;
-            $elem111 = new Blur::TopFieldDocs();
-            $xfer += $elem111->read($input);
-            push(@{$self->{success}},$elem111);
+            my $elem118 = undef;
+            $elem118 = new Blur::TopFieldDocs();
+            $xfer += $elem118->read($input);
+            push(@{$self->{success}},$elem118);
           }
           $xfer += $input->readListEnd();
         }
@@ -321,9 +321,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter112 (@{$self->{success}}) 
+        foreach my $iter119 (@{$self->{success}}) 
         {
-          $xfer += ${iter112}->write($output);
+          $xfer += ${iter119}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -393,15 +393,15 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size113 = 0;
+          my $_size120 = 0;
           $self->{docLocations} = [];
-          my $_etype116 = 0;
-          $xfer += $input->readListBegin(\$_etype116, \$_size113);
-          for (my $_i117 = 0; $_i117 < $_size113; ++$_i117)
+          my $_etype123 = 0;
+          $xfer += $input->readListBegin(\$_etype123, \$_size120);
+          for (my $_i124 = 0; $_i124 < $_size120; ++$_i124)
           {
-            my $elem118 = undef;
-            $xfer += $input->readI64(\$elem118);
-            push(@{$self->{docLocations}},$elem118);
+            my $elem125 = undef;
+            $xfer += $input->readI64(\$elem125);
+            push(@{$self->{docLocations}},$elem125);
           }
           $xfer += $input->readListEnd();
         }
@@ -411,15 +411,15 @@ sub read {
       last; };
       /^4$/ && do{      if ($ftype == TType::SET) {
         {
-          my $_size119 = 0;
+          my $_size126 = 0;
           $self->{fields} = {};
-          my $_etype122 = 0;
-          $xfer += $input->readSetBegin(\$_etype122, \$_size119);
-          for (my $_i123 = 0; $_i123 < $_size119; ++$_i123)
+          my $_etype129 = 0;
+          $xfer += $input->readSetBegin(\$_etype129, \$_size126);
+          for (my $_i130 = 0; $_i130 < $_size126; ++$_i130)
           {
-            my $elem124 = undef;
-            $xfer += $input->readString(\$elem124);
-            $self->{fields}->{$elem124} = 1;
+            my $elem131 = undef;
+            $xfer += $input->readString(\$elem131);
+            $self->{fields}->{$elem131} = 1;
           }
           $xfer += $input->readSetEnd();
         }
@@ -449,9 +449,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::I64, scalar(@{$self->{docLocations}}));
       {
-        foreach my $iter125 (@{$self->{docLocations}}) 
+        foreach my $iter132 (@{$self->{docLocations}}) 
         {
-          $xfer += $output->writeI64($iter125);
+          $xfer += $output->writeI64($iter132);
         }
       }
       $xfer += $output->writeListEnd();
@@ -463,9 +463,9 @@ sub write {
     {
       $xfer += $output->writeSetBegin(TType::STRING, scalar(@{$self->{fields}}));
       {
-        foreach my $iter126 (@{$self->{fields}})
+        foreach my $iter133 (@{$self->{fields}})
         {
-          $xfer += $output->writeString($iter126);
+          $xfer += $output->writeString($iter133);
         }
       }
       $xfer += $output->writeSetEnd();
@@ -519,16 +519,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size127 = 0;
+          my $_size134 = 0;
           $self->{success} = [];
-          my $_etype130 = 0;
-          $xfer += $input->readListBegin(\$_etype130, \$_size127);
-          for (my $_i131 = 0; $_i131 < $_size127; ++$_i131)
+          my $_etype137 = 0;
+          $xfer += $input->readListBegin(\$_etype137, \$_size134);
+          for (my $_i138 = 0; $_i138 < $_size134; ++$_i138)
           {
-            my $elem132 = undef;
-            $elem132 = new Blur::Document();
-            $xfer += $elem132->read($input);
-            push(@{$self->{success}},$elem132);
+            my $elem139 = undef;
+            $elem139 = new Blur::Document();
+            $xfer += $elem139->read($input);
+            push(@{$self->{success}},$elem139);
           }
           $xfer += $input->readListEnd();
         }
@@ -560,9 +560,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter133 (@{$self->{success}}) 
+        foreach my $iter140 (@{$self->{success}}) 
         {
-          $xfer += ${iter133}->write($output);
+          $xfer += ${iter140}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -758,16 +758,16 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size134 = 0;
+          my $_size141 = 0;
           $self->{documents} = [];
-          my $_etype137 = 0;
-          $xfer += $input->readListBegin(\$_etype137, \$_size134);
-          for (my $_i138 = 0; $_i138 < $_size134; ++$_i138)
+          my $_etype144 = 0;
+          $xfer += $input->readListBegin(\$_etype144, \$_size141);
+          for (my $_i145 = 0; $_i145 < $_size141; ++$_i145)
           {
-            my $elem139 = undef;
-            $elem139 = new Blur::Document();
-            $xfer += $elem139->read($input);
-            push(@{$self->{documents}},$elem139);
+            my $elem146 = undef;
+            $elem146 = new Blur::Document();
+            $xfer += $elem146->read($input);
+            push(@{$self->{documents}},$elem146);
           }
           $xfer += $input->readListEnd();
         }
@@ -797,9 +797,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{documents}}));
       {
-        foreach my $iter140 (@{$self->{documents}}) 
+        foreach my $iter147 (@{$self->{documents}}) 
         {
-          $xfer += ${iter140}->write($output);
+          $xfer += ${iter147}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -853,16 +853,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size141 = 0;
+          my $_size148 = 0;
           $self->{success} = [];
-          my $_etype144 = 0;
-          $xfer += $input->readListBegin(\$_etype144, \$_size141);
-          for (my $_i145 = 0; $_i145 < $_size141; ++$_i145)
+          my $_etype151 = 0;
+          $xfer += $input->readListBegin(\$_etype151, \$_size148);
+          for (my $_i152 = 0; $_i152 < $_size148; ++$_i152)
           {
-            my $elem146 = undef;
-            $elem146 = new Blur::Generation();
-            $xfer += $elem146->read($input);
-            push(@{$self->{success}},$elem146);
+            my $elem153 = undef;
+            $elem153 = new Blur::Generation();
+            $xfer += $elem153->read($input);
+            push(@{$self->{success}},$elem153);
           }
           $xfer += $input->readListEnd();
         }
@@ -894,9 +894,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter147 (@{$self->{success}}) 
+        foreach my $iter154 (@{$self->{success}}) 
         {
-          $xfer += ${iter147}->write($output);
+          $xfer += ${iter154}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -962,15 +962,15 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size148 = 0;
+          my $_size155 = 0;
           $self->{queries} = [];
-          my $_etype151 = 0;
-          $xfer += $input->readListBegin(\$_etype151, \$_size148);
-          for (my $_i152 = 0; $_i152 < $_size148; ++$_i152)
+          my $_etype158 = 0;
+          $xfer += $input->readListBegin(\$_etype158, \$_size155);
+          for (my $_i159 = 0; $_i159 < $_size155; ++$_i159)
           {
-            my $elem153 = undef;
-            $xfer += $input->readString(\$elem153);
-            push(@{$self->{queries}},$elem153);
+            my $elem160 = undef;
+            $xfer += $input->readString(\$elem160);
+            push(@{$self->{queries}},$elem160);
           }
           $xfer += $input->readListEnd();
         }
@@ -1000,9 +1000,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{queries}}));
       {
-        foreach my $iter154 (@{$self->{queries}}) 
+        foreach my $iter161 (@{$self->{queries}}) 
         {
-          $xfer += $output->writeString($iter154);
+          $xfer += $output->writeString($iter161);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1056,16 +1056,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size155 = 0;
+          my $_size162 = 0;
           $self->{success} = [];
-          my $_etype158 = 0;
-          $xfer += $input->readListBegin(\$_etype158, \$_size155);
-          for (my $_i159 = 0; $_i159 < $_size155; ++$_i159)
+          my $_etype165 = 0;
+          $xfer += $input->readListBegin(\$_etype165, \$_size162);
+          for (my $_i166 = 0; $_i166 < $_size162; ++$_i166)
           {
-            my $elem160 = undef;
-            $elem160 = new Blur::Generation();
-            $xfer += $elem160->read($input);
-            push(@{$self->{success}},$elem160);
+            my $elem167 = undef;
+            $elem167 = new Blur::Generation();
+            $xfer += $elem167->read($input);
+            push(@{$self->{success}},$elem167);
           }
           $xfer += $input->readListEnd();
         }
@@ -1097,9 +1097,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter161 (@{$self->{success}}) 
+        foreach my $iter168 (@{$self->{success}}) 
         {
-          $xfer += ${iter161}->write($output);
+          $xfer += ${iter168}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1165,16 +1165,16 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size162 = 0;
+          my $_size169 = 0;
           $self->{terms} = [];
-          my $_etype165 = 0;
-          $xfer += $input->readListBegin(\$_etype165, \$_size162);
-          for (my $_i166 = 0; $_i166 < $_size162; ++$_i166)
+          my $_etype172 = 0;
+          $xfer += $input->readListBegin(\$_etype172, \$_size169);
+          for (my $_i173 = 0; $_i173 < $_size169; ++$_i173)
           {
-            my $elem167 = undef;
-            $elem167 = new Blur::Term();
-            $xfer += $elem167->read($input);
-            push(@{$self->{terms}},$elem167);
+            my $elem174 = undef;
+            $elem174 = new Blur::Term();
+            $xfer += $elem174->read($input);
+            push(@{$self->{terms}},$elem174);
           }
           $xfer += $input->readListEnd();
         }
@@ -1204,9 +1204,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{terms}}));
       {
-        foreach my $iter168 (@{$self->{terms}}) 
+        foreach my $iter175 (@{$self->{terms}}) 
         {
-          $xfer += ${iter168}->write($output);
+          $xfer += ${iter175}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1260,16 +1260,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size169 = 0;
+          my $_size176 = 0;
           $self->{success} = [];
-          my $_etype172 = 0;
-          $xfer += $input->readListBegin(\$_etype172, \$_size169);
-          for (my $_i173 = 0; $_i173 < $_size169; ++$_i173)
+          my $_etype179 = 0;
+          $xfer += $input->readListBegin(\$_etype179, \$_size176);
+          for (my $_i180 = 0; $_i180 < $_size176; ++$_i180)
           {
-            my $elem174 = undef;
-            $elem174 = new Blur::Generation();
-            $xfer += $elem174->read($input);
-            push(@{$self->{success}},$elem174);
+            my $elem181 = undef;
+            $elem181 = new Blur::Generation();
+            $xfer += $elem181->read($input);
+            push(@{$self->{success}},$elem181);
           }
           $xfer += $input->readListEnd();
         }
@@ -1301,9 +1301,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter175 (@{$self->{success}}) 
+        foreach my $iter182 (@{$self->{success}}) 
         {
-          $xfer += ${iter175}->write($output);
+          $xfer += ${iter182}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1369,16 +1369,16 @@ sub read {
       last; };
       /^2$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size176 = 0;
+          my $_size183 = 0;
           $self->{updatePackages} = [];
-          my $_etype179 = 0;
-          $xfer += $input->readListBegin(\$_etype179, \$_size176);
-          for (my $_i180 = 0; $_i180 < $_size176; ++$_i180)
+          my $_etype186 = 0;
+          $xfer += $input->readListBegin(\$_etype186, \$_size183);
+          for (my $_i187 = 0; $_i187 < $_size183; ++$_i187)
           {
-            my $elem181 = undef;
-            $elem181 = new Blur::UpdatePackage();
-            $xfer += $elem181->read($input);
-            push(@{$self->{updatePackages}},$elem181);
+            my $elem188 = undef;
+            $elem188 = new Blur::UpdatePackage();
+            $xfer += $elem188->read($input);
+            push(@{$self->{updatePackages}},$elem188);
           }
           $xfer += $input->readListEnd();
         }
@@ -1408,9 +1408,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{updatePackages}}));
       {
-        foreach my $iter182 (@{$self->{updatePackages}}) 
+        foreach my $iter189 (@{$self->{updatePackages}}) 
         {
-          $xfer += ${iter182}->write($output);
+          $xfer += ${iter189}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1464,16 +1464,16 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size183 = 0;
+          my $_size190 = 0;
           $self->{success} = [];
-          my $_etype186 = 0;
-          $xfer += $input->readListBegin(\$_etype186, \$_size183);
-          for (my $_i187 = 0; $_i187 < $_size183; ++$_i187)
+          my $_etype193 = 0;
+          $xfer += $input->readListBegin(\$_etype193, \$_size190);
+          for (my $_i194 = 0; $_i194 < $_size190; ++$_i194)
           {
-            my $elem188 = undef;
-            $elem188 = new Blur::Generation();
-            $xfer += $elem188->read($input);
-            push(@{$self->{success}},$elem188);
+            my $elem195 = undef;
+            $elem195 = new Blur::Generation();
+            $xfer += $elem195->read($input);
+            push(@{$self->{success}},$elem195);
           }
           $xfer += $input->readListEnd();
         }
@@ -1505,9 +1505,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{success}}));
       {
-        foreach my $iter189 (@{$self->{success}}) 
+        foreach my $iter196 (@{$self->{success}}) 
         {
-          $xfer += ${iter189}->write($output);
+          $xfer += ${iter196}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1566,16 +1566,16 @@ sub read {
     {
       /^1$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size190 = 0;
+          my $_size197 = 0;
           $self->{generations} = [];
-          my $_etype193 = 0;
-          $xfer += $input->readListBegin(\$_etype193, \$_size190);
-          for (my $_i194 = 0; $_i194 < $_size190; ++$_i194)
+          my $_etype200 = 0;
+          $xfer += $input->readListBegin(\$_etype200, \$_size197);
+          for (my $_i201 = 0; $_i201 < $_size197; ++$_i201)
           {
-            my $elem195 = undef;
-            $elem195 = new Blur::Generation();
-            $xfer += $elem195->read($input);
-            push(@{$self->{generations}},$elem195);
+            my $elem202 = undef;
+            $elem202 = new Blur::Generation();
+            $xfer += $elem202->read($input);
+            push(@{$self->{generations}},$elem202);
           }
           $xfer += $input->readListEnd();
         }
@@ -1606,9 +1606,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{generations}}));
       {
-        foreach my $iter196 (@{$self->{generations}}) 
+        foreach my $iter203 (@{$self->{generations}}) 
         {
-          $xfer += ${iter196}->write($output);
+          $xfer += ${iter203}->write($output);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1778,15 +1778,15 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size197 = 0;
+          my $_size204 = 0;
           $self->{success} = [];
-          my $_etype200 = 0;
-          $xfer += $input->readListBegin(\$_etype200, \$_size197);
-          for (my $_i201 = 0; $_i201 < $_size197; ++$_i201)
+          my $_etype207 = 0;
+          $xfer += $input->readListBegin(\$_etype207, \$_size204);
+          for (my $_i208 = 0; $_i208 < $_size204; ++$_i208)
           {
-            my $elem202 = undef;
-            $xfer += $input->readString(\$elem202);
-            push(@{$self->{success}},$elem202);
+            my $elem209 = undef;
+            $xfer += $input->readString(\$elem209);
+            push(@{$self->{success}},$elem209);
           }
           $xfer += $input->readListEnd();
         }
@@ -1818,9 +1818,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{success}}));
       {
-        foreach my $iter203 (@{$self->{success}}) 
+        foreach my $iter210 (@{$self->{success}}) 
         {
-          $xfer += $output->writeString($iter203);
+          $xfer += $output->writeString($iter210);
         }
       }
       $xfer += $output->writeListEnd();
@@ -1958,15 +1958,15 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size204 = 0;
+          my $_size211 = 0;
           $self->{success} = [];
-          my $_etype207 = 0;
-          $xfer += $input->readListBegin(\$_etype207, \$_size204);
-          for (my $_i208 = 0; $_i208 < $_size204; ++$_i208)
+          my $_etype214 = 0;
+          $xfer += $input->readListBegin(\$_etype214, \$_size211);
+          for (my $_i215 = 0; $_i215 < $_size211; ++$_i215)
           {
-            my $elem209 = undef;
-            $xfer += $input->readI32(\$elem209);
-            push(@{$self->{success}},$elem209);
+            my $elem216 = undef;
+            $xfer += $input->readI32(\$elem216);
+            push(@{$self->{success}},$elem216);
           }
           $xfer += $input->readListEnd();
         }
@@ -1998,9 +1998,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{success}}));
       {
-        foreach my $iter210 (@{$self->{success}}) 
+        foreach my $iter217 (@{$self->{success}}) 
         {
-          $xfer += $output->writeI32($iter210);
+          $xfer += $output->writeI32($iter217);
         }
       }
       $xfer += $output->writeListEnd();
@@ -2017,6 +2017,176 @@ sub write {
   return $xfer;
 }
 
+package Blur::Blur_shardLayout_args;
+use base qw(Class::Accessor);
+Blur::Blur_shardLayout_args->mk_accessors( qw( table ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{table} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{table}) {
+      $self->{table} = $vals->{table};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Blur_shardLayout_args';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{table});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Blur_shardLayout_args');
+  if (defined $self->{table}) {
+    $xfer += $output->writeFieldBegin('table', TType::STRING, 1);
+    $xfer += $output->writeString($self->{table});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Blur_shardLayout_result;
+use base qw(Class::Accessor);
+Blur::Blur_shardLayout_result->mk_accessors( qw( success ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{success} = undef;
+  $self->{ex} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{success}) {
+      $self->{success} = $vals->{success};
+    }
+    if (defined $vals->{ex}) {
+      $self->{ex} = $vals->{ex};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Blur_shardLayout_result';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^0$/ && do{      if ($ftype == TType::MAP) {
+        {
+          my $_size218 = 0;
+          $self->{success} = {};
+          my $_ktype219 = 0;
+          my $_vtype220 = 0;
+          $xfer += $input->readMapBegin(\$_ktype219, \$_vtype220, \$_size218);
+          for (my $_i222 = 0; $_i222 < $_size218; ++$_i222)
+          {
+            my $key223 = '';
+            my $val224 = new Blur::ShardLayout();
+            $xfer += $input->readString(\$key223);
+            $val224 = new Blur::ShardLayout();
+            $xfer += $val224->read($input);
+            $self->{success}->{$key223} = $val224;
+          }
+          $xfer += $input->readMapEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^1$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{ex} = new Blur::BlurException();
+        $xfer += $self->{ex}->read($input);
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Blur_shardLayout_result');
+  if (defined $self->{success}) {
+    $xfer += $output->writeFieldBegin('success', TType::MAP, 0);
+    {
+      $xfer += $output->writeMapBegin(TType::STRING, TType::STRUCT, scalar(keys %{$self->{success}}));
+      {
+        while( my ($kiter225,$viter226) = each %{$self->{success}}) 
+        {
+          $xfer += $output->writeString($kiter225);
+          $xfer += ${viter226}->write($output);
+        }
+      }
+      $xfer += $output->writeMapEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{ex}) {
+    $xfer += $output->writeFieldBegin('ex', TType::STRUCT, 1);
+    $xfer += $self->{ex}->write($output);
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
 package Blur::Blur_tableList_args;
 use base qw(Class::Accessor);
 
@@ -2105,15 +2275,15 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size211 = 0;
+          my $_size227 = 0;
           $self->{success} = [];
-          my $_etype214 = 0;
-          $xfer += $input->readListBegin(\$_etype214, \$_size211);
-          for (my $_i215 = 0; $_i215 < $_size211; ++$_i215)
+          my $_etype230 = 0;
+          $xfer += $input->readListBegin(\$_etype230, \$_size227);
+          for (my $_i231 = 0; $_i231 < $_size227; ++$_i231)
           {
-            my $elem216 = undef;
-            $xfer += $input->readString(\$elem216);
-            push(@{$self->{success}},$elem216);
+            my $elem232 = undef;
+            $xfer += $input->readString(\$elem232);
+            push(@{$self->{success}},$elem232);
           }
           $xfer += $input->readListEnd();
         }
@@ -2145,9 +2315,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{success}}));
       {
-        foreach my $iter217 (@{$self->{success}}) 
+        foreach my $iter233 (@{$self->{success}}) 
         {
-          $xfer += $output->writeString($iter217);
+          $xfer += $output->writeString($iter233);
         }
       }
       $xfer += $output->writeListEnd();
@@ -3219,15 +3389,15 @@ sub read {
     {
       /^0$/ && do{      if ($ftype == TType::LIST) {
         {
-          my $_size218 = 0;
+          my $_size234 = 0;
           $self->{success} = [];
-          my $_etype221 = 0;
-          $xfer += $input->readListBegin(\$_etype221, \$_size218);
-          for (my $_i222 = 0; $_i222 < $_size218; ++$_i222)
+          my $_etype237 = 0;
+          $xfer += $input->readListBegin(\$_etype237, \$_size234);
+          for (my $_i238 = 0; $_i238 < $_size234; ++$_i238)
           {
-            my $elem223 = undef;
-            $xfer += $input->readI64(\$elem223);
-            push(@{$self->{success}},$elem223);
+            my $elem239 = undef;
+            $xfer += $input->readI64(\$elem239);
+            push(@{$self->{success}},$elem239);
           }
           $xfer += $input->readListEnd();
         }
@@ -3259,9 +3429,9 @@ sub write {
     {
       $xfer += $output->writeListBegin(TType::I64, scalar(@{$self->{success}}));
       {
-        foreach my $iter224 (@{$self->{success}}) 
+        foreach my $iter240 (@{$self->{success}}) 
         {
-          $xfer += $output->writeI64($iter224);
+          $xfer += $output->writeI64($iter240);
         }
       }
       $xfer += $output->writeListEnd();
@@ -3819,6 +3989,13 @@ sub serverLayout{
   die 'implement interface';
 }
 
+sub shardLayout{
+  my $self = shift;
+  my $table = shift;
+
+  die 'implement interface';
+}
+
 sub tableList{
   my $self = shift;
 
@@ -4001,6 +4178,13 @@ sub serverLayout{
   return $self->{impl}->serverLayout($table, $server);
 }
 
+sub shardLayout{
+  my ($self, $request) = @_;
+
+  my $table = ($request->{'table'}) ? $request->{'table'} : undef;
+  return $self->{impl}->shardLayout($table);
+}
+
 sub tableList{
   my ($self, $request) = @_;
 
@@ -4623,6 +4807,52 @@ sub recv_serverLayout{
   }
   die "serverLayout failed: unknown result";
 }
+sub shardLayout{
+  my $self = shift;
+  my $table = shift;
+
+    $self->send_shardLayout($table);
+  return $self->recv_shardLayout();
+}
+
+sub send_shardLayout{
+  my $self = shift;
+  my $table = shift;
+
+  $self->{output}->writeMessageBegin('shardLayout', TMessageType::CALL, $self->{seqid});
+  my $args = new Blur::Blur_shardLayout_args();
+  $args->{table} = $table;
+  $args->write($self->{output});
+  $self->{output}->writeMessageEnd();
+  $self->{output}->getTransport()->flush();
+}
+
+sub recv_shardLayout{
+  my $self = shift;
+
+  my $rseqid = 0;
+  my $fname;
+  my $mtype = 0;
+
+  $self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid);
+  if ($mtype == TMessageType::EXCEPTION) {
+    my $x = new TApplicationException();
+    $x->read($self->{input});
+    $self->{input}->readMessageEnd();
+    die $x;
+  }
+  my $result = new Blur::Blur_shardLayout_result();
+  $result->read($self->{input});
+  $self->{input}->readMessageEnd();
+
+  if (defined $result->{success} ) {
+    return $result->{success};
+  }
+  if (defined $result->{ex}) {
+    die $result->{ex};
+  }
+  die "shardLayout failed: unknown result";
+}
 sub tableList{
   my $self = shift;
 
@@ -5384,6 +5614,23 @@ sub process_serverLayout {
     $output->getTransport()->flush();
 }
 
+sub process_shardLayout {
+    my ($self, $seqid, $input, $output) = @_;
+    my $args = new Blur::Blur_shardLayout_args();
+    $args->read($input);
+    $input->readMessageEnd();
+    my $result = new Blur::Blur_shardLayout_result();
+    eval {
+      $result->{success} = $self->{handler}->shardLayout($args->table);
+    }; if( UNIVERSAL::isa($@,'Blur::BlurException') ){ 
+      $result->{ex} = $@;
+    }
+    $output->writeMessageBegin('shardLayout', TMessageType::REPLY, $seqid);
+    $result->write($output);
+    $output->writeMessageEnd();
+    $output->getTransport()->flush();
+}
+
 sub process_tableList {
     my ($self, $seqid, $input, $output) = @_;
     my $args = new Blur::Blur_tableList_args();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-perl/Blur/Types.pm
----------------------------------------------------------------------
diff --git a/interface/gen-perl/Blur/Types.pm b/interface/gen-perl/Blur/Types.pm
index a8c2f41..d93e3ab 100644
--- a/interface/gen-perl/Blur/Types.pm
+++ b/interface/gen-perl/Blur/Types.pm
@@ -1488,7 +1488,7 @@ sub write {
 
 package Blur::QueryArgs;
 use base qw(Class::Accessor);
-Blur::QueryArgs->mk_accessors( qw( id after query filter numberToFetch sort doDocScores doMaxScore shardIndexes ) );
+Blur::QueryArgs->mk_accessors( qw( id after query filter numberToFetch aggregateResults sort doDocScores doMaxScore shardIndexes ) );
 
 sub new {
   my $classname = shift;
@@ -1499,6 +1499,7 @@ sub new {
   $self->{query} = undef;
   $self->{filter} = undef;
   $self->{numberToFetch} = 100;
+  $self->{aggregateResults} = 1;
   $self->{sort} = undef;
   $self->{doDocScores} = 1;
   $self->{doMaxScore} = 0;
@@ -1519,6 +1520,9 @@ sub new {
     if (defined $vals->{numberToFetch}) {
       $self->{numberToFetch} = $vals->{numberToFetch};
     }
+    if (defined $vals->{aggregateResults}) {
+      $self->{aggregateResults} = $vals->{aggregateResults};
+    }
     if (defined $vals->{sort}) {
       $self->{sort} = $vals->{sort};
     }
@@ -1585,26 +1589,32 @@ sub read {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^6$/ && do{      if ($ftype == TType::STRUCT) {
+      /^6$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{aggregateResults});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^7$/ && do{      if ($ftype == TType::STRUCT) {
         $self->{sort} = new Blur::Sort();
         $xfer += $self->{sort}->read($input);
       } else {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^7$/ && do{      if ($ftype == TType::BOOL) {
+      /^8$/ && do{      if ($ftype == TType::BOOL) {
         $xfer += $input->readBool(\$self->{doDocScores});
       } else {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^8$/ && do{      if ($ftype == TType::BOOL) {
+      /^9$/ && do{      if ($ftype == TType::BOOL) {
         $xfer += $input->readBool(\$self->{doMaxScore});
       } else {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^9$/ && do{      if ($ftype == TType::LIST) {
+      /^10$/ && do{      if ($ftype == TType::LIST) {
         {
           my $_size71 = 0;
           $self->{shardIndexes} = [];
@@ -1659,23 +1669,28 @@ sub write {
     $xfer += $output->writeI32($self->{numberToFetch});
     $xfer += $output->writeFieldEnd();
   }
+  if (defined $self->{aggregateResults}) {
+    $xfer += $output->writeFieldBegin('aggregateResults', TType::BOOL, 6);
+    $xfer += $output->writeBool($self->{aggregateResults});
+    $xfer += $output->writeFieldEnd();
+  }
   if (defined $self->{sort}) {
-    $xfer += $output->writeFieldBegin('sort', TType::STRUCT, 6);
+    $xfer += $output->writeFieldBegin('sort', TType::STRUCT, 7);
     $xfer += $self->{sort}->write($output);
     $xfer += $output->writeFieldEnd();
   }
   if (defined $self->{doDocScores}) {
-    $xfer += $output->writeFieldBegin('doDocScores', TType::BOOL, 7);
+    $xfer += $output->writeFieldBegin('doDocScores', TType::BOOL, 8);
     $xfer += $output->writeBool($self->{doDocScores});
     $xfer += $output->writeFieldEnd();
   }
   if (defined $self->{doMaxScore}) {
-    $xfer += $output->writeFieldBegin('doMaxScore', TType::BOOL, 8);
+    $xfer += $output->writeFieldBegin('doMaxScore', TType::BOOL, 9);
     $xfer += $output->writeBool($self->{doMaxScore});
     $xfer += $output->writeFieldEnd();
   }
   if (defined $self->{shardIndexes}) {
-    $xfer += $output->writeFieldBegin('shardIndexes', TType::LIST, 9);
+    $xfer += $output->writeFieldBegin('shardIndexes', TType::LIST, 10);
     {
       $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{shardIndexes}}));
       {
@@ -2440,4 +2455,104 @@ sub write {
   return $xfer;
 }
 
+package Blur::ShardLayout;
+use base qw(Class::Accessor);
+Blur::ShardLayout->mk_accessors( qw( server shards ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{server} = undef;
+  $self->{shards} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{server}) {
+      $self->{server} = $vals->{server};
+    }
+    if (defined $vals->{shards}) {
+      $self->{shards} = $vals->{shards};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'ShardLayout';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{server});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size106 = 0;
+          $self->{shards} = [];
+          my $_etype109 = 0;
+          $xfer += $input->readListBegin(\$_etype109, \$_size106);
+          for (my $_i110 = 0; $_i110 < $_size106; ++$_i110)
+          {
+            my $elem111 = undef;
+            $xfer += $input->readI32(\$elem111);
+            push(@{$self->{shards}},$elem111);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('ShardLayout');
+  if (defined $self->{server}) {
+    $xfer += $output->writeFieldBegin('server', TType::STRING, 1);
+    $xfer += $output->writeString($self->{server});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{shards}) {
+    $xfer += $output->writeFieldBegin('shards', TType::LIST, 2);
+    {
+      $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{shards}}));
+      {
+        foreach my $iter112 (@{$self->{shards}}) 
+        {
+          $xfer += $output->writeI32($iter112);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
 1;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-rb/blur.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur.rb b/interface/gen-rb/blur.rb
index 68b0a27..6bf4abf 100644
--- a/interface/gen-rb/blur.rb
+++ b/interface/gen-rb/blur.rb
@@ -186,6 +186,22 @@ module Blur
         raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'serverLayout failed: unknown result')
       end
 
+      def shardLayout(table)
+        send_shardLayout(table)
+        return recv_shardLayout()
+      end
+
+      def send_shardLayout(table)
+        send_message('shardLayout', ShardLayout_args, :table => table)
+      end
+
+      def recv_shardLayout()
+        result = receive_message(ShardLayout_result)
+        return result.success unless result.success.nil?
+        raise result.ex unless result.ex.nil?
+        raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'shardLayout failed: unknown result')
+      end
+
       def tableList()
         send_tableList()
         return recv_tableList()
@@ -499,6 +515,17 @@ module Blur
         write_result(result, oprot, 'serverLayout', seqid)
       end
 
+      def process_shardLayout(seqid, iprot, oprot)
+        args = read_args(iprot, ShardLayout_args)
+        result = ShardLayout_result.new()
+        begin
+          result.success = @handler.shardLayout(args.table)
+        rescue ::Blur::BlurException => ex
+          result.ex = ex
+        end
+        write_result(result, oprot, 'shardLayout', seqid)
+      end
+
       def process_tableList(seqid, iprot, oprot)
         args = read_args(iprot, TableList_args)
         result = TableList_result.new()
@@ -1022,6 +1049,40 @@ module Blur
       ::Thrift::Struct.generate_accessors self
     end
 
+    class ShardLayout_args
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      TABLE = 1
+
+      FIELDS = {
+        TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class ShardLayout_result
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      SUCCESS = 0
+      EX = 1
+
+      FIELDS = {
+        SUCCESS => {:type => ::Thrift::Types::MAP, :name => 'success', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::ShardLayout}},
+        EX => {:type => ::Thrift::Types::STRUCT, :name => 'ex', :class => ::Blur::BlurException}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
     class TableList_args
       include ::Thrift::Struct, ::Thrift::Struct_Union
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur_types.rb b/interface/gen-rb/blur_types.rb
index d22b325..00e92bf 100644
--- a/interface/gen-rb/blur_types.rb
+++ b/interface/gen-rb/blur_types.rb
@@ -398,20 +398,38 @@ module Blur
     QUERY = 3
     FILTER = 4
     NUMBERTOFETCH = 5
-    SORT = 6
-    DODOCSCORES = 7
-    DOMAXSCORE = 8
-    SHARDINDEXES = 9
+    AGGREGATERESULTS = 6
+    SORT = 7
+    DODOCSCORES = 8
+    DOMAXSCORE = 9
+    SHARDINDEXES = 10
 
     FIELDS = {
+      # Unique id for controlling the given query.
       ID => {:type => ::Thrift::Types::I64, :name => '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.
       AFTER => {:type => ::Thrift::Types::STRUCT, :name => 'after', :class => ::Blur::ScoreDoc},
+      # The query to be executed.
       QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true},
+      # Filter to be executed.
       FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true},
+      # The number of document locations to fetch.
       NUMBERTOFETCH => {:type => ::Thrift::Types::I32, :name => 'numberToFetch', :default => 100},
+      # 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.
+      AGGREGATERESULTS => {:type => ::Thrift::Types::BOOL, :name => 'aggregateResults', :default => true},
+      # NOT YET IMPLEMENTED.
       SORT => {:type => ::Thrift::Types::STRUCT, :name => 'sort', :class => ::Blur::Sort},
+      # NOT YET IMPLEMENTED.  Related to sort.
       DODOCSCORES => {:type => ::Thrift::Types::BOOL, :name => 'doDocScores', :default => true},
+      # Calculate the max score of the search.
       DOMAXSCORE => {:type => ::Thrift::Types::BOOL, :name => 'doMaxScore', :default => false},
+      # 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.
       SHARDINDEXES => {:type => ::Thrift::Types::LIST, :name => 'shardIndexes', :element => {:type => ::Thrift::Types::I32}}
     }
 
@@ -586,4 +604,24 @@ module Blur
     ::Thrift::Struct.generate_accessors self
   end
 
+  class ShardLayout
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    SERVER = 1
+    SHARDS = 2
+
+    FIELDS = {
+      # The server for this layout.
+      SERVER => {:type => ::Thrift::Types::STRING, :name => 'server'},
+      # A list of shard ids for the given server.
+      SHARDS => {:type => ::Thrift::Types::LIST, :name => 'shards', :element => {:type => ::Thrift::Types::I32}}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+    end
+
+    ::Thrift::Struct.generate_accessors self
+  end
+
 end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d783db83/src/blur-core/src/main/java/org/apache/blur/thrift/BlurServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/thrift/BlurServer.java b/src/blur-core/src/main/java/org/apache/blur/thrift/BlurServer.java
index 62468ae..ea87ba8 100644
--- a/src/blur-core/src/main/java/org/apache/blur/thrift/BlurServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/thrift/BlurServer.java
@@ -60,6 +60,7 @@ import org.apache.blur.thrift.generated.MutateOptions;
 import org.apache.blur.thrift.generated.QueryArgs;
 import org.apache.blur.thrift.generated.QueryStatus;
 import org.apache.blur.thrift.generated.Session;
+import org.apache.blur.thrift.generated.ShardLayout;
 import org.apache.blur.thrift.generated.TableDescriptor;
 import org.apache.blur.thrift.generated.TableStats;
 import org.apache.blur.thrift.generated.Term;
@@ -637,4 +638,9 @@ public class BlurServer extends TableAdmin implements Iface {
     return new Connection(server);
   }
 
+  @Override
+  public Map<String, ShardLayout> shardLayout(String table) throws BlurException, TException {
+    throw new BlurException("Not implemented", null);
+  }
+
 }


Mime
View raw message