usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [04/12] incubator-usergrid git commit: Added getAllEntityFromField to the entity manager so we can expose it in the service tier.
Date Mon, 16 Mar 2015 23:35:47 GMT
Added getAllEntityFromField to the entity manager so we can expose it in the service tier.


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

Branch: refs/heads/USERGRID-466
Commit: d4eb288c8a04bf73e79b64d1a06d12fca11260ee
Parents: acde0e4
Author: GERey <greyes@apigee.com>
Authored: Wed Mar 11 09:57:11 2015 -0700
Committer: GERey <greyes@apigee.com>
Committed: Wed Mar 11 09:57:11 2015 -0700

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManager.java |  7 ++++++-
 .../org/apache/usergrid/persistence/EntityManager.java   |  9 ++++++++-
 .../persistence/cassandra/EntityManagerImpl.java         | 11 +++++++++++
 3 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d4eb288c/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 5619382..4b62fbe 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
@@ -33,6 +33,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
 
+import org.apache.usergrid.persistence.collection.FieldSet;
 import org.apache.usergrid.persistence.core.future.BetterFuture;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -500,7 +501,6 @@ public class CpEntityManager implements EntityManager {
 
         CollectionScope collectionScope = getCollectionScopeNameFromEntityType(appId, type
);
         EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope
);
-
         Id entityId = new SimpleId( entity.getUuid(), entity.getType() );
 
         if ( logger.isDebugEnabled() ) {
@@ -729,6 +729,11 @@ public class CpEntityManager implements EntityManager {
         create( entityType, null );
     }
 
+    @Override
+    public Observable<FieldSet> getAllEntityFromFields(CollectionScope collectionScope,Collection<Field>
fields){
+        EntityCollectionManager ecm = managerCache.getEntityCollectionManager( collectionScope
);
+        return ecm.getAllEntities( fields );
+    }
 
     @Override
     public EntityRef getAlias( String aliasType, String alias ) throws Exception {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d4eb288c/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
index 4054d77..459032c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/EntityManager.java
@@ -17,6 +17,8 @@
 package org.apache.usergrid.persistence;
 
 
+import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.FieldSet;
 import org.apache.usergrid.persistence.index.query.Query;
 import java.nio.ByteBuffer;
 import java.util.Collection;
@@ -25,6 +27,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 import me.prettyprint.hector.api.mutation.Mutator;
+import rx.Observable;
 
 import org.apache.usergrid.persistence.cassandra.CassandraService;
 import org.apache.usergrid.persistence.cassandra.GeoIndexManager;
@@ -34,6 +37,7 @@ import org.apache.usergrid.persistence.entities.Role;
 import org.apache.usergrid.persistence.index.query.CounterResolution;
 import org.apache.usergrid.persistence.index.query.Identifier;
 import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.model.field.Field;
 
 
 /**
@@ -712,4 +716,7 @@ public interface EntityManager {
      * Get health status of application's index.
      */
     public Health getIndexHealth();
-}
+
+    public Observable<FieldSet> getAllEntityFromFields(CollectionScope collectionScope,Collection<Field>
fields);
+
+    }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d4eb288c/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
index be43920..adf106a 100644
--- a/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/persistence/cassandra/EntityManagerImpl.java
@@ -69,6 +69,8 @@ import org.apache.usergrid.persistence.SimpleRoleRef;
 import org.apache.usergrid.persistence.TypedEntity;
 import org.apache.usergrid.persistence.cassandra.CounterUtils.AggregateCounterSelection;
 import org.apache.usergrid.persistence.cassandra.util.TraceParticipant;
+import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.apache.usergrid.persistence.collection.FieldSet;
 import org.apache.usergrid.persistence.entities.Application;
 import org.apache.usergrid.persistence.entities.Event;
 import org.apache.usergrid.persistence.entities.Group;
@@ -83,6 +85,7 @@ import org.apache.usergrid.persistence.index.query.Identifier;
 import org.apache.usergrid.persistence.index.query.Query;
 import org.apache.usergrid.persistence.index.query.Query.CounterFilterPredicate;
 import org.apache.usergrid.persistence.index.query.Query.Level;
+import org.apache.usergrid.persistence.model.field.Field;
 import org.apache.usergrid.persistence.schema.CollectionInfo;
 import org.apache.usergrid.utils.ClassUtils;
 import org.apache.usergrid.utils.CompositeUtils;
@@ -107,6 +110,7 @@ import me.prettyprint.hector.api.mutation.Mutator;
 import me.prettyprint.hector.api.query.MultigetSliceCounterQuery;
 import me.prettyprint.hector.api.query.QueryResult;
 import me.prettyprint.hector.api.query.SliceCounterQuery;
+import rx.Observable;
 
 import static java.lang.String.CASE_INSENSITIVE_ORDER;
 import static java.util.Arrays.asList;
@@ -2947,4 +2951,11 @@ public class EntityManagerImpl implements EntityManager {
     public Health getIndexHealth() {
         return Health.GREEN; // no good way to assess index status using old-school entity
manager
     }
+
+
+    @Override
+    public Observable<FieldSet> getAllEntityFromFields( final CollectionScope collectionScope,
+                                                        final Collection<Field> fields
) {
+        throw new UnsupportedOperationException( "Not supported." );
+    }
 }


Mime
View raw message