usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [09/20] incubator-usergrid git commit: Fixed wiring issues present when running tests.
Date Sat, 07 Mar 2015 01:05:36 GMT
Fixed wiring issues present when running tests.


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

Branch: refs/heads/USERGRID-416
Commit: cb35127f30ea4d155ce93577b8a27547f93223fd
Parents: d3b469e
Author: GERey <greyes@apigee.com>
Authored: Thu Mar 5 12:32:07 2015 -0800
Committer: GERey <greyes@apigee.com>
Committed: Thu Mar 5 12:32:07 2015 -0800

----------------------------------------------------------------------
 .../org/apache/usergrid/corepersistence/CpEntityManager.java   | 6 +++---
 .../usergrid/corepersistence/CpEntityManagerFactory.java       | 6 +++---
 .../org/apache/usergrid/corepersistence/CpRelationManager.java | 6 ++++--
 3 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb35127f/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 4355638..e7efa6f 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -189,14 +189,13 @@ public class CpEntityManager implements EntityManager {
 
     private boolean skipAggregateCounters;
 
-    private final Timer corePersistanceTimer;
+    private Timer corePersistanceTimer;
 
 //    /** Short-term cache to keep us from reloading same Entity during single request. */
 //    private LoadingCache<EntityScope, org.apache.usergrid.persistence.model.entity.Entity>
entityCache;
 
 
     public CpEntityManager() {
-        corePersistanceTimer = emf.getMetricsFactory().getTimer( CpEntityManager.class, "cp.entity.manager.timer"
);
 
     }
 
@@ -207,6 +206,7 @@ public class CpEntityManager implements EntityManager {
         Preconditions.checkNotNull( applicationId, "applicationId must not be null" );
 
         this.emf = ( CpEntityManagerFactory ) emf;
+        corePersistanceTimer = this.emf.getMetricsFactory().getTimer( CpEntityManager.class,
"cp.entity.manager.timer" );
         this.managerCache = this.emf.getManagerCache();
         this.applicationId = applicationId;
 
@@ -689,7 +689,7 @@ public class CpEntityManager implements EntityManager {
     @Override
     public RelationManager getRelationManager( EntityRef entityRef ) {
         CpRelationManager rmi = new CpRelationManager();
-        rmi.init( this, emf, applicationId, entityRef, null );
+        rmi.init( this, emf, applicationId, entityRef, null, emf.getMetricsFactory() );
         return rmi;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb35127f/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index b247eae..3f439e6 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -18,6 +18,7 @@ package org.apache.usergrid.corepersistence;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
+import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.yammer.metrics.annotation.Metered;
 import static java.lang.String.CASE_INSENSITIVE_ORDER;
@@ -109,15 +110,14 @@ public class CpEntityManagerFactory implements EntityManagerFactory,
Application
     private final MetricsFactory metricsFactory;
 
     public CpEntityManagerFactory(
-            final CassandraService cassandraService, final CounterUtils counterUtils, final
Injector injector,
-                                 final MetricsFactory metricsFactory) {
+            final CassandraService cassandraService, final CounterUtils counterUtils, final
Injector injector) {
 
         this.cassandraService = cassandraService;
         this.counterUtils = counterUtils;
         this.injector = injector;
         this.managerCache = injector.getInstance( ManagerCache.class );
         this.dataMigrationManager = injector.getInstance( DataMigrationManager.class );
-        this.metricsFactory = metricsFactory;
+        this.metricsFactory = injector.getInstance( MetricsFactory.class );
 
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/cb35127f/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
index 786b0f5..499f841 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
@@ -192,6 +192,8 @@ public class CpRelationManager implements RelationManager {
 
     private Timer cpRelationTimer;
 
+    private MetricsFactory metricsFactory;
+
     public CpRelationManager() {}
 
 
@@ -221,7 +223,7 @@ public class CpRelationManager implements RelationManager {
 
         this.cass = em.getCass(); // TODO: eliminate need for this via Core Persistence
         this.indexBucketLocator = indexBucketLocator; // TODO: this also
-
+        this.metricsFactory = metricsFactory;
         this.cpRelationTimer = metricsFactory.getTimer( CpRelationManager.class, "relation.manager.timer"
);
 
         // load the Core Persistence version of the head entity as well
@@ -1541,7 +1543,7 @@ public class CpRelationManager implements RelationManager {
 
     private CpRelationManager getRelationManager( EntityRef headEntity ) {
         CpRelationManager rmi = new CpRelationManager();
-        rmi.init( em, emf, applicationId, headEntity, null );
+        rmi.init( em, emf, applicationId, headEntity, null, metricsFactory);
         return rmi;
     }
 


Mime
View raw message