/** * Returns the source id * @return source id */ public GradoopId getSourceId() { return f1.getSourceId(); }
@Override public boolean filter(E e) throws Exception { return e.getSourceId().equals(sourceId); } }
@Override public boolean filter(E e) throws Exception { return e.getSourceId().equals(sourceId); } }
@Override public Tuple3<E, GradoopId, GradoopId> map(E edge) { reuseTuple.setFields(edge, edge.getSourceId(), edge.getTargetId()); return reuseTuple; } }
@Override public Tuple3<E, GradoopId, GradoopId> map(E edge) { reuseTuple.setFields(edge, edge.getSourceId(), edge.getTargetId()); return reuseTuple; } }
@Override public org.apache.flink.graph.Edge<GradoopId, NullValue> map(Edge epgmEdge) throws Exception { reuseEdge.setSource(epgmEdge.getSourceId()); reuseEdge.setTarget(epgmEdge.getTargetId()); return reuseEdge; } }
@Override public org.apache.flink.graph.Edge<GradoopId, NullValue> map(Edge e) throws Exception { reuse.setSource(e.getSourceId()); reuse.setTarget(e.getTargetId()); return reuse; } }
@Override public IdWithLabel map(E edge) throws Exception { reuseTuple.setId(edge.getSourceId()); reuseTuple.setLabel(edge.getLabel()); return reuseTuple; } }
@Override public org.apache.flink.graph.Edge<GradoopId, NullValue> map(Edge e) throws Exception { reuse.setSource(e.getSourceId()); reuse.setTarget(e.getTargetId()); return reuse; } }
@Override public void validateSpecific(LogicalGraph input, LogicalGraph output) { Set<GradoopId> connectedVerticesIDs = new HashSet<>(); for (Edge edge : newEdges) { connectedVerticesIDs.add(edge.getSourceId()); connectedVerticesIDs.add(edge.getTargetId()); } newVertexIDs.removeAll(connectedVerticesIDs); assertTrue("there are unconnected vertices in the sampled graph", newVertexIDs.isEmpty()); }
@Override public void flatMap(Edge edge, Collector<EdgeString> collector) throws Exception { GradoopId sourceId = edge.getSourceId(); GradoopId targetId = edge.getTargetId(); String edgeLabel = "[" + edge.getId() + "]"; for (GradoopId graphId : edge.getGraphIds()) { collector.collect(new EdgeString(graphId, sourceId, targetId, edgeLabel)); } } }
/** * {@inheritDoc} */ @Override public void flatMap(Edge edge, Collector<Tuple2<GradoopId, Edge>> collector) throws Exception { reuseTuple.setFields(edge.getSourceId(), edge); collector.collect(reuseTuple); reuseTuple.setFields(edge.getTargetId(), edge); collector.collect(reuseTuple); } }
@Override public void flatMap( E edge, Collector<Tuple4<GradoopId, GradoopId, GradoopId, GradoopId>> collector) { for (GradoopId graphId : edge.getGraphIds()) { collector.collect(new Tuple4<>( edge.getId(), edge.getSourceId(), edge.getTargetId(), graphId)); } } }
@Override public void flatMap(Edge edge, Collector<EdgeString> collector) throws Exception { GradoopId sourceId = edge.getSourceId(); GradoopId targetId = edge.getTargetId(); String edgeLabel = "[" + label(edge) + "]"; for (GradoopId graphId : edge.getGraphIds()) { collector.collect(new EdgeString(graphId, sourceId, targetId, edgeLabel)); } } }
@Override public org.apache.flink.graph.Edge<GradoopId, PropertyValue> map(Edge epgmEdge) { reuseEdge.setSource(epgmEdge.getSourceId()); reuseEdge.setTarget(epgmEdge.getTargetId()); reuseEdge.setValue(epgmEdge.getPropertyValue(propertyKey)); return reuseEdge; } }
@Override public void flatMap(Edge edge, Collector<EdgeString> collector) throws Exception { GradoopId sourceId = edge.getSourceId(); GradoopId targetId = edge.getTargetId(); String edgeLabel = "[" + label(edge) + "]"; for (GradoopId graphId : edge.getGraphIds()) { collector.collect(new EdgeString(graphId, sourceId, targetId, edgeLabel)); } } }
@Override public void flatMap( E e, Collector<Tuple2<GradoopId, GradoopIdSet>> collector) throws Exception { collector.collect(new Tuple2<>(e.getSourceId(), e.getGraphIds())); collector.collect(new Tuple2<>(e.getTargetId(), e.getGraphIds())); } }
@Override public TripleWithCandidates<GradoopId> map(E e) throws Exception { reuseTuple.setEdgeId(e.getId()); reuseTuple.setSourceId(e.getSourceId()); reuseTuple.setTargetId(e.getTargetId()); reuseTuple.setCandidates( getCandidates(edgeCount, ElementMatcher.getMatches(e, queryEdges, DEFAULT_EDGE_LABEL))); return reuseTuple; } }
@Override public Tuple2<GradoopIdSet, TripleWithCandidates<GradoopId>> map(E e) throws Exception { reuseTuple.f0 = e.getGraphIds(); reuseTuple.f1.setEdgeId(e.getId()); reuseTuple.f1.setSourceId(e.getSourceId()); reuseTuple.f1.setTargetId(e.getTargetId()); reuseTuple.f1.setCandidates(getCandidates(edgeCount, ElementMatcher.getMatches(e, queryEdges, DEFAULT_EDGE_LABEL))); return reuseTuple; } }
@Override public CSVEdge map(Edge edge) throws Exception { csvEdge.setId(edge.getId().toString()); csvEdge.setGradoopIds(collectionToCsvString(edge.getGraphIds())); csvEdge.setSourceId(edge.getSourceId().toString()); csvEdge.setTargetId(edge.getTargetId().toString()); csvEdge.setLabel(StringEscaper.escape(edge.getLabel(), CSVConstants.ESCAPED_CHARACTERS)); csvEdge.setProperties(getPropertyString(edge, MetaDataSource.EDGE_TYPE)); return csvEdge; } }