geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject incubator-geode git commit: Changing IndexManager to take a RegionFunctionContext
Date Thu, 10 Sep 2015 00:32:10 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-11 6f1772334 -> 363303f9a


Changing IndexManager to take a RegionFunctionContext

The LuceneSearchFunctionArgs class had a getBuckets method, but it
didn't make sense because we want to search only the local data set.
Change the API to pass the function context to the RepositoryManager.


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

Branch: refs/heads/feature/GEODE-11
Commit: 363303f9ade402b5b39568f89b7e761b1488f677
Parents: 6f17723
Author: Dan Smith <upthewaterspout@apache.org>
Authored: Wed Sep 9 17:29:14 2015 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Wed Sep 9 17:31:18 2015 -0700

----------------------------------------------------------------------
 .../internal/distributed/LuceneQueryFunction.java     |  3 +--
 .../distributed/LuceneSearchFunctionArgs.java         |  7 -------
 .../lucene/internal/repository/RepositoryManager.java |  7 +++----
 .../distributed/LuceneQueryFunctionJUnitTest.java     | 14 +++++---------
 4 files changed, 9 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/363303f9/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunction.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunction.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunction.java
index 9549a0f..27a42ad 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunction.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunction.java
@@ -43,7 +43,6 @@ public class LuceneQueryFunction extends FunctionAdapter {
     }
 
     LuceneSearchFunctionArgs args = (LuceneSearchFunctionArgs) ctx.getArguments();
-    Set<Integer> buckets = (args == null ? null : args.getBuckets());
 
     CollectorManager manager = (args == null) ? null : args.getCollectorManager();
     if (manager == null) {
@@ -53,7 +52,7 @@ public class LuceneQueryFunction extends FunctionAdapter {
 
     Collection<IndexResultCollector> results = new ArrayList<>();
     try {
-      Collection<IndexRepository> repositories = repoManager.getRepositories(region,
buckets);
+      Collection<IndexRepository> repositories = repoManager.getRepositories(region,
ctx);
       for (IndexRepository repo : repositories) {
         IndexResultCollector collector = manager.newCollector(repo.toString());
         logger.debug("Executing search on repo: " + repo.toString());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/363303f9/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneSearchFunctionArgs.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneSearchFunctionArgs.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneSearchFunctionArgs.java
index 25b8a17..2a5a5b6 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneSearchFunctionArgs.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneSearchFunctionArgs.java
@@ -36,13 +36,6 @@ public class LuceneSearchFunctionArgs implements VersionedDataSerializable
{
   }
 
   /**
-   * @return List of bucket IDs on which the query is to be executed
-   */
-  public Set<Integer> getBuckets() {
-    return null;
-  }
-
-  /**
    * @return The maximum count of result objects to be produced by the function
    */
   public int getLimit() {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/363303f9/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/RepositoryManager.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/RepositoryManager.java
b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/RepositoryManager.java
index e8ea3e6..a1d0f86 100644
--- a/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/RepositoryManager.java
+++ b/gemfire-lucene/src/main/java/com/gemstone/gemfire/cache/lucene/internal/repository/RepositoryManager.java
@@ -1,9 +1,9 @@
 package com.gemstone.gemfire.cache.lucene.internal.repository;
 
 import java.util.Collection;
-import java.util.Set;
 
 import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.execute.RegionFunctionContext;
 import com.gemstone.gemfire.internal.cache.BucketNotFoundException;
 
 /**
@@ -19,10 +19,9 @@ public interface RepositoryManager {
    * bucket needs to be present on this member.
    * 
    * @param region
-   * @param buckets buckets of a Partitioned region for which {@link IndexRepository}s needs
to be discovered. null
-   *          for all primary buckets on this member or if the region is Replicated.
+   * @param ctx function context for which {@link IndexRepository}s needs to be discovered.

    * @return a collection of {@link IndexRepository} instances
    * @throws BucketNotFoundException if any of the requested buckets is not found on this
member
    */
-  Collection<IndexRepository> getRepositories(Region region, Set<Integer> buckets)
throws BucketNotFoundException;
+  Collection<IndexRepository> getRepositories(Region region, RegionFunctionContext
ctx) throws BucketNotFoundException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/363303f9/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunctionJUnitTest.java
b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunctionJUnitTest.java
index c99eaee..4c350cf 100644
--- a/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunctionJUnitTest.java
+++ b/gemfire-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/internal/distributed/LuceneQueryFunctionJUnitTest.java
@@ -52,7 +52,7 @@ public class LuceneQueryFunctionJUnitTest {
         oneOf(m.mockContext).getArguments();
         will(returnValue(null));
 
-        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, null);
+        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, m.mockContext);
         will(returnValue(m.repos));
 
         oneOf(m.mockContext).getResultSender();
@@ -116,14 +116,12 @@ public class LuceneQueryFunctionJUnitTest {
         oneOf(m.mockContext).getResultSender();
         will(returnValue(m.mockResultSender));
 
-        oneOf(m.mockFuncArgs).getBuckets();
-        will(returnValue(null));
         oneOf(m.mockFuncArgs).getLimit();
         will(returnValue(3));
         oneOf(m.mockFuncArgs).getCollectorManager();
         will(returnValue(null));
 
-        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, null);
+        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, m.mockContext);
         will(returnValue(m.repos));
 
         oneOf(m.mockRepository1).query(with(aNull(Query.class)), with(equal(0)), with(any(IndexResultCollector.class)));
@@ -185,12 +183,10 @@ public class LuceneQueryFunctionJUnitTest {
         oneOf(m.mockContext).getResultSender();
         will(returnValue(m.mockResultSender));
 
-        oneOf(m.mockFuncArgs).getBuckets();
-        will(returnValue(null));
         oneOf(m.mockFuncArgs).getCollectorManager();
         will(returnValue(mockManager));
 
-        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, null);
+        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, m.mockContext);
         m.repos.remove(0);
         will(returnValue(m.repos));
 
@@ -239,7 +235,7 @@ public class LuceneQueryFunctionJUnitTest {
         oneOf(m.mockContext).getArguments();
         will(returnValue(null));
 
-        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, null);
+        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, m.mockContext);
         will(returnValue(m.repos));
 
         oneOf(m.mockContext).getResultSender();
@@ -267,7 +263,7 @@ public class LuceneQueryFunctionJUnitTest {
         oneOf(m.mockContext).getArguments();
         will(returnValue(null));
 
-        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, null);
+        oneOf(m.mockRepoManager).getRepositories(m.mockRegion, m.mockContext);
         will(throwException(new BucketNotFoundException("")));
 
         oneOf(m.mockContext).getResultSender();


Mime
View raw message