Skip to content
Permalink
Browse files

[#1302] Add BaseGraph as generic type to BaseGraphCollection (#1304)

fixes #1302
  • Loading branch information...
timo95 authored and galpha committed Jun 7, 2019
1 parent 1750ccd commit a48fcbc007bf66e4a524d4d95ce5be78307042dc
Showing with 47 additions and 27 deletions.
  1. +2 −1 ...gration/src/main/java/org/gradoop/dataintegration/transformation/impl/PropertyTransformation.java
  2. +5 −3 gradoop-flink/src/main/java/org/gradoop/flink/io/impl/gdl/GDLConsoleOutput.java
  3. +2 −2 gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/BaseGraph.java
  4. +5 −3 gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/BaseGraphCollection.java
  5. +3 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/BaseGraphCollectionFactory.java
  6. +3 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/BaseGraphCollectionOperators.java
  7. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/api/epgm/BaseGraphFactory.java
  8. +4 −2 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/epgm/GraphCollection.java
  9. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/epgm/GraphCollectionFactory.java
  10. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/epgm/LogicalGraph.java
  11. +2 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/aggregation/Aggregation.java
  12. +3 −2 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/grouping/Grouping.java
  13. +1 −1 ...oop-flink/src/main/java/org/gradoop/flink/model/impl/operators/grouping/GroupingGroupCombine.java
  14. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/grouping/GroupingGroupReduce.java
  15. +2 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/subgraph/Subgraph.java
  16. +2 −1 ...oop-flink/src/main/java/org/gradoop/flink/model/impl/operators/transformation/Transformation.java
  17. +2 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/verify/Verify.java
  18. +2 −1 ...oop-flink/src/main/java/org/gradoop/flink/model/impl/operators/verify/VerifyGraphContainment.java
  19. +4 −1 ...op-flink/src/main/java/org/gradoop/flink/model/impl/operators/verify/VerifyGraphsContainment.java
  20. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/util/GradoopFlinkConfig.java
@@ -41,7 +41,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

/**
* Label of the element whose property shall be transformed.
@@ -46,7 +46,7 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> void print(BaseGraph<G, V, E, LG, GC> graph)
GC extends BaseGraphCollection<G, V, E, LG, GC>> void print(BaseGraph<G, V, E, LG, GC> graph)
throws Exception {

print(graph.getCollectionFactory().fromGraph(graph));
@@ -59,15 +59,17 @@
* @param <G> the graph head type
* @param <V> the vertex type
* @param <E> the edge type
* @param <LG> the type of the logical graph
* @param <GC> the type of the graph collection
* @throws Exception Forwarded from flink execute.
*/
public static <
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge,
GC extends BaseGraphCollection<G, V, E, GC>> void print(
BaseGraphCollection<G, V, E, GC> collection) throws Exception {
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, LG, GC>> void print(
BaseGraphCollection<G, V, E, LG, GC> collection) throws Exception {

List<G> graphHeads = new ArrayList<>();
collection.getGraphHeads().output(new LocalCollectionOutputFormat<>(graphHeads));
@@ -35,7 +35,7 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> extends LogicalGraphLayout<G, V, E> {
GC extends BaseGraphCollection<G, V, E, LG, GC>> extends LogicalGraphLayout<G, V, E> {
/**
* Returns the Gradoop Flink configuration.
*
@@ -56,6 +56,6 @@
*
* @return a factory that can be used to create a {@link GC} instance.
*/
BaseGraphCollectionFactory<G, V, E, GC> getCollectionFactory();
BaseGraphCollectionFactory<G, V, E, LG, GC> getCollectionFactory();

}
@@ -27,14 +27,16 @@
* @param <G> type of the graph head
* @param <V> the vertex type
* @param <E> the edge type
* @param <LG> the type of the logical graph
* @param <GC> the type of the graph collection that will be created with a provided factory
*/
public interface BaseGraphCollection<
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge,
GC extends BaseGraphCollection<G, V, E, GC>>
extends GraphCollectionLayout<G, V, E>, BaseGraphCollectionOperators<G, V, E, GC> {
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, LG, GC>>
extends GraphCollectionLayout<G, V, E>, BaseGraphCollectionOperators<G, V, E, LG, GC> {
/**
* Returns the Gradoop Flink configuration.
*
@@ -47,5 +49,5 @@
*
* @return a factory that can be used to create a {@link GC} instance
*/
BaseGraphCollectionFactory<G, V, E, GC> getFactory();
BaseGraphCollectionFactory<G, V, E, LG, GC> getFactory();
}
@@ -36,13 +36,15 @@
* @param <G> type of the graph head
* @param <V> the vertex type
* @param <E> the edge type
* @param <LG> the type of the logical graph
* @param <GC> the type of the graph collection that will be created with this factory
*/
public interface BaseGraphCollectionFactory<
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge,
GC extends BaseGraphCollection<G, V, E, GC>> extends ElementFactoryProvider<G, V, E> {
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, LG, GC>> extends ElementFactoryProvider<G, V, E> {

/**
* Sets the layout factory that is responsible for creating a graph collection layout.
@@ -27,13 +27,15 @@
* @param <G> type of the graph head
* @param <V> the vertex type
* @param <E> the edge type
* @param <LG> the type of the logical graph
* @param <GC> the type of the graph collection
*/
public interface BaseGraphCollectionOperators<
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge,
GC extends BaseGraphCollection<G, V, E, GC>> {
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, LG, GC>> {

//----------------------------------------------------------------------------
// Unary Operators
@@ -40,7 +40,7 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> extends ElementFactoryProvider<G, V, E> {
GC extends BaseGraphCollection<G, V, E, LG, GC>> extends ElementFactoryProvider<G, V, E> {

/**
* Sets the layout factory that is responsible for creating a graph layout.
@@ -86,7 +86,8 @@
* just forward the calls to the layout. This is just for convenience and API synchronicity.
*/
public class GraphCollection implements
BaseGraphCollection<GraphHead, Vertex, Edge, GraphCollection>, GraphCollectionOperators {
BaseGraphCollection<GraphHead, Vertex, Edge, LogicalGraph, GraphCollection>,
GraphCollectionOperators {
/**
* Layout for that graph collection
*/
@@ -348,7 +349,8 @@ public GradoopFlinkConfig getConfig() {
}

@Override
public BaseGraphCollectionFactory<GraphHead, Vertex, Edge, GraphCollection> getFactory() {
public BaseGraphCollectionFactory<GraphHead, Vertex, Edge, LogicalGraph, GraphCollection>
getFactory() {
return config.getGraphCollectionFactory();
}

@@ -40,7 +40,7 @@
* {@link GraphCollectionLayout}.
*/
public class GraphCollectionFactory
implements BaseGraphCollectionFactory<GraphHead, Vertex, Edge, GraphCollection> {
implements BaseGraphCollectionFactory<GraphHead, Vertex, Edge, LogicalGraph, GraphCollection> {
/**
* Creates the layout from given data.
*/
@@ -131,7 +131,7 @@ public GradoopFlinkConfig getConfig() {
}

@Override
public BaseGraphCollectionFactory<GraphHead, Vertex, Edge, GraphCollection>
public BaseGraphCollectionFactory<GraphHead, Vertex, Edge, LogicalGraph, GraphCollection>
getCollectionFactory() {
return config.getGraphCollectionFactory();
}
@@ -52,7 +52,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

/**
* User-defined aggregate functions which are applied on a single logical graph.
@@ -88,7 +88,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {
/**
* Used as property key to declare a label based grouping.
*
@@ -658,7 +659,7 @@ public GroupingBuilder addEdgeAggregateFunction(AggregateFunction aggregateFunct
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> Grouping<G, V, E, LG, GC> build() {
GC extends BaseGraphCollection<G, V, E, LG, GC>> Grouping<G, V, E, LG, GC> build() {
if (vertexLabelGroups.isEmpty() && !useVertexLabel) {
throw new IllegalArgumentException(
"Provide vertex key(s) and/or use vertex labels for grouping.");
@@ -76,7 +76,7 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> extends Grouping<G, V, E, LG, GC> {
GC extends BaseGraphCollection<G, V, E, LG, GC>> extends Grouping<G, V, E, LG, GC> {

/**
* Creates grouping operator instance.
@@ -67,7 +67,7 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> extends Grouping<G, V, E, LG, GC> {
GC extends BaseGraphCollection<G, V, E, LG, GC>> extends Grouping<G, V, E, LG, GC> {
/**
* Creates grouping operator instance.
*
@@ -63,7 +63,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

/**
* Used to filter vertices from the logical graph.
@@ -47,7 +47,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

/**
* Modification function for graph heads
@@ -42,7 +42,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

@Override
public LG execute(LG graph) {
@@ -40,7 +40,8 @@
V extends EPGMVertex,
E extends EPGMEdge,
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, GC>> implements UnaryBaseGraphToBaseGraphOperator<LG> {
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphToBaseGraphOperator<LG> {

@Override
public LG execute(LG collection) {
@@ -20,6 +20,7 @@
import org.gradoop.common.model.api.entities.EPGMGraphHead;
import org.gradoop.common.model.api.entities.EPGMVertex;
import org.gradoop.common.model.impl.id.GradoopId;
import org.gradoop.flink.model.api.epgm.BaseGraph;
import org.gradoop.flink.model.api.epgm.BaseGraphCollection;
import org.gradoop.flink.model.api.operators.UnaryBaseGraphCollectionToBaseGraphCollectionOperator;
import org.gradoop.flink.model.impl.functions.epgm.Id;
@@ -32,13 +33,15 @@
* @param <G> The graph head type.
* @param <V> The vertex type.
* @param <E> The edge type.
* @param <LG> The logical graph type.
* @param <GC> The graph collection type.
*/
public class VerifyGraphsContainment<
G extends EPGMGraphHead,
V extends EPGMVertex,
E extends EPGMEdge,
GC extends BaseGraphCollection<G, V, E, GC>>
LG extends BaseGraph<G, V, E, LG, GC>,
GC extends BaseGraphCollection<G, V, E, LG, GC>>
implements UnaryBaseGraphCollectionToBaseGraphCollectionOperator<GC> {

@Override
@@ -52,7 +52,7 @@
/**
* Creates instances of {@link GraphCollection}
*/
private final BaseGraphCollectionFactory<GraphHead, Vertex, Edge, GraphCollection>
private final BaseGraphCollectionFactory<GraphHead, Vertex, Edge, LogicalGraph, GraphCollection>
graphCollectionFactory;

/**

0 comments on commit a48fcbc

Please sign in to comment.
You can’t perform that action at this time.