usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [20/50] [abbrv] incubator-usergrid git commit: add caching to indexes
Date Fri, 12 Dec 2014 14:30:19 GMT
add caching to indexes


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

Branch: refs/heads/two-dot-o-events
Commit: 1d2697fc967680aa092b42705ffdc688e3579dae
Parents: b545c0e
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Dec 9 09:50:45 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Dec 9 09:50:45 2014 -0700

----------------------------------------------------------------------
 .../persistence/index/impl/EsIndexCache.java        | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/1d2697fc/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexCache.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexCache.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexCache.java
index 710cc60..f418590 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexCache.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsIndexCache.java
@@ -40,7 +40,7 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
 /**
- * Classy class class.
+ * Cache for Es index operations
  */
 @Singleton
 public class EsIndexCache {
@@ -66,11 +66,15 @@ public class EsIndexCache {
                         ImmutableOpenMap<String, List<AliasMetaData>> aliasMap
= adminClient.indices().getAliases(new GetAliasesRequest(aliasName)).actionGet().getAliases();
                         return aliasMap.keys().toArray(String.class);
                     }
-                })
-
-        ;
+                }) ;
     }
 
+    /**
+     * Get indexes for an alias
+     * @param alias
+     * @param aliasType
+     * @return
+     */
     public String[] getIndexes(IndexIdentifier.IndexAlias alias, AliasedEntityIndex.AliasType
aliasType) {
         String[] indexes;
         try {
@@ -82,6 +86,10 @@ public class EsIndexCache {
         return indexes;
     }
 
+    /**
+     * clean up cache
+     * @param alias
+     */
     public void invalidate(IndexIdentifier.IndexAlias alias){
         aliasIndexCache.invalidate(alias.getWriteAlias());
         aliasIndexCache.invalidate(alias.getReadAlias());


Mime
View raw message