You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2014/12/10 01:31:48 UTC

[08/14] incubator-usergrid git commit: add observable to refresh

add observable to refresh


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

Branch: refs/heads/USERGRID-252
Commit: 8d344268ba435253497a7c92db895152c193a20a
Parents: 21630f4
Author: Shawn Feldman <sf...@apache.org>
Authored: Mon Dec 8 17:32:03 2014 -0700
Committer: Shawn Feldman <sf...@apache.org>
Committed: Mon Dec 8 17:32:03 2014 -0700

----------------------------------------------------------------------
 .../persistence/index/impl/EsEntityIndexBatchImpl.java         | 6 +-----
 .../usergrid/persistence/index/impl/EsEntityIndexImpl.java     | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8d344268/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
index 0d0e52b..cd5be7f 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexBatchImpl.java
@@ -191,7 +191,6 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
         if(indexes == null ||indexes.length == 0){
             indexes = new String[]{indexIdentifier.getIndex(null)};
         }
-        final AtomicInteger errorCount = new AtomicInteger();
         //get all indexes then flush everyone
         Observable.from(indexes).subscribeOn(Schedulers.io())
                .map(new Func1<String, Object>() {
@@ -201,15 +200,12 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
                            bulkRequest.add(client.prepareDelete(index, entityType, indexId).setRefresh(refresh));
                        }catch (Exception e){
                            log.error("failed to deindex",e);
-                           errorCount.incrementAndGet();
+                           throw e;
                        }
                        return index;
                    }
                }).toBlocking().last();
 
-        if(errorCount.get()>0){
-            log.error("Failed to flush some indexes");
-        }
         log.debug( "Deindexed Entity with index id " + indexId );
 
         maybeFlush();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8d344268/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
index 4bca8c2..3f895b5 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexImpl.java
@@ -464,7 +464,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                             esProvider.getClient().admin().indices().prepareRefresh( index ).execute().actionGet();
                             return index;
                         }
-                    });
+                    }).toBlocking().last();
 
                     logger.debug( "Refreshed index: " + alias);