/** * True, if an element is contained in any of a set of given graphs. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class InAnyGraphBroadcast<GE extends GraphElement> extends GraphsContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return element.getGraphIds().containsAny(this.graphIds); } }
/** * (graphHead, {vertex,..}, {edge,..}) => graphHead * * @param <T> tuple type */ @FunctionAnnotation.ForwardedFields("f0->*") @FunctionAnnotation.ReadFields("f0") public class TransactionGraphHead<T extends Tuple3<GraphHead, Set<Vertex>, Set<Edge>>> implements MapFunction<T, GraphHead> { @Override public GraphHead map(T triple) throws Exception { return triple.f0; } }
/** * True, if an element is not contained in a given graph. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class NotInGraphBroadcast<GE extends GraphElement> extends GraphContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return !element.getGraphIds().contains(graphId); } }
/** * Maps an element to a GradoopIdSet, containing the elements id. * * @param <EL> element type */ @FunctionAnnotation.ReadFields("id") public class IdAsIdSet<EL extends Element> implements MapFunction<EL, GradoopIdSet> { @Override public GradoopIdSet map(EL element) { return GradoopIdSet.fromExisting(element.getId()); } }
/** * True, if an element is not contained in a given graph. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class InGraphBroadcast<GE extends GraphElement> extends GraphContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return element.getGraphIds().contains(graphId); } }
/** * Maps an element to a GradoopIdSet, containing the elements id. * * @param <EL> element type */ @FunctionAnnotation.ReadFields("id") public class IdAsIdSet<EL extends Element> implements MapFunction<EL, GradoopIdSet> { @Override public GradoopIdSet map(EL element) { return GradoopIdSet.fromExisting(element.getId()); } }
/** * True, if an element is not contained in a given graph. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class NotInGraphBroadcast<GE extends GraphElement> extends GraphContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return !element.getGraphIds().contains(graphId); } }
/** * True, if an element is not contained in a given graph. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class InGraphBroadcast<GE extends GraphElement> extends GraphContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return element.getGraphIds().contains(graphId); } }
/** * True, if an element is contained in any of a set of given graphs. * * @param <GE> element type */ @FunctionAnnotation.ReadFields("graphIds") public class InAnyGraphBroadcast<GE extends GraphElement> extends GraphsContainmentFilterBroadcast<GE> { @Override public boolean filter(GE element) throws Exception { return element.getGraphIds().containsAny(this.graphIds); } }
/** * Filter those tuples which are used to create new super vertices. */ @FunctionAnnotation.ReadFields("f5") public class FilterSuperVertices implements FilterFunction<VertexGroupItem> { @Override public boolean filter(VertexGroupItem vertexGroupItem) throws Exception { return vertexGroupItem.isSuperVertex(); } }
/** * Filter those tuples which are used to create new super vertices. */ @FunctionAnnotation.ReadFields("f5") public class FilterSuperVertices implements FilterFunction<VertexGroupItem> { @Override public boolean filter(VertexGroupItem vertexGroupItem) throws Exception { return vertexGroupItem.isSuperVertex(); } }
/** * Filter those tuples which only contain a vertex and its representative. */ @FunctionAnnotation.ReadFields("f5") public class FilterRegularVertices implements FilterFunction<VertexGroupItem> { @Override public boolean filter(VertexGroupItem vertexGroupItem) throws Exception { return !vertexGroupItem.isSuperVertex(); } }
/** * Filter those tuples which only contain a vertex and its representative. */ @FunctionAnnotation.ReadFields("f5") public class FilterRegularVertices implements FilterFunction<VertexGroupItem> { @Override public boolean filter(VertexGroupItem vertexGroupItem) throws Exception { return !vertexGroupItem.isSuperVertex(); } }
@FunctionAnnotation.ReadFields("0;3;4") private static class DummyGroupReduceFunction2 implements GroupReduceFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void reduce(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } }
@FunctionAnnotation.ForwardedFields("0->4;1;1->3;2") @FunctionAnnotation.ReadFields("0;3;4") private static class DummyGroupCombineFunction1 implements GroupCombineFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void combine(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } }
@FunctionAnnotation.ReadFields("0;3;4") private static class DummyReduceFunction2 implements ReduceFunction<Tuple5<Integer, Long, String, Long, Integer>> { @Override public Tuple5<Integer, Long, String, Long, Integer> reduce(Tuple5<Integer, Long, String, Long, Integer> v1, Tuple5<Integer, Long, String, Long, Integer> v2) throws Exception { return new Tuple5<Integer, Long, String, Long, Integer>(); } }
@FunctionAnnotation.ReadFields("0;3;4") private static class DummyGroupCombineFunction2 implements GroupCombineFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void combine(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } }
@FunctionAnnotation.ForwardedFields("0->4;1;1->3;2") @FunctionAnnotation.ReadFields("0;3;4") private static class DummyGroupReduceFunction1 implements GroupReduceFunction<Tuple5<Integer, Long, String, Long, Integer>, Tuple5<Integer, Long, String, Long, Integer>> { @Override public void reduce(Iterable<Tuple5<Integer, Long, String, Long, Integer>> values, Collector<Tuple5<Integer, Long, String, Long, Integer>> out) throws Exception { } }
@FunctionAnnotation.ReadFields({"0;2"}) private static class ReadSetMapper<T> implements MapFunction<T, T> { @Override public T map(T value) { return value; } }
@FunctionAnnotation.ForwardedFields("0->4;1;1->3;2") @FunctionAnnotation.ReadFields("0;3;4") private static class DummyReduceFunction1 implements ReduceFunction<Tuple5<Integer, Long, String, Long, Integer>> { @Override public Tuple5<Integer, Long, String, Long, Integer> reduce(Tuple5<Integer, Long, String, Long, Integer> v1, Tuple5<Integer, Long, String, Long, Integer> v2) throws Exception { return new Tuple5<Integer, Long, String, Long, Integer>(); } }