usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [25/31] incubator-usergrid git commit: Fixes merge error
Date Mon, 09 Mar 2015 15:25:38 GMT
Fixes merge error


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

Branch: refs/heads/USERGRID-405
Commit: 3b409f67f712ccee2ef28813a4e1af9cb0beb685
Parents: 046ba4e
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Mar 6 18:05:25 2015 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Fri Mar 6 18:05:25 2015 -0700

----------------------------------------------------------------------
 .../index/impl/EsEntityIndexFactoryImpl.java    |  9 +++--
 .../index/impl/EsEntityIndexImpl.java           | 35 +++++++++++---------
 2 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b409f67/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
index 4bf8b59..3a9f790 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/EsEntityIndexFactoryImpl.java
@@ -24,6 +24,8 @@ import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
 import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
+
+import org.apache.usergrid.persistence.core.metrics.MetricsFactory;
 import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.index.EntityIndex;
 import org.apache.usergrid.persistence.index.EntityIndexFactory;
@@ -41,21 +43,24 @@ public class EsEntityIndexFactoryImpl implements EntityIndexFactory{
     private final EsProvider provider;
     private final EsIndexCache indexCache;
     private final IndexBufferProducer indexBatchBufferProducer;
+    private final MetricsFactory metricsFactory;
 
     private LoadingCache<ApplicationScope, EntityIndex> eiCache =
         CacheBuilder.newBuilder().maximumSize( 1000 ).build( new CacheLoader<ApplicationScope,
EntityIndex>() {
             public EntityIndex load( ApplicationScope scope ) {
-                return new EsEntityIndexImpl(scope,config, indexBatchBufferProducer, provider,indexCache);
+                return new EsEntityIndexImpl(scope,config, indexBatchBufferProducer, provider,indexCache,
metricsFactory);
             }
         } );
 
     @Inject
     public EsEntityIndexFactoryImpl( final IndexFig config, final EsProvider provider, final
EsIndexCache indexCache,
-                                     final IndexBufferProducer indexBatchBufferProducer ){
+                                     final IndexBufferProducer indexBatchBufferProducer,
+                                     final MetricsFactory metricsFactory ){
         this.config = config;
         this.provider = provider;
         this.indexCache = indexCache;
         this.indexBatchBufferProducer = indexBatchBufferProducer;
+        this.metricsFactory = metricsFactory;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/3b409f67/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 951f96b..d980401 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
@@ -241,25 +241,30 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
 
             String[] indexNames = getIndexes(AliasType.Write);
 
-            for (String currentIndex : indexNames){
+            for ( String currentIndex : indexNames ) {
 
                 final Timer.Context timeRemoveAlias = removeAliasTimer.time();
+
                 try {
-                //Added For Graphite Metrics
+                    //Added For Graphite Metrics
 
-                isAck = adminClient.indices().prepareAliases().removeAlias(currentIndex,
-                        alias.getWriteAlias()).execute().actionGet().isAcknowledged();
-
-                logger.info("Removed Index Name [{}] from Alias=[{}] ACK=[{}]", currentIndex,
alias, isAck);
-                } catch (AliasesMissingException aie) {
-                                   logger.info("Alias does not exist Index Name [{}] from
Alias=[{}] ACK=[{}]", currentIndex, alias, aie.getMessage());
-                                   continue;
-                               }catch(InvalidAliasNameException iane) {
-                                   logger.info("Alias does not exist Index Name [{}] from
Alias=[{}] ACK=[{}]", currentIndex, alias, iane.getMessage());
-                                   continue;
-                               }finally{
-                    timeRemoveAlias.stop();
+                    isAck = adminClient.indices().prepareAliases().removeAlias( currentIndex,
alias.getWriteAlias() )
+                                       .execute().actionGet().isAcknowledged();
 
+                    logger.info( "Removed Index Name [{}] from Alias=[{}] ACK=[{}]", currentIndex,
alias, isAck );
+                }
+                catch ( AliasesMissingException aie ) {
+                    logger.info( "Alias does not exist Index Name [{}] from Alias=[{}] ACK=[{}]",
currentIndex, alias,
+                        aie.getMessage() );
+                    continue;
+                }
+                catch ( InvalidAliasNameException iane ) {
+                    logger.info( "Alias does not exist Index Name [{}] from Alias=[{}] ACK=[{}]",
currentIndex, alias,
+                        iane.getMessage() );
+                    continue;
+                }
+                finally {
+                    timeRemoveAlias.stop();
                 }
             }
 
@@ -617,7 +622,7 @@ public class EsEntityIndexImpl implements AliasedEntityIndex {
             public void onResponse( DeleteByQueryResponse response) {
                 timeDeleteAllVersions.stop();
                 logger
-                    .debug("Deleted entity {}:{} from all index scopes with response status
= {}", entityId.getType(),
+                    .debug( "Deleted entity {}:{} from all index scopes with response status
= {}", entityId.getType(),
                         entityId.getUuid(), response.status().toString() );
 
                 checkDeleteByQueryResponse(tqb, response);


Mime
View raw message