incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixed BLUR-37.
Date Wed, 22 May 2013 23:55:31 GMT
Updated Branches:
  refs/heads/0.1.5 51aa6d099 -> 9b89a5ba3


Fixed BLUR-37.


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

Branch: refs/heads/0.1.5
Commit: 9b89a5ba3489f78ad4a094fbb516c21612e37b25
Parents: 51aa6d0
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed May 22 19:55:11 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed May 22 19:55:11 2013 -0400

----------------------------------------------------------------------
 .../java/org/apache/blur/manager/IndexManager.java |    2 +-
 .../blur/manager/status/QueryStatusManager.java    |   10 +++++-----
 .../org/apache/blur/thrift/BlurShardServer.java    |    7 ++++++-
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9b89a5ba/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
index 3483a54..9938219 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/IndexManager.java
@@ -431,7 +431,7 @@ public class IndexManager {
     return _statusManager.currentQueries(table);
   }
 
-  public BlurQueryStatus queryStatus(String table, long uuid) throws BlurException {
+  public BlurQueryStatus queryStatus(String table, long uuid) {
     return _statusManager.queryStatus(table, uuid);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9b89a5ba/src/blur-core/src/main/java/org/apache/blur/manager/status/QueryStatusManager.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/status/QueryStatusManager.java
b/src/blur-core/src/main/java/org/apache/blur/manager/status/QueryStatusManager.java
index 17c333f..88915c7 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/status/QueryStatusManager.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/status/QueryStatusManager.java
@@ -29,11 +29,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
-import org.apache.blur.thrift.generated.BlurException;
 import org.apache.blur.thrift.generated.BlurQuery;
 import org.apache.blur.thrift.generated.BlurQueryStatus;
 
-
 public class QueryStatusManager {
 
   private static final Log LOG = LogFactory.getLog(QueryStatusManager.class);
@@ -110,19 +108,21 @@ public class QueryStatusManager {
     return result;
   }
 
-  public BlurQueryStatus queryStatus(String table, long uuid) throws BlurException {
+  public BlurQueryStatus queryStatus(String table, long uuid) {
     for (QueryStatus status : currentQueryStatusCollection.keySet()) {
       if (status.getUserUuid() == uuid && status.getTable().equals(table)) {
         return status.getQueryStatus();
       }
     }
-    throw new BlurException("Query status for table [" + table + "] and uuid [" + uuid +
"] not found", null);
+    return null;
   }
 
   public List<Long> queryStatusIdList(String table) {
     Set<Long> ids = new HashSet<Long>();
     for (QueryStatus status : currentQueryStatusCollection.keySet()) {
-      ids.add(status.getUserUuid());
+      if (status.getTable().equals(table)) {
+        ids.add(status.getUserUuid());
+      }
     }
     return new ArrayList<Long>(ids);
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/9b89a5ba/src/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java b/src/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
index bbacd63..b9dbfaa 100644
--- a/src/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/thrift/BlurShardServer.java
@@ -345,12 +345,17 @@ public class BlurShardServer extends TableAdmin implements Iface {
   public BlurQueryStatus queryStatusById(String table, long uuid) throws BlurException, TException
{
     checkTable(_cluster, table);
     resetSearchers();
+    BlurQueryStatus blurQueryStatus;
     try {
-      return _indexManager.queryStatus(table, uuid);
+      blurQueryStatus = _indexManager.queryStatus(table, uuid);
     } catch (Exception e) {
       LOG.error("Unknown error while trying to get current query status [table={0},uuid={1}]",
e, table, uuid);
       throw new BException(e.getMessage(), e);
     }
+    if (blurQueryStatus == null) {
+      throw new BlurException("Query status for table [" + table + "] and uuid [" + uuid
+ "] not found", null);
+    }
+    return blurQueryStatus;
   }
 
   @Override


Mime
View raw message