usergrid-commits mailing list archives

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


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

Branch: refs/heads/USERGRID-256-ApiResponseImplementation
Commit: 5d613dca337e23314851b4c0e1aba3e5fa3788e9
Parents: b16c728
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Nov 21 16:42:36 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Nov 21 16:42:36 2014 -0700

----------------------------------------------------------------------
 .../persistence/index/IndexIdentifier.java      | 21 ++++++++++++++++----
 .../index/impl/EsEntityIndexImpl.java           |  5 +++++
 2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5d613dca/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 13af8eb..c65a740 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
@@ -35,19 +35,32 @@ public class IndexIdentifier{
         this.applicationScope = applicationScope;
     }
 
+    /**
+     * Get the alias name
+     * @return
+     */
     public String getAlias() {
         return getIndexBase() + config.getAliasPostfix();
     }
 
-    public String getIndex(int i) {
-        if (i > 0) {
-            return getIndexBase() + "_v" + (i + 1);
+    /**
+     * Get index name, send in additional parameter to add incremental indexes
+     * @param version
+     * @return
+     */
+    public String getIndex(int version) {
+        if (version > 0) {
+            return getIndexBase() + "_v" + (version + 1);
         } else {
             return getIndexBase();
         }
     }
 
-    String getIndexBase() {
+    /**
+     * returns the base name for index which will be used to add an alias and index
+     * @return
+     */
+    private String getIndexBase() {
         StringBuilder sb = new StringBuilder();
         sb.append(config.getIndexPrefix()).append(IndexingUtils.SEPARATOR);
         IndexingUtils.idString(sb, applicationScope.getApplication());

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/5d613dca/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 baa3551..fa5197e 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
@@ -174,6 +174,11 @@ public class EsEntityIndexImpl implements EntityIndex {
         }
     }
 
+    /**
+     * Create the index and alias
+     * @param admin
+     * @param settings
+     */
     private void createIndexAndAlias(AdminClient admin, Settings settings) {
         String indexVersionName =  indexIdentifier.getIndex(0);
         final CreateIndexResponse cir = admin.indices().prepareCreate( indexVersionName ).setSettings(
settings ).execute().actionGet();


Mime
View raw message