Github user GERey commented on a diff in the pull request:
https://github.com/apache/usergrid/pull/388#discussion_r40155990
--- Diff:
stack/core/src/main/java/org/apache/usergrid/corepersistence/CpRelationManager.java
---
@@ -697,25 +695,35 @@ public ConnectionRef createConnection( String
connectionType, EntityRef connecte
final GraphManager gm = managerCache.getGraphManager(
applicationScope );
- //check if the edge exists
+ //write new edge
+ gm.writeEdge( edge ).subscribe();
- final SearchByEdge searchByEdge = new
SimpleSearchByEdge(edge.getSourceNode(), edge.getType(), edge.getTargetNode(),
Long.MAX_VALUE, SearchByEdgeType.Order.DESCENDING, Optional.absent() );
+ indexService.queueNewEdge( applicationScope, targetEntity, edge );
- //only take 1 and count it. If we don't have anything, create the
edge
- final int count = gm.loadEdgeVersions( searchByEdge ).take( 1
).count().toBlocking().last();
+ //now read all older versions of an edge, and remove them.
Finally calling delete
+ final SearchByEdge searchByEdge =
--- End diff --
What are the performance implications of doing this delete every time we
write a connection? Seems like every connection write be 2x the time since
delete is a heavy operation. Or is there something I'm missing?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---