incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Fixing the ClusterReadCombiningCommand command so that it only using a single type for index execute output and combine output so that it can be reused in both the shard and controller servers.
Date Wed, 24 Sep 2014 00:20:54 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master 6ca03b650 -> 1ecfe4247


Fixing the ClusterReadCombiningCommand command so that it only using a single type for index
execute output and combine output so that it can be reused in both the shard and controller
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/bf560711
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/bf560711
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/bf560711

Branch: refs/heads/master
Commit: bf560711b96b8943a3e9bfe9639c0134d9cb9d2a
Parents: 2b0125a
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Sep 23 20:20:01 2014 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Sep 23 20:20:01 2014 -0400

----------------------------------------------------------------------
 .../command/DocumentCountDefaultClusterCombine.java     | 12 ++++++------
 .../blur/command/ClusterReadCombiningCommand.java       |  2 +-
 .../src/main/java/org/apache/blur/command/Command.java  |  4 ++--
 .../apache/blur/command/ControllerCommandManager.java   |  4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bf560711/blur-command/src/main/java/org/apache/blur/command/DocumentCountDefaultClusterCombine.java
----------------------------------------------------------------------
diff --git a/blur-command/src/main/java/org/apache/blur/command/DocumentCountDefaultClusterCombine.java
b/blur-command/src/main/java/org/apache/blur/command/DocumentCountDefaultClusterCombine.java
index cc6d20c..98116c2 100644
--- a/blur-command/src/main/java/org/apache/blur/command/DocumentCountDefaultClusterCombine.java
+++ b/blur-command/src/main/java/org/apache/blur/command/DocumentCountDefaultClusterCombine.java
@@ -23,7 +23,7 @@ import org.apache.blur.command.annotation.Description;
 
 @SuppressWarnings("serial")
 @Description("Gets the number of visible documents in the index.")
-public class DocumentCountDefaultClusterCombine extends Command implements ClusterReadCombiningCommand<Integer,
Long> {
+public class DocumentCountDefaultClusterCombine extends Command implements ClusterReadCombiningCommand<Long>
{
 
   private static final String DOC_COUNT_CLUSTER_COMBINE = "docCountClusterCombine";
 
@@ -33,16 +33,16 @@ public class DocumentCountDefaultClusterCombine extends Command implements
Clust
   }
 
   @Override
-  public Integer execute(IndexContext context) throws IOException {
-    return context.getIndexReader().numDocs();
+  public Long execute(IndexContext context) throws IOException {
+    return (long) context.getIndexReader().numDocs();
   }
 
   @Override
-  public Long combine(CombiningContext context, Map<? extends Location<?>, Integer>
results) throws IOException,
+  public Long combine(CombiningContext context, Map<? extends Location<?>, Long>
results) throws IOException,
       InterruptedException {
     long total = 0;
-    for (Integer i : results.values()) {
-      total += i;
+    for (Long l : results.values()) {
+      total += l;
     }
     return total;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bf560711/blur-core/src/main/java/org/apache/blur/command/ClusterReadCombiningCommand.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/command/ClusterReadCombiningCommand.java
b/blur-core/src/main/java/org/apache/blur/command/ClusterReadCombiningCommand.java
index 440da70..a87fffc 100644
--- a/blur-core/src/main/java/org/apache/blur/command/ClusterReadCombiningCommand.java
+++ b/blur-core/src/main/java/org/apache/blur/command/ClusterReadCombiningCommand.java
@@ -16,6 +16,6 @@
  */
 package org.apache.blur.command;
 
-public interface ClusterReadCombiningCommand<T1, T2> extends IndexReadCombiningCommand<T1,
T2> {
+public interface ClusterReadCombiningCommand<T> extends IndexReadCombiningCommand<T,
T> {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bf560711/blur-core/src/main/java/org/apache/blur/command/Command.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/command/Command.java b/blur-core/src/main/java/org/apache/blur/command/Command.java
index 30b22b0..e2ed191 100644
--- a/blur-core/src/main/java/org/apache/blur/command/Command.java
+++ b/blur-core/src/main/java/org/apache/blur/command/Command.java
@@ -86,13 +86,13 @@ public abstract class Command implements Serializable, Cloneable {
     return (Map<Server, T>) runInternal((Command) command, arguments, connection);
   }
 
-  public static <T> T run(ClusterReadCombiningCommand<?, T> command, Args arguments,
Blur.Iface client)
+  public static <T> T run(ClusterReadCombiningCommand<T> command, Args arguments,
Blur.Iface client)
       throws IOException, BlurException, TException {
     return run(command, arguments, getConnection(client));
   }
 
   @SuppressWarnings("unchecked")
-  public static <T> T run(ClusterReadCombiningCommand<?, T> command, Args arguments,
Connection... connection)
+  public static <T> T run(ClusterReadCombiningCommand<T> command, Args arguments,
Connection... connection)
       throws IOException, BlurException, TException {
     return (T) runInternal((Command) command, arguments, connection);
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bf560711/blur-core/src/main/java/org/apache/blur/command/ControllerCommandManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/command/ControllerCommandManager.java
b/blur-core/src/main/java/org/apache/blur/command/ControllerCommandManager.java
index 63dda47..eb8d904 100644
--- a/blur-core/src/main/java/org/apache/blur/command/ControllerCommandManager.java
+++ b/blur-core/src/main/java/org/apache/blur/command/ControllerCommandManager.java
@@ -98,10 +98,10 @@ public class ControllerCommandManager extends BaseCommandManager {
 
   private Response executeClusterReadCombiningCommand(Args args, ClusterContext context,
Command command,
       CombiningContext combiningContext) throws IOException, InterruptedException {
-    Class<? extends ClusterReadCombiningCommand<Object, Object>> clazz = (Class<?
extends ClusterReadCombiningCommand<Object, Object>>) command
+    Class<? extends ClusterReadCombiningCommand<Object>> clazz = (Class<?
extends ClusterReadCombiningCommand<Object>>) command
         .getClass();
     Map<Server, Object> results = context.readServers(args, clazz);
-    ClusterReadCombiningCommand<Object, Object> clusterReadCombiningCommand = (ClusterReadCombiningCommand<Object,
Object>) command;
+    ClusterReadCombiningCommand<Object> clusterReadCombiningCommand = (ClusterReadCombiningCommand<Object>)
command;
     Object result = clusterReadCombiningCommand.combine(combiningContext, (Map<? extends
Location<?>, Object>) results);
     return Response.createNewAggregateResponse(result);
   }


Mime
View raw message