usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [13/17] incubator-usergrid git commit: add index refresh logic
Date Fri, 17 Apr 2015 21:31:46 GMT
add index refresh logic


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

Branch: refs/heads/USERGRID-541
Commit: 488fa936907a1d26d529e91761804556ebb5be46
Parents: 8d12b39
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Apr 17 12:04:39 2015 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Apr 17 12:04:39 2015 -0600

----------------------------------------------------------------------
 .../apache/usergrid/persistence/index/CandidateResults.java | 9 +--------
 .../index/impl/EsApplicationEntityIndexImpl.java            | 3 +--
 .../persistence/index/impl/IndexRefreshCommandImpl.java     | 2 ++
 .../queryindex/src/test/resources/dynamic-test.properties   | 2 +-
 4 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/488fa936/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResults.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResults.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResults.java
index 0e2bddf..f0955ea 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResults.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/CandidateResults.java
@@ -49,16 +49,12 @@ public class CandidateResults implements Iterable<CandidateResult>
{
 
     private final List<CandidateResult> candidates;
     private final Collection<SelectFieldMapping> getFieldMappings;
-    private final String elasticSearchCursor;
 
 
     public CandidateResults( List<CandidateResult> candidates,
-                             final Collection<SelectFieldMapping> getFieldMappings,
-                             String elasticSearchCursor
-    ) {
+                             final Collection<SelectFieldMapping> getFieldMappings
) {
         this.candidates = candidates;
         this.getFieldMappings = getFieldMappings;
-        this.elasticSearchCursor = elasticSearchCursor;
     }
 
 
@@ -113,7 +109,4 @@ public class CandidateResults implements Iterable<CandidateResult>
{
         return candidates.iterator();
     }
 
-    public String getElasticSearchCursor() {
-        return elasticSearchCursor;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/488fa936/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
index 83e1648..6574985 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsApplicationEntityIndexImpl.java
@@ -310,10 +310,9 @@ public class EsApplicationEntityIndexImpl implements ApplicationEntityIndex
{
             candidates.add( candidateResult );
         }
 
+        final CandidateResults candidateResults = new CandidateResults( candidates, query.getSelectFieldMappings());
         final String esScrollCursor = searchResponse.getScrollId();
 
-        final CandidateResults candidateResults = new CandidateResults( candidates, query.getSelectFieldMappings(),esScrollCursor
);
-
         // >= seems odd.  However if we get an overflow, we need to account for it.
         if ( esScrollCursor != null && length >= limit ) {
             final String cursor = candidateResults.initializeCursor();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/488fa936/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
index b916d58..804de51 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/IndexRefreshCommandImpl.java
@@ -147,6 +147,8 @@ public class IndexRefreshCommandImpl implements IndexRefreshCommand {
         return future.doOnNext( found -> {
             if ( !found.hasFinished() ) {
                 logger.error(String.format("Couldn't find record during refresh uuid: {}
took ms:{} ", uuid, found.getExecutionTime()));
+            }else{
+                logger.info(String.format("found record during refresh uuid: {} took ms:{}
", uuid, found.getExecutionTime()));
             }
         } ).doOnCompleted(() -> {
             //clean up our data

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/488fa936/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties b/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
index 3d4582f..9bc19ed 100644
--- a/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
+++ b/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
@@ -9,7 +9,7 @@ collections.keyspace=Usergrid_Collections
 cassandra.timeout=5000
 
 index.query.limit.default=10
-elasticsearch.indexname=Usergrid
+elasticsearch.indexname=QueryIndexTests
 elasticsearch.startup=external
 elasticsearch.force-refresh=false
 


Mime
View raw message