Last active
August 20, 2018 10:51
-
-
Save karussell/f4c2b2b1191be978d7ee9ec8dd2cd48f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// New EdgeIteratorState setter API, without exposing IntsRef and without public getFlags/getData(int) | |
encDistance = encodingManager.get("distance"); | |
encSpeed = encodingManager.get("car.average_speed"); | |
encMaxSpeed = encodingManager.get("car.max_speed"); | |
// improved usage to store values easy and more efficient | |
EdgeIteratorState edge = graph.newEdge().setNodes(from, to); // creates tempary memory to store attributes, we could easily use the implementation for VirtualEdgeIteratorState | |
edge.set(encDistance, 123.5).set(encSpeed, 20).set(encMaxSpeed, 50); | |
// for EdgeIterator we could also implement kind of autocommit when next() is called | |
edge.store(); // create edgeId and copies attributes into DataAccess (best via sys copy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment