epgmEdges.add(edgeFactory.createEdge( edge.getLabel(), vertexIdMap.get(edge.getSourceId()),
epgmEdges.add(edgeFactory.createEdge( edge.getLabel(), vertexIdMap.get(edge.getSourceId()),
/** * Outputs a pair of import target vertex id and new EPGM edge. The target * vertex id is used for further joining the tuple with the import vertices. * * @param importEdge import edge * @param vertexIdPair pair of import id and corresponding Gradoop vertex id * @return pair of import target vertex id and EPGM edge * @throws Exception */ @Override public Tuple2<K, Edge> join(ImportEdge<K> importEdge, Tuple2<K, GradoopId> vertexIdPair) throws Exception { reuseTuple.f0 = importEdge.getTargetId(); Edge edge = edgeFactory.createEdge(importEdge.getLabel(), vertexIdPair.f1, GradoopId.get(), importEdge.getProperties()); reuseTuple.f1 = updateLineage(edge, importEdge.getId()); return reuseTuple; }
/** * Outputs a pair of import target vertex id and new EPGM edge. The target * vertex id is used for further joining the tuple with the import vertices. * * @param importEdge import edge * @param vertexIdPair pair of import id and corresponding Gradoop vertex id * @return pair of import target vertex id and EPGM edge * @throws Exception */ @Override public Tuple2<K, Edge> join(ImportEdge<K> importEdge, Tuple2<K, GradoopId> vertexIdPair) throws Exception { reuseTuple.f0 = importEdge.getTargetId(); Edge edge = edgeFactory.createEdge(importEdge.getLabel(), vertexIdPair.f1, GradoopId.get(), importEdge.getProperties()); reuseTuple.f1 = updateLineage(edge, importEdge.getId()); return reuseTuple; }
/** * Reduces edge group items to a single edge group item, creates a new * super EPGM edge and collects it. * * @param edgeGroupItems edge group items * @param collector output collector * @throws Exception */ @Override public void reduce(Iterable<EdgeGroupItem> edgeGroupItems, Collector<Edge> collector) throws Exception { EdgeGroupItem edgeGroupItem = reduceInternal(edgeGroupItems); Edge superEdge = edgeFactory.createEdge( edgeGroupItem.getGroupLabel(), edgeGroupItem.getSourceId(), edgeGroupItem.getTargetId()); setGroupProperties( superEdge, edgeGroupItem.getGroupingValues(), edgeGroupItem.getLabelGroup()); setAggregateProperties(superEdge, edgeGroupItem.getLabelGroup().getAggregateValueList(), edgeGroupItem.getLabelGroup().getAggregateFunctions()); edgeGroupItem.getLabelGroup().resetAggregateValues(); collector.collect(superEdge); }
/** * Reduces edge group items to a single edge group item, creates a new * super EPGM edge and collects it. * * @param edgeGroupItems edge group items * @param collector output collector * @throws Exception */ @Override public void reduce(Iterable<EdgeGroupItem> edgeGroupItems, Collector<Edge> collector) throws Exception { EdgeGroupItem edgeGroupItem = reduceInternal(edgeGroupItems); Edge superEdge = edgeFactory.createEdge( edgeGroupItem.getGroupLabel(), edgeGroupItem.getSourceId(), edgeGroupItem.getTargetId()); setGroupProperties( superEdge, edgeGroupItem.getGroupingValues(), edgeGroupItem.getLabelGroup()); setAggregateProperties(superEdge, edgeGroupItem.getLabelGroup().getAggregateValueList(), edgeGroupItem.getLabelGroup().getAggregateFunctions()); edgeGroupItem.getLabelGroup().resetAggregateValues(); collector.collect(superEdge); }