incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/3] git commit: More changes to simplify.
Date Fri, 05 Oct 2012 02:33:34 GMT
Updated Branches:
  refs/heads/new-api-prototype 8651473d7 -> 320f9de80


More changes to simplify.


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

Branch: refs/heads/new-api-prototype
Commit: 320f9de80f3eb5cfe0f8b6a04c3176f81fbf2c10
Parents: 8651473
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Thu Oct 4 22:33:03 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Thu Oct 4 22:33:03 2012 -0400

----------------------------------------------------------------------
 src/blur-new-api-prototype/service.thrift          |   52 +-
 .../main/java/org/apache/blur/proto/Server.java    |   97 +-
 .../src/main/java/org/apache/blur/proto/Util.java  |  131 +-
 .../blur/proto/example/clients/LoadClient.java     |   85 -
 .../proto/example/clients/LoadClientBatch.java     |    4 +-
 .../blur/proto/example/clients/ReadClient.java     |   79 -
 .../proto/example/clients/ReadClientBatch.java     |   25 +-
 .../apache/blur/thrift/generated/Attribute.java    |  145 +-
 .../blur/thrift/generated/BlurException.java       |  186 +-
 .../apache/blur/thrift/generated/BlurTuple.java    | 3133 ++-------------
 .../apache/blur/thrift/generated/ReadResult.java   |  320 --
 .../apache/blur/thrift/generated/ReadSession.java  |  319 --
 .../org/apache/blur/thrift/generated/Session.java  |  319 ++
 .../org/apache/blur/thrift/generated/TYPE.java     |    9 +-
 .../org/apache/blur/thrift/generated/Value.java    |  949 -----
 .../apache/blur/thrift/generated/WriteSession.java |  319 --
 16 files changed, 1173 insertions(+), 4999 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/service.thrift
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/service.thrift b/src/blur-new-api-prototype/service.thrift
index 9197a37..6949ff3 100644
--- a/src/blur-new-api-prototype/service.thrift
+++ b/src/blur-new-api-prototype/service.thrift
@@ -1,61 +1,39 @@
 namespace java org.apache.blur.thrift.generated
 
 exception BlurException {
-
+  1:string message,
+  2:string stackTraceStr
 }
 
 enum TYPE {
-  STRING, BOOL, SHORT, INT, LONG, DOUBLE, BINARY
-}
-
-struct Value {
-  1:TYPE type,
-  2:string stringValue,
-  3:bool boolValue,
-  4:i16 shortValue,
-  5:i32 intValue,
-  6:i64 longValue,
-  7:double doubleValue,
-  8:binary binaryValue
+  STRING, BOOL, SHORT, INT, LONG, FLOAT, DOUBLE, BINARY
 }
 
 struct Attribute {
   1:string name,
-  2:Value value
+  2:binary value,
+  3:TYPE type
 }
 
 struct Tuple {
   1:list<Attribute> attributes
 }
 
-struct ReadResult {
-  1:Tuple tuple
-}
-
-struct ReadSession {
-  1:string sessionId
-}
-
-struct WriteSession {
+struct Session {
   1:string sessionId
 }
 
 service BlurTuple {
 
-  ReadSession openReadSession() throws (1:BlurException e)
-  void executeQuery(1:ReadSession session, 2:string query) throws (1:BlurException e)
-  ReadResult nextMetaDataResult(1:ReadSession session) throws (1:BlurException e)
-  list<ReadResult> nextMetaDataResults(1:ReadSession session, 2:i32 batchSize) throws (1:BlurException e)
-  
-  ReadResult nextResult(1:ReadSession session) throws (1:BlurException e)
-  list<ReadResult> nextResults(1:ReadSession session, 2:i32 batchSize) throws (1:BlurException e)
-  
-  void closeReadSession(1:ReadSession session) throws (1:BlurException e)
+  Session openReadSession() throws (1:BlurException e)
+  void executeQuery(1:Session session, 2:string query) throws (1:BlurException e)
+  list<Tuple> nextMetaDataResults(1:Session session, 2:i32 batchSize) throws (1:BlurException e)
+  list<Tuple> nextResults(1:Session session, 2:i32 batchSize) throws (1:BlurException e)
+  void closeReadSession(1:Session session) throws (1:BlurException e)
 
-  WriteSession openWriteSession() throws (1:BlurException e)
-  void writeTuple(1:WriteSession session, 2:Tuple tuple) throws (1:BlurException e)
-  void writeTuples(1:WriteSession session, 2:list<Tuple> tuples) throws (1:BlurException e)
-  void commitWriteSession(1:WriteSession session) throws (1:BlurException e)
-  void rollbackWriteSession(1:WriteSession session) throws (1:BlurException e)
+  Session openWriteSession() throws (1:BlurException e)
+  void writeTuples(1:Session session, 2:list<Tuple> tuples) throws (1:BlurException e)
+  void commitWriteSession(1:Session session) throws (1:BlurException e)
+  void rollbackWriteSession(1:Session session) throws (1:BlurException e)
   
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Server.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Server.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Server.java
index 41ed74e..f997917 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Server.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Server.java
@@ -30,10 +30,8 @@ import org.apache.blur.thrift.generated.Attribute;
 import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.BlurTuple.Iface;
 import org.apache.blur.thrift.generated.BlurTuple.Processor;
-import org.apache.blur.thrift.generated.ReadResult;
-import org.apache.blur.thrift.generated.ReadSession;
+import org.apache.blur.thrift.generated.Session;
 import org.apache.blur.thrift.generated.Tuple;
-import org.apache.blur.thrift.generated.WriteSession;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.DirectoryReader;
@@ -56,6 +54,8 @@ import org.apache.thrift.transport.TTransportException;
 
 public class Server implements Iface {
 
+  private static final List<Tuple> EMPTY_LIST = new ArrayList<Tuple>();
+
   public static void main(String[] argsStr) throws TTransportException, IOException {
     Server server = new Server(new File(argsStr[0]));
     Processor<Iface> processor = new Processor<Iface>(server);
@@ -87,12 +87,12 @@ public class Server implements Iface {
   }
 
   @Override
-  public ReadSession openReadSession() throws BlurException, TException {
+  public Session openReadSession() throws BlurException, TException {
     try {
       IndexReader reader = DirectoryReader.open(writer, true);
       RSession session = new RSession(UUID.randomUUID().toString(), reader);
       readSessions.put(session.getSessionId(), session);
-      return new ReadSession(session.getSessionId());
+      return new Session(session.getSessionId());
     } catch (Exception e) {
       e.printStackTrace();
       throw new BlurException();
@@ -100,9 +100,9 @@ public class Server implements Iface {
   }
 
   @Override
-  public void executeQuery(ReadSession readSession, String query) throws BlurException, TException {
+  public void executeQuery(Session readSession, String query) throws BlurException, TException {
     try {
-      RSession session = getSession(readSession);
+      RSession session = getReadSession(readSession);
       if (query.trim().equals("*")) {
         session.execute(new MatchAllDocsQuery());
         return;
@@ -117,32 +117,15 @@ public class Server implements Iface {
   }
 
   @Override
-  public ReadResult nextMetaDataResult(ReadSession readSession) throws BlurException, TException {
+  public List<Tuple> nextMetaDataResults(Session readSession, int batchSize) throws BlurException, TException {
     try {
-      RSession session = getSession(readSession);
+      RSession session = getReadSession(readSession);
       if (session.isMetaDataBeenFetched()) {
-        return new ReadResult((Tuple) null);
+        return EMPTY_LIST;
       }
       Tuple tuple = new Tuple();
       tuple.addToAttributes(Util.newAttribute("totalResults", session.getTotalHits()));
-      return new ReadResult(tuple);
-    } catch (Exception e) {
-      e.printStackTrace();
-      throw new BlurException();
-    }
-  }
-
-  @Override
-  public List<ReadResult> nextMetaDataResults(ReadSession readSession, int batchSize) throws BlurException, TException {
-    return Arrays.asList(nextMetaDataResult(readSession));
-  }
-
-  @Override
-  public ReadResult nextResult(ReadSession readSession) throws BlurException, TException {
-    try {
-      RSession session = getSession(readSession);
-      Tuple document = convert(session.nextDocument());
-      return new ReadResult(document);
+      return Arrays.asList(tuple);
     } catch (Exception e) {
       e.printStackTrace();
       throw new BlurException();
@@ -150,16 +133,16 @@ public class Server implements Iface {
   }
 
   @Override
-  public List<ReadResult> nextResults(ReadSession readSession, int batchSize) throws BlurException, TException {
+  public List<Tuple> nextResults(Session readSession, int batchSize) throws BlurException, TException {
     try {
-      RSession session = getSession(readSession);
-      List<ReadResult> results = new ArrayList<ReadResult>();
+      RSession session = getReadSession(readSession);
+      List<Tuple> results = new ArrayList<Tuple>();
       for (int i = 0; i < batchSize; i++) {
         Tuple tuple = convert(session.nextDocument());
         if (tuple == null) {
           break;
         }
-        results.add(new ReadResult(tuple));
+        results.add(tuple);
       }
       return results;
     } catch (Exception e) {
@@ -169,7 +152,7 @@ public class Server implements Iface {
   }
 
   @Override
-  public void closeReadSession(ReadSession readSession) throws BlurException, TException {
+  public void closeReadSession(Session readSession) throws BlurException, TException {
     try {
       RSession session = readSessions.remove(readSession.getSessionId());
       session.close();
@@ -180,33 +163,23 @@ public class Server implements Iface {
   }
 
   @Override
-  public WriteSession openWriteSession() throws BlurException, TException {
+  public Session openWriteSession() throws BlurException, TException {
     try {
       String id = UUID.randomUUID().toString();
       File f = new File(file, id);
       Directory directory = FSDirectory.open(f);
       WSession session = new WSessionThreaded(id, openWriter(directory), f, directory);
       writeSessions.put(session.getSessionId(), session);
-      return new WriteSession(session.getSessionId());
+      return new Session(session.getSessionId());
     } catch (Exception e) {
       throw new BlurException();
     }
   }
 
   @Override
-  public void writeTuple(WriteSession writeSession, Tuple tuple) throws BlurException, TException {
+  public void writeTuples(Session writeSession, List<Tuple> tuples) throws BlurException, TException {
     try {
-      WSession session = writeSessions.get(writeSession.getSessionId());
-      session.addDocument(convert(tuple));
-    } catch (Exception e) {
-      throw new BlurException();
-    }
-  }
-
-  @Override
-  public void writeTuples(WriteSession writeSession, List<Tuple> tuples) throws BlurException, TException {
-    try {
-      WSession session = writeSessions.get(writeSession.getSessionId());
+      WSession session = getWriteSession(writeSession);
       session.addDocuments(convert(tuples));
     } catch (Exception e) {
       throw new BlurException();
@@ -214,7 +187,7 @@ public class Server implements Iface {
   }
 
   @Override
-  public void commitWriteSession(WriteSession writeSession) throws BlurException, TException {
+  public void commitWriteSession(Session writeSession) throws BlurException, TException {
     try {
       WSession session = writeSessions.remove(writeSession.getSessionId());
       session.closeWriter();
@@ -228,7 +201,7 @@ public class Server implements Iface {
   }
 
   @Override
-  public void rollbackWriteSession(WriteSession writeSession) throws BlurException, TException {
+  public void rollbackWriteSession(Session writeSession) throws BlurException, TException {
     try {
       WSession session = writeSessions.remove(writeSession.getSessionId());
       session.closeWriter();
@@ -250,13 +223,13 @@ public class Server implements Iface {
     file.delete();
   }
 
-  private Document convert(Tuple tuple) {
+  private Document convert(Tuple tuple) throws BlurException {
     if (tuple == null) {
       return null;
     }
     Document newDoc = new Document();
-    for (Attribute field : tuple.getAttributes()) {
-      newDoc.add(Util.getField(field.getName(), field.getValue()));
+    for (Attribute attribute : tuple.getAttributes()) {
+      newDoc.add(Util.getField(attribute));
     }
     return newDoc;
   }
@@ -273,20 +246,28 @@ public class Server implements Iface {
     return tuple;
   }
 
-  private List<Document> convert(List<Tuple> tuples) {
+  private List<Document> convert(List<Tuple> tuples) throws BlurException {
     List<Document> docs = new ArrayList<Document>();
     for (Tuple tuple : tuples) {
       docs.add(convert(tuple));
     }
     return docs;
   }
+  
+  private WSession getWriteSession(Session session) throws BlurException {
+    WSession wsession = writeSessions.get(session.getSessionId());
+    if (wsession == null) {
+      throw new BlurException("Write Session [" + session + "] not found", null);
+    }
+    return wsession;
+  }
 
-  private RSession getSession(ReadSession readSession) throws BlurException {
-    RSession session = readSessions.get(readSession.getSessionId());
-    if (session == null) {
-      throw new BlurException();
+  private RSession getReadSession(Session session) throws BlurException {
+    RSession rsession = readSessions.get(session.getSessionId());
+    if (rsession == null) {
+      throw new BlurException("Read Session [" + session + "] not found", null);
     }
-    return session;
+    return rsession;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Util.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Util.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Util.java
index 9dfc7e9..3a65fb6 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Util.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/Util.java
@@ -16,111 +16,76 @@ package org.apache.blur.proto;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import java.nio.ByteBuffer;
+import java.util.List;
+
 import org.apache.blur.thrift.generated.Attribute;
+import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.TYPE;
-import org.apache.blur.thrift.generated.Value;
+import org.apache.blur.thrift.generated.Tuple;
 import org.apache.lucene.document.Field.Store;
-import org.apache.lucene.document.LongField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.index.IndexableField;
 
 public class Util {
 
   public static Attribute newAttribute(String name, String value) {
-    return new Attribute(name, newValue(value));
-  }
-
-  public static Attribute newAttribute(String name, boolean value) {
-    return new Attribute(name, newValue(value));
-  }
-
-  public static Attribute newAttribute(String name, short value) {
-    return new Attribute(name, newValue(value));
+    return new Attribute(name, ByteBuffer.wrap(value.getBytes()), TYPE.STRING);
   }
 
   public static Attribute newAttribute(String name, int value) {
-    return new Attribute(name, newValue(value));
-  }
-
-  public static Attribute newAttribute(String name, long value) {
-    return new Attribute(name, newValue(value));
+    ByteBuffer buffer = ByteBuffer.allocate(4);
+    buffer.putInt(value);
+    buffer.flip();
+    Attribute attribute = new Attribute();
+    attribute.setName(name);
+    attribute.setValue(buffer.array());
+    attribute.setType(TYPE.INT);
+    return attribute;
   }
 
-  public static Attribute newAttribute(String name, double value) {
-    return new Attribute(name, newValue(value));
-  }
-
-  public static Attribute newAttribute(String name, byte[] value) {
-    return new Attribute(name, newValue(value));
-  }
-
-  public static Value newValue(String value) {
-    Value v = new Value();
-    v.setStringValue(value);
-    v.setType(TYPE.STRING);
-    return v;
-  }
-
-  public static Value newValue(boolean value) {
-    Value v = new Value();
-    v.setBoolValue(value);
-    v.setType(TYPE.BOOL);
-    return v;
-  }
-
-  public static Value newValue(short value) {
-    Value v = new Value();
-    v.setShortValue(value);
-    v.setType(TYPE.SHORT);
-    return v;
-  }
-
-  public static Value newValue(int value) {
-    Value v = new Value();
-    v.setIntValue(value);
-    v.setType(TYPE.INT);
-    return v;
-  }
-
-  public static Value newValue(long value) {
-    Value v = new Value();
-    v.setLongValue(value);
-    v.setType(TYPE.LONG);
-    return v;
-  }
-
-  public static Value newValue(double value) {
-    Value v = new Value();
-    v.setDoubleValue(value);
-    v.setType(TYPE.DOUBLE);
-    return v;
-  }
-
-  public static Value newValue(byte[] value) {
-    Value v = new Value();
-    v.setBinaryValue(value);
-    v.setType(TYPE.BINARY);
-    return v;
+  public static Attribute toAttribute(IndexableField fieldable) {
+    return newAttribute(fieldable.name(), fieldable.stringValue());
   }
 
-  public static IndexableField getField(String name, Value value) {
-    switch (value.getType()) {
+  public static IndexableField getField(Attribute attribute) throws BlurException {
+    switch (attribute.getType()) {
     case STRING:
-      return new StringField(name, value.getStringValue(), Store.YES);
-    case LONG:
-      return new LongField(name, value.getLongValue(), Store.YES);
+      return new StringField(attribute.getName(), toString(attribute.getValue()), Store.YES);
     default:
-      throw new RuntimeException("not supported");
+      throw new BlurException("Not supported [" + attribute.getType() + "]", null);
     }
   }
 
-  public static Attribute toAttribute(IndexableField fieldable) {
-    Number numericValue = fieldable.numericValue();
-    if (numericValue == null) {
-      return newAttribute(fieldable.name(), fieldable.stringValue());
-    } else {
-      return newAttribute(fieldable.name(), (Long) numericValue);
+  public static String toString(byte[] bs) {
+    return new String(bs);
+  }
+
+  public static String toString(Tuple tuple) {
+    List<Attribute> attributes = tuple.getAttributes();
+    String s = "";
+    for (Attribute attribute : attributes) {
+      if (!s.isEmpty()) {
+        s += ",";
+      }
+      String name = attribute.getName();
+      s += "\"" + name + "\":";
+      switch (attribute.getType()) {
+      case STRING:
+        s += "\"" + toString(attribute.getValue()) + "\"";
+        break;
+      case INT:
+        s += toInt(attribute.getValue());
+        break;
+      default:
+        throw new RuntimeException("Type [" + attribute.getType() + "] not supported.");
+      }
     }
+    return "{" + s + "}";
+  }
+
+  public static int toInt(byte[] bs) {
+    return ByteBuffer.wrap(bs).getInt();
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClient.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClient.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClient.java
deleted file mode 100644
index 3361da9..0000000
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClient.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.blur.proto.example.clients;
-
-/**
- * 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.io.IOException;
-import java.util.Random;
-
-import org.apache.blur.proto.ClientManager;
-import org.apache.blur.proto.Command;
-import org.apache.blur.proto.Util;
-import org.apache.blur.thrift.generated.BlurException;
-import org.apache.blur.thrift.generated.BlurTuple.Client;
-import org.apache.blur.thrift.generated.Tuple;
-import org.apache.blur.thrift.generated.WriteSession;
-import org.apache.thrift.TException;
-
-public class LoadClient {
-
-  public static void main(String[] args) throws BlurException, TException, IOException {
-    final int length = Integer.parseInt(args[0]);
-    final int fields = Integer.parseInt(args[1]);
-    ClientManager.execute("localhost:9000", new Command<Void>() {
-      @Override
-      public Void call(Client client) throws BlurException, TException {
-        WriteSession session = client.openWriteSession();
-        long s = System.currentTimeMillis();
-        Random random = new Random();
-
-        long count = 0;
-        long total = 0;
-        long start = System.nanoTime();
-        long attributeCount = 0;
-        long attributeTotal = 0;
-        
-        for (int i = 0; i < length; i++) {
-          long now = System.nanoTime();
-          if (start + 5000000000L < now) {
-            double seconds = (now - start) / 1000000000.0;
-            double rate = count / seconds;
-            double attributeRate = attributeCount / seconds;
-            System.out.println("Tuple count [" + total + "] at [" + rate + "/s] Attribute Count [" + attributeTotal + "] at [" + attributeRate + "/s]");
-            start = System.nanoTime();
-            count = 0;
-            attributeCount = 0;
-          }
-          
-          Tuple tuple = new Tuple();
-          for (int f = 0; f < fields; f++) {
-            tuple.addToAttributes(Util.newAttribute("id" + f, Long.toString(random.nextLong())));
-          }
-          client.writeTuple(session, tuple);
-          
-          count++;
-          total++;
-          int atCount = tuple.getAttributes().size();
-          attributeCount += atCount;
-          attributeTotal += atCount;
-        }
-        long m = System.currentTimeMillis();
-        client.commitWriteSession(session);
-        long e = System.currentTimeMillis();
-        double rate = length / ((m - s) / 1000.0);
-        System.out.println("Load time [" + (m - s) + "] at [" + rate + "/s]");
-        System.out.println("Commit time [" + (e - m) + "]");
-        return null;
-      }
-    });
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClientBatch.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClientBatch.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClientBatch.java
index 4f4a291..9f68cd6 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClientBatch.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadClientBatch.java
@@ -26,8 +26,8 @@ import org.apache.blur.proto.Command;
 import org.apache.blur.proto.Util;
 import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.BlurTuple.Client;
+import org.apache.blur.thrift.generated.Session;
 import org.apache.blur.thrift.generated.Tuple;
-import org.apache.blur.thrift.generated.WriteSession;
 import org.apache.thrift.TException;
 
 public class LoadClientBatch {
@@ -39,7 +39,7 @@ public class LoadClientBatch {
     ClientManager.execute("localhost:9000", new Command<Void>() {
       @Override
       public Void call(Client client) throws BlurException, TException {
-        WriteSession session = client.openWriteSession();
+        Session session = client.openWriteSession();
         long s = System.currentTimeMillis();
         Random random = new Random();
         List<Tuple> tuples = new ArrayList<Tuple>();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClient.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClient.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClient.java
deleted file mode 100644
index 7495e72..0000000
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClient.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.apache.blur.proto.example.clients;
-/**
- * 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.io.IOException;
-
-import org.apache.blur.proto.ClientManager;
-import org.apache.blur.proto.Command;
-import org.apache.blur.thrift.generated.BlurException;
-import org.apache.blur.thrift.generated.BlurTuple.Client;
-import org.apache.blur.thrift.generated.ReadResult;
-import org.apache.blur.thrift.generated.ReadSession;
-import org.apache.blur.thrift.generated.Tuple;
-import org.apache.thrift.TException;
-
-public class ReadClient {
-
-  public static void main(String[] args) throws BlurException, TException, IOException {
-    ClientManager.execute("localhost:9000", new Command<Void>() {
-      @Override
-      public Void call(Client client) throws BlurException, TException {
-        ReadSession session = client.openReadSession();
-        client.executeQuery(session, "*");
-        while (true) {
-          ReadResult metaDataResult = client.nextMetaDataResult(session);
-          Tuple tuple = metaDataResult.getTuple();
-          if (tuple == null) {
-            break;
-          }
-          System.out.println(tuple);
-        }
-        long count = 0;
-        long total = 0;
-        long start = System.nanoTime();
-        long attributeCount = 0;
-        long attributeTotal = 0;
-        while (true) {
-          long now = System.nanoTime();
-          if (start + 5000000000L < now) {
-            double seconds = (now - start) / 1000000000.0;
-            double rate = count / seconds;
-            double attributeRate = attributeCount / seconds;
-            System.out.println("Tuple count [" + total + "] at [" + rate + "/s] Attribute Count [" + attributeTotal + "] at [" + attributeRate + "/s]");
-            start = System.nanoTime();
-            count = 0;
-            attributeCount = 0;
-          }
-          ReadResult result = client.nextResult(session);
-//          System.out.println(result.getTuple());
-          if (result.getTuple() == null) {
-            break;
-          }
-          count++;
-          total++;
-          int atCount = result.getTuple().getAttributes().size();
-          attributeCount += atCount;
-          attributeTotal += atCount;
-        }
-        client.closeReadSession(session);
-        return null;
-      }
-    });
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClientBatch.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClientBatch.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClientBatch.java
index dcfca2e..d91a19d 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClientBatch.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/ReadClientBatch.java
@@ -21,10 +21,10 @@ import java.util.List;
 
 import org.apache.blur.proto.ClientManager;
 import org.apache.blur.proto.Command;
+import org.apache.blur.proto.Util;
 import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.BlurTuple.Client;
-import org.apache.blur.thrift.generated.ReadResult;
-import org.apache.blur.thrift.generated.ReadSession;
+import org.apache.blur.thrift.generated.Session;
 import org.apache.blur.thrift.generated.Tuple;
 import org.apache.thrift.TException;
 
@@ -34,16 +34,17 @@ public class ReadClientBatch {
     ClientManager.execute("localhost:9000", new Command<Void>() {
       @Override
       public Void call(Client client) throws BlurException, TException {
-        ReadSession session = client.openReadSession();
+        Session session = client.openReadSession();
         // client.executeQuery(session, "id1:fb*");
         client.executeQuery(session, "*");
         while (true) {
-          ReadResult metaDataResult = client.nextMetaDataResult(session);
-          Tuple tuple = metaDataResult.getTuple();
-          if (tuple == null) {
+          List<Tuple> metaDataResults = client.nextMetaDataResults(session, 10);
+          if (metaDataResults.isEmpty()) {
             break;
           }
-          System.out.println(tuple);
+          for (Tuple tuple : metaDataResults) {
+            System.out.println(Util.toString(tuple));
+          }
         }
 
         long count = 0;
@@ -62,16 +63,18 @@ public class ReadClientBatch {
             count = 0;
             attributeCount = 0;
           }
-          List<ReadResult> results = client.nextResults(session, 10);
-          // System.out.println(result.getDocument());
+          List<Tuple> results = client.nextResults(session, 10);
           if (results.isEmpty()) {
             break;
           }
+//          for (Tuple tuple : results) {
+//            System.out.println(Util.toString(tuple));
+//          }
           count += results.size();
           total += results.size();
           int atCount = 0;
-          for (ReadResult rr : results) {
-            atCount += rr.getTuple().getAttributes().size();
+          for (Tuple t : results) {
+            atCount += t.getAttributes().size();
           }
           attributeCount += atCount;
           attributeTotal += atCount;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Attribute.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Attribute.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Attribute.java
index c6aafeb..bfa1d21 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Attribute.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Attribute.java
@@ -24,15 +24,26 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Attribute");
 
   private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
-  private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+  private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)2);
+  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)3);
 
   public String name; // required
-  public Value value; // required
+  public ByteBuffer value; // required
+  /**
+   * 
+   * @see TYPE
+   */
+  public TYPE type; // 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 {
     NAME((short)1, "name"),
-    VALUE((short)2, "value");
+    VALUE((short)2, "value"),
+    /**
+     * 
+     * @see TYPE
+     */
+    TYPE((short)3, "type");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -51,6 +62,8 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
           return NAME;
         case 2: // VALUE
           return VALUE;
+        case 3: // TYPE
+          return TYPE;
         default:
           return null;
       }
@@ -98,7 +111,9 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Value.class)));
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+    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, TYPE.class)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Attribute.class, metaDataMap);
   }
@@ -108,11 +123,13 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
 
   public Attribute(
     String name,
-    Value value)
+    ByteBuffer value,
+    TYPE type)
   {
     this();
     this.name = name;
     this.value = value;
+    this.type = type;
   }
 
   /**
@@ -123,7 +140,11 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
       this.name = other.name;
     }
     if (other.isSetValue()) {
-      this.value = new Value(other.value);
+      this.value = org.apache.thrift.TBaseHelper.copyBinary(other.value);
+;
+    }
+    if (other.isSetType()) {
+      this.type = other.type;
     }
   }
 
@@ -135,6 +156,7 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
   public void clear() {
     this.name = null;
     this.value = null;
+    this.type = null;
   }
 
   public String getName() {
@@ -161,11 +183,21 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     }
   }
 
-  public Value getValue() {
-    return this.value;
+  public byte[] getValue() {
+    setValue(org.apache.thrift.TBaseHelper.rightSize(value));
+    return value == null ? null : value.array();
+  }
+
+  public ByteBuffer bufferForValue() {
+    return value;
   }
 
-  public Attribute setValue(Value value) {
+  public Attribute setValue(byte[] value) {
+    setValue(value == null ? (ByteBuffer)null : ByteBuffer.wrap(value));
+    return this;
+  }
+
+  public Attribute setValue(ByteBuffer value) {
     this.value = value;
     return this;
   }
@@ -185,6 +217,38 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     }
   }
 
+  /**
+   * 
+   * @see TYPE
+   */
+  public TYPE getType() {
+    return this.type;
+  }
+
+  /**
+   * 
+   * @see TYPE
+   */
+  public Attribute setType(TYPE 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;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case NAME:
@@ -199,7 +263,15 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
       if (value == null) {
         unsetValue();
       } else {
-        setValue((Value)value);
+        setValue((ByteBuffer)value);
+      }
+      break;
+
+    case TYPE:
+      if (value == null) {
+        unsetType();
+      } else {
+        setType((TYPE)value);
       }
       break;
 
@@ -214,6 +286,9 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     case VALUE:
       return getValue();
 
+    case TYPE:
+      return getType();
+
     }
     throw new IllegalStateException();
   }
@@ -229,6 +304,8 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
       return isSetName();
     case VALUE:
       return isSetValue();
+    case TYPE:
+      return isSetType();
     }
     throw new IllegalStateException();
   }
@@ -264,6 +341,15 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
         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;
+    }
+
     return true;
   }
 
@@ -300,6 +386,16 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
         return lastComparison;
       }
     }
+    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;
+      }
+    }
     return 0;
   }
 
@@ -325,9 +421,15 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
           }
           break;
         case 2: // VALUE
-          if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-            this.value = new Value();
-            this.value.read(iprot);
+          if (field.type == org.apache.thrift.protocol.TType.STRING) {
+            this.value = iprot.readBinary();
+          } else { 
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
+        case 3: // TYPE
+          if (field.type == org.apache.thrift.protocol.TType.I32) {
+            this.type = TYPE.findByValue(iprot.readI32());
           } else { 
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           }
@@ -354,7 +456,12 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     }
     if (this.value != null) {
       oprot.writeFieldBegin(VALUE_FIELD_DESC);
-      this.value.write(oprot);
+      oprot.writeBinary(this.value);
+      oprot.writeFieldEnd();
+    }
+    if (this.type != null) {
+      oprot.writeFieldBegin(TYPE_FIELD_DESC);
+      oprot.writeI32(this.type.getValue());
       oprot.writeFieldEnd();
     }
     oprot.writeFieldStop();
@@ -378,7 +485,15 @@ public class Attribute implements org.apache.thrift.TBase<Attribute, Attribute._
     if (this.value == null) {
       sb.append("null");
     } else {
-      sb.append(this.value);
+      org.apache.thrift.TBaseHelper.toString(this.value, sb);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("type:");
+    if (this.type == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.type);
     }
     first = false;
     sb.append(")");

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/320f9de8/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurException.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurException.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurException.java
index 67ca68e..e419042 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurException.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurException.java
@@ -23,11 +23,16 @@ import org.slf4j.LoggerFactory;
 public class BlurException extends Exception implements org.apache.thrift.TBase<BlurException, BlurException._Fields>, java.io.Serializable, Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlurException");
 
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
+  private static final org.apache.thrift.protocol.TField STACK_TRACE_STR_FIELD_DESC = new org.apache.thrift.protocol.TField("stackTraceStr", org.apache.thrift.protocol.TType.STRING, (short)2);
 
+  public String message; // required
+  public String stackTraceStr; // 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 {
-;
+    MESSAGE((short)1, "message"),
+    STACK_TRACE_STR((short)2, "stackTraceStr");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -42,6 +47,10 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
      */
     public static _Fields findByThriftId(int fieldId) {
       switch(fieldId) {
+        case 1: // MESSAGE
+          return MESSAGE;
+        case 2: // STACK_TRACE_STR
+          return STACK_TRACE_STR;
         default:
           return null;
       }
@@ -80,9 +89,16 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
       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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.STACK_TRACE_STR, new org.apache.thrift.meta_data.FieldMetaData("stackTraceStr", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BlurException.class, metaDataMap);
   }
@@ -90,10 +106,25 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
   public BlurException() {
   }
 
+  public BlurException(
+    String message,
+    String stackTraceStr)
+  {
+    this();
+    this.message = message;
+    this.stackTraceStr = stackTraceStr;
+  }
+
   /**
    * Performs a deep copy on <i>other</i>.
    */
   public BlurException(BlurException other) {
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+    if (other.isSetStackTraceStr()) {
+      this.stackTraceStr = other.stackTraceStr;
+    }
   }
 
   public BlurException deepCopy() {
@@ -102,15 +133,87 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
 
   @Override
   public void clear() {
+    this.message = null;
+    this.stackTraceStr = null;
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public BlurException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public String getStackTraceStr() {
+    return this.stackTraceStr;
+  }
+
+  public BlurException setStackTraceStr(String stackTraceStr) {
+    this.stackTraceStr = stackTraceStr;
+    return this;
+  }
+
+  public void unsetStackTraceStr() {
+    this.stackTraceStr = null;
+  }
+
+  /** Returns true if field stackTraceStr is set (has been assigned a value) and false otherwise */
+  public boolean isSetStackTraceStr() {
+    return this.stackTraceStr != null;
+  }
+
+  public void setStackTraceStrIsSet(boolean value) {
+    if (!value) {
+      this.stackTraceStr = null;
+    }
   }
 
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    case STACK_TRACE_STR:
+      if (value == null) {
+        unsetStackTraceStr();
+      } else {
+        setStackTraceStr((String)value);
+      }
+      break;
+
     }
   }
 
   public Object getFieldValue(_Fields field) {
     switch (field) {
+    case MESSAGE:
+      return getMessage();
+
+    case STACK_TRACE_STR:
+      return getStackTraceStr();
+
     }
     throw new IllegalStateException();
   }
@@ -122,6 +225,10 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
     }
 
     switch (field) {
+    case MESSAGE:
+      return isSetMessage();
+    case STACK_TRACE_STR:
+      return isSetStackTraceStr();
     }
     throw new IllegalStateException();
   }
@@ -139,6 +246,24 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
     if (that == null)
       return false;
 
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    boolean this_present_stackTraceStr = true && this.isSetStackTraceStr();
+    boolean that_present_stackTraceStr = true && that.isSetStackTraceStr();
+    if (this_present_stackTraceStr || that_present_stackTraceStr) {
+      if (!(this_present_stackTraceStr && that_present_stackTraceStr))
+        return false;
+      if (!this.stackTraceStr.equals(that.stackTraceStr))
+        return false;
+    }
+
     return true;
   }
 
@@ -155,6 +280,26 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
     int lastComparison = 0;
     BlurException typedOther = (BlurException)other;
 
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetStackTraceStr()).compareTo(typedOther.isSetStackTraceStr());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetStackTraceStr()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stackTraceStr, typedOther.stackTraceStr);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -172,6 +317,20 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
         break;
       }
       switch (field.id) {
+        case 1: // MESSAGE
+          if (field.type == org.apache.thrift.protocol.TType.STRING) {
+            this.message = iprot.readString();
+          } else { 
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
+        case 2: // STACK_TRACE_STR
+          if (field.type == org.apache.thrift.protocol.TType.STRING) {
+            this.stackTraceStr = iprot.readString();
+          } else { 
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
         default:
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
       }
@@ -187,6 +346,16 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
     validate();
 
     oprot.writeStructBegin(STRUCT_DESC);
+    if (this.message != null) {
+      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+      oprot.writeString(this.message);
+      oprot.writeFieldEnd();
+    }
+    if (this.stackTraceStr != null) {
+      oprot.writeFieldBegin(STACK_TRACE_STR_FIELD_DESC);
+      oprot.writeString(this.stackTraceStr);
+      oprot.writeFieldEnd();
+    }
     oprot.writeFieldStop();
     oprot.writeStructEnd();
   }
@@ -196,6 +365,21 @@ public class BlurException extends Exception implements org.apache.thrift.TBase<
     StringBuilder sb = new StringBuilder("BlurException(");
     boolean first = true;
 
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("stackTraceStr:");
+    if (this.stackTraceStr == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.stackTraceStr);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }


Mime
View raw message