incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Adding a special thread safe client that internally will lock and throw an exception if more than one thread accesses the client. The stack trace of the owning thread and the accessing thread are in the runtime exception that is thrown
Date Wed, 18 Dec 2013 03:33:45 GMT
Adding a special thread safe client that internally will lock and throw an exception if more than one thread accesses the client.  The stack trace of the owning thread and the accessing thread are in the runtime exception that is thrown.  Also added a noop method ping to the API to test connections to the servers.


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

Branch: refs/heads/apache-blur-0.2
Commit: 33f083166af2df02558fc238ad7f537ad475f890
Parents: 89a5f69
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Dec 17 22:31:58 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Dec 17 22:31:58 2013 -0500

----------------------------------------------------------------------
 .../apache/blur/server/FilteredBlurServer.java  |   5 +
 .../java/org/apache/blur/thrift/TableAdmin.java |   5 +
 .../java/org/apache/blur/thrift/ClientLock.java |  54 ++
 .../java/org/apache/blur/thrift/ClientPool.java |   3 +-
 .../org/apache/blur/thrift/generated/Blur.java  | 568 ++++++++++++
 .../blur/thrift/generated/SafeClientGen.java    | 890 +++++++++++++++++++
 .../blur/thrift/util/GenerateSafeClient.java    | 137 +++
 .../src/main/scripts/interface/Blur.thrift      |   4 +
 .../main/scripts/interface/gen-html/Blur.html   |   6 +-
 .../main/scripts/interface/gen-html/index.html  |   1 +
 .../org/apache/blur/thrift/generated/Blur.java  | 568 ++++++++++++
 .../src/main/scripts/interface/gen-js/Blur.js   |  86 ++
 .../scripts/interface/gen-perl/Blur/Blur.pm     | 154 ++++
 .../src/main/scripts/interface/gen-rb/blur.rb   |  51 ++
 .../src/main/scripts/interface/genAndReplace.sh |   3 +
 docs/Blur.html                                  |   6 +-
 16 files changed, 2538 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java b/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java
index fcfe129..67d0ad3 100644
--- a/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java
+++ b/blur-core/src/main/java/org/apache/blur/server/FilteredBlurServer.java
@@ -218,4 +218,9 @@ public class FilteredBlurServer implements Iface {
     _iface.traceRemove(traceId);
   }
 
+  @Override
+  public void ping() throws TException {
+    _iface.ping();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java b/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
index f5ffcc8..b44259c 100644
--- a/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
+++ b/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
@@ -569,4 +569,9 @@ public abstract class TableAdmin implements Iface {
   private TableContext getTableContext(final String table) {
     return TableContext.create(_clusterStatus.getTableDescriptor(true, _clusterStatus.getCluster(true, table), table));
   }
+
+  @Override
+  public void ping() throws TException {
+
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-thrift/src/main/java/org/apache/blur/thrift/ClientLock.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/ClientLock.java b/blur-thrift/src/main/java/org/apache/blur/thrift/ClientLock.java
new file mode 100644
index 0000000..9e62ebb
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/ClientLock.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.thrift;
+
+import java.util.Map;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class ClientLock extends ReentrantLock {
+
+  private static final long serialVersionUID = -3246136431587733012L;
+  
+  private final String _desc;
+
+  public ClientLock(String desc) {
+    _desc = desc;
+  }
+  
+  public void errorFailLock() {
+    if (tryLock()) {
+      return;
+    }
+    Thread thread = getOwner();
+    throw new RuntimeException("Thread [" + thread + "] owns this " + _desc + "."
+        + "Including the current stacktrace of the owner (ENDING with <<<<<<):\n\n" + getStackTrace(thread)
+        + "\n<<<<<<\n");
+  }
+
+  private String getStackTrace(Thread thread) {
+    Map<Thread, StackTraceElement[]> allStackTraces = Thread.getAllStackTraces();
+    StackTraceElement[] stackTraceElements = allStackTraces.get(thread);
+    if (stackTraceElements != null) {
+      StringBuilder builder = new StringBuilder();
+      for (StackTraceElement stackTraceElement : stackTraceElements) {
+        builder.append("\tOwner at ").append(stackTraceElement.toString()).append("\n");
+      }
+      return builder.toString();
+    }
+    return "Unknown";
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-thrift/src/main/java/org/apache/blur/thrift/ClientPool.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/ClientPool.java b/blur-thrift/src/main/java/org/apache/blur/thrift/ClientPool.java
index d1f959a..9407ee5 100644
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/ClientPool.java
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/ClientPool.java
@@ -45,6 +45,7 @@ import org.apache.blur.thirdparty.thrift_0_9_0.transport.TFramedTransport;
 import org.apache.blur.thirdparty.thrift_0_9_0.transport.TSocket;
 import org.apache.blur.thirdparty.thrift_0_9_0.transport.TTransportException;
 import org.apache.blur.thrift.generated.Blur.Client;
+import org.apache.blur.thrift.generated.SafeClientGen;
 
 public class ClientPool {
 
@@ -130,7 +131,7 @@ public class ClientPool {
     }
   }
 
-  private class WeightedClient extends Client {
+  private class WeightedClient extends SafeClientGen {
     private long _enqueueTime;
 
     public WeightedClient(TProtocol prot) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
index b67737a..99357fd 100644
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Blur.java
@@ -406,6 +406,11 @@ public class Blur {
      */
     public void traceRemove(String traceId) throws BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException;
 
+    /**
+     * A way to ping a server to make sure the connection is still valid.
+     */
+    public void ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException;
+
   }
 
   public interface AsyncIface {
@@ -488,6 +493,8 @@ public class Blur {
 
     public void traceRemove(String traceId, org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.traceRemove_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException;
 
+    public void ping(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<AsyncClient.ping_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException;
+
   }
 
   public static class Client extends org.apache.blur.thirdparty.thrift_0_9_0.TServiceClient implements Iface {
@@ -1478,6 +1485,25 @@ public class Blur {
       return;
     }
 
+    public void ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException
+    {
+      send_ping();
+      recv_ping();
+    }
+
+    public void send_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException
+    {
+      ping_args args = new ping_args();
+      sendBase("ping", args);
+    }
+
+    public void recv_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException
+    {
+      ping_result result = new ping_result();
+      receiveBase(result, "ping");
+      return;
+    }
+
   }
   public static class AsyncClient extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClient implements AsyncIface {
     public static class Factory implements org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClientFactory<AsyncClient> {
@@ -2787,6 +2813,35 @@ public class Blur {
       }
     }
 
+    public void ping(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<ping_call> resultHandler) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      checkReady();
+      ping_call method_call = new ping_call(resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class ping_call extends org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall {
+      public ping_call(org.apache.blur.thirdparty.thrift_0_9_0.async.AsyncMethodCallback<ping_call> resultHandler, org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncClient client, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolFactory protocolFactory, org.apache.blur.thirdparty.thrift_0_9_0.transport.TNonblockingTransport transport) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+      }
+
+      public void write_args(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        prot.writeMessageBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessage("ping", org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMessageType.CALL, 0));
+        ping_args args = new ping_args();
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public void getResult() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        if (getState() != org.apache.blur.thirdparty.thrift_0_9_0.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport memoryTransport = new org.apache.blur.thirdparty.thrift_0_9_0.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        (new Client(prot)).recv_ping();
+      }
+    }
+
   }
 
   public static class Processor<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.TBaseProcessor<I> implements org.apache.blur.thirdparty.thrift_0_9_0.TProcessor {
@@ -2839,6 +2894,7 @@ public class Blur {
       processMap.put("traceRequestList", new traceRequestList());
       processMap.put("traceRequestFetch", new traceRequestFetch());
       processMap.put("traceRemove", new traceRemove());
+      processMap.put("ping", new ping());
       return processMap;
     }
 
@@ -3771,6 +3827,26 @@ public class Blur {
       }
     }
 
+    public static class ping<I extends Iface> extends org.apache.blur.thirdparty.thrift_0_9_0.ProcessFunction<I, ping_args> {
+      public ping() {
+        super("ping");
+      }
+
+      public ping_args getEmptyArgsInstance() {
+        return new ping_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public ping_result getResult(I iface, ping_args args) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        ping_result result = new ping_result();
+        iface.ping();
+        return result;
+      }
+    }
+
   }
 
   public static class createTable_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<createTable_args, createTable_args._Fields>, java.io.Serializable, Cloneable   {
@@ -36544,4 +36620,496 @@ public class Blur {
 
   }
 
+  public static class ping_args implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ping_args, ping_args._Fields>, java.io.Serializable, Cloneable   {
+    private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("ping_args");
+
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new ping_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new ping_argsTupleSchemeFactory());
+    }
+
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum {
+;
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap);
+    }
+
+    public ping_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public ping_args(ping_args other) {
+    }
+
+    public ping_args deepCopy() {
+      return new ping_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof ping_args)
+        return this.equals((ping_args)that);
+      return false;
+    }
+
+    public boolean equals(ping_args that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    public int compareTo(ping_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+      ping_args typedOther = (ping_args)other;
+
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+    }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("ping_args(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out)));
+      } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in)));
+      } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class ping_argsStandardSchemeFactory implements SchemeFactory {
+      public ping_argsStandardScheme getScheme() {
+        return new ping_argsStandardScheme();
+      }
+    }
+
+    private static class ping_argsStandardScheme extends StandardScheme<ping_args> {
+
+      public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class ping_argsTupleSchemeFactory implements SchemeFactory {
+      public ping_argsTupleScheme getScheme() {
+        return new ping_argsTupleScheme();
+      }
+    }
+
+    private static class ping_argsTupleScheme extends TupleScheme<ping_args> {
+
+      @Override
+      public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_args struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
+  public static class ping_result implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<ping_result, ping_result._Fields>, java.io.Serializable, Cloneable   {
+    private static final org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct STRUCT_DESC = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TStruct("ping_result");
+
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new ping_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new ping_resultTupleSchemeFactory());
+    }
+
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    public enum _Fields implements org.apache.blur.thirdparty.thrift_0_9_0.TFieldIdEnum {
+;
+
+      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+      static {
+        for (_Fields field : EnumSet.allOf(_Fields.class)) {
+          byName.put(field.getFieldName(), field);
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, or null if its not found.
+       */
+      public static _Fields findByThriftId(int fieldId) {
+        switch(fieldId) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.blur.thirdparty.thrift_0_9_0.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap);
+    }
+
+    public ping_result() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public ping_result(ping_result other) {
+    }
+
+    public ping_result deepCopy() {
+      return new ping_result(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+    public boolean isSet(_Fields field) {
+      if (field == null) {
+        throw new IllegalArgumentException();
+      }
+
+      switch (field) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof ping_result)
+        return this.equals((ping_result)that);
+      return false;
+    }
+
+    public boolean equals(ping_result that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    public int compareTo(ping_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+      ping_result typedOther = (ping_result)other;
+
+      return 0;
+    }
+
+    public _Fields fieldForId(int fieldId) {
+      return _Fields.findByThriftId(fieldId);
+    }
+
+    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+    }
+
+    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+      }
+
+    @Override
+    public String toString() {
+      StringBuilder sb = new StringBuilder("ping_result(");
+      boolean first = true;
+
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+      // check for required fields
+      // check for sub-struct validity
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(out)));
+      } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TCompactProtocol(new org.apache.blur.thirdparty.thrift_0_9_0.transport.TIOStreamTransport(in)));
+      } catch (org.apache.blur.thirdparty.thrift_0_9_0.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class ping_resultStandardSchemeFactory implements SchemeFactory {
+      public ping_resultStandardScheme getScheme() {
+        return new ping_resultStandardScheme();
+      }
+    }
+
+    private static class ping_resultStandardScheme extends StandardScheme<ping_result> {
+
+      public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        org.apache.blur.thirdparty.thrift_0_9_0.protocol.TField schemeField;
+        iprot.readStructBegin();
+        while (true)
+        {
+          schemeField = iprot.readFieldBegin();
+          if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STOP) { 
+            break;
+          }
+          switch (schemeField.id) {
+            default:
+              org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+          }
+          iprot.readFieldEnd();
+        }
+        iprot.readStructEnd();
+
+        // check for required fields of primitive type, which can't be checked in the validate method
+        struct.validate();
+      }
+
+      public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class ping_resultTupleSchemeFactory implements SchemeFactory {
+      public ping_resultTupleScheme getScheme() {
+        return new ping_resultTupleScheme();
+      }
+    }
+
+    private static class ping_resultTupleScheme extends TupleScheme<ping_result> {
+
+      @Override
+      public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, ping_result struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java
new file mode 100644
index 0000000..5392531
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/SafeClientGen.java
@@ -0,0 +1,890 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+import org.apache.blur.thirdparty.thrift_0_9_0.scheme.IScheme;
+import org.apache.blur.thirdparty.thrift_0_9_0.scheme.SchemeFactory;
+import org.apache.blur.thirdparty.thrift_0_9_0.scheme.StandardScheme;
+
+import org.apache.blur.thirdparty.thrift_0_9_0.scheme.TupleScheme;
+import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TTupleProtocol;
+import org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocolException;
+import org.apache.blur.thirdparty.thrift_0_9_0.EncodingUtils;
+import org.apache.blur.thirdparty.thrift_0_9_0.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+
+public class SafeClientGen extends org.apache.blur.thrift.generated.Blur.Client {
+
+private final org.apache.blur.thrift.ClientLock _lock = new org.apache.blur.thrift.ClientLock("client");
+
+public SafeClientGen(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) {
+super(iprot, oprot);
+}
+
+public SafeClientGen(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot) {
+super(prot);
+}
+
+@Override
+public void optimize(java.lang.String arg0, int arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.optimize(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.BlurResults query(java.lang.String arg0, org.apache.blur.thrift.generated.BlurQuery arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.query(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void createTable(org.apache.blur.thrift.generated.TableDescriptor arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.createTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_createTable(org.apache.blur.thrift.generated.TableDescriptor arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_createTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_createTable() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_createTable();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void enableTable(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.enableTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_enableTable(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_enableTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_enableTable() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_enableTable();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void disableTable(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.disableTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_disableTable(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_disableTable(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_disableTable() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_disableTable();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void removeTable(java.lang.String arg0, boolean arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.removeTable(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_removeTable(java.lang.String arg0, boolean arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_removeTable(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_removeTable() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_removeTable();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public boolean addColumnDefinition(java.lang.String arg0, org.apache.blur.thrift.generated.ColumnDefinition arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.addColumnDefinition(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_addColumnDefinition(java.lang.String arg0, org.apache.blur.thrift.generated.ColumnDefinition arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_addColumnDefinition(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public boolean recv_addColumnDefinition() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_addColumnDefinition();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List tableList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.tableList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_tableList() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_tableList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_tableList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_tableList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List tableListByCluster(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.tableListByCluster(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_tableListByCluster(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_tableListByCluster(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_tableListByCluster() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_tableListByCluster();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.TableDescriptor describe(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.describe(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_describe(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_describe(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.TableDescriptor recv_describe() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_describe();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.Schema schema(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.schema(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_schema(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_schema(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.Schema recv_schema() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_schema();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.lang.String parseQuery(java.lang.String arg0, org.apache.blur.thrift.generated.Query arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.parseQuery(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_parseQuery(java.lang.String arg0, org.apache.blur.thrift.generated.Query arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_parseQuery(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.lang.String recv_parseQuery() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_parseQuery();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.TableStats tableStats(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.tableStats(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_tableStats(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_tableStats(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.TableStats recv_tableStats() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_tableStats();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_optimize(java.lang.String arg0, int arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_optimize(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_optimize() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_optimize();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void createSnapshot(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.createSnapshot(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_createSnapshot(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_createSnapshot(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_createSnapshot() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_createSnapshot();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void removeSnapshot(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.removeSnapshot(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_removeSnapshot(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_removeSnapshot(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_removeSnapshot() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_removeSnapshot();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map listSnapshots(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.listSnapshots(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_listSnapshots(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_listSnapshots(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map recv_listSnapshots() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_listSnapshots();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void setUser(org.apache.blur.thrift.generated.User arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.setUser(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_setUser(org.apache.blur.thrift.generated.User arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_setUser(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_query(java.lang.String arg0, org.apache.blur.thrift.generated.BlurQuery arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_query(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.BlurResults recv_query() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_query();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.FetchResult fetchRow(java.lang.String arg0, org.apache.blur.thrift.generated.Selector arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.fetchRow(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_fetchRow(java.lang.String arg0, org.apache.blur.thrift.generated.Selector arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_fetchRow(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.FetchResult recv_fetchRow() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_fetchRow();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List fetchRowBatch(java.lang.String arg0, java.util.List arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.fetchRowBatch(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_fetchRowBatch(java.lang.String arg0, java.util.List arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_fetchRowBatch(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_fetchRowBatch() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_fetchRowBatch();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void mutate(org.apache.blur.thrift.generated.RowMutation arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.mutate(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_mutate(org.apache.blur.thrift.generated.RowMutation arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_mutate(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_mutate() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_mutate();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void mutateBatch(java.util.List arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.mutateBatch(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_mutateBatch(java.util.List arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_mutateBatch(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_mutateBatch() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_mutateBatch();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void cancelQuery(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.cancelQuery(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_cancelQuery(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_cancelQuery(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_cancelQuery() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_cancelQuery();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List queryStatusIdList(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.queryStatusIdList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_queryStatusIdList(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_queryStatusIdList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_queryStatusIdList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_queryStatusIdList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.BlurQueryStatus queryStatusById(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.queryStatusById(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_queryStatusById(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_queryStatusById(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public org.apache.blur.thrift.generated.BlurQueryStatus recv_queryStatusById() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_queryStatusById();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List terms(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, short arg4) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.terms(arg0, arg1, arg2, arg3, arg4);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_terms(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, short arg4) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_terms(arg0, arg1, arg2, arg3, arg4);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_terms() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_terms();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public long recordFrequency(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recordFrequency(arg0, arg1, arg2, arg3);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_recordFrequency(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_recordFrequency(arg0, arg1, arg2, arg3);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public long recv_recordFrequency() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_recordFrequency();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List shardClusterList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.shardClusterList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_shardClusterList() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_shardClusterList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_shardClusterList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_shardClusterList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List shardServerList(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.shardServerList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_shardServerList(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_shardServerList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_shardServerList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_shardServerList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List controllerServerList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.controllerServerList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_controllerServerList() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_controllerServerList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_controllerServerList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_controllerServerList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map shardServerLayout(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.shardServerLayout(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_shardServerLayout(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_shardServerLayout(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map recv_shardServerLayout() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_shardServerLayout();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map shardServerLayoutState(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.shardServerLayoutState(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_shardServerLayoutState(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_shardServerLayoutState(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map recv_shardServerLayoutState() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_shardServerLayoutState();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public boolean isInSafeMode(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.isInSafeMode(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_isInSafeMode(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_isInSafeMode(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public boolean recv_isInSafeMode() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_isInSafeMode();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_configuration() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_configuration();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map recv_configuration() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_configuration();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map metrics(java.util.Set arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.metrics(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_metrics(java.util.Set arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_metrics(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map recv_metrics() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_metrics();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void startTrace(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.startTrace(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_startTrace(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_startTrace(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List traceList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.traceList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_traceList() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_traceList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_traceList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_traceList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List traceRequestList(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.traceRequestList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_traceRequestList(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_traceRequestList(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.List recv_traceRequestList() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_traceRequestList();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.lang.String traceRequestFetch(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.traceRequestFetch(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_traceRequestFetch(java.lang.String arg0, java.lang.String arg1) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_traceRequestFetch(arg0, arg1);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.lang.String recv_traceRequestFetch() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.recv_traceRequestFetch();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void traceRemove(java.lang.String arg0) throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.traceRemove(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_traceRemove(java.lang.String arg0) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_traceRemove(arg0);
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_traceRemove() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_traceRemove();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.ping();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void send_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.send_ping();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public void recv_ping() throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    super.recv_ping();
+  } finally {_lock.unlock();}
+}
+
+@Override
+public java.util.Map configuration() throws org.apache.blur.thrift.generated.BlurException, org.apache.blur.thirdparty.thrift_0_9_0.TException {
+  _lock.errorFailLock(); try {
+    return super.configuration();
+  } finally {_lock.unlock();}
+}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/blur-thrift/src/main/java/org/apache/blur/thrift/util/GenerateSafeClient.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/util/GenerateSafeClient.java b/blur-thrift/src/main/java/org/apache/blur/thrift/util/GenerateSafeClient.java
new file mode 100644
index 0000000..5d0c0a2
--- /dev/null
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/util/GenerateSafeClient.java
@@ -0,0 +1,137 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.blur.thrift.util;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+
+import org.apache.blur.thrift.ClientLock;
+import org.apache.blur.thrift.generated.Blur;
+import org.apache.blur.thrift.generated.Blur.Client;
+
+public class GenerateSafeClient {
+
+  private static final String PUBLIC_CLASS_BLUR = "public class Blur {";
+
+  public static void main(String[] args) throws IOException {
+    File file = new File("./src/main/java/" + toPath(Blur.Client.class)).getAbsoluteFile();
+    File output = new File(file.getParentFile(), "SafeClientGen.java");
+    if (output.exists() && !output.delete()) {
+      throw new IOException("Cannot delete [" + output + "]");
+    }
+    System.out.println("Writing new safe client to [" + output + "]");
+    PrintWriter writer = new PrintWriter(output);
+    BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+    String line;
+    while ((line = reader.readLine()) != null) {
+      if (line.trim().equals(PUBLIC_CLASS_BLUR)) {
+        break;
+      }
+      writer.println(line);
+    }
+    reader.close();
+
+    writer.println("public class SafeClientGen extends org.apache.blur.thrift.generated.Blur.Client {");
+    writer.println();
+    writer.println("private final " + ClientLock.class.getName() + " _lock = new " + ClientLock.class.getName()
+        + "(\"client\");");
+    writer.println();
+    writer
+        .println("public SafeClientGen(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol iprot, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol oprot) {");
+    writer.println("super(iprot, oprot);");
+    writer.println("}");
+    writer.println();
+    writer.println("public SafeClientGen(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot) {");
+    writer.println("super(prot);");
+    writer.println("}");
+    writer.println();
+
+    Method[] methods = Blur.Client.class.getDeclaredMethods();
+    for (Method method : methods) {
+      Class<?>[] exceptionTypes = method.getExceptionTypes();
+      Class<?>[] parameterTypes = method.getParameterTypes();
+      Class<?> returnType = method.getReturnType();
+
+      String returnTypeStr = getReturnType(returnType);
+      writer.println("@Override");
+      writer.println("public " + returnTypeStr + " " + method.getName() + "(" + getParams(parameterTypes) + ") throws "
+          + getExceptions(exceptionTypes) + " {");
+      writer.println("  _lock.errorFailLock(); try {");
+      if (returnTypeStr.equals("void")) {
+        writer.println("    super." + method.getName() + "(" + getArgs(parameterTypes) + ");");
+      } else {
+        writer.println("    return super." + method.getName() + "(" + getArgs(parameterTypes) + ");");
+      }
+      writer.println("  } finally {_lock.unlock();}");
+      writer.println("}");
+      writer.println();
+    }
+    writer.println("}");
+    writer.close();
+  }
+
+  private static String getArgs(Class<?>[] parameterTypes) {
+    StringBuilder builder = new StringBuilder();
+    for (int i = 0; i < parameterTypes.length; i++) {
+      if (builder.length() != 0) {
+        builder.append(", ");
+      }
+      builder.append("arg" + i);
+    }
+    return builder.toString();
+  }
+
+  private static String getReturnType(Class<?> returnType) {
+    return returnType.getName();
+  }
+
+  private static String getParams(Class<?>[] parameterTypes) {
+    StringBuilder builder = new StringBuilder();
+    int i = 0;
+    for (Class<?> p : parameterTypes) {
+      if (builder.length() != 0) {
+        builder.append(", ");
+      }
+      builder.append(p.getName() + " arg" + i);
+      i++;
+    }
+    return builder.toString();
+  }
+
+  private static String getExceptions(Class<?>[] exceptionTypes) {
+    StringBuilder builder = new StringBuilder();
+    for (Class<?> e : exceptionTypes) {
+      if (builder.length() != 0) {
+        builder.append(", ");
+      }
+      builder.append(e.getName());
+    }
+    return builder.toString();
+  }
+
+  private static String toPath(Class<Client> clazz) {
+    String name = clazz.getName();
+    int index = name.indexOf("$");
+    return name.substring(0, index).replace(".", "/") + ".java";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/distribution/src/main/scripts/interface/Blur.thrift
----------------------------------------------------------------------
diff --git a/distribution/src/main/scripts/interface/Blur.thrift b/distribution/src/main/scripts/interface/Blur.thrift
index 2dce3e0..0378788 100644
--- a/distribution/src/main/scripts/interface/Blur.thrift
+++ b/distribution/src/main/scripts/interface/Blur.thrift
@@ -1128,6 +1128,10 @@ service Blur {
     1:string traceId
   ) throws (1:BlurException ex)
 
+  /** 
+   * A way to ping a server to make sure the connection is still valid.
+   */
+  void ping()
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/distribution/src/main/scripts/interface/gen-html/Blur.html
----------------------------------------------------------------------
diff --git a/distribution/src/main/scripts/interface/gen-html/Blur.html b/distribution/src/main/scripts/interface/gen-html/Blur.html
index f5f3fee..9a951aa 100644
--- a/distribution/src/main/scripts/interface/gen-html/Blur.html
+++ b/distribution/src/main/scripts/interface/gen-html/Blur.html
@@ -29,6 +29,7 @@
 <li><a href="Blur.html#Fn_Blur_mutateBatch">mutateBatch</a></li>
 <li><a href="Blur.html#Fn_Blur_optimize">optimize</a></li>
 <li><a href="Blur.html#Fn_Blur_parseQuery">parseQuery</a></li>
+<li><a href="Blur.html#Fn_Blur_ping">ping</a></li>
 <li><a href="Blur.html#Fn_Blur_query">query</a></li>
 <li><a href="Blur.html#Fn_Blur_queryStatusById">queryStatusById</a></li>
 <li><a href="Blur.html#Fn_Blur_queryStatusIdList">queryStatusIdList</a></li>
@@ -875,4 +876,7 @@ the shard given the same situation.
 <br/><br/><h4 id="Parameters_Blur_traceRemove">Parameters</h4>
 <table class="table-bordered table-striped table-condensed"><thead><th>Name</th><th>Description</th></thead><tr><td>traceId</td><td>the trace id.
 </td></tr>
-</table></div></div></body></html>
+</table></div><div class="definition"><h4 id="Fn_Blur_ping">Function: Blur.ping</h4>
+<pre><code>void</code> ping()
+</pre>A way to ping a server to make sure the connection is still valid.
+<br/></div></div></body></html>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/33f08316/distribution/src/main/scripts/interface/gen-html/index.html
----------------------------------------------------------------------
diff --git a/distribution/src/main/scripts/interface/gen-html/index.html b/distribution/src/main/scripts/interface/gen-html/index.html
index 25b9b96..51dadde 100644
--- a/distribution/src/main/scripts/interface/gen-html/index.html
+++ b/distribution/src/main/scripts/interface/gen-html/index.html
@@ -25,6 +25,7 @@
 <li><a href="Blur.html#Fn_Blur_mutateBatch">mutateBatch</a></li>
 <li><a href="Blur.html#Fn_Blur_optimize">optimize</a></li>
 <li><a href="Blur.html#Fn_Blur_parseQuery">parseQuery</a></li>
+<li><a href="Blur.html#Fn_Blur_ping">ping</a></li>
 <li><a href="Blur.html#Fn_Blur_query">query</a></li>
 <li><a href="Blur.html#Fn_Blur_queryStatusById">queryStatusById</a></li>
 <li><a href="Blur.html#Fn_Blur_queryStatusIdList">queryStatusIdList</a></li>


Mime
View raw message