usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [45/50] git commit: Cleaned up method names to be more concise
Date Wed, 12 Feb 2014 13:21:53 GMT
Cleaned up method names to be more concise


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

Branch: refs/heads/optimistic-tx-semantics
Commit: 2272a9d0d0b416bf0941afdc1b611cda0b490b1f
Parents: 27192cf
Author: Todd Nine <tnine@apigee.com>
Authored: Fri Feb 7 17:05:34 2014 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Fri Feb 7 17:05:34 2014 -0700

----------------------------------------------------------------------
 .../usergrid/persistence/graph/EdgeManager.java |  16 +--
 .../persistence/graph/impl/EdgeManagerImpl.java |  47 ++++---
 .../EdgeMetadataSerialization.java              |  24 ++--
 .../impl/EdgeMetadataSerializationImpl.java     |  69 ++++++-----
 .../persistence/graph/EdgeManagerIT.java        | 122 +++++++++----------
 .../EdgeMetadataSerializationTest.java          |  81 ++++++------
 6 files changed, 188 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/EdgeManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/EdgeManager.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/EdgeManager.java
index ee1b27d..67f0a9d 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/EdgeManager.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/EdgeManager.java
@@ -76,7 +76,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits Edges. The observer will need to unsubscribe when it has completed consumption.
      */
-    Observable<Edge> loadSourceEdges( SearchByEdgeType search );
+    Observable<Edge> loadEdgesFromSource( SearchByEdgeType search );
 
     /**
      * Returns an observable that emits all edges where the specified node is the target node. The edges will match the
@@ -86,7 +86,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits Edges. The observer will need to unsubscribe when it has completed consumption.
      */
-    Observable<Edge> loadTargetEdges( SearchByEdgeType search );
+    Observable<Edge> loadEdgesToTarget( SearchByEdgeType search );
 
 
     /**
@@ -97,7 +97,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits Edges. The observer will need to unsubscribe when it has completed consumption.
      */
-    Observable<Edge> loadSourceEdges( SearchByIdType search );
+    Observable<Edge> loadEdgesFromSourceByType( SearchByIdType search );
 
 
     /**
@@ -108,7 +108,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits Edges. The observer will need to unsubscribe when it has completed consumption.
      */
-    Observable<Edge> loadTargetEdges( SearchByIdType search );
+    Observable<Edge> loadEdgesToTargetByType( SearchByIdType search );
 
     /**
      * Get all edge types to this node.  The node provided by search is the target node.
@@ -117,7 +117,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits strings for edge types
      */
-    Observable<String> getSourceEdgeTypes( SearchEdgeType search );
+    Observable<String> getEdgeTypesFromSource( SearchEdgeType search );
 
 
     /**
@@ -127,7 +127,7 @@ public interface EdgeManager {
      *
      * @return An observable of all source id types
      */
-    Observable<String> getSourceIdTypes( SearchIdType search );
+    Observable<String> getIdTypesFromSource( SearchIdType search );
 
 
     /**
@@ -137,7 +137,7 @@ public interface EdgeManager {
      *
      * @return An observable that emits strings for edge types
      */
-    Observable<String> getTargetEdgeTypes( SearchEdgeType search );
+    Observable<String> getEdgeTypesToTarget( SearchEdgeType search );
 
 
     /**
@@ -147,5 +147,5 @@ public interface EdgeManager {
      *
      * @return An observable of all source id types
      */
-    Observable<String> getTargetIdTypes( SearchIdType search );
+    Observable<String> getIdTypesToTarget( SearchIdType search );
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/EdgeManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/EdgeManagerImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/EdgeManagerImpl.java
index d2aace2..2784519 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/EdgeManagerImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/impl/EdgeManagerImpl.java
@@ -23,7 +23,6 @@ package org.apache.usergrid.persistence.graph.impl;
 import java.util.Iterator;
 
 import org.apache.usergrid.persistence.collection.OrganizationScope;
-import org.apache.usergrid.persistence.collection.hystrix.CassandraCommand;
 import org.apache.usergrid.persistence.collection.mvcc.entity.ValidationUtils;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.EdgeManager;
@@ -32,6 +31,7 @@ import org.apache.usergrid.persistence.graph.SearchByIdType;
 import org.apache.usergrid.persistence.graph.SearchEdgeType;
 import org.apache.usergrid.persistence.graph.SearchIdType;
 import org.apache.usergrid.persistence.graph.serialization.EdgeMetadataSerialization;
+import org.apache.usergrid.persistence.graph.serialization.EdgeSerialization;
 import org.apache.usergrid.persistence.graph.serialization.impl.parse.ObservableIterator;
 import org.apache.usergrid.persistence.graph.serialization.stage.GraphIoEvent;
 import org.apache.usergrid.persistence.graph.serialization.stage.write.EdgeWriteStage;
@@ -58,14 +58,19 @@ public class EdgeManagerImpl implements EdgeManager {
 
     private final EdgeMetadataSerialization edgeMetadataSerialization;
 
+    private final EdgeSerialization edgeSerialization;
+
 
     @Inject
     public EdgeManagerImpl( final EdgeWriteStage edgeWriteStage, final Scheduler scheduler,
-                            @Assisted final OrganizationScope scope,
-                            final EdgeMetadataSerialization edgeMetadataSerialization ) {
+                            final EdgeMetadataSerialization edgeMetadataSerialization,
+                            final EdgeSerialization edgeSerialization,
+                            @Assisted final OrganizationScope scope ) {
         this.edgeWriteStage = edgeWriteStage;
         this.scheduler = scheduler;
         this.edgeMetadataSerialization = edgeMetadataSerialization;
+        this.edgeSerialization = edgeSerialization;
+
 
         ValidationUtils.validateOrganizationScope( scope );
 
@@ -76,25 +81,29 @@ public class EdgeManagerImpl implements EdgeManager {
 
     @Override
     public Observable<Edge> writeEdge( final Edge edge ) {
-        return Observable.from( new GraphIoEvent<Edge>( scope, edge ) ).map( edgeWriteStage );
+        return Observable.from( new GraphIoEvent<Edge>( scope, edge ) ).subscribeOn( scheduler ).map( edgeWriteStage );
     }
 
 
     @Override
     public void deleteEdge( final Edge edge ) {
-        //To change body of implemented methods use File | Settings | File Templates.
+        throw new UnsupportedOperationException("Not yet implemented");
     }
 
 
     @Override
-    public Observable<Edge> loadSourceEdges( final SearchByEdgeType search ) {
-
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    public Observable<Edge> loadEdgesFromSource( final SearchByEdgeType search ) {
+        return Observable.create( new ObservableIterator<Edge>() {
+            @Override
+            protected Iterator<Edge> getIterator() {
+                return edgeSerialization.getEdgesFromSource( scope, search );
+            }
+        } );
     }
 
 
     @Override
-    public Observable<Edge> loadTargetEdges( final SearchByEdgeType search ) {
+    public Observable<Edge> loadEdgesToTarget( final SearchByEdgeType search ) {
 
 
         return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -102,24 +111,24 @@ public class EdgeManagerImpl implements EdgeManager {
 
 
     @Override
-    public Observable<Edge> loadSourceEdges( final SearchByIdType search ) {
+    public Observable<Edge> loadEdgesFromSourceByType( final SearchByIdType search ) {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
 
     @Override
-    public Observable<Edge> loadTargetEdges( final SearchByIdType search ) {
+    public Observable<Edge> loadEdgesToTargetByType( final SearchByIdType search ) {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
 
     @Override
-    public Observable<String> getSourceEdgeTypes( final SearchEdgeType search ) {
+    public Observable<String> getEdgeTypesFromSource( final SearchEdgeType search ) {
 
        return Observable.create( new ObservableIterator<String>() {
             @Override
             protected Iterator<String> getIterator() {
-                return edgeMetadataSerialization.getSourceEdgeTypes( scope, search );
+                return edgeMetadataSerialization.getEdgeTypesToTarget( scope, search );
             }
         } );
 
@@ -127,34 +136,34 @@ public class EdgeManagerImpl implements EdgeManager {
 
 
     @Override
-    public Observable<String> getSourceIdTypes( final SearchIdType search ) {
+    public Observable<String> getIdTypesFromSource( final SearchIdType search ) {
         return Observable.create( new ObservableIterator<String>() {
             @Override
             protected Iterator<String> getIterator() {
-                return edgeMetadataSerialization.getSourceIdTypes( scope, search );
+                return edgeMetadataSerialization.getIdTypesToTarget( scope, search );
             }
         } );
     }
 
 
     @Override
-    public Observable<String> getTargetEdgeTypes( final SearchEdgeType search ) {
+    public Observable<String> getEdgeTypesToTarget( final SearchEdgeType search ) {
 
         return Observable.create( new ObservableIterator<String>() {
             @Override
             protected Iterator<String> getIterator() {
-                return edgeMetadataSerialization.getTargetEdgeTypes( scope, search );
+                return edgeMetadataSerialization.getEdgeTypesFromSource( scope, search );
             }
         } );
     }
 
 
     @Override
-    public Observable<String> getTargetIdTypes( final SearchIdType search ) {
+    public Observable<String> getIdTypesToTarget( final SearchIdType search ) {
         return Observable.create( new ObservableIterator<String>() {
             @Override
             protected Iterator<String> getIterator() {
-                return edgeMetadataSerialization.getTargetIdTypes( scope, search );
+                return edgeMetadataSerialization.getIdTypesFromSource( scope, search );
             }
         } );
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
index 05e7b51..bb36bff 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerialization.java
@@ -50,7 +50,7 @@ public interface EdgeMetadataSerialization {
      *
      * @return a mutation batch with the delete operations
      */
-    MutationBatch removeTargetEdgeType( OrganizationScope scope, Edge edge );
+    MutationBatch removeEdgeTypeFromSource( OrganizationScope scope, Edge edge );
 
 
     /**
@@ -62,7 +62,7 @@ public interface EdgeMetadataSerialization {
      *
      * @return a mutation batch with the delete operations
      */
-    MutationBatch removeTargetIdType( OrganizationScope scope, Edge edge );
+    MutationBatch removeIdTypeFromSource( OrganizationScope scope, Edge edge );
 
     /**
      * Remove all meta data from the target to the source type.  The caller must ensure that this is the last
@@ -73,7 +73,7 @@ public interface EdgeMetadataSerialization {
      *
      * @return a mutation batch with the delete operations
      */
-    MutationBatch removeSourceEdgeType( OrganizationScope scope, Edge edge );
+    MutationBatch removeEdgeTypeToTarget( OrganizationScope scope, Edge edge );
 
 
     /**
@@ -85,42 +85,42 @@ public interface EdgeMetadataSerialization {
      *
      * @return a mutation batch with the delete operations
      */
-    MutationBatch removeSourceIdType( OrganizationScope scope, Edge edge );
+    MutationBatch removeIdTypeToTarget( OrganizationScope scope, Edge edge );
 
     /**
-     * Get all target edge types for the given source node
+     * Get all edge types from the given source node
      *
      * @param search The search to execute
      *
      * @return An iterator of all the edge types
      */
-    Iterator<String> getTargetEdgeTypes( OrganizationScope scope, SearchEdgeType search );
+    Iterator<String> getEdgeTypesFromSource( OrganizationScope scope, SearchEdgeType search );
 
     /**
-     * Get all target id types on the edge with the type given and the source node
+     * Get all target id types on the edge with the type given from the source node
      *
      * @param search The search to execute
      *
      * @return An iterator of all id types
      */
-    Iterator<String> getTargetIdTypes( OrganizationScope scope, SearchIdType search );
+    Iterator<String> getIdTypesFromSource( OrganizationScope scope, SearchIdType search );
 
 
     /**
-     * Get all target edge types for the given target node
+     * Get all source edge types pointing to the given target node
      *
      * @param search The search to execute
      *
      * @return An iterator of all the edge types
      */
-    Iterator<String> getSourceEdgeTypes( OrganizationScope scope, SearchEdgeType search );
+    Iterator<String> getEdgeTypesToTarget( OrganizationScope scope, SearchEdgeType search );
 
     /**
-     * Get all target id types on the edge with the type given and the target node
+     * Get all source id types on the edge with the type given pointing to the target node
      *
      * @param search The search to execute
      *
      * @return An iterator of all id types
      */
-    Iterator<String> getSourceIdTypes( OrganizationScope scope, SearchIdType search );
+    Iterator<String> getIdTypesToTarget( OrganizationScope scope, SearchIdType search );
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
index 0323a1f..c2aadb2 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
@@ -82,23 +82,30 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
     private static final StringColumnParser PARSER = StringColumnParser.get();
 
 
-    private static final MultiTennantColumnFamily<OrganizationScope, Id, String> CF_TARGET_EDGE_TYPES =
-            new MultiTennantColumnFamily<OrganizationScope, Id, String>( "Graph_Target_Edge_Types", ROW_KEY_SER,
-                    STRING_SERIALIZER );
-
+    /**
+     * CFs where the row key contains the source node id
+     */
     private static final MultiTennantColumnFamily<OrganizationScope, Id, String> CF_SOURCE_EDGE_TYPES =
             new MultiTennantColumnFamily<OrganizationScope, Id, String>( "Graph_Source_Edge_Types", ROW_KEY_SER,
                     STRING_SERIALIZER );
 
-    //all target id types for source edge type
-    private static final MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String> CF_TARGET_EDGE_ID_TYPES =
-            new MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String>( "Graph_Target_Edge_Id_Types",
+       //all target id types for source edge type
+    private static final MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String> CF_SOURCE_EDGE_ID_TYPES =
+            new MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String>( "Graph_Source_Edge_Id_Types",
                     EDGE_TYPE_ROW_KEY, STRING_SERIALIZER );
 
+    /**
+     * CFs where the row key is the target node id
+     */
+    private static final MultiTennantColumnFamily<OrganizationScope, Id, String> CF_TARGET_EDGE_TYPES =
+            new MultiTennantColumnFamily<OrganizationScope, Id, String>( "Graph_Target_Edge_Types", ROW_KEY_SER,
+                    STRING_SERIALIZER );
+
+
 
     //all source id types for target edge type
-    private static final MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String> CF_SOURCE_EDGE_ID_TYPES =
-            new MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String>( "Graph_Source_Edge_Id_Types",
+    private static final MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String> CF_TARGET_EDGE_ID_TYPES =
+            new MultiTennantColumnFamily<OrganizationScope, EdgeIdTypeKey, String>( "Graph_Target_Edge_Id_Types",
                     EDGE_TYPE_ROW_KEY, STRING_SERIALIZER );
 
 
@@ -133,7 +140,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
         //add source->target edge type to meta data
         final ScopedRowKey<OrganizationScope, Id> sourceKey = new ScopedRowKey<OrganizationScope, Id>( scope, source );
 
-        batch.withRow( CF_TARGET_EDGE_TYPES, sourceKey ).setTimestamp( timestamp ).putColumn( edgeType, HOLDER );
+        batch.withRow( CF_SOURCE_EDGE_TYPES, sourceKey ).setTimestamp( timestamp ).putColumn( edgeType, HOLDER );
 
 
         //write source->target edge type and id type to meta data
@@ -142,7 +149,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
                 new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, tk );
 
 
-        batch.withRow( CF_TARGET_EDGE_ID_TYPES, sourceTypeKey ).setTimestamp( timestamp )
+        batch.withRow( CF_SOURCE_EDGE_ID_TYPES, sourceTypeKey ).setTimestamp( timestamp )
              .putColumn( target.getType(), HOLDER );
 
 
@@ -150,7 +157,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
         final ScopedRowKey<OrganizationScope, Id> targetKey = new ScopedRowKey<OrganizationScope, Id>( scope, target );
 
 
-        batch.withRow( CF_SOURCE_EDGE_TYPES, targetKey ).setTimestamp( timestamp ).putColumn( edgeType, HOLDER );
+        batch.withRow( CF_TARGET_EDGE_TYPES, targetKey ).setTimestamp( timestamp ).putColumn( edgeType, HOLDER );
 
 
         //write target<--source edge type and id type to meta data
@@ -158,7 +165,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
                 new ScopedRowKey<OrganizationScope, EdgeIdTypeKey>( scope, new EdgeIdTypeKey( target, edgeType ) );
 
 
-        batch.withRow( CF_SOURCE_EDGE_ID_TYPES, targetTypeKey ).setTimestamp( timestamp )
+        batch.withRow( CF_TARGET_EDGE_ID_TYPES, targetTypeKey ).setTimestamp( timestamp )
              .putColumn( source.getType(), HOLDER );
 
 
@@ -167,29 +174,29 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
 
     @Override
-    public MutationBatch removeTargetEdgeType( final OrganizationScope scope, final Edge edge ) {
-        return removeEdgeType( scope, edge.getSourceNode(), edge.getType(), edge.getVersion(), CF_TARGET_EDGE_TYPES );
+    public MutationBatch removeEdgeTypeFromSource( final OrganizationScope scope, final Edge edge ) {
+        return removeEdgeType( scope, edge.getSourceNode(), edge.getType(), edge.getVersion(), CF_SOURCE_EDGE_TYPES );
     }
 
 
     @Override
-    public MutationBatch removeTargetIdType( final OrganizationScope scope, final Edge edge ) {
+    public MutationBatch removeIdTypeFromSource( final OrganizationScope scope, final Edge edge ) {
         return removeIdType( scope, edge.getSourceNode(), edge.getTargetNode(), edge.getType(), edge.getVersion(),
-                CF_TARGET_EDGE_ID_TYPES );
+                CF_SOURCE_EDGE_ID_TYPES );
     }
 
 
     @Override
-    public MutationBatch removeSourceEdgeType( final OrganizationScope scope, final Edge edge ) {
-        return removeEdgeType( scope, edge.getTargetNode(), edge.getType(), edge.getVersion(), CF_SOURCE_EDGE_TYPES );
+    public MutationBatch removeEdgeTypeToTarget( final OrganizationScope scope, final Edge edge ) {
+        return removeEdgeType( scope, edge.getTargetNode(), edge.getType(), edge.getVersion(), CF_TARGET_EDGE_TYPES );
     }
 
 
 
     @Override
-    public MutationBatch removeSourceIdType( final OrganizationScope scope, final Edge edge ) {
+    public MutationBatch removeIdTypeToTarget( final OrganizationScope scope, final Edge edge ) {
         return removeIdType( scope, edge.getTargetNode(), edge.getSourceNode(), edge.getType(), edge.getVersion(),
-                CF_SOURCE_EDGE_ID_TYPES );
+                CF_TARGET_EDGE_ID_TYPES );
     }
 
 
@@ -256,20 +263,20 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
 
     @Override
-    public Iterator<String> getTargetEdgeTypes( final OrganizationScope scope, final SearchEdgeType search ) {
-        return getEdgeTypes( scope, search, CF_TARGET_EDGE_TYPES );
+    public Iterator<String> getEdgeTypesFromSource( final OrganizationScope scope, final SearchEdgeType search ) {
+        return getEdgeTypes( scope, search, CF_SOURCE_EDGE_TYPES );
     }
 
 
     @Override
-    public Iterator<String> getTargetIdTypes( final OrganizationScope scope, final SearchIdType search ) {
-        return getIdTypes( scope, search, CF_TARGET_EDGE_ID_TYPES );
+    public Iterator<String> getIdTypesFromSource( final OrganizationScope scope, final SearchIdType search ) {
+        return getIdTypes( scope, search, CF_SOURCE_EDGE_ID_TYPES );
     }
 
 
     @Override
-    public Iterator<String> getSourceEdgeTypes( final OrganizationScope scope, final SearchEdgeType search ) {
-        return getEdgeTypes( scope, search, CF_SOURCE_EDGE_TYPES );
+    public Iterator<String> getEdgeTypesToTarget( final OrganizationScope scope, final SearchEdgeType search ) {
+        return getEdgeTypes( scope, search, CF_TARGET_EDGE_TYPES );
     }
 
 
@@ -311,8 +318,8 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
 
     @Override
-    public Iterator<String> getSourceIdTypes( final OrganizationScope scope, final SearchIdType search ) {
-        return getIdTypes( scope, search, CF_SOURCE_EDGE_ID_TYPES );
+    public Iterator<String> getIdTypesToTarget( final OrganizationScope scope, final SearchIdType search ) {
+        return getIdTypes( scope, search, CF_TARGET_EDGE_ID_TYPES );
     }
 
 
@@ -353,8 +360,8 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
     @Override
     public Collection<MultiTennantColumnFamilyDefinition> getColumnFamilies() {
-        return Arrays.asList( graphCf( CF_TARGET_EDGE_TYPES ), graphCf( CF_SOURCE_EDGE_TYPES ),
-                graphCf( CF_TARGET_EDGE_ID_TYPES ), graphCf( CF_SOURCE_EDGE_ID_TYPES ) );
+        return Arrays.asList( graphCf( CF_SOURCE_EDGE_TYPES ), graphCf( CF_TARGET_EDGE_TYPES ),
+                graphCf( CF_SOURCE_EDGE_ID_TYPES ), graphCf( CF_TARGET_EDGE_ID_TYPES ) );
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/EdgeManagerIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/EdgeManagerIT.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/EdgeManagerIT.java
index 17cff7d..cd079e6 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/EdgeManagerIT.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/EdgeManagerIT.java
@@ -27,7 +27,6 @@ import org.jukito.JukitoRunner;
 import org.jukito.UseModules;
 import org.junit.Before;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -35,7 +34,7 @@ import org.junit.runner.RunWith;
 import org.apache.usergrid.persistence.collection.OrganizationScope;
 import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
 import org.apache.usergrid.persistence.collection.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.graph.guice.GraphModule;
+import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
 import org.apache.usergrid.persistence.graph.impl.SimpleEdge;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchIdType;
@@ -58,10 +57,9 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
 
-@Ignore // tests fail due to unimplemented methods in EdgeManagerImpl that return null
 
 @RunWith( JukitoRunner.class )
-@UseModules( { GraphModule.class } )
+@UseModules( { TestGraphModule.class } )
 public class EdgeManagerIT {
 
 
@@ -108,7 +106,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getSourceNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().last();
@@ -118,7 +116,7 @@ public class EdgeManagerIT {
         //change edge type to be invalid, shouldn't get a result
         search = createSearchByEdge( edge.getSourceNode(), edge.getType() + "invalid", edge.getVersion(), null );
 
-        edges = em.loadSourceEdges( search );
+        edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -141,7 +139,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getTargetNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadTargetEdges( search );
+        Observable<Edge> edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -151,7 +149,7 @@ public class EdgeManagerIT {
         //change edge type to be invalid, shouldn't get a result
         search = createSearchByEdge( edge.getTargetNode(), edge.getType() + "invalid", edge.getVersion(), null );
 
-        edges = em.loadTargetEdges( search );
+        edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -176,7 +174,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getSourceNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -186,7 +184,7 @@ public class EdgeManagerIT {
         //now test with an earlier version, we shouldn't get the edge back
         search = createSearchByEdge( edge.getSourceNode(), edge.getType(), earlyVersion, null );
 
-        edges = em.loadSourceEdges( search );
+        edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -212,7 +210,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getTargetNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadTargetEdges( search );
+        Observable<Edge> edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -222,7 +220,7 @@ public class EdgeManagerIT {
         //change edge type to be invalid, shouldn't get a result
         search = createSearchByEdge( edge.getTargetNode(), edge.getType(), earlyVersion, null );
 
-        edges = em.loadTargetEdges( search );
+        edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -239,15 +237,15 @@ public class EdgeManagerIT {
 
         Edge edge1 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge1 );
+        em.writeEdge( edge1 ).toBlockingObservable().singleOrDefault( null );;
 
         Edge edge2 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge2 );
+        em.writeEdge( edge2 ).toBlockingObservable().singleOrDefault( null );;
 
         Edge edge3 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge3 );
+        em.writeEdge( edge3 ).toBlockingObservable().singleOrDefault( null );;
 
 
         //now test retrieving it
@@ -255,7 +253,7 @@ public class EdgeManagerIT {
         SearchByEdgeType search =
                 createSearchByEdge( edge1.getSourceNode(), edge1.getType(), edge1.getVersion(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Iterator<Edge> returned = edges.toBlockingObservable().next().iterator();
@@ -268,7 +266,7 @@ public class EdgeManagerIT {
 
         search = createSearchByEdge( edge1.getSourceNode(), edge1.getType(), edge1.getVersion(), edge2 );
 
-        edges = em.loadSourceEdges( search );
+        edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().next().iterator();
@@ -288,15 +286,15 @@ public class EdgeManagerIT {
 
         Edge edge1 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge1 );
+        em.writeEdge( edge1 ).toBlockingObservable().singleOrDefault( null );;
 
         Edge edge2 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge2 );
+        em.writeEdge( edge2 ).toBlockingObservable().singleOrDefault( null );;
 
         Edge edge3 = createEdge( "source", "test", "target" );
 
-        em.writeEdge( edge3 );
+        em.writeEdge( edge3 ).toBlockingObservable().singleOrDefault( null );;
 
 
         //now test retrieving it
@@ -304,7 +302,7 @@ public class EdgeManagerIT {
         SearchByEdgeType search =
                 createSearchByEdge( edge1.getTargetNode(), edge1.getType(), edge1.getVersion(), null );
 
-        Observable<Edge> edges = em.loadTargetEdges( search );
+        Observable<Edge> edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Iterator<Edge> returned = edges.toBlockingObservable().next().iterator();
@@ -317,7 +315,7 @@ public class EdgeManagerIT {
 
         search = createSearchByEdge( edge1.getTargetNode(), edge1.getType(), edge1.getVersion(), edge2 );
 
-        edges = em.loadTargetEdges( search );
+        edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().next().iterator();
@@ -343,7 +341,7 @@ public class EdgeManagerIT {
         SearchByIdType search = createSearchByEdgeAndId( edge.getSourceNode(), edge.getType(), edge.getVersion(),
                 edge.getTargetNode().getType(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSourceByType( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -355,7 +353,7 @@ public class EdgeManagerIT {
         search = createSearchByEdgeAndId( edge.getSourceNode(), edge.getType(), edge.getVersion(),
                 edge.getTargetNode().getType() + "invalid", null );
 
-        edges = em.loadSourceEdges( search );
+        edges = em.loadEdgesFromSourceByType( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -379,7 +377,7 @@ public class EdgeManagerIT {
         SearchByIdType search = createSearchByEdgeAndId( edge.getTargetNode(), edge.getType(), edge.getVersion(),
                 edge.getSourceNode().getType(), null );
 
-        Observable<Edge> edges = em.loadTargetEdges( search );
+        Observable<Edge> edges = em.loadEdgesToTargetByType( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -391,7 +389,7 @@ public class EdgeManagerIT {
         search = createSearchByEdgeAndId( edge.getTargetNode(), edge.getType(), edge.getVersion(),
                 edge.getSourceNode().getType() + "invalid", null );
 
-        edges = em.loadTargetEdges( search );
+        edges = em.loadEdgesToTargetByType( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -415,7 +413,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getSourceNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -425,7 +423,7 @@ public class EdgeManagerIT {
         SearchByIdType searchById = createSearchByEdgeAndId( edge.getSourceNode(), edge.getType(), edge.getVersion(),
                 edge.getTargetNode().getType(), null );
 
-        edges = em.loadSourceEdges( searchById );
+        edges = em.loadEdgesFromSourceByType( searchById );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().single();
@@ -437,7 +435,7 @@ public class EdgeManagerIT {
         em.deleteEdge( edge );
 
         //now test retrieval, should be null
-        edges = em.loadSourceEdges( search );
+        edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -447,7 +445,7 @@ public class EdgeManagerIT {
 
         //no search by type, should be null as well
 
-        edges = em.loadSourceEdges( searchById );
+        edges = em.loadEdgesFromSourceByType( searchById );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -471,7 +469,7 @@ public class EdgeManagerIT {
 
         SearchByEdgeType search = createSearchByEdge( edge.getTargetNode(), edge.getType(), edge.getVersion(), null );
 
-        Observable<Edge> edges = em.loadSourceEdges( search );
+        Observable<Edge> edges = em.loadEdgesFromSource( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         Edge returned = edges.toBlockingObservable().single();
@@ -481,7 +479,7 @@ public class EdgeManagerIT {
         SearchByIdType searchById = createSearchByEdgeAndId( edge.getTargetNode(), edge.getType(), edge.getVersion(),
                 edge.getSourceNode().getType(), null );
 
-        edges = em.loadSourceEdges( searchById );
+        edges = em.loadEdgesFromSourceByType( searchById );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().single();
@@ -493,7 +491,7 @@ public class EdgeManagerIT {
         em.deleteEdge( edge );
 
         //now test retrieval, should be null
-        edges = em.loadTargetEdges( search );
+        edges = em.loadEdgesToTarget( search );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -503,7 +501,7 @@ public class EdgeManagerIT {
 
         //no search by type, should be null as well
 
-        edges = em.loadTargetEdges( searchById );
+        edges = em.loadEdgesToTargetByType( searchById );
 
         //implicitly blows up if more than 1 is returned from "single"
         returned = edges.toBlockingObservable().singleOrDefault( null );
@@ -523,21 +521,21 @@ public class EdgeManagerIT {
 
         Edge testTargetEdge = new SimpleEdge( sourceId, "test", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge );
+        em.writeEdge( testTargetEdge ).toBlockingObservable().singleOrDefault( null );
 
         Edge testTarget2Edge = new SimpleEdge( sourceId, "test", targetId2, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTarget2Edge );
+        em.writeEdge( testTarget2Edge ).toBlockingObservable().singleOrDefault( null );;
 
 
         Edge test2TargetEdge = new SimpleEdge( sourceId, "test2", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( test2TargetEdge );
+        em.writeEdge( test2TargetEdge).toBlockingObservable().singleOrDefault( null );
 
 
         //get our 2 edge types
         Observable<String> edges =
-                em.getTargetEdgeTypes( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
+                em.getEdgeTypesToTarget( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
 
 
         List<String> results = edges.toList().toBlockingObservable().single();
@@ -550,7 +548,7 @@ public class EdgeManagerIT {
 
         //now test sub edges
 
-        edges = em.getTargetIdTypes( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test", null ) );
+        edges = em.getIdTypesToTarget( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test", null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -561,7 +559,7 @@ public class EdgeManagerIT {
         assertTrue( "Types correct", results.contains( targetId2 ) );
 
         //now get types for test2
-        edges = em.getTargetIdTypes( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test2", null ) );
+        edges = em.getIdTypesToTarget( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test2", null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -575,7 +573,7 @@ public class EdgeManagerIT {
         em.deleteEdge( test2TargetEdge );
 
 
-        edges = em.getTargetEdgeTypes( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
+        edges = em.getEdgeTypesToTarget( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -595,22 +593,22 @@ public class EdgeManagerIT {
 
         Edge testTargetEdge = new SimpleEdge( sourceId1, "test", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge );
+        em.writeEdge( testTargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
         Edge testTarget2Edge = new SimpleEdge( sourceId2, "test", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTarget2Edge );
+        em.writeEdge( testTarget2Edge ).toBlockingObservable().singleOrDefault( null );;
 
 
         Edge test2TargetEdge = new SimpleEdge( sourceId1, "test2", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( test2TargetEdge );
+        em.writeEdge( test2TargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
 
         //get our 2 edge types
         final SearchEdgeType edgeTypes = new SimpleSearchEdgeType( testTargetEdge.getTargetNode(), null );
 
-        Observable<String> edges = em.getSourceEdgeTypes( edgeTypes );
+        Observable<String> edges = em.getEdgeTypesFromSource( edgeTypes );
 
 
         List<String> results = edges.toList().toBlockingObservable().single();
@@ -624,7 +622,7 @@ public class EdgeManagerIT {
 
         //now test sub edges
 
-        edges = em.getSourceEdgeTypes( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test", null ) );
+        edges = em.getEdgeTypesFromSource( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test", null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -636,7 +634,7 @@ public class EdgeManagerIT {
 
 
         //now get types for test2
-        edges = em.getSourceIdTypes( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test2", null ) );
+        edges = em.getIdTypesFromSource( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test2", null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -650,7 +648,7 @@ public class EdgeManagerIT {
         em.deleteEdge( test2TargetEdge );
 
 
-        edges = em.getTargetEdgeTypes( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
+        edges = em.getEdgeTypesToTarget( new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null ) );
 
         results = edges.toList().toBlockingObservable().single();
 
@@ -670,23 +668,23 @@ public class EdgeManagerIT {
 
         Edge testTargetEdge = new SimpleEdge( sourceId1, "test", targetId1, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge );
+        em.writeEdge( testTargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
 
         Edge testTargetEdge2 = new SimpleEdge( sourceId1, "test", targetId2, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge2 );
+        em.writeEdge( testTargetEdge2 ).toBlockingObservable().singleOrDefault( null );;
 
 
         Edge test2TargetEdge = new SimpleEdge( sourceId1, "test2", targetId2, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( test2TargetEdge );
+        em.writeEdge( test2TargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
 
         //get our 2 edge types
         SearchEdgeType edgeTypes = new SimpleSearchEdgeType( testTargetEdge.getSourceNode(), null );
 
-        Observable<String> edges = em.getTargetEdgeTypes( edgeTypes );
+        Observable<String> edges = em.getEdgeTypesToTarget( edgeTypes );
 
 
         Iterator<String> results = edges.toBlockingObservable().getIterator();
@@ -698,7 +696,7 @@ public class EdgeManagerIT {
 
         edgeTypes = new SimpleSearchEdgeType( testTargetEdge.getTargetNode(), "test" );
 
-        edges = em.getTargetEdgeTypes( edgeTypes );
+        edges = em.getEdgeTypesToTarget( edgeTypes );
 
 
         results = edges.toBlockingObservable().getIterator();
@@ -709,7 +707,7 @@ public class EdgeManagerIT {
 
         //now test sub edges
 
-        edges = em.getTargetIdTypes( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test", null ) );
+        edges = em.getIdTypesToTarget( new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test", null ) );
 
         results = edges.toBlockingObservable().getIterator();
 
@@ -718,7 +716,7 @@ public class EdgeManagerIT {
 
         //now get the next page
 
-        edges = em.getTargetIdTypes(
+        edges = em.getIdTypesToTarget(
                 new SimpleSearchIdType( testTargetEdge.getSourceNode(), "test", targetId1.getType() ) );
 
         results = edges.toBlockingObservable().getIterator();
@@ -742,22 +740,22 @@ public class EdgeManagerIT {
 
         Edge testTargetEdge = new SimpleEdge( sourceId1, "test", targetId, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge );
+        em.writeEdge( testTargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
 
         Edge testTargetEdge2 = new SimpleEdge( sourceId2, "test", targetId, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( testTargetEdge2 );
+        em.writeEdge( testTargetEdge2 ).toBlockingObservable().singleOrDefault( null );;
 
         Edge test2TargetEdge = new SimpleEdge( sourceId2, "test2", targetId, UUIDGenerator.newTimeUUID() );
 
-        em.writeEdge( test2TargetEdge );
+        em.writeEdge( test2TargetEdge ).toBlockingObservable().singleOrDefault( null );;
 
 
         //get our 2 edge types
         SearchEdgeType edgeTypes = new SimpleSearchEdgeType( testTargetEdge.getTargetNode(), null );
 
-        Observable<String> edges = em.getSourceEdgeTypes( edgeTypes );
+        Observable<String> edges = em.getEdgeTypesFromSource( edgeTypes );
 
 
         Iterator<String> results = edges.toBlockingObservable().getIterator();
@@ -769,7 +767,7 @@ public class EdgeManagerIT {
 
         edgeTypes = new SimpleSearchEdgeType( testTargetEdge.getTargetNode(), "test" );
 
-        edges = em.getSourceEdgeTypes( edgeTypes );
+        edges = em.getEdgeTypesFromSource( edgeTypes );
 
 
         results = edges.toBlockingObservable().getIterator();
@@ -780,7 +778,7 @@ public class EdgeManagerIT {
 
         //now test sub edges
 
-        edges = em.getSourceEdgeTypes( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test", null ) );
+        edges = em.getEdgeTypesFromSource( new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test", null ) );
 
         results = edges.toBlockingObservable().getIterator();
 
@@ -789,7 +787,7 @@ public class EdgeManagerIT {
 
         //now get the next page
 
-        edges = em.getSourceEdgeTypes(
+        edges = em.getEdgeTypesFromSource(
                 new SimpleSearchIdType( testTargetEdge.getTargetNode(), "test", sourceId1.getType() ) );
 
         results = edges.toBlockingObservable().getIterator();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/2272a9d0/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerializationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerializationTest.java b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerializationTest.java
index 5194e97..0600119 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerializationTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeMetadataSerializationTest.java
@@ -34,7 +34,6 @@ import org.apache.usergrid.persistence.collection.OrganizationScope;
 import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
 import org.apache.usergrid.persistence.collection.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.graph.Edge;
-import org.apache.usergrid.persistence.graph.guice.GraphModule;
 import org.apache.usergrid.persistence.graph.guice.TestGraphModule;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
@@ -108,7 +107,7 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge3 ).execute();
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, null ) );
+        Iterator<String> edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
@@ -116,7 +115,7 @@ public class EdgeMetadataSerializationTest {
 
         //now check we can resume correctly with a "last"
 
-        edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, "edge" ) );
+        edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, "edge" ) );
 
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
@@ -142,7 +141,7 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge3 ).execute();
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, null ) );
+        Iterator<String> edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
@@ -150,7 +149,7 @@ public class EdgeMetadataSerializationTest {
 
         //now check we can resume correctly with a "last"
 
-        edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, "edge" ) );
+        edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, "edge" ) );
 
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
@@ -180,7 +179,8 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge4 ).execute();
 
         //now check we get both types back
-        Iterator<String> types = serialization.getTargetIdTypes( scope, createSearchIdType( sourceId, "edge", null ) );
+        Iterator<String> types = serialization.getIdTypesFromSource( scope,
+                createSearchIdType( sourceId, "edge", null ) );
 
         assertEquals( "target", types.next() );
         assertEquals( "target2", types.next() );
@@ -189,14 +189,14 @@ public class EdgeMetadataSerializationTest {
 
         //now check we can resume correctly with a "last"
 
-        types = serialization.getTargetIdTypes( scope, createSearchIdType( sourceId, "edge", "target" ) );
+        types = serialization.getIdTypesFromSource( scope, createSearchIdType( sourceId, "edge", "target" ) );
 
         assertEquals( "target2", types.next() );
         assertFalse( types.hasNext() );
 
 
         //check by other type
-        types = serialization.getTargetIdTypes( scope, createSearchIdType( sourceId, "edge2", null ) );
+        types = serialization.getIdTypesFromSource( scope, createSearchIdType( sourceId, "edge2", null ) );
         assertEquals( "target3", types.next() );
         assertFalse( types.hasNext() );
     }
@@ -225,7 +225,8 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge4 ).execute();
 
         //now check we get both types back
-        Iterator<String> types = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge", null ) );
+        Iterator<String> types = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge",
+                null ) );
 
         assertEquals( "source", types.next() );
         assertEquals( "source2", types.next() );
@@ -234,14 +235,14 @@ public class EdgeMetadataSerializationTest {
 
         //now check we can resume correctly with a "last"
 
-        types = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge", "source" ) );
+        types = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge", "source" ) );
 
         assertEquals( "source2", types.next() );
         assertFalse( types.hasNext() );
 
 
         //check by other type
-        types = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge2", null ) );
+        types = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge2", null ) );
         assertEquals( "source3", types.next() );
         assertFalse( types.hasNext() );
     }
@@ -266,35 +267,35 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge3 ).execute();
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, null ) );
+        Iterator<String> edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this shouldn't remove the edge, since edge1 has a version < edge2
-        serialization.removeTargetEdgeType( scope, edge1 ).execute();
+        serialization.removeEdgeTypeFromSource( scope, edge1 ).execute();
 
-        edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, null ) );
+        edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this should delete it. The version is the max for that edge type
-        serialization.removeTargetEdgeType( scope, edge2 ).execute();
+        serialization.removeEdgeTypeFromSource( scope, edge2 ).execute();
 
 
         //now check we have 1 left
-        edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, null ) );
+        edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, null ) );
 
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
-        serialization.removeTargetEdgeType( scope, edge3 ).execute();
+        serialization.removeEdgeTypeFromSource( scope, edge3 ).execute();
 
         //check we have nothing
-        edges = serialization.getTargetEdgeTypes( scope, createSearchEdge( sourceId, null ) );
+        edges = serialization.getEdgeTypesFromSource( scope, createSearchEdge( sourceId, null ) );
 
         assertFalse( edges.hasNext() );
     }
@@ -320,34 +321,34 @@ public class EdgeMetadataSerializationTest {
 
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, null ) );
+        Iterator<String> edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this shouldn't remove the edge, since edge1 has a version < edge2
-        serialization.removeTargetEdgeType( scope, edge1 ).execute();
+        serialization.removeEdgeTypeFromSource( scope, edge1 ).execute();
 
-        edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, null ) );
+        edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, null ) );
 
         assertEquals( "edge", edges.next() );
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
 
-        serialization.removeSourceEdgeType( scope, edge2 ).execute();
+        serialization.removeEdgeTypeToTarget( scope, edge2 ).execute();
 
         //now check we have 1 left
-        edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, null ) );
+        edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, null ) );
 
         assertEquals( "edge2", edges.next() );
         assertFalse( edges.hasNext() );
 
-        serialization.removeSourceEdgeType( scope, edge3 ).execute();
+        serialization.removeEdgeTypeToTarget( scope, edge3 ).execute();
 
         //check we have nothing
-        edges = serialization.getSourceEdgeTypes( scope, createSearchEdge( targetId, null ) );
+        edges = serialization.getEdgeTypesToTarget( scope, createSearchEdge( targetId, null ) );
 
         assertFalse( edges.hasNext() );
     }
@@ -373,35 +374,36 @@ public class EdgeMetadataSerializationTest {
         serialization.writeEdge( scope, edge3 ).execute();
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getTargetIdTypes( scope, createSearchIdType( sourceId, "edge", null ) );
+        Iterator<String> edges = serialization.getIdTypesFromSource( scope,
+                createSearchIdType( sourceId, "edge", null ) );
 
         assertEquals( "target", edges.next() );
         assertEquals( "target2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this shouldn't remove the edge, since edge1 has a version < edge2
-        serialization.removeTargetIdType( scope, edge1 ).execute();
+        serialization.removeIdTypeFromSource( scope, edge1 ).execute();
 
-        edges = serialization.getTargetIdTypes( scope,  createSearchIdType( sourceId, "edge", null ) );
+        edges = serialization.getIdTypesFromSource( scope, createSearchIdType( sourceId, "edge", null ) );
 
         assertEquals( "target", edges.next() );
         assertEquals( "target2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this should delete it. The version is the max for that edge type
-        serialization.removeTargetIdType( scope, edge2 ).execute();
+        serialization.removeIdTypeFromSource( scope, edge2 ).execute();
 
 
         //now check we have 1 left
-        edges = serialization.getTargetIdTypes( scope,  createSearchIdType( sourceId, "edge", null ) );
+        edges = serialization.getIdTypesFromSource( scope, createSearchIdType( sourceId, "edge", null ) );
 
         assertEquals( "target2", edges.next() );
         assertFalse( edges.hasNext() );
 
-        serialization.removeTargetIdType( scope, edge3 ).execute();
+        serialization.removeIdTypeFromSource( scope, edge3 ).execute();
 
         //check we have nothing
-        edges = serialization.getTargetIdTypes( scope,  createSearchIdType( sourceId, "edge", null ));
+        edges = serialization.getIdTypesFromSource( scope, createSearchIdType( sourceId, "edge", null ) );
 
         assertFalse( edges.hasNext() );
     }
@@ -427,34 +429,35 @@ public class EdgeMetadataSerializationTest {
 
 
         //now check we get both types back
-        Iterator<String> edges = serialization.getSourceIdTypes( scope,  createSearchIdType( targetId, "edge", null ) );
+        Iterator<String> edges = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge",
+                null ) );
 
         assertEquals( "source", edges.next() );
         assertEquals( "source2", edges.next() );
         assertFalse( edges.hasNext() );
 
         //this shouldn't remove the edge, since edge1 has a version < edge2
-        serialization.removeSourceIdType( scope, edge1 ).execute();
+        serialization.removeIdTypeToTarget( scope, edge1 ).execute();
 
-        edges = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge", null ) );
+        edges = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge", null ) );
 
         assertEquals( "source", edges.next() );
         assertEquals( "source2", edges.next() );
         assertFalse( edges.hasNext() );
 
 
-        serialization.removeSourceIdType( scope, edge2 ).execute();
+        serialization.removeIdTypeToTarget( scope, edge2 ).execute();
 
         //now check we have 1 left
-        edges = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge", null ) );
+        edges = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge", null ) );
 
         assertEquals( "source2", edges.next() );
         assertFalse( edges.hasNext() );
 
-        serialization.removeSourceIdType( scope, edge3 ).execute();
+        serialization.removeIdTypeToTarget( scope, edge3 ).execute();
 
         //check we have nothing
-        edges = serialization.getSourceIdTypes( scope, createSearchIdType( targetId, "edge", null ) );
+        edges = serialization.getIdTypesToTarget( scope, createSearchIdType( targetId, "edge", null ) );
 
         assertFalse( edges.hasNext() );
     }


Mime
View raw message