@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFields other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsFirst other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsFirstExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsSecondExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsSecond other) { return other.value(); } }
/** * UDF that joins a candidate (Vertex-ID, Component-ID) pair with another (Vertex-ID, Component-ID) pair. * Returns the candidate pair, if the candidate's Component-ID is smaller. */ @ConstantFieldsFirst(0) public static final class UpdateComponentIdMatch extends JoinFunction implements Serializable { private static final long serialVersionUID = 1L; @Override public void join(Record newVertexWithComponent, Record currentVertexWithComponent, Collector<Record> out){ long candidateComponentID = newVertexWithComponent.getField(1, LongValue.class).getValue(); long currentComponentID = currentVertexWithComponent.getField(1, LongValue.class).getValue(); if (candidateComponentID < currentComponentID) { out.collect(newVertexWithComponent); } } }
@ConstantFieldsSecond(0) public static final class UpdateComponentIdMatchMirrored extends JoinFunction implements Serializable { private static final long serialVersionUID = 1L; @Override public void join(Record currentVertexWithComponent, Record newVertexWithComponent, Collector<Record> out){ long candidateComponentID = newVertexWithComponent.getField(1, LongValue.class).getValue(); long currentComponentID = currentVertexWithComponent.getField(1, LongValue.class).getValue(); if (candidateComponentID < currentComponentID) { out.collect(newVertexWithComponent); } } }
@ConstantFieldsFirstExcept(2) public static class JoinInputs extends JoinFunction { private static final long serialVersionUID = 1L; @Override public void join(Record input1, Record input2, Collector<Record> out) { input1.setField(2, input2.getField(1, IntValue.class)); out.collect(input1); } }
private ImplicitlyForwardingSingleInputSemanticProperties(FieldSet nonForwardedFields) { this.nonForwardedFields = nonForwardedFields; addWrittenFields(nonForwardedFields); }
@ConstantFieldsSecondExcept({}) public static final class UpdateComponentIdMatchMirrored extends JoinFunction implements Serializable { private static final long serialVersionUID = 1L; @Override public void join(Record currentVertexWithComponent, Record newVertexWithComponent, Collector<Record> out){ long candidateComponentID = newVertexWithComponent.getField(1, LongValue.class).getValue(); long currentComponentID = currentVertexWithComponent.getField(1, LongValue.class).getValue(); if (candidateComponentID < currentComponentID) { out.collect(newVertexWithComponent); } } }
@ConstantFieldsExcept({}) public static class DummyReduce extends ReduceFunction { private static final long serialVersionUID = 1L; @Override public void reduce(Iterator<Record> values, Collector<Record> out) { while (values.hasNext()) { out.collect(values.next()); } } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFields other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsFirst other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsFirstExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsSecondExcept other) { return other.value(); } }
@Override protected int[] getOtherFields(FunctionAnnotation.ConstantFieldsSecond other) { return other.value(); } }
@ConstantFieldsSecond(0) public static final class RankComparisonMatch extends JoinFunction { private static final long serialVersionUID = 1L; private final DoubleValue newRank = new DoubleValue(); @Override public void join(Record vertexWithDelta, Record vertexWithOldRank, Collector<Record> out) throws Exception { DoubleValue deltaVal = vertexWithDelta.getField(1, DoubleValue.class); DoubleValue currentVal = vertexWithOldRank.getField(1, DoubleValue.class); newRank.setValue(deltaVal.getValue() + currentVal.getValue()); vertexWithOldRank.setField(1, newRank); out.collect(vertexWithOldRank); } }
/** * Matches all missing edges with existing edges from input. * If the missing edge for a triad is found, the triad is transformed to a triangle by adding the missing edge. */ @ConstantFieldsFirstExcept({}) public static class CloseTriads extends JoinFunction implements Serializable { private static final long serialVersionUID = 1L; @Override public void join(Record triad, Record missingEdge, Collector<Record> out) throws Exception { // emit triangle (already contains missing edge at field 0 out.collect(triad); } }