usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject incubator-usergrid git commit: Moved add alias and test new index into try so we don't keep moving the index alias
Date Mon, 09 Mar 2015 03:08:08 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/rebuild-fix d164ff141 -> fc07d9aa8 (forced update)


Moved add alias and test new index into try so we don't keep moving the index alias


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

Branch: refs/heads/rebuild-fix
Commit: fc07d9aa85e8c01cd0e3f122e0ac7375ec43a7a3
Parents: 3b409f6
Author: Todd Nine <tnine@apigee.com>
Authored: Sun Mar 8 20:14:37 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Sun Mar 8 21:07:58 2015 -0600

----------------------------------------------------------------------
 .../persistence/index/impl/EsEntityIndexImpl.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/fc07d9aa/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 d980401..80fede9 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
@@ -216,14 +216,26 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
                         .execute()
                         .actionGet();
                 timeNewIndexCreation.stop();
+
+                //ONLY add the alias if we create the index, otherwise we're going to overwrite
production settings
+
+                /**
+                 * DO NOT MOVE THIS LINE OF CODE UNLESS YOU REALLY KNOW WHAT YOU'RE DOING!!!!
+                 */
+
+                //We do NOT want to create an alias if the index already exists, we'll overwrite
the indexes that
+                //may have been set via other administrative endpoint
+                addAlias(normalizedSuffix);
+
+                testNewIndex();
+
                 logger.info("Created new Index Name [{}] ACK=[{}]", indexName, cir.isAcknowledged());
             } catch (IndexAlreadyExistsException e) {
                 logger.info("Index Name [{}] already exists", indexName);
             }
 
-            addAlias(normalizedSuffix);
 
-            testNewIndex();
+
         } catch (IndexAlreadyExistsException expected) {
             // this is expected to happen if index already exists, it's a no-op and swallow
         } catch (IOException e) {


Mime
View raw message