usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [08/50] incubator-usergrid git commit: testing multiple index creations
Date Thu, 04 Dec 2014 20:10:43 GMT
testing multiple index creations


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

Branch: refs/heads/USERGRID-256-ApiResponseImplementation
Commit: 30b38176ec960d40f9feece7c695c224f6b83528
Parents: fc79628
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Mon Nov 24 08:55:47 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Mon Nov 24 08:55:47 2014 -0700

----------------------------------------------------------------------
 .../org/apache/usergrid/persistence/index/IndexFig.java |  2 +-
 .../usergrid/persistence/index/IndexIdentifier.java     |  2 +-
 .../persistence/index/impl/EsEntityIndexImpl.java       |  5 ++++-
 .../persistence/index/impl/EntityIndexTest.java         | 12 ++++++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30b38176/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
index c64ddff..ea0a4f3 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexFig.java
@@ -37,7 +37,7 @@ public interface IndexFig extends GuicyFig {
 
     public static final String ELASTICSEARCH_INDEX_PREFIX = "elasticsearch.index_prefix";
 
-    public static final String ELASTICSEARCH_ALIAS_POSTFIX = "elasticsearch_index_postfix";
+    public static final String ELASTICSEARCH_ALIAS_POSTFIX = "elasticsearch.alias_postfix";
 
     public static final String ELASTICSEARCH_STARTUP = "elasticsearch.startup";
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30b38176/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifier.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifier.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifier.java
index c65a740..58e6ee5 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifier.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/IndexIdentifier.java
@@ -40,7 +40,7 @@ public class IndexIdentifier{
      * @return
      */
     public String getAlias() {
-        return getIndexBase() + config.getAliasPostfix();
+        return getIndexBase() + "_" + config.getAliasPostfix();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30b38176/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 aab8301..f9623ce 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
@@ -180,12 +180,15 @@ public class EsEntityIndexImpl implements EntityIndex {
         if(!admin.indices().exists(new IndicesExistsRequest(indexVersionName)).actionGet().isExists())
{
             final CreateIndexResponse cir = admin.indices().prepareCreate(indexVersionName).setSettings(settings).execute().actionGet();
             logger.info( "Created new Index Name [{}] ACK=[{}]", indexVersionName, cir.isAcknowledged()
);
+        }else{
+            logger.info( " Index Name [{}] already exists", indexVersionName);
         }
         //check if alias exists and get the alias
         if(!admin.indices().aliasesExist(new GetAliasesRequest(aliasName)).actionGet().exists())
{
             final Boolean isAck = admin.indices().prepareAliases().addAlias(indexVersionName,
aliasName).execute().actionGet().isAcknowledged();
             logger.info( "Created new Alias Name [{}] ACK=[{}]", aliasName, isAck);
-
+        }else{
+            logger.info( " Alias Name [{}] already exists", aliasName);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/30b38176/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
index a30e222..f8bd30f 100644
--- a/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
+++ b/stack/corepersistence/queryindex/src/test/java/org/apache/usergrid/persistence/index/impl/EntityIndexTest.java
@@ -136,6 +136,18 @@ public class EntityIndexTest extends BaseIT {
         testQueries( indexScope, searchTypes,  entityIndex );
     }
 
+    @Test
+    public void testMultipleIndexInitializations(){
+        Id appId = new SimpleId( "application" );
+
+        ApplicationScope applicationScope = new ApplicationScopeImpl( appId );
+
+        EntityIndex entityIndex = eif.createEntityIndex( applicationScope );
+        for(int i=0;i<10;i++) {
+            entityIndex.initializeIndex();
+        }
+
+    }
 
     @Test
     public void testDeindex() {


Mime
View raw message