incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [6/9] Tons of changes to make shell work. This has uncovered some limitations in the queryargs object. Refactored to allow for different query types.
Date Mon, 31 Dec 2012 20:44:03 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-shell/src/main/java/org/apache/blur/shell/UpdateCommand.java
----------------------------------------------------------------------
diff --git a/src/blur-shell/src/main/java/org/apache/blur/shell/UpdateCommand.java b/src/blur-shell/src/main/java/org/apache/blur/shell/UpdateCommand.java
new file mode 100644
index 0000000..4cd07b7
--- /dev/null
+++ b/src/blur-shell/src/main/java/org/apache/blur/shell/UpdateCommand.java
@@ -0,0 +1,79 @@
+/**
+ * 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.
+ */
+
+package org.apache.blur.shell;
+
+import java.io.PrintWriter;
+
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.thrift.TException;
+
+public class UpdateCommand extends Command {
+  public UpdateCommand(Iface client) {
+    super(client);
+  }
+
+  @Override
+  public void doit(PrintWriter out, Iface client, String[] args) throws CommandException, TException, BlurException {
+    if (args.length != 7) {
+      throw new CommandException("Invalid args: " + help());
+    }
+    String tablename = args[1];
+    String rowid = args[2];
+    String recordid = args[3];
+    String columnfamily = args[4];
+    String columnname = args[5];
+    String value = args[6];
+
+    throw new CommandException("Needs to be implemented");
+
+    // List<Column> columns = new ArrayList<Column>();
+    // columns.add(new Column(columnname, value));
+    //
+    // Record record = new Record();
+    // record.setRecordId(recordid);
+    // record.setFamily(columnfamily);
+    // record.setColumns(columns);
+    //
+    // RecordMutation recordMutation = new RecordMutation();
+    // recordMutation.setRecord(record);
+    // recordMutation.setRecordMutationType(RecordMutationType.REPLACE_ENTIRE_RECORD);
+    //
+    // List<RecordMutation> recordMutations = new ArrayList<RecordMutation>();
+    // recordMutations.add(recordMutation);
+    //
+    // RowMutation mutation = new RowMutation();
+    // mutation.setTable(tablename);
+    // mutation.setRowId(rowid);
+    // mutation.setRowMutationType(RowMutationType.REPLACE_ROW);
+    // mutation.setRecordMutations(recordMutations);
+    //
+    // client.mutate(mutation);
+  }
+
+  @Override
+  public String help() {
+    return "mutate the specified row, args; tablename rowid recordid columnfamily columnname value";
+  }
+
+  @Override
+  public String getName() {
+    return "update";
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/TestCreateTable.java
----------------------------------------------------------------------
diff --git a/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/TestCreateTable.java b/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/TestCreateTable.java
new file mode 100644
index 0000000..0b638bb
--- /dev/null
+++ b/src/blur-testsuite/src/main/java/org/apache/blur/testsuite/TestCreateTable.java
@@ -0,0 +1,41 @@
+package org.apache.blur.testsuite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.blur.thrift.BlurClient;
+import org.apache.blur.thrift.generated.Analyzer;
+import org.apache.blur.thrift.generated.AnalyzerType;
+import org.apache.blur.thrift.generated.Blur.Iface;
+import org.apache.blur.thrift.generated.BlurException;
+import org.apache.blur.thrift.generated.ClassDefinition;
+import org.apache.blur.thrift.generated.TableDescriptor;
+import org.apache.thrift.TException;
+
+public class TestCreateTable {
+
+  public static void main(String[] args) throws BlurException, TException {
+    Iface client = BlurClient.getClient("localhost:40020");
+
+    TableDescriptor tableDescriptor = new TableDescriptor();
+    tableDescriptor.setName("test2");
+    tableDescriptor.setEnabled(true);
+    tableDescriptor.setReadOnly(false);
+    tableDescriptor.setStoragePath("file:///Users/amccurry/Development/blur-tables/test2");
+    tableDescriptor.setShardCount(5);
+    Map<String, String> properties= new HashMap<String, String>();
+    properties.put("k1", "v1");
+    tableDescriptor.setProperties(properties);
+    Analyzer analyzer = new Analyzer();
+    AnalyzerType type = new AnalyzerType();
+    ClassDefinition classDefinition = new ClassDefinition();
+    classDefinition.setClassName("org.apache.lucene.analysis.standard.StandardAnalyzer");
+    type.setClassDefinition(classDefinition);
+    analyzer.addToAnalyzerTypes(type);
+//    tableDescriptor.setAnalyzer(analyzer);
+    
+    client.createTable(tableDescriptor);
+    
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
index 6a3527a..1ebd02e 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
@@ -117,7 +117,7 @@ public class Blur {
      * @param options
      * @param queries
      */
-    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws BlurException, org.apache.thrift.TException;
+    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws BlurException, org.apache.thrift.TException;
 
     /**
      * Delete Documents to the given table in the provided shard.  If the table
@@ -282,7 +282,7 @@ public class Blur {
 
     public void addDocuments(MutateOptions options, List<Document> documents, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addDocuments_call> resultHandler) throws org.apache.thrift.TException;
 
-    public void deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException;
+    public void deleteDocumentsByQueries(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException;
 
     public void deleteDocuments(MutateOptions options, List<Term> terms, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocuments_call> resultHandler) throws org.apache.thrift.TException;
 
@@ -473,13 +473,13 @@ public class Blur {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addDocuments failed: unknown result");
     }
 
-    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws BlurException, org.apache.thrift.TException
+    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws BlurException, org.apache.thrift.TException
     {
       send_deleteDocumentsByQueries(options, queries);
       return recv_deleteDocumentsByQueries();
     }
 
-    public void send_deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws org.apache.thrift.TException
+    public void send_deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws org.apache.thrift.TException
     {
       deleteDocumentsByQueries_args args = new deleteDocumentsByQueries_args();
       args.setOptions(options);
@@ -1144,7 +1144,7 @@ public class Blur {
       }
     }
 
-    public void deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException {
+    public void deleteDocumentsByQueries(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException {
       checkReady();
       deleteDocumentsByQueries_call method_call = new deleteDocumentsByQueries_call(options, queries, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
@@ -1153,8 +1153,8 @@ public class Blur {
 
     public static class deleteDocumentsByQueries_call extends org.apache.thrift.async.TAsyncMethodCall {
       private MutateOptions options;
-      private List<ByteBuffer> queries;
-      public deleteDocumentsByQueries_call(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private List<Query> queries;
+      public deleteDocumentsByQueries_call(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.options = options;
         this.queries = queries;
@@ -7099,7 +7099,7 @@ public class Blur {
     }
 
     public MutateOptions options; // required
-    public List<ByteBuffer> queries; // required
+    public List<Query> queries; // 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 {
@@ -7170,7 +7170,7 @@ public class Blur {
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MutateOptions.class)));
       tmpMap.put(_Fields.QUERIES, new org.apache.thrift.meta_data.FieldMetaData("queries", 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.STRING              , true))));
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Query.class))));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteDocumentsByQueries_args.class, metaDataMap);
     }
@@ -7180,7 +7180,7 @@ public class Blur {
 
     public deleteDocumentsByQueries_args(
       MutateOptions options,
-      List<ByteBuffer> queries)
+      List<Query> queries)
     {
       this();
       this.options = options;
@@ -7195,11 +7195,9 @@ public class Blur {
         this.options = new MutateOptions(other.options);
       }
       if (other.isSetQueries()) {
-        List<ByteBuffer> __this__queries = new ArrayList<ByteBuffer>();
-        for (ByteBuffer other_element : other.queries) {
-          ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
-;
-          __this__queries.add(temp_binary_element);
+        List<Query> __this__queries = new ArrayList<Query>();
+        for (Query other_element : other.queries) {
+          __this__queries.add(new Query(other_element));
         }
         this.queries = __this__queries;
       }
@@ -7243,22 +7241,22 @@ public class Blur {
       return (this.queries == null) ? 0 : this.queries.size();
     }
 
-    public java.util.Iterator<ByteBuffer> getQueriesIterator() {
+    public java.util.Iterator<Query> getQueriesIterator() {
       return (this.queries == null) ? null : this.queries.iterator();
     }
 
-    public void addToQueries(ByteBuffer elem) {
+    public void addToQueries(Query elem) {
       if (this.queries == null) {
-        this.queries = new ArrayList<ByteBuffer>();
+        this.queries = new ArrayList<Query>();
       }
       this.queries.add(elem);
     }
 
-    public List<ByteBuffer> getQueries() {
+    public List<Query> getQueries() {
       return this.queries;
     }
 
-    public deleteDocumentsByQueries_args setQueries(List<ByteBuffer> queries) {
+    public deleteDocumentsByQueries_args setQueries(List<Query> queries) {
       this.queries = queries;
       return this;
     }
@@ -7292,7 +7290,7 @@ public class Blur {
         if (value == null) {
           unsetQueries();
         } else {
-          setQueries((List<ByteBuffer>)value);
+          setQueries((List<Query>)value);
         }
         break;
 
@@ -7487,11 +7485,12 @@ public class Blur {
               if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                 {
                   org.apache.thrift.protocol.TList _list176 = iprot.readListBegin();
-                  struct.queries = new ArrayList<ByteBuffer>(_list176.size);
+                  struct.queries = new ArrayList<Query>(_list176.size);
                   for (int _i177 = 0; _i177 < _list176.size; ++_i177)
                   {
-                    ByteBuffer _elem178; // required
-                    _elem178 = iprot.readBinary();
+                    Query _elem178; // required
+                    _elem178 = new Query();
+                    _elem178.read(iprot);
                     struct.queries.add(_elem178);
                   }
                   iprot.readListEnd();
@@ -7524,10 +7523,10 @@ public class Blur {
         if (struct.queries != null) {
           oprot.writeFieldBegin(QUERIES_FIELD_DESC);
           {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.queries.size()));
-            for (ByteBuffer _iter179 : struct.queries)
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.queries.size()));
+            for (Query _iter179 : struct.queries)
             {
-              oprot.writeBinary(_iter179);
+              _iter179.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -7564,9 +7563,9 @@ public class Blur {
         if (struct.isSetQueries()) {
           {
             oprot.writeI32(struct.queries.size());
-            for (ByteBuffer _iter180 : struct.queries)
+            for (Query _iter180 : struct.queries)
             {
-              oprot.writeBinary(_iter180);
+              _iter180.write(oprot);
             }
           }
         }
@@ -7583,12 +7582,13 @@ public class Blur {
         }
         if (incoming.get(1)) {
           {
-            org.apache.thrift.protocol.TList _list181 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-            struct.queries = new ArrayList<ByteBuffer>(_list181.size);
+            org.apache.thrift.protocol.TList _list181 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.queries = new ArrayList<Query>(_list181.size);
             for (int _i182 = 0; _i182 < _list181.size; ++_i182)
             {
-              ByteBuffer _elem183; // required
-              _elem183 = iprot.readBinary();
+              Query _elem183; // required
+              _elem183 = new Query();
+              _elem183.read(iprot);
               struct.queries.add(_elem183);
             }
           }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Query.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Query.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Query.java
new file mode 100644
index 0000000..afa8ba5
--- /dev/null
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Query.java
@@ -0,0 +1,665 @@
+/**
+ * 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;
+
+/**
+ * The Query object describes how the query is passed.  If the
+ * type is STRING or JSON the queryString field is used.  If
+ * the BINARY type is used the queryBinary should be used.
+ */
+public class Query implements org.apache.thrift.TBase<Query, Query._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Query");
+
+  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
+  private static final org.apache.thrift.protocol.TField QUERY_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("queryString", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField QUERY_BINARY_FIELD_DESC = new org.apache.thrift.protocol.TField("queryBinary", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new QueryStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new QueryTupleSchemeFactory());
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public QueryType type; // required
+  /**
+   * The query to be executed.
+   */
+  public String queryString; // required
+  /**
+   * The query to be executed.
+   */
+  public ByteBuffer queryBinary; // 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 query type.
+     * 
+     * @see QueryType
+     */
+    TYPE((short)1, "type"),
+    /**
+     * The query to be executed.
+     */
+    QUERY_STRING((short)2, "queryString"),
+    /**
+     * The query to be executed.
+     */
+    QUERY_BINARY((short)3, "queryBinary");
+
+    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: // TYPE
+          return TYPE;
+        case 2: // QUERY_STRING
+          return QUERY_STRING;
+        case 3: // QUERY_BINARY
+          return QUERY_BINARY;
+        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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, QueryType.class)));
+    tmpMap.put(_Fields.QUERY_STRING, new org.apache.thrift.meta_data.FieldMetaData("queryString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.QUERY_BINARY, new org.apache.thrift.meta_data.FieldMetaData("queryBinary", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Query.class, metaDataMap);
+  }
+
+  public Query() {
+  }
+
+  public Query(
+    QueryType type,
+    String queryString,
+    ByteBuffer queryBinary)
+  {
+    this();
+    this.type = type;
+    this.queryString = queryString;
+    this.queryBinary = queryBinary;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public Query(Query other) {
+    if (other.isSetType()) {
+      this.type = other.type;
+    }
+    if (other.isSetQueryString()) {
+      this.queryString = other.queryString;
+    }
+    if (other.isSetQueryBinary()) {
+      this.queryBinary = org.apache.thrift.TBaseHelper.copyBinary(other.queryBinary);
+;
+    }
+  }
+
+  public Query deepCopy() {
+    return new Query(this);
+  }
+
+  @Override
+  public void clear() {
+    this.type = null;
+    this.queryString = null;
+    this.queryBinary = null;
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public QueryType getType() {
+    return this.type;
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public Query setType(QueryType type) {
+    this.type = type;
+    return this;
+  }
+
+  public void unsetType() {
+    this.type = null;
+  }
+
+  /** Returns true if field type is set (has been assigned a value) and false otherwise */
+  public boolean isSetType() {
+    return this.type != null;
+  }
+
+  public void setTypeIsSet(boolean value) {
+    if (!value) {
+      this.type = null;
+    }
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public String getQueryString() {
+    return this.queryString;
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public Query setQueryString(String queryString) {
+    this.queryString = queryString;
+    return this;
+  }
+
+  public void unsetQueryString() {
+    this.queryString = null;
+  }
+
+  /** Returns true if field queryString is set (has been assigned a value) and false otherwise */
+  public boolean isSetQueryString() {
+    return this.queryString != null;
+  }
+
+  public void setQueryStringIsSet(boolean value) {
+    if (!value) {
+      this.queryString = null;
+    }
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public byte[] getQueryBinary() {
+    setQueryBinary(org.apache.thrift.TBaseHelper.rightSize(queryBinary));
+    return queryBinary == null ? null : queryBinary.array();
+  }
+
+  public ByteBuffer bufferForQueryBinary() {
+    return queryBinary;
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public Query setQueryBinary(byte[] queryBinary) {
+    setQueryBinary(queryBinary == null ? (ByteBuffer)null : ByteBuffer.wrap(queryBinary));
+    return this;
+  }
+
+  public Query setQueryBinary(ByteBuffer queryBinary) {
+    this.queryBinary = queryBinary;
+    return this;
+  }
+
+  public void unsetQueryBinary() {
+    this.queryBinary = null;
+  }
+
+  /** Returns true if field queryBinary is set (has been assigned a value) and false otherwise */
+  public boolean isSetQueryBinary() {
+    return this.queryBinary != null;
+  }
+
+  public void setQueryBinaryIsSet(boolean value) {
+    if (!value) {
+      this.queryBinary = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case TYPE:
+      if (value == null) {
+        unsetType();
+      } else {
+        setType((QueryType)value);
+      }
+      break;
+
+    case QUERY_STRING:
+      if (value == null) {
+        unsetQueryString();
+      } else {
+        setQueryString((String)value);
+      }
+      break;
+
+    case QUERY_BINARY:
+      if (value == null) {
+        unsetQueryBinary();
+      } else {
+        setQueryBinary((ByteBuffer)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case TYPE:
+      return getType();
+
+    case QUERY_STRING:
+      return getQueryString();
+
+    case QUERY_BINARY:
+      return getQueryBinary();
+
+    }
+    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 TYPE:
+      return isSetType();
+    case QUERY_STRING:
+      return isSetQueryString();
+    case QUERY_BINARY:
+      return isSetQueryBinary();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof Query)
+      return this.equals((Query)that);
+    return false;
+  }
+
+  public boolean equals(Query that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_type = true && this.isSetType();
+    boolean that_present_type = true && that.isSetType();
+    if (this_present_type || that_present_type) {
+      if (!(this_present_type && that_present_type))
+        return false;
+      if (!this.type.equals(that.type))
+        return false;
+    }
+
+    boolean this_present_queryString = true && this.isSetQueryString();
+    boolean that_present_queryString = true && that.isSetQueryString();
+    if (this_present_queryString || that_present_queryString) {
+      if (!(this_present_queryString && that_present_queryString))
+        return false;
+      if (!this.queryString.equals(that.queryString))
+        return false;
+    }
+
+    boolean this_present_queryBinary = true && this.isSetQueryBinary();
+    boolean that_present_queryBinary = true && that.isSetQueryBinary();
+    if (this_present_queryBinary || that_present_queryBinary) {
+      if (!(this_present_queryBinary && that_present_queryBinary))
+        return false;
+      if (!this.queryBinary.equals(that.queryBinary))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  public int compareTo(Query other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+    Query typedOther = (Query)other;
+
+    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetQueryString()).compareTo(typedOther.isSetQueryString());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetQueryString()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryString, typedOther.queryString);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetQueryBinary()).compareTo(typedOther.isSetQueryBinary());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetQueryBinary()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryBinary, typedOther.queryBinary);
+      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("Query(");
+    boolean first = true;
+
+    sb.append("type:");
+    if (this.type == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.type);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("queryString:");
+    if (this.queryString == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.queryString);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("queryBinary:");
+    if (this.queryBinary == null) {
+      sb.append("null");
+    } else {
+      org.apache.thrift.TBaseHelper.toString(this.queryBinary, sb);
+    }
+    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 QueryStandardSchemeFactory implements SchemeFactory {
+    public QueryStandardScheme getScheme() {
+      return new QueryStandardScheme();
+    }
+  }
+
+  private static class QueryStandardScheme extends StandardScheme<Query> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Query 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: // TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.type = QueryType.findByValue(iprot.readI32());
+              struct.setTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // QUERY_STRING
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.queryString = iprot.readString();
+              struct.setQueryStringIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // QUERY_BINARY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.queryBinary = iprot.readBinary();
+              struct.setQueryBinaryIsSet(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, Query struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.type != null) {
+        oprot.writeFieldBegin(TYPE_FIELD_DESC);
+        oprot.writeI32(struct.type.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.queryString != null) {
+        oprot.writeFieldBegin(QUERY_STRING_FIELD_DESC);
+        oprot.writeString(struct.queryString);
+        oprot.writeFieldEnd();
+      }
+      if (struct.queryBinary != null) {
+        oprot.writeFieldBegin(QUERY_BINARY_FIELD_DESC);
+        oprot.writeBinary(struct.queryBinary);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class QueryTupleSchemeFactory implements SchemeFactory {
+    public QueryTupleScheme getScheme() {
+      return new QueryTupleScheme();
+    }
+  }
+
+  private static class QueryTupleScheme extends TupleScheme<Query> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Query struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetType()) {
+        optionals.set(0);
+      }
+      if (struct.isSetQueryString()) {
+        optionals.set(1);
+      }
+      if (struct.isSetQueryBinary()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetType()) {
+        oprot.writeI32(struct.type.getValue());
+      }
+      if (struct.isSetQueryString()) {
+        oprot.writeString(struct.queryString);
+      }
+      if (struct.isSetQueryBinary()) {
+        oprot.writeBinary(struct.queryBinary);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Query struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(3);
+      if (incoming.get(0)) {
+        struct.type = QueryType.findByValue(iprot.readI32());
+        struct.setTypeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.queryString = iprot.readString();
+        struct.setQueryStringIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.queryBinary = iprot.readBinary();
+        struct.setQueryBinaryIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryArgs.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryArgs.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryArgs.java
index 3746dd8..46451f0 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryArgs.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryArgs.java
@@ -54,7 +54,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
 
   private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
   private static final org.apache.thrift.protocol.TField AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("after", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-  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 QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRUCT, (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 AGGREGATE_RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("aggregateResults", org.apache.thrift.protocol.TType.BOOL, (short)6);
@@ -82,7 +82,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   /**
    * The query to be executed.
    */
-  public ByteBuffer query; // required
+  public Query query; // required
   /**
    * Filter to be executed.
    */
@@ -252,7 +252,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     tmpMap.put(_Fields.AFTER, new org.apache.thrift.meta_data.FieldMetaData("after", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScoreDoc.class)));
     tmpMap.put(_Fields.QUERY, new org.apache.thrift.meta_data.FieldMetaData("query", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Query.class)));
     tmpMap.put(_Fields.FILTER, new org.apache.thrift.meta_data.FieldMetaData("filter", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         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, 
@@ -286,7 +286,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   public QueryArgs(
     long id,
     ScoreDoc after,
-    ByteBuffer query,
+    Query query,
     ByteBuffer filter,
     int numberToFetch,
     boolean aggregateResults,
@@ -323,8 +323,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       this.after = new ScoreDoc(other.after);
     }
     if (other.isSetQuery()) {
-      this.query = org.apache.thrift.TBaseHelper.copyBinary(other.query);
-;
+      this.query = new Query(other.query);
     }
     if (other.isSetFilter()) {
       this.filter = org.apache.thrift.TBaseHelper.copyBinary(other.filter);
@@ -435,24 +434,14 @@ 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();
-  }
-
-  public ByteBuffer bufferForQuery() {
-    return query;
+  public Query getQuery() {
+    return this.query;
   }
 
   /**
    * The query to be executed.
    */
-  public QueryArgs setQuery(byte[] query) {
-    setQuery(query == null ? (ByteBuffer)null : ByteBuffer.wrap(query));
-    return this;
-  }
-
-  public QueryArgs setQuery(ByteBuffer query) {
+  public QueryArgs setQuery(Query query) {
     this.query = query;
     return this;
   }
@@ -733,7 +722,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       if (value == null) {
         unsetQuery();
       } else {
-        setQuery((ByteBuffer)value);
+        setQuery((Query)value);
       }
       break;
 
@@ -1118,7 +1107,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     if (this.query == null) {
       sb.append("null");
     } else {
-      org.apache.thrift.TBaseHelper.toString(this.query, sb);
+      sb.append(this.query);
     }
     first = false;
     if (!first) sb.append(", ");
@@ -1171,6 +1160,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     if (after != null) {
       after.validate();
     }
+    if (query != null) {
+      query.validate();
+    }
     if (sort != null) {
       sort.validate();
     }
@@ -1230,8 +1222,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
             }
             break;
           case 3: // QUERY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.query = iprot.readBinary();
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.query = new Query();
+              struct.query.read(iprot);
               struct.setQueryIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -1329,7 +1322,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       }
       if (struct.query != null) {
         oprot.writeFieldBegin(QUERY_FIELD_DESC);
-        oprot.writeBinary(struct.query);
+        struct.query.write(oprot);
         oprot.writeFieldEnd();
       }
       if (struct.filter != null) {
@@ -1422,7 +1415,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         struct.after.write(oprot);
       }
       if (struct.isSetQuery()) {
-        oprot.writeBinary(struct.query);
+        struct.query.write(oprot);
       }
       if (struct.isSetFilter()) {
         oprot.writeBinary(struct.filter);
@@ -1467,7 +1460,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         struct.setAfterIsSet(true);
       }
       if (incoming.get(2)) {
-        struct.query = iprot.readBinary();
+        struct.query = new Query();
+        struct.query.read(iprot);
         struct.setQueryIsSet(true);
       }
       if (incoming.get(3)) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryType.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryType.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryType.java
new file mode 100644
index 0000000..c8c83fe
--- /dev/null
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/QueryType.java
@@ -0,0 +1,67 @@
+/**
+ * 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 java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum QueryType implements org.apache.thrift.TEnum {
+  STRING(0),
+  JSON(1),
+  BINARY(2);
+
+  private final int value;
+
+  private QueryType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static QueryType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return STRING;
+      case 1:
+        return JSON;
+      case 2:
+        return BINARY;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableDescriptor.java
----------------------------------------------------------------------
diff --git a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableDescriptor.java b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableDescriptor.java
index 0202abf..0776df6 100644
--- a/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableDescriptor.java
+++ b/src/blur-thrift/src/main/java/org/apache/blur/thrift/generated/TableDescriptor.java
@@ -61,7 +61,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
   private static final org.apache.thrift.protocol.TField STORAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("storagePath", org.apache.thrift.protocol.TType.STRING, (short)4);
   private static final org.apache.thrift.protocol.TField ANALYZER_FIELD_DESC = new org.apache.thrift.protocol.TField("analyzer", org.apache.thrift.protocol.TType.STRUCT, (short)5);
   private static final org.apache.thrift.protocol.TField READ_ONLY_FIELD_DESC = new org.apache.thrift.protocol.TField("readOnly", org.apache.thrift.protocol.TType.BOOL, (short)6);
-  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)7);
+  private static final org.apache.thrift.protocol.TField DEFAULT_FIELD_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultFieldName", org.apache.thrift.protocol.TType.STRING, (short)7);
+  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)8);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -97,6 +98,10 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
    */
   public boolean readOnly; // required
   /**
+   * The default field name for any field where the field name is null.
+   */
+  public String defaultFieldName; // required
+  /**
    * compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
    */
   public Map<String,String> properties; // required
@@ -131,9 +136,13 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
      */
     READ_ONLY((short)6, "readOnly"),
     /**
+     * The default field name for any field where the field name is null.
+     */
+    DEFAULT_FIELD_NAME((short)7, "defaultFieldName"),
+    /**
      * compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
      */
-    PROPERTIES((short)7, "properties");
+    PROPERTIES((short)8, "properties");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -160,7 +169,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
           return ANALYZER;
         case 6: // READ_ONLY
           return READ_ONLY;
-        case 7: // PROPERTIES
+        case 7: // DEFAULT_FIELD_NAME
+          return DEFAULT_FIELD_NAME;
+        case 8: // PROPERTIES
           return PROPERTIES;
         default:
           return null;
@@ -221,6 +232,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Analyzer.class)));
     tmpMap.put(_Fields.READ_ONLY, new org.apache.thrift.meta_data.FieldMetaData("readOnly", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.DEFAULT_FIELD_NAME, new org.apache.thrift.meta_data.FieldMetaData("defaultFieldName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
@@ -236,6 +249,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
 
     this.readOnly = false;
 
+    this.defaultFieldName = "body";
+
   }
 
   public TableDescriptor(
@@ -245,6 +260,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     String storagePath,
     Analyzer analyzer,
     boolean readOnly,
+    String defaultFieldName,
     Map<String,String> properties)
   {
     this();
@@ -257,6 +273,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     this.analyzer = analyzer;
     this.readOnly = readOnly;
     setReadOnlyIsSet(true);
+    this.defaultFieldName = defaultFieldName;
     this.properties = properties;
   }
 
@@ -277,6 +294,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       this.analyzer = new Analyzer(other.analyzer);
     }
     this.readOnly = other.readOnly;
+    if (other.isSetDefaultFieldName()) {
+      this.defaultFieldName = other.defaultFieldName;
+    }
     if (other.isSetProperties()) {
       Map<String,String> __this__properties = new HashMap<String,String>();
       for (Map.Entry<String, String> other_element : other.properties.entrySet()) {
@@ -309,6 +329,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     this.analyzer = null;
     this.readOnly = false;
 
+    this.defaultFieldName = "body";
+
     this.properties = null;
   }
 
@@ -495,6 +517,36 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __READONLY_ISSET_ID, value);
   }
 
+  /**
+   * The default field name for any field where the field name is null.
+   */
+  public String getDefaultFieldName() {
+    return this.defaultFieldName;
+  }
+
+  /**
+   * The default field name for any field where the field name is null.
+   */
+  public TableDescriptor setDefaultFieldName(String defaultFieldName) {
+    this.defaultFieldName = defaultFieldName;
+    return this;
+  }
+
+  public void unsetDefaultFieldName() {
+    this.defaultFieldName = null;
+  }
+
+  /** Returns true if field defaultFieldName is set (has been assigned a value) and false otherwise */
+  public boolean isSetDefaultFieldName() {
+    return this.defaultFieldName != null;
+  }
+
+  public void setDefaultFieldNameIsSet(boolean value) {
+    if (!value) {
+      this.defaultFieldName = null;
+    }
+  }
+
   public int getPropertiesSize() {
     return (this.properties == null) ? 0 : this.properties.size();
   }
@@ -586,6 +638,14 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       }
       break;
 
+    case DEFAULT_FIELD_NAME:
+      if (value == null) {
+        unsetDefaultFieldName();
+      } else {
+        setDefaultFieldName((String)value);
+      }
+      break;
+
     case PROPERTIES:
       if (value == null) {
         unsetProperties();
@@ -617,6 +677,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     case READ_ONLY:
       return Boolean.valueOf(isReadOnly());
 
+    case DEFAULT_FIELD_NAME:
+      return getDefaultFieldName();
+
     case PROPERTIES:
       return getProperties();
 
@@ -643,6 +706,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       return isSetAnalyzer();
     case READ_ONLY:
       return isSetReadOnly();
+    case DEFAULT_FIELD_NAME:
+      return isSetDefaultFieldName();
     case PROPERTIES:
       return isSetProperties();
     }
@@ -716,6 +781,15 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         return false;
     }
 
+    boolean this_present_defaultFieldName = true && this.isSetDefaultFieldName();
+    boolean that_present_defaultFieldName = true && that.isSetDefaultFieldName();
+    if (this_present_defaultFieldName || that_present_defaultFieldName) {
+      if (!(this_present_defaultFieldName && that_present_defaultFieldName))
+        return false;
+      if (!this.defaultFieldName.equals(that.defaultFieldName))
+        return false;
+    }
+
     boolean this_present_properties = true && this.isSetProperties();
     boolean that_present_properties = true && that.isSetProperties();
     if (this_present_properties || that_present_properties) {
@@ -801,6 +875,16 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetDefaultFieldName()).compareTo(typedOther.isSetDefaultFieldName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDefaultFieldName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultFieldName, typedOther.defaultFieldName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetProperties()).compareTo(typedOther.isSetProperties());
     if (lastComparison != 0) {
       return lastComparison;
@@ -867,6 +951,14 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     sb.append(this.readOnly);
     first = false;
     if (!first) sb.append(", ");
+    sb.append("defaultFieldName:");
+    if (this.defaultFieldName == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.defaultFieldName);
+    }
+    first = false;
+    if (!first) sb.append(", ");
     sb.append("properties:");
     if (this.properties == null) {
       sb.append("null");
@@ -971,7 +1063,15 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 7: // PROPERTIES
+          case 7: // DEFAULT_FIELD_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.defaultFieldName = iprot.readString();
+              struct.setDefaultFieldNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // PROPERTIES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
                 org.apache.thrift.protocol.TMap _map54 = iprot.readMapBegin();
@@ -1030,6 +1130,11 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       oprot.writeFieldBegin(READ_ONLY_FIELD_DESC);
       oprot.writeBool(struct.readOnly);
       oprot.writeFieldEnd();
+      if (struct.defaultFieldName != null) {
+        oprot.writeFieldBegin(DEFAULT_FIELD_NAME_FIELD_DESC);
+        oprot.writeString(struct.defaultFieldName);
+        oprot.writeFieldEnd();
+      }
       if (struct.properties != null) {
         oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
         {
@@ -1079,10 +1184,13 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       if (struct.isSetReadOnly()) {
         optionals.set(5);
       }
-      if (struct.isSetProperties()) {
+      if (struct.isSetDefaultFieldName()) {
         optionals.set(6);
       }
-      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetProperties()) {
+        optionals.set(7);
+      }
+      oprot.writeBitSet(optionals, 8);
       if (struct.isSetName()) {
         oprot.writeString(struct.name);
       }
@@ -1101,6 +1209,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       if (struct.isSetReadOnly()) {
         oprot.writeBool(struct.readOnly);
       }
+      if (struct.isSetDefaultFieldName()) {
+        oprot.writeString(struct.defaultFieldName);
+      }
       if (struct.isSetProperties()) {
         {
           oprot.writeI32(struct.properties.size());
@@ -1116,7 +1227,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TableDescriptor struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(7);
+      BitSet incoming = iprot.readBitSet(8);
       if (incoming.get(0)) {
         struct.name = iprot.readString();
         struct.setNameIsSet(true);
@@ -1143,6 +1254,10 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         struct.setReadOnlyIsSet(true);
       }
       if (incoming.get(6)) {
+        struct.defaultFieldName = iprot.readString();
+        struct.setDefaultFieldNameIsSet(true);
+      }
+      if (incoming.get(7)) {
         {
           org.apache.thrift.protocol.TMap _map60 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
           struct.properties = new HashMap<String,String>(2*_map60.size);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/pom.xml
----------------------------------------------------------------------
diff --git a/src/pom.xml b/src/pom.xml
index fc67591..7b7190f 100644
--- a/src/pom.xml
+++ b/src/pom.xml
@@ -46,7 +46,7 @@ under the License.
 		<module>blur-gui</module>
 		<!--module>blur-jdbc</module-->
 		<!--module>blur-testsuite</module-->
-		<!--module>blur-shell</module-->
+		<module>blur-shell</module>
 	</modules>
 
 	<dependencies>


Mime
View raw message