incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [8/8] git commit: Added a tablename to mutates and properties to the session.
Date Tue, 16 Oct 2012 00:57:06 GMT
Added a tablename to mutates and properties to the session.


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

Branch: refs/heads/lucene-4.0.0
Commit: 2b89bce8da570d17ab8982903491a2dadd83186f
Parents: 234bc49
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Oct 10 20:15:08 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Oct 10 20:15:08 2012 -0400

----------------------------------------------------------------------
 src/blur-new-api-prototype/service.thrift          |    5 +-
 .../java/org/apache/blur/cache/BlockDirectory.java |    4 +
 .../main/java/org/apache/blur/core/ServerHdfs.java |   56 ++++--
 .../org/apache/blur/core/sessions/ReadSession.java |   12 +-
 .../blur/core/sessions/RunningQuerySession.java    |   16 +-
 .../apache/blur/core/sessions/WriteSession.java    |   25 ++-
 .../example/clients/LoadThriftClientBatch.java     |   13 +-
 .../org/apache/blur/store/SimpleHDFSDirectory.java |   32 +++
 .../apache/blur/thrift/generated/BlurShard.java    |   54 +++---
 .../apache/blur/thrift/generated/BlurTuple.java    |  173 +++++++++++---
 .../org/apache/blur/thrift/generated/Session.java  |  138 +++++++++++-
 11 files changed, 427 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/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 81cc582..45d03b0 100644
--- a/src/blur-new-api-prototype/service.thrift
+++ b/src/blur-new-api-prototype/service.thrift
@@ -20,7 +20,8 @@ struct Tuple {
 }
 
 struct Session {
-  1:string sessionId
+  1:string sessionId,
+  2:map<string,string> properties
 }
 
 struct QuerySession {
@@ -36,7 +37,7 @@ service BlurTuple {
   list<Tuple> nextResults(1:QuerySession session, 2:i32 batchSize) throws (1:BlurException e)
   void closeReadSession(1:Session session) throws (1:BlurException e)
 
-  Session openWriteSession() throws (1:BlurException e)
+  Session openWriteSession(1:string table) 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)

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/cache/BlockDirectory.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/cache/BlockDirectory.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/cache/BlockDirectory.java
index 6441a3b..6231d99 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/cache/BlockDirectory.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/cache/BlockDirectory.java
@@ -288,4 +288,8 @@ public class BlockDirectory extends Directory {
     return _directory.listAll();
   }
 
+  public Directory getDirectory() {
+    return _directory;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ServerHdfs.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ServerHdfs.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ServerHdfs.java
index 1ccccf5..a7eb11f 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ServerHdfs.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ServerHdfs.java
@@ -23,8 +23,10 @@ import java.lang.management.RuntimeMXBean;
 import java.net.InetSocketAddress;
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -49,6 +51,7 @@ import org.apache.blur.thrift.generated.Tuple;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.lucene.analysis.Analyzer;
@@ -72,7 +75,7 @@ import org.apache.thrift.transport.TServerSocket;
 import org.apache.thrift.transport.TTransportException;
 
 public class ServerHdfs implements Iface {
-  
+
   private static final Log LOG = LogFactory.getLog(ServerHdfs.class);
 
   private static final String XX_MAX_DIRECT_MEMORY_SIZE = "-XX:MaxDirectMemorySize=";
@@ -100,7 +103,7 @@ public class ServerHdfs implements Iface {
 
   private Map<String, ReadSession> readSessions = new ConcurrentHashMap<String, ReadSession>();
   private Map<String, WriteSession> writeSessions = new ConcurrentHashMap<String, WriteSession>();
-  private IndexWriter writer;
+  private Map<String, IndexWriter> tables = new ConcurrentHashMap<String, IndexWriter>();
   private Path path;
   private Configuration configuration;
   private Analyzer analyzer = new KeywordAnalyzer();
@@ -113,10 +116,12 @@ public class ServerHdfs implements Iface {
     this.path = fileSystem.makeQualified(p);
     fileSystem.close();
     if (nativeDirectory) {
-      FSDirectory directory = FSDirectory.open(getFile(this.path));
-      this.writer = openWriter(directory);
+      File file = getFile(this.path);
+      for (File f : file.listFiles()) {
+        FSDirectory directory = FSDirectory.open(f);
+        tables.put(f.getName(), openWriter(directory));
+      }
     } else {
-      Directory directory = new SimpleHDFSDirectory(configuration, this.path);
       BufferStore.init();
       long totalMemory = getTotalMemory();
       int slabSize = MAX_SLABSIZE;
@@ -128,9 +133,15 @@ public class ServerHdfs implements Iface {
         LOG.info("Block cache using [" + totalMemory + "] total memory in off heap cache, with slab size of [" + slabSize + "].");
         cache = new BlockCache(true, totalMemory, slabSize);
       }
-      BlockDirectoryCache blockDirectoryCache = new BlockDirectoryCache(cache);
-      BlockDirectory blockDirectory = new BlockDirectory("embedded", directory, blockDirectoryCache);
-      this.writer = openWriter(blockDirectory);
+
+      FileStatus[] listStatus = fileSystem.listStatus(path);
+      for (FileStatus status : listStatus) {
+        Path tablePath = status.getPath();
+        Directory directory = new SimpleHDFSDirectory(configuration, tablePath);
+        BlockDirectoryCache blockDirectoryCache = new BlockDirectoryCache(cache);
+        BlockDirectory blockDirectory = new BlockDirectory("embedded", directory, blockDirectoryCache);
+        tables.put(tablePath.getName(), openWriter(blockDirectory));
+      }
     }
   }
 
@@ -178,15 +189,24 @@ public class ServerHdfs implements Iface {
   @Override
   public Session openReadSession() throws BlurException, TException {
     try {
-      IndexReader reader = DirectoryReader.open(writer, true);
-      ReadSession session = new ReadSession(UUID.randomUUID().toString(), reader);
+      Map<String, IndexReader> readers = getReaders();
+      ReadSession session = new ReadSession(UUID.randomUUID().toString(), readers);
       readSessions.put(session.getSessionId(), session);
-      return new Session(session.getSessionId());
+      return new Session(session.getSessionId(), null);
     } catch (Throwable t) {
       throw Util.wrapThrowable(t);
     }
   }
 
+  private Map<String, IndexReader> getReaders() throws IOException {
+    Map<String, IndexReader> readers = new HashMap<String, IndexReader>();
+    for (Entry<String, IndexWriter> e : tables.entrySet()) {
+      IndexReader reader = DirectoryReader.open(e.getValue(), true);
+      readers.put(e.getKey(), reader);
+    }
+    return readers;
+  }
+
   @Override
   public QuerySession executeQuery(Session readSession, String query) throws BlurException, TException {
     try {
@@ -256,7 +276,7 @@ public class ServerHdfs implements Iface {
   }
 
   @Override
-  public Session openWriteSession() throws BlurException, TException {
+  public Session openWriteSession(String table) throws BlurException, TException {
     try {
       String id = UUID.randomUUID().toString();
       Path p = new Path(path, id);
@@ -270,7 +290,9 @@ public class ServerHdfs implements Iface {
         session = new WriteSessionThreadedPath(id, openWriter(directory), directory, configuration, p);
       }
       writeSessions.put(session.getSessionId(), session);
-      return new Session(session.getSessionId());
+      Map<String, String> properties = new HashMap<String, String>();
+      properties.put("table", table);
+      return new Session(session.getSessionId(), properties);
     } catch (Throwable t) {
       throw Util.wrapThrowable(t);
     }
@@ -290,11 +312,9 @@ public class ServerHdfs implements Iface {
   public void commitWriteSession(Session writeSession) throws BlurException, TException {
     try {
       WriteSession session = writeSessions.remove(writeSession.getSessionId());
-      session.closeWriter();
-      writer.addIndexes(session.getDirectory());
-      writer.commit();
-      writer.maybeMerge();
-      session.removeTempSpace();
+      String table = writeSession.getProperties().get("table");
+      IndexWriter writer = tables.get(table);
+      session.commit(writer);
     } catch (Throwable t) {
       throw Util.wrapThrowable(t);
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/ReadSession.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/ReadSession.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/ReadSession.java
index 468e909..1ea7927 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/ReadSession.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/ReadSession.java
@@ -25,12 +25,12 @@ import org.apache.lucene.index.IndexReader;
 public class ReadSession {
 
   private String sessionId;
-  private IndexReader reader;
+  private Map<String, IndexReader> readers;
   private Map<String, RunningQuerySession> runningQueries = new ConcurrentHashMap<String, RunningQuerySession>();
 
-  public ReadSession(String sessionId, IndexReader reader) {
+  public ReadSession(String sessionId, Map<String, IndexReader> readers) {
     this.sessionId = sessionId;
-    this.reader = reader;
+    this.readers = readers;
   }
 
   public String getSessionId() {
@@ -38,7 +38,7 @@ public class ReadSession {
   }
 
   public RunningQuerySession create(String queryId) {
-    RunningQuerySession runningQuerySession = new RunningQuerySession(reader, sessionId, queryId);
+    RunningQuerySession runningQuerySession = new RunningQuerySession(readers, sessionId, queryId);
     runningQueries.put(queryId, runningQuerySession);
     return runningQuerySession;
   }
@@ -48,7 +48,9 @@ public class ReadSession {
   }
 
   public void close() throws IOException {
-    reader.close();
+    for (IndexReader reader : readers.values()) {
+      reader.close();
+    }
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/RunningQuerySession.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/RunningQuerySession.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/RunningQuerySession.java
index 9132c9d..90d227a 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/RunningQuerySession.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/RunningQuerySession.java
@@ -2,7 +2,10 @@ package org.apache.blur.core.sessions;
 
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -28,7 +31,7 @@ import org.apache.lucene.search.TopDocs;
 public class RunningQuerySession {
 
   private static final List<String> ALL_COLUMNS = Arrays.asList("*");
-  private IndexSearcher searcher;
+  private Map<String, IndexSearcher> searchers;
   private TopDocs topDocs;
   private int count;
   private Query query;
@@ -49,19 +52,26 @@ public class RunningQuerySession {
   private Query queryRewrite;
   private double rewriteTime;
   private double queryTime;
+  private IndexSearcher searcher;
 
-  public RunningQuerySession(IndexReader reader, String sessionId, String queryId) {
-    searcher = new IndexSearcher(reader);
+  public RunningQuerySession(Map<String, IndexReader> readers, String sessionId, String queryId) {
+    searchers = new HashMap<String, IndexSearcher>();
+    for (Entry<String, IndexReader> e : readers.entrySet()) {
+      searchers.put(e.getKey(), new IndexSearcher(e.getValue()));
+    }
     executor = Executors.newSingleThreadExecutor();
   }
 
   public void executeBql(BqlParser bqlParser) throws IOException {
     if (bqlParser.getQueryType() == QueryType.SELECT) {
+      String tableName = bqlParser.getTableName();
+      searcher = searchers.get(tableName);
       limit = bqlParser.getLimit();
       query = bqlParser.getLuceneQuery();
       if (query == null) {
         query = new MatchAllDocsQuery();
       }
+      
       List<String> attributeTokens = bqlParser.getAttributeTokens();
       List<String> attributeTokenAliases = bqlParser.getAttributeTokenAliases();
       if (attributeTokens.equals(ALL_COLUMNS)) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/WriteSession.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/WriteSession.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/WriteSession.java
index d74b383..4d04c67 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/WriteSession.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/sessions/WriteSession.java
@@ -19,11 +19,14 @@ package org.apache.blur.core.sessions;
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.store.Directory;
 
 public abstract class WriteSession {
+  private static final Log LOG = LogFactory.getLog(WriteSession.class);
 
   protected IndexWriter writer;
   protected String sessionId;
@@ -48,7 +51,7 @@ public abstract class WriteSession {
   }
 
   public void closeWriter() throws IOException {
-    writer.close();
+    writer.close(false);
   }
 
   public Directory getDirectory() {
@@ -57,4 +60,24 @@ public abstract class WriteSession {
 
   public abstract void removeTempSpace() throws IOException;
 
+  public void commit(IndexWriter masterWriter) throws IOException {
+    long t0 = System.nanoTime();
+    closeWriter();
+    long t1 = System.nanoTime();
+    masterWriter.addIndexes(getDirectory());
+    long t2 = System.nanoTime();
+    masterWriter.commit();
+    long t3 = System.nanoTime();
+    masterWriter.maybeMerge();
+    long t4 = System.nanoTime();
+    removeTempSpace();
+    long t5 = System.nanoTime();
+    double close = (t1 - t0) / 1000000.0;
+    double addIndexes = (t2 - t1) / 1000000.0;
+    double commit = (t3 - t2) / 1000000.0;
+    double maybeMerge = (t4 - t3) / 1000000.0;
+    double rmTmpWriter = (t5 - t4) / 1000000.0;
+    LOG.info("Close [" + close + "] Add Indexes [" + addIndexes + "] Commit [" + commit + "] Maybe merge [" + maybeMerge + "] Remove tmp writer [" + rmTmpWriter + "]");
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadThriftClientBatch.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadThriftClientBatch.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadThriftClientBatch.java
index 456ceb0..0296133 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadThriftClientBatch.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/proto/example/clients/LoadThriftClientBatch.java
@@ -33,16 +33,17 @@ import org.apache.thrift.TException;
 public class LoadThriftClientBatch {
 
   public static void main(String[] args) throws BlurException, TException, IOException {
-    if (args.length != 3) {
-      throw new BlurException("load <total tuple> <fields> <batch size>", null);
+    if (args.length != 4) {
+      throw new BlurException("load <table name> <total tuple> <fields> <batch size>", null);
     }
-    final int length = Integer.parseInt(args[0]);
-    final int fields = Integer.parseInt(args[1]);
-    final int batch = Integer.parseInt(args[2]);
+    final String tableName = args[0];
+    final int length = Integer.parseInt(args[1]);
+    final int fields = Integer.parseInt(args[2]);
+    final int batch = Integer.parseInt(args[3]);
     ClientManager.execute("localhost:9000", new Command<Void>() {
       @Override
       public Void call(Client client) throws BlurException, TException {
-        Session session = client.openWriteSession();
+        Session session = client.openWriteSession(tableName);
         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/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/store/SimpleHDFSDirectory.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/store/SimpleHDFSDirectory.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/store/SimpleHDFSDirectory.java
index a2c3365..3a4b7c4 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/store/SimpleHDFSDirectory.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/store/SimpleHDFSDirectory.java
@@ -4,6 +4,7 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.Collection;
 
+import org.apache.blur.cache.BlockDirectory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -149,4 +150,35 @@ public class SimpleHDFSDirectory extends Directory {
     return fileSystem.getFileStatus(file).getModificationTime();
   }
 
+  @Override
+  public void copy(Directory to, String src, String dest, IOContext context) throws IOException {
+    if (to instanceof SimpleHDFSDirectory) {
+      if (quickMove(to, src, dest, context)) {
+        return;
+      }
+    } else if (to instanceof BlockDirectory) {
+      BlockDirectory bd = (BlockDirectory) to;
+      Directory inner = bd.getDirectory();
+      if (quickMove(inner, src, dest, context)) {
+        return;
+      }
+    }
+    super.copy(to, src, dest, context);
+  }
+
+  private boolean quickMove(Directory to, String src, String dest, IOContext context) throws IOException {
+    SimpleHDFSDirectory simpleTo = (SimpleHDFSDirectory) to;
+    if (ifSameCluster(to, this)) {
+      Path newDest = simpleTo.getPath(dest);
+      Path oldSrc = getPath(src);
+      return fileSystem.rename(oldSrc, newDest);
+    }
+    return false;
+  }
+
+  private boolean ifSameCluster(Directory to, SimpleHDFSDirectory simpleHDFSDirectory) {
+    // @TODO
+    return true;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurShard.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurShard.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurShard.java
index 7b6ed23..5396ae8 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurShard.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurShard.java
@@ -2734,14 +2734,14 @@ public class BlurShard {
           case 0: // SUCCESS
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
-                this.success = new ArrayList<Tuple>(_list16.size);
-                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
+                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
+                this.success = new ArrayList<Tuple>(_list21.size);
+                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
                 {
-                  Tuple _elem18; // required
-                  _elem18 = new Tuple();
-                  _elem18.read(iprot);
-                  this.success.add(_elem18);
+                  Tuple _elem23; // required
+                  _elem23 = new Tuple();
+                  _elem23.read(iprot);
+                  this.success.add(_elem23);
                 }
                 iprot.readListEnd();
               }
@@ -2775,9 +2775,9 @@ public class BlurShard {
         oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
-          for (Tuple _iter19 : this.success)
+          for (Tuple _iter24 : this.success)
           {
-            _iter19.write(oprot);
+            _iter24.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -3544,14 +3544,14 @@ public class BlurShard {
           case 0: // SUCCESS
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
-                this.success = new ArrayList<Tuple>(_list20.size);
-                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
+                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
+                this.success = new ArrayList<Tuple>(_list25.size);
+                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
                 {
-                  Tuple _elem22; // required
-                  _elem22 = new Tuple();
-                  _elem22.read(iprot);
-                  this.success.add(_elem22);
+                  Tuple _elem27; // required
+                  _elem27 = new Tuple();
+                  _elem27.read(iprot);
+                  this.success.add(_elem27);
                 }
                 iprot.readListEnd();
               }
@@ -3585,9 +3585,9 @@ public class BlurShard {
         oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
-          for (Tuple _iter23 : this.success)
+          for (Tuple _iter28 : this.success)
           {
-            _iter23.write(oprot);
+            _iter28.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -5165,14 +5165,14 @@ public class BlurShard {
           case 2: // TUPLES
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
-                this.tuples = new ArrayList<Tuple>(_list24.size);
-                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
+                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
+                this.tuples = new ArrayList<Tuple>(_list29.size);
+                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
                 {
-                  Tuple _elem26; // required
-                  _elem26 = new Tuple();
-                  _elem26.read(iprot);
-                  this.tuples.add(_elem26);
+                  Tuple _elem31; // required
+                  _elem31 = new Tuple();
+                  _elem31.read(iprot);
+                  this.tuples.add(_elem31);
                 }
                 iprot.readListEnd();
               }
@@ -5204,9 +5204,9 @@ public class BlurShard {
         oprot.writeFieldBegin(TUPLES_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.tuples.size()));
-          for (Tuple _iter27 : this.tuples)
+          for (Tuple _iter32 : this.tuples)
           {
-            _iter27.write(oprot);
+            _iter32.write(oprot);
           }
           oprot.writeListEnd();
         }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurTuple.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurTuple.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurTuple.java
index aab7fc3..f3097be 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurTuple.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/BlurTuple.java
@@ -34,7 +34,7 @@ public class BlurTuple {
 
     public void closeReadSession(Session session) throws BlurException, org.apache.thrift.TException;
 
-    public Session openWriteSession() throws BlurException, org.apache.thrift.TException;
+    public Session openWriteSession(String table) throws BlurException, org.apache.thrift.TException;
 
     public void writeTuples(Session session, List<Tuple> tuples) throws BlurException, org.apache.thrift.TException;
 
@@ -56,7 +56,7 @@ public class BlurTuple {
 
     public void closeReadSession(Session session, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.closeReadSession_call> resultHandler) throws org.apache.thrift.TException;
 
-    public void openWriteSession(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.openWriteSession_call> resultHandler) throws org.apache.thrift.TException;
+    public void openWriteSession(String table, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.openWriteSession_call> resultHandler) throws org.apache.thrift.TException;
 
     public void writeTuples(Session session, List<Tuple> tuples, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.writeTuples_call> resultHandler) throws org.apache.thrift.TException;
 
@@ -215,15 +215,16 @@ public class BlurTuple {
       return;
     }
 
-    public Session openWriteSession() throws BlurException, org.apache.thrift.TException
+    public Session openWriteSession(String table) throws BlurException, org.apache.thrift.TException
     {
-      send_openWriteSession();
+      send_openWriteSession(table);
       return recv_openWriteSession();
     }
 
-    public void send_openWriteSession() throws org.apache.thrift.TException
+    public void send_openWriteSession(String table) throws org.apache.thrift.TException
     {
       openWriteSession_args args = new openWriteSession_args();
+      args.setTable(table);
       sendBase("openWriteSession", args);
     }
 
@@ -494,21 +495,24 @@ public class BlurTuple {
       }
     }
 
-    public void openWriteSession(org.apache.thrift.async.AsyncMethodCallback<openWriteSession_call> resultHandler) throws org.apache.thrift.TException {
+    public void openWriteSession(String table, org.apache.thrift.async.AsyncMethodCallback<openWriteSession_call> resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      openWriteSession_call method_call = new openWriteSession_call(resultHandler, this, ___protocolFactory, ___transport);
+      openWriteSession_call method_call = new openWriteSession_call(table, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class openWriteSession_call extends org.apache.thrift.async.TAsyncMethodCall {
-      public openWriteSession_call(org.apache.thrift.async.AsyncMethodCallback<openWriteSession_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 String table;
+      public openWriteSession_call(String table, org.apache.thrift.async.AsyncMethodCallback<openWriteSession_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.table = table;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("openWriteSession", org.apache.thrift.protocol.TMessageType.CALL, 0));
         openWriteSession_args args = new openWriteSession_args();
+        args.setTable(table);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -759,7 +763,7 @@ public class BlurTuple {
       protected openWriteSession_result getResult(I iface, openWriteSession_args args) throws org.apache.thrift.TException {
         openWriteSession_result result = new openWriteSession_result();
         try {
-          result.success = iface.openWriteSession();
+          result.success = iface.openWriteSession(args.table);
         } catch (BlurException e) {
           result.e = e;
         }
@@ -2897,14 +2901,14 @@ public class BlurTuple {
           case 0: // SUCCESS
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
-                this.success = new ArrayList<Tuple>(_list4.size);
-                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
+                org.apache.thrift.protocol.TList _list9 = iprot.readListBegin();
+                this.success = new ArrayList<Tuple>(_list9.size);
+                for (int _i10 = 0; _i10 < _list9.size; ++_i10)
                 {
-                  Tuple _elem6; // required
-                  _elem6 = new Tuple();
-                  _elem6.read(iprot);
-                  this.success.add(_elem6);
+                  Tuple _elem11; // required
+                  _elem11 = new Tuple();
+                  _elem11.read(iprot);
+                  this.success.add(_elem11);
                 }
                 iprot.readListEnd();
               }
@@ -2938,9 +2942,9 @@ public class BlurTuple {
         oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
-          for (Tuple _iter7 : this.success)
+          for (Tuple _iter12 : this.success)
           {
-            _iter7.write(oprot);
+            _iter12.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -3707,14 +3711,14 @@ public class BlurTuple {
           case 0: // SUCCESS
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
-                this.success = new ArrayList<Tuple>(_list8.size);
-                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
+                org.apache.thrift.protocol.TList _list13 = iprot.readListBegin();
+                this.success = new ArrayList<Tuple>(_list13.size);
+                for (int _i14 = 0; _i14 < _list13.size; ++_i14)
                 {
-                  Tuple _elem10; // required
-                  _elem10 = new Tuple();
-                  _elem10.read(iprot);
-                  this.success.add(_elem10);
+                  Tuple _elem15; // required
+                  _elem15 = new Tuple();
+                  _elem15.read(iprot);
+                  this.success.add(_elem15);
                 }
                 iprot.readListEnd();
               }
@@ -3748,9 +3752,9 @@ public class BlurTuple {
         oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
-          for (Tuple _iter11 : this.success)
+          for (Tuple _iter16 : this.success)
           {
-            _iter11.write(oprot);
+            _iter16.write(oprot);
           }
           oprot.writeListEnd();
         }
@@ -4408,11 +4412,13 @@ public class BlurTuple {
   public static class openWriteSession_args implements org.apache.thrift.TBase<openWriteSession_args, openWriteSession_args._Fields>, java.io.Serializable, Cloneable   {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("openWriteSession_args");
 
+    private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1);
 
+    public String table; // 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 {
-;
+      TABLE((short)1, "table");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4427,6 +4433,8 @@ public class BlurTuple {
        */
       public static _Fields findByThriftId(int fieldId) {
         switch(fieldId) {
+          case 1: // TABLE
+            return TABLE;
           default:
             return null;
         }
@@ -4465,9 +4473,14 @@ public class BlurTuple {
         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.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", 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(openWriteSession_args.class, metaDataMap);
     }
@@ -4475,10 +4488,20 @@ public class BlurTuple {
     public openWriteSession_args() {
     }
 
+    public openWriteSession_args(
+      String table)
+    {
+      this();
+      this.table = table;
+    }
+
     /**
      * Performs a deep copy on <i>other</i>.
      */
     public openWriteSession_args(openWriteSession_args other) {
+      if (other.isSetTable()) {
+        this.table = other.table;
+      }
     }
 
     public openWriteSession_args deepCopy() {
@@ -4487,15 +4510,51 @@ public class BlurTuple {
 
     @Override
     public void clear() {
+      this.table = null;
+    }
+
+    public String getTable() {
+      return this.table;
+    }
+
+    public openWriteSession_args setTable(String table) {
+      this.table = table;
+      return this;
+    }
+
+    public void unsetTable() {
+      this.table = null;
+    }
+
+    /** Returns true if field table is set (has been assigned a value) and false otherwise */
+    public boolean isSetTable() {
+      return this.table != null;
+    }
+
+    public void setTableIsSet(boolean value) {
+      if (!value) {
+        this.table = null;
+      }
     }
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
+      case TABLE:
+        if (value == null) {
+          unsetTable();
+        } else {
+          setTable((String)value);
+        }
+        break;
+
       }
     }
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
+      case TABLE:
+        return getTable();
+
       }
       throw new IllegalStateException();
     }
@@ -4507,6 +4566,8 @@ public class BlurTuple {
       }
 
       switch (field) {
+      case TABLE:
+        return isSetTable();
       }
       throw new IllegalStateException();
     }
@@ -4524,6 +4585,15 @@ public class BlurTuple {
       if (that == null)
         return false;
 
+      boolean this_present_table = true && this.isSetTable();
+      boolean that_present_table = true && that.isSetTable();
+      if (this_present_table || that_present_table) {
+        if (!(this_present_table && that_present_table))
+          return false;
+        if (!this.table.equals(that.table))
+          return false;
+      }
+
       return true;
     }
 
@@ -4540,6 +4610,16 @@ public class BlurTuple {
       int lastComparison = 0;
       openWriteSession_args typedOther = (openWriteSession_args)other;
 
+      lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetTable()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -4557,6 +4637,13 @@ public class BlurTuple {
           break;
         }
         switch (field.id) {
+          case 1: // TABLE
+            if (field.type == org.apache.thrift.protocol.TType.STRING) {
+              this.table = iprot.readString();
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
@@ -4572,6 +4659,11 @@ public class BlurTuple {
       validate();
 
       oprot.writeStructBegin(STRUCT_DESC);
+      if (this.table != null) {
+        oprot.writeFieldBegin(TABLE_FIELD_DESC);
+        oprot.writeString(this.table);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -4581,6 +4673,13 @@ public class BlurTuple {
       StringBuilder sb = new StringBuilder("openWriteSession_args(");
       boolean first = true;
 
+      sb.append("table:");
+      if (this.table == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.table);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -5321,14 +5420,14 @@ public class BlurTuple {
           case 2: // TUPLES
             if (field.type == org.apache.thrift.protocol.TType.LIST) {
               {
-                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
-                this.tuples = new ArrayList<Tuple>(_list12.size);
-                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
+                org.apache.thrift.protocol.TList _list17 = iprot.readListBegin();
+                this.tuples = new ArrayList<Tuple>(_list17.size);
+                for (int _i18 = 0; _i18 < _list17.size; ++_i18)
                 {
-                  Tuple _elem14; // required
-                  _elem14 = new Tuple();
-                  _elem14.read(iprot);
-                  this.tuples.add(_elem14);
+                  Tuple _elem19; // required
+                  _elem19 = new Tuple();
+                  _elem19.read(iprot);
+                  this.tuples.add(_elem19);
                 }
                 iprot.readListEnd();
               }
@@ -5360,9 +5459,9 @@ public class BlurTuple {
         oprot.writeFieldBegin(TUPLES_FIELD_DESC);
         {
           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.tuples.size()));
-          for (Tuple _iter15 : this.tuples)
+          for (Tuple _iter20 : this.tuples)
           {
-            _iter15.write(oprot);
+            _iter20.write(oprot);
           }
           oprot.writeListEnd();
         }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/2b89bce8/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Session.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Session.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Session.java
index cb0a4dc..a2fd950 100644
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Session.java
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/thrift/generated/Session.java
@@ -24,12 +24,15 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Session");
 
   private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1);
+  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)2);
 
   public String sessionId; // required
+  public Map<String,String> properties; // 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 {
-    SESSION_ID((short)1, "sessionId");
+    SESSION_ID((short)1, "sessionId"),
+    PROPERTIES((short)2, "properties");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -46,6 +49,8 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
       switch(fieldId) {
         case 1: // SESSION_ID
           return SESSION_ID;
+        case 2: // PROPERTIES
+          return PROPERTIES;
         default:
           return null;
       }
@@ -92,6 +97,10 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
     tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", 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), 
+            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Session.class, metaDataMap);
   }
@@ -100,10 +109,12 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
   }
 
   public Session(
-    String sessionId)
+    String sessionId,
+    Map<String,String> properties)
   {
     this();
     this.sessionId = sessionId;
+    this.properties = properties;
   }
 
   /**
@@ -113,6 +124,21 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
     if (other.isSetSessionId()) {
       this.sessionId = other.sessionId;
     }
+    if (other.isSetProperties()) {
+      Map<String,String> __this__properties = new HashMap<String,String>();
+      for (Map.Entry<String, String> other_element : other.properties.entrySet()) {
+
+        String other_element_key = other_element.getKey();
+        String other_element_value = other_element.getValue();
+
+        String __this__properties_copy_key = other_element_key;
+
+        String __this__properties_copy_value = other_element_value;
+
+        __this__properties.put(__this__properties_copy_key, __this__properties_copy_value);
+      }
+      this.properties = __this__properties;
+    }
   }
 
   public Session deepCopy() {
@@ -122,6 +148,7 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
   @Override
   public void clear() {
     this.sessionId = null;
+    this.properties = null;
   }
 
   public String getSessionId() {
@@ -148,6 +175,41 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
     }
   }
 
+  public int getPropertiesSize() {
+    return (this.properties == null) ? 0 : this.properties.size();
+  }
+
+  public void putToProperties(String key, String val) {
+    if (this.properties == null) {
+      this.properties = new HashMap<String,String>();
+    }
+    this.properties.put(key, val);
+  }
+
+  public Map<String,String> getProperties() {
+    return this.properties;
+  }
+
+  public Session setProperties(Map<String,String> properties) {
+    this.properties = properties;
+    return this;
+  }
+
+  public void unsetProperties() {
+    this.properties = null;
+  }
+
+  /** Returns true if field properties is set (has been assigned a value) and false otherwise */
+  public boolean isSetProperties() {
+    return this.properties != null;
+  }
+
+  public void setPropertiesIsSet(boolean value) {
+    if (!value) {
+      this.properties = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case SESSION_ID:
@@ -158,6 +220,14 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
       }
       break;
 
+    case PROPERTIES:
+      if (value == null) {
+        unsetProperties();
+      } else {
+        setProperties((Map<String,String>)value);
+      }
+      break;
+
     }
   }
 
@@ -166,6 +236,9 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
     case SESSION_ID:
       return getSessionId();
 
+    case PROPERTIES:
+      return getProperties();
+
     }
     throw new IllegalStateException();
   }
@@ -179,6 +252,8 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
     switch (field) {
     case SESSION_ID:
       return isSetSessionId();
+    case PROPERTIES:
+      return isSetProperties();
     }
     throw new IllegalStateException();
   }
@@ -205,6 +280,15 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
         return false;
     }
 
+    boolean this_present_properties = true && this.isSetProperties();
+    boolean that_present_properties = true && that.isSetProperties();
+    if (this_present_properties || that_present_properties) {
+      if (!(this_present_properties && that_present_properties))
+        return false;
+      if (!this.properties.equals(that.properties))
+        return false;
+    }
+
     return true;
   }
 
@@ -231,6 +315,16 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetProperties()).compareTo(typedOther.isSetProperties());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetProperties()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, typedOther.properties);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -255,6 +349,25 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
           }
           break;
+        case 2: // PROPERTIES
+          if (field.type == org.apache.thrift.protocol.TType.MAP) {
+            {
+              org.apache.thrift.protocol.TMap _map4 = iprot.readMapBegin();
+              this.properties = new HashMap<String,String>(2*_map4.size);
+              for (int _i5 = 0; _i5 < _map4.size; ++_i5)
+              {
+                String _key6; // required
+                String _val7; // required
+                _key6 = iprot.readString();
+                _val7 = iprot.readString();
+                this.properties.put(_key6, _val7);
+              }
+              iprot.readMapEnd();
+            }
+          } else { 
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
+          }
+          break;
         default:
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
       }
@@ -275,6 +388,19 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
       oprot.writeString(this.sessionId);
       oprot.writeFieldEnd();
     }
+    if (this.properties != null) {
+      oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
+      {
+        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, this.properties.size()));
+        for (Map.Entry<String, String> _iter8 : this.properties.entrySet())
+        {
+          oprot.writeString(_iter8.getKey());
+          oprot.writeString(_iter8.getValue());
+        }
+        oprot.writeMapEnd();
+      }
+      oprot.writeFieldEnd();
+    }
     oprot.writeFieldStop();
     oprot.writeStructEnd();
   }
@@ -291,6 +417,14 @@ public class Session implements org.apache.thrift.TBase<Session, Session._Fields
       sb.append(this.sessionId);
     }
     first = false;
+    if (!first) sb.append(", ");
+    sb.append("properties:");
+    if (this.properties == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.properties);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }


Mime
View raw message