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: Updates to the thrift api to support shard or server responses in the Response object.
Date Mon, 01 Sep 2014 12:43:17 GMT
Updates to the thrift api to support shard or server responses in the Response object.


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

Branch: refs/heads/master
Commit: b434b067fbf89ce37cfde920209250ca2f954f8e
Parents: 122f30e
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Sep 1 08:43:16 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Sep 1 08:43:16 2014 -0400

----------------------------------------------------------------------
 .../blur/manager/command/ClusterContext.java    |   12 +
 .../blur/manager/command/CommandUtil.java       |   38 +-
 .../command/ControllerClusterContext.java       |   42 +-
 .../blur/manager/command/IndexContext.java      |    7 +-
 .../apache/blur/manager/command/Response.java   |    2 +-
 .../manager/command/ShardCommandManager.java    |   51 +-
 .../apache/blur/server/FilteredBlurServer.java  |   11 +
 .../blur/thrift/BlurControllerServer.java       |   14 +-
 .../org/apache/blur/thrift/BlurShardServer.java |   14 +-
 .../apache/blur/thrift/generated/Arguments.java |   48 +-
 .../org/apache/blur/thrift/generated/Blur.java  | 2346 ++++++++++++++----
 .../apache/blur/thrift/generated/Response.java  |  173 +-
 .../blur/thrift/generated/SafeClientGen.java    |  983 +++++++-
 .../apache/blur/thrift/generated/Server.java    |  405 +++
 .../org/apache/blur/thrift/generated/Shard.java |  405 +++
 .../blur/thrift/generated/TimeoutException.java |  409 +++
 .../apache/blur/thrift/util/CommandExample.java |   14 +-
 .../src/main/scripts/interface/Blur.thrift      |   41 +-
 .../main/scripts/interface/gen-html/Blur.html   |   36 +-
 .../main/scripts/interface/gen-html/index.html  |    5 +
 .../apache/blur/thrift/generated/Arguments.java |   48 +-
 .../org/apache/blur/thrift/generated/Blur.java  | 2346 ++++++++++++++----
 .../apache/blur/thrift/generated/Response.java  |  173 +-
 .../apache/blur/thrift/generated/Server.java    |  405 +++
 .../org/apache/blur/thrift/generated/Shard.java |  405 +++
 .../blur/thrift/generated/TimeoutException.java |  409 +++
 .../src/main/scripts/interface/gen-js/Blur.js   |  969 +++++---
 .../main/scripts/interface/gen-js/Blur_types.js |  269 +-
 .../scripts/interface/gen-perl/Blur/Blur.pm     |  849 +++++--
 .../scripts/interface/gen-perl/Blur/Types.pm    |  282 ++-
 .../src/main/scripts/interface/gen-rb/blur.rb   |  124 +-
 .../main/scripts/interface/gen-rb/blur_types.rb |   67 +-
 docs/Blur.html                                  |   36 +-
 33 files changed, 9724 insertions(+), 1714 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/ClusterContext.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ClusterContext.java b/blur-core/src/main/java/org/apache/blur/manager/command/ClusterContext.java
index 976e3f4..1c541e5 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/ClusterContext.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/ClusterContext.java
@@ -4,7 +4,9 @@ import java.io.IOException;
 import java.util.Map;
 import java.util.concurrent.Future;
 
+import org.apache.blur.BlurConfiguration;
 import org.apache.blur.server.TableContext;
+import org.apache.hadoop.conf.Configuration;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -29,12 +31,22 @@ public abstract class ClusterContext {
 
   public abstract TableContext getTableContext();
 
+  public abstract BlurConfiguration getBlurConfiguration();
+
+  public abstract Configuration getConfiguration();
+
   public abstract <T> Map<Shard, T> readIndexes(Args args, Class<? extends
IndexReadCommand<T>> clazz)
       throws IOException;
 
   public abstract <T> Map<Shard, Future<T>> readIndexesAsync(Args args,
Class<? extends IndexReadCommand<T>> clazz)
       throws IOException;
 
+  public abstract <T> T readIndex(Shard shard, Args args, Class<? extends IndexReadCommand<T>>
clazz)
+      throws IOException;
+
+  public abstract <T> Future<T> readIndexAsync(Shard shard, Args args, Class<?
extends IndexReadCommand<T>> clazz)
+      throws IOException;
+
   public abstract <T> Map<Server, T> readServers(Args args, Class<? extends
IndexReadCombiningCommand<?, T>> clazz)
       throws IOException;
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/CommandUtil.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/CommandUtil.java b/blur-core/src/main/java/org/apache/blur/manager/command/CommandUtil.java
index 23ee738..43ce656 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/CommandUtil.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/CommandUtil.java
@@ -29,21 +29,36 @@ import org.apache.blur.thrift.generated.Value;
 
 public class CommandUtil {
 
-  public static org.apache.blur.thrift.generated.Response convert(Response response) throws
BlurException {
+  public static org.apache.blur.thrift.generated.Response fromObjectToThrift(Response response)
throws BlurException {
     org.apache.blur.thrift.generated.Response converted = new org.apache.blur.thrift.generated.Response();
     if (response.isAggregatedResults()) {
       converted.setValue(toValue(response.getServerResult()));
     } else {
-      converted.setShardToValue(convert(response.getShardResults()));
+      Map<Server, Object> serverResults = response.getServerResults();
+      if (serverResults == null) {
+        Map<org.apache.blur.thrift.generated.Shard, Value> fromObjectToThrift = fromObjectToThrift(response
+            .getShardResults());
+        converted.setShardToValue(fromObjectToThrift);
+      } else {
+        Map<org.apache.blur.thrift.generated.Server, Value> fromObjectToThrift = fromObjectToThrift(serverResults);
+        converted.setServerToValue(fromObjectToThrift);
+      }
     }
     return converted;
   }
 
-  public static Map<String, Value> convert(Map<Shard, Object> map) throws BlurException
{
-    Map<String, Value> result = new HashMap<String, Value>();
-    for (Entry<Shard, Object> e : map.entrySet()) {
-      // @TODO need to make different setters for shard and server results
-      result.put(e.getKey().getShard(), toValue(e.getValue()));
+  @SuppressWarnings("unchecked")
+  public static <T, R> Map<R, Value> fromObjectToThrift(Map<T, Object>
map) throws BlurException {
+    Map<R, Value> result = new HashMap<R, Value>();
+    for (Entry<T, Object> e : map.entrySet()) {
+      T key = e.getKey();
+      if (key instanceof Shard) {
+        Shard shard = (Shard) key;
+        result.put((R) new org.apache.blur.thrift.generated.Shard(shard.getShard()), toValue(e.getValue()));
+      } else if (key instanceof Server) {
+        Server server = (Server) key;
+        result.put((R) new org.apache.blur.thrift.generated.Server(server.getServer()), toValue(e.getValue()));
+      }
     }
     return result;
   }
@@ -98,4 +113,13 @@ public class CommandUtil {
     }
     return arguments;
   }
+
+  @SuppressWarnings("unchecked")
+  public static <T> Map<Shard, T> fromThriftToObject(Map<org.apache.blur.thrift.generated.Shard,
Value> shardToValue) {
+    Map<Shard, T> result = new HashMap<Shard, T>();
+    for (Entry<org.apache.blur.thrift.generated.Shard, Value> e : shardToValue.entrySet())
{
+      result.put(new Shard(e.getKey().getShard()), (T) CommandUtil.toObject(e.getValue()));
+    }
+    return result;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/ControllerClusterContext.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ControllerClusterContext.java
b/blur-core/src/main/java/org/apache/blur/manager/command/ControllerClusterContext.java
index 63a706d..344475f 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/ControllerClusterContext.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/ControllerClusterContext.java
@@ -12,6 +12,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
+import org.apache.blur.BlurConfiguration;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.manager.command.cmds.BaseCommand;
@@ -24,6 +25,7 @@ import org.apache.blur.thrift.generated.Arguments;
 import org.apache.blur.thrift.generated.Blur.Client;
 import org.apache.blur.thrift.generated.Response;
 import org.apache.blur.thrift.generated.Value;
+import org.apache.hadoop.conf.Configuration;
 
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -127,16 +129,8 @@ public class ControllerClusterContext extends ClusterContext implements
Closeabl
         public Map<Shard, T> call() throws Exception {
           Arguments arguments = CommandUtil.toArguments(args);
           Response response = client.execute(getTable(), commandName, arguments);
-          Map<String, Value> shardToValue = response.getShardToValue();
-          return toShardResponse(shardToValue);
-        }
-
-        private Map<Shard, T> toShardResponse(Map<String, Value> values) {
-          Map<Shard, T> result = new HashMap<Shard, T>();
-          for (Entry<String, Value> e : values.entrySet()) {
-            result.put(new Shard(e.getKey()), (T) CommandUtil.toObject(e.getValue()));
-          }
-          return result;
+          Map<Shard, Object> shardToValue = CommandUtil.fromThriftToObject(response.getShardToValue());
+          return (Map<Shard, T>) shardToValue;
         }
       });
       Set<Shard> shards = getShardsOnServer(server);
@@ -216,4 +210,32 @@ public class ControllerClusterContext extends ClusterContext implements
Closeabl
     }
     return result;
   }
+
+  @Override
+  public BlurConfiguration getBlurConfiguration() {
+    return _tableContext.getBlurConfiguration();
+  }
+
+  @Override
+  public Configuration getConfiguration() {
+    return _tableContext.getConfiguration();
+  }
+
+  @Override
+  public <T> T readIndex(Shard shard, Args args, Class<? extends IndexReadCommand<T>>
clazz) throws IOException {
+    Future<T> future = readIndexAsync(shard, args, clazz);
+    try {
+      return future.get();
+    } catch (InterruptedException e) {
+      throw new IOException(e);
+    } catch (ExecutionException e) {
+      throw new IOException(e.getCause());
+    }
+  }
+
+  @Override
+  public <T> Future<T> readIndexAsync(Shard shard, Args args, Class<? extends
IndexReadCommand<T>> clazz)
+      throws IOException {
+    throw new RuntimeException("Not Implemented.");
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/IndexContext.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/IndexContext.java b/blur-core/src/main/java/org/apache/blur/manager/command/IndexContext.java
index a555e94..051a98e 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/IndexContext.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/IndexContext.java
@@ -1,6 +1,8 @@
 package org.apache.blur.manager.command;
 
+import org.apache.blur.BlurConfiguration;
 import org.apache.blur.server.TableContext;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.IndexSearcher;
 
@@ -26,12 +28,15 @@ public abstract class IndexContext {
   public abstract Args getArgs();
 
   public abstract TableContext getTableContext();
-  
+
   public abstract Shard getShard();
 
   public abstract IndexReader getIndexReader();
 
   public abstract IndexSearcher getIndexSearcher();
 
+  public abstract BlurConfiguration getBlurConfiguration();
+
+  public abstract Configuration getConfiguration();
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/Response.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/Response.java b/blur-core/src/main/java/org/apache/blur/manager/command/Response.java
index e26eeec..ff27a48 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/Response.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/Response.java
@@ -58,6 +58,6 @@ public class Response {
   }
 
   public static Response createNewServerResponse(Map<Server, Object> result) {
-    return new Response(null, null, result, true);
+    return new Response(null, null, result, false);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java
b/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java
index b266aea..1790b30 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/command/ShardCommandManager.java
@@ -24,11 +24,14 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 
+import org.apache.blur.BlurConfiguration;
 import org.apache.blur.manager.IndexServer;
 import org.apache.blur.manager.command.cmds.BaseCommand;
 import org.apache.blur.manager.writer.BlurIndex;
 import org.apache.blur.server.IndexSearcherClosable;
+import org.apache.blur.server.ShardServerContext;
 import org.apache.blur.server.TableContext;
+import org.apache.hadoop.conf.Configuration;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.IndexSearcher;
 
@@ -72,6 +75,7 @@ public class ShardCommandManager extends BaseCommandManager {
       throws IOException {
     Map<String, BlurIndex> indexes = _indexServer.getIndexes(tableContext.getTable());
     Map<String, Future<?>> futureMap = new HashMap<String, Future<?>>();
+    ShardServerContext shardServerContext = ShardServerContext.getShardServerContext();
     for (Entry<String, BlurIndex> e : indexes.entrySet()) {
       String shardId = e.getKey();
       final Shard shard = new Shard(shardId);
@@ -79,10 +83,10 @@ public class ShardCommandManager extends BaseCommandManager {
       Callable<Object> callable;
       if (command instanceof IndexReadCommand) {
         final IndexReadCommand<?> readCommand = (IndexReadCommand<?>) command.clone();
-        callable = getCallable(tableContext, args, shard, blurIndex, readCommand);
+        callable = getCallable(shardServerContext, tableContext, args, shard, blurIndex,
readCommand);
       } else if (command instanceof IndexReadCombiningCommand) {
         final IndexReadCombiningCommand<?, ?> readCombiningCommand = (IndexReadCombiningCommand<?,
?>) command.clone();
-        callable = getCallable(tableContext, args, shard, blurIndex, readCombiningCommand);
+        callable = getCallable(shardServerContext, tableContext, args, shard, blurIndex,
readCombiningCommand);
       } else {
         throw new IOException("Command type of [" + command.getClass() + "] not supported.");
       }
@@ -105,32 +109,37 @@ public class ShardCommandManager extends BaseCommandManager {
     return resultMap;
   }
 
-  private Callable<Object> getCallable(final TableContext tableContext, final Args
args, final Shard shard,
-      final BlurIndex blurIndex, final IndexReadCombiningCommand<?, ?> readCombiningCommand)
{
+  private Callable<Object> getCallable(final ShardServerContext shardServerContext,
final TableContext tableContext,
+      final Args args, final Shard shard, final BlurIndex blurIndex,
+      final IndexReadCombiningCommand<?, ?> readCombiningCommand) {
     return new Callable<Object>() {
       @Override
       public Object call() throws Exception {
-        IndexSearcherClosable searcher = blurIndex.getIndexSearcher();
-        try {
-          return readCombiningCommand.execute(new ShardIndexContext(tableContext, shard,
searcher, args));
-        } finally {
-          searcher.close();
+        String table = tableContext.getTable();
+        String shardId = shard.getShard();
+        IndexSearcherClosable searcher = shardServerContext.getIndexSearcherClosable(table,
shardId);
+        if (searcher == null) {
+          searcher = blurIndex.getIndexSearcher();
+          shardServerContext.setIndexSearcherClosable(table, shardId, searcher);
         }
+        return readCombiningCommand.execute(new ShardIndexContext(tableContext, shard, searcher,
args));
       }
     };
   }
 
-  private Callable<Object> getCallable(final TableContext tableContext, final Args
args, final Shard shard,
-      final BlurIndex blurIndex, final IndexReadCommand<?> readCommand) {
+  private Callable<Object> getCallable(final ShardServerContext shardServerContext,
final TableContext tableContext,
+      final Args args, final Shard shard, final BlurIndex blurIndex, final IndexReadCommand<?>
readCommand) {
     return new Callable<Object>() {
       @Override
       public Object call() throws Exception {
-        IndexSearcherClosable searcher = blurIndex.getIndexSearcher();
-        try {
-          return readCommand.execute(new ShardIndexContext(tableContext, shard, searcher,
args));
-        } finally {
-          searcher.close();
+        String table = tableContext.getTable();
+        String shardId = shard.getShard();
+        IndexSearcherClosable searcher = shardServerContext.getIndexSearcherClosable(table,
shardId);
+        if (searcher == null) {
+          searcher = blurIndex.getIndexSearcher();
+          shardServerContext.setIndexSearcherClosable(table, shardId, searcher);
         }
+        return readCommand.execute(new ShardIndexContext(tableContext, shard, searcher, args));
       }
     };
   }
@@ -174,5 +183,15 @@ public class ShardCommandManager extends BaseCommandManager {
       return _shard;
     }
 
+    @Override
+    public BlurConfiguration getBlurConfiguration() {
+      return _tableContext.getBlurConfiguration();
+    }
+
+    @Override
+    public Configuration getConfiguration() {
+      return _tableContext.getConfiguration();
+    }
+
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/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 f1ee57c..59896f0 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
@@ -40,6 +40,7 @@ import org.apache.blur.thrift.generated.Selector;
 import org.apache.blur.thrift.generated.ShardState;
 import org.apache.blur.thrift.generated.TableDescriptor;
 import org.apache.blur.thrift.generated.TableStats;
+import org.apache.blur.thrift.generated.TimeoutException;
 import org.apache.blur.thrift.generated.User;
 
 public class FilteredBlurServer implements Iface {
@@ -251,4 +252,14 @@ public class FilteredBlurServer implements Iface {
     return _iface.execute(table, commandName, arguments);
   }
 
+  @Override
+  public Response reconnect(String executionId) throws BlurException, TimeoutException, TException
{
+    return _iface.reconnect(executionId);
+  }
+
+  @Override
+  public void refresh() throws TException {
+    _iface.refresh();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java b/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java
index 3c0a924..f6ce7f9 100644
--- a/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java
+++ b/blur-core/src/main/java/org/apache/blur/thrift/BlurControllerServer.java
@@ -92,6 +92,7 @@ import org.apache.blur.thrift.generated.Selector;
 import org.apache.blur.thrift.generated.ShardState;
 import org.apache.blur.thrift.generated.TableDescriptor;
 import org.apache.blur.thrift.generated.TableStats;
+import org.apache.blur.thrift.generated.TimeoutException;
 import org.apache.blur.thrift.generated.User;
 import org.apache.blur.trace.Trace;
 import org.apache.blur.trace.Trace.TraceId;
@@ -1509,7 +1510,7 @@ public class BlurControllerServer extends TableAdmin implements Iface
{
       Map<String, String> tableLayout = getTableLayout(table);
       Response response = _commandManager.execute(tableContext, commandName, CommandUtil.toArgs(arguments),
           tableLayout);
-      return CommandUtil.convert(response);
+      return CommandUtil.fromObjectToThrift(response);
     } catch (Exception e) {
       LOG.error("Unknown error while trying to execute command [{0}] for table [{1}]", e,
commandName, table);
       if (e instanceof BlurException) {
@@ -1522,4 +1523,15 @@ public class BlurControllerServer extends TableAdmin implements Iface
{
   public void setCommandManager(ControllerCommandManager commandManager) {
     _commandManager = commandManager;
   }
+
+  @Override
+  public org.apache.blur.thrift.generated.Response reconnect(String executionId) throws BlurException,
+      TimeoutException, TException {
+    throw new BException("Not implemented yet.");
+  }
+
+  @Override
+  public void refresh() throws TException {
+    // This is a NO-OP at this point for the controller.
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java b/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
index bde114a..e54b53e 100644
--- a/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
+++ b/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
@@ -59,6 +59,7 @@ import org.apache.blur.thrift.generated.Selector;
 import org.apache.blur.thrift.generated.ShardState;
 import org.apache.blur.thrift.generated.Status;
 import org.apache.blur.thrift.generated.TableStats;
+import org.apache.blur.thrift.generated.TimeoutException;
 import org.apache.blur.thrift.generated.User;
 import org.apache.blur.utils.BlurConstants;
 import org.apache.blur.utils.BlurUtil;
@@ -594,7 +595,7 @@ public class BlurShardServer extends TableAdmin implements Iface {
       throws BlurException, TException {
     try {
       Response response = _commandManager.execute(getTableContext(table), commandName, CommandUtil.toArgs(arguments));
-      return CommandUtil.convert(response);
+      return CommandUtil.fromObjectToThrift(response);
     } catch (Exception e) {
       LOG.error("Unknown error while trying to execute command [{0}] for table [{1}]", e,
commandName, table);
       if (e instanceof BlurException) {
@@ -611,4 +612,15 @@ public class BlurShardServer extends TableAdmin implements Iface {
   public void setCommandManager(ShardCommandManager commandManager) {
     _commandManager = commandManager;
   }
+
+  @Override
+  public org.apache.blur.thrift.generated.Response reconnect(String executionId) throws BlurException,
+      TimeoutException, TException {
+    throw new BException("Not implemented yet.");
+  }
+
+  @Override
+  public void refresh() throws TException {
+    ShardServerContext.resetSearchers();
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b434b067/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Arguments.java
----------------------------------------------------------------------
diff --git a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Arguments.java b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Arguments.java
index 68d6916..d14f8c9 100644
--- a/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Arguments.java
+++ b/blur-thrift/src/main/java/org/apache/blur/thrift/generated/Arguments.java
@@ -363,16 +363,16 @@ public class Arguments implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<
           case 1: // VALUES
             if (schemeField.type == org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.MAP)
{
               {
-                org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map242 = iprot.readMapBegin();
-                struct.values = new HashMap<String,Value>(2*_map242.size);
-                for (int _i243 = 0; _i243 < _map242.size; ++_i243)
+                org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map252 = iprot.readMapBegin();
+                struct.values = new HashMap<String,Value>(2*_map252.size);
+                for (int _i253 = 0; _i253 < _map252.size; ++_i253)
                 {
-                  String _key244; // optional
-                  Value _val245; // required
-                  _key244 = iprot.readString();
-                  _val245 = new Value();
-                  _val245.read(iprot);
-                  struct.values.put(_key244, _val245);
+                  String _key254; // optional
+                  Value _val255; // required
+                  _key254 = iprot.readString();
+                  _val255 = new Value();
+                  _val255.read(iprot);
+                  struct.values.put(_key254, _val255);
                 }
                 iprot.readMapEnd();
               }
@@ -400,10 +400,10 @@ public class Arguments implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<
         oprot.writeFieldBegin(VALUES_FIELD_DESC);
         {
           oprot.writeMapBegin(new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING,
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, struct.values.size()));
-          for (Map.Entry<String, Value> _iter246 : struct.values.entrySet())
+          for (Map.Entry<String, Value> _iter256 : struct.values.entrySet())
           {
-            oprot.writeString(_iter246.getKey());
-            _iter246.getValue().write(oprot);
+            oprot.writeString(_iter256.getKey());
+            _iter256.getValue().write(oprot);
           }
           oprot.writeMapEnd();
         }
@@ -434,10 +434,10 @@ public class Arguments implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<
       if (struct.isSetValues()) {
         {
           oprot.writeI32(struct.values.size());
-          for (Map.Entry<String, Value> _iter247 : struct.values.entrySet())
+          for (Map.Entry<String, Value> _iter257 : struct.values.entrySet())
           {
-            oprot.writeString(_iter247.getKey());
-            _iter247.getValue().write(oprot);
+            oprot.writeString(_iter257.getKey());
+            _iter257.getValue().write(oprot);
           }
         }
       }
@@ -449,16 +449,16 @@ public class Arguments implements org.apache.blur.thirdparty.thrift_0_9_0.TBase<
       BitSet incoming = iprot.readBitSet(1);
       if (incoming.get(0)) {
         {
-          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map248 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING,
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32());
-          struct.values = new HashMap<String,Value>(2*_map248.size);
-          for (int _i249 = 0; _i249 < _map248.size; ++_i249)
+          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map258 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING,
org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32());
+          struct.values = new HashMap<String,Value>(2*_map258.size);
+          for (int _i259 = 0; _i259 < _map258.size; ++_i259)
           {
-            String _key250; // optional
-            Value _val251; // required
-            _key250 = iprot.readString();
-            _val251 = new Value();
-            _val251.read(iprot);
-            struct.values.put(_key250, _val251);
+            String _key260; // optional
+            Value _val261; // required
+            _key260 = iprot.readString();
+            _val261 = new Value();
+            _val261.read(iprot);
+            struct.values.put(_key260, _val261);
           }
         }
         struct.setValuesIsSet(true);


Mime
View raw message