@Nullable @Override public TitanVertex apply(@Nullable TitanEdge titanEdge) { return titanEdge.otherVertex(other); } });
@Override public boolean evaluate(E relation) { return relation.isEdge() && ((TitanEdge) relation).otherVertex(baseVertex).equals(otherVertex); }
protected VertexList edges2VertexIds(final Iterable<TitanEdge> edges, final TitanVertex other) { VertexArrayList vertices = new VertexArrayList(tx); for (TitanEdge edge : edges) vertices.add(edge.otherVertex(other)); return vertices; }
public Stream<M> receiveMessages(MessageScope messageScope) { if (messageScope instanceof MessageScope.Global) { M message = vertexMemory.getMessage(vertexId,messageScope); if (message == null) return Stream.empty(); else return Stream.of(message); } else { final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope; final Traversal<Vertex, Edge> reverseIncident = FulgoraUtil.getReverseElementTraversal(localMessageScope,vertex,vertex.tx()); final BiFunction<M,Edge,M> edgeFct = localMessageScope.getEdgeFunction(); return IteratorUtils.stream(reverseIncident) .map(e -> { M msg = vertexMemory.getMessage(vertexMemory.getCanonicalId(((TitanEdge) e).otherVertex(vertex).longId()), localMessageScope); return msg == null ? null : edgeFct.apply(msg, e); }) .filter(m -> m != null); } }
assertEquals(partition, getPartitionID(r)); if (r instanceof TitanEdge) { TitanVertex o = ((TitanEdge) r).otherVertex(v); assertTrue(o.equals(g1) || o.equals(g2));
@Nullable @Override public TitanVertex apply(@Nullable TitanEdge titanEdge) { return titanEdge.otherVertex(other); } });
@Override public boolean evaluate(E relation) { return relation.isEdge() && ((TitanEdge) relation).otherVertex(baseVertex).equals(otherVertex); }
protected VertexList edges2VertexIds(final Iterable<TitanEdge> edges, final TitanVertex other) { VertexArrayList vertices = new VertexArrayList(tx); for (TitanEdge edge : edges) vertices.add(edge.otherVertex(other)); return vertices; }
public Stream<M> receiveMessages(MessageScope messageScope) { if (messageScope instanceof MessageScope.Global) { M message = vertexMemory.getMessage(vertexId,messageScope); if (message == null) return Stream.empty(); else return Stream.of(message); } else { final MessageScope.Local<M> localMessageScope = (MessageScope.Local) messageScope; final Traversal<Vertex, Edge> reverseIncident = FulgoraUtil.getReverseElementTraversal(localMessageScope,vertex,vertex.tx()); final BiFunction<M,Edge,M> edgeFct = localMessageScope.getEdgeFunction(); return IteratorUtils.stream(reverseIncident) .map(e -> { M msg = vertexMemory.getMessage(vertexMemory.getCanonicalId(((TitanEdge) e).otherVertex(vertex).longId()), localMessageScope); return msg == null ? null : edgeFct.apply(msg, e); }) .filter(m -> m != null); } }