Skip to content

Commit

Permalink
[FLINK-1514] [gelly] suppressed warnings in several places; adjusted …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
vasia committed Apr 25, 2015
1 parent 921414d commit 4e3165e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
Expand Up @@ -85,7 +85,7 @@ public Double map(Long id) {
return 0.0; return 0.0;
} }
else { else {
return Double.MAX_VALUE; return Double.POSITIVE_INFINITY;
} }
} }
} }
Expand Down
Expand Up @@ -23,6 +23,7 @@


import java.io.Serializable; import java.io.Serializable;


@SuppressWarnings("serial")
public abstract class ApplyFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable { public abstract class ApplyFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable {


public abstract void apply(M message, VV vertexValue); public abstract void apply(M message, VV vertexValue);
Expand Down Expand Up @@ -54,6 +55,7 @@ public void setResult(VV result) {
// Internal methods // Internal methods
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


@SuppressWarnings("unused")
private IterationRuntimeContext runtimeContext; private IterationRuntimeContext runtimeContext;


private Collector<VV> out; private Collector<VV> out;
Expand Down
Expand Up @@ -22,6 +22,7 @@


import java.io.Serializable; import java.io.Serializable;


@SuppressWarnings("serial")
public abstract class GatherFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable { public abstract class GatherFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable {


public abstract M gather(Neighbor<VV, EV> neighbor); public abstract M gather(Neighbor<VV, EV> neighbor);
Expand All @@ -44,6 +45,7 @@ public abstract class GatherFunction<VV extends Serializable, EV extends Seriali
// Internal methods // Internal methods
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


@SuppressWarnings("unused")
private IterationRuntimeContext runtimeContext; private IterationRuntimeContext runtimeContext;


public void init(IterationRuntimeContext iterationRuntimeContext) { public void init(IterationRuntimeContext iterationRuntimeContext) {
Expand Down
Expand Up @@ -165,6 +165,7 @@ GatherSumApplyIteration<K, VV, EV, M> withEdges(DataSet<Edge<K, EV>> edges,
// Wrapping UDFs // Wrapping UDFs
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


@SuppressWarnings("serial")
private static final class GatherUdf<K extends Comparable<K> & Serializable, VV extends Serializable, private static final class GatherUdf<K extends Comparable<K> & Serializable, VV extends Serializable,
EV extends Serializable, M> extends RichMapFunction<Tuple2<Vertex<K, VV>, Edge<K, EV>>, EV extends Serializable, M> extends RichMapFunction<Tuple2<Vertex<K, VV>, Edge<K, EV>>,
Tuple2<K, M>> implements ResultTypeQueryable<Tuple2<K, M>> { Tuple2<K, M>> implements ResultTypeQueryable<Tuple2<K, M>> {
Expand Down Expand Up @@ -206,6 +207,7 @@ public TypeInformation<Tuple2<K, M>> getProducedType() {
} }
} }


@SuppressWarnings("serial")
private static final class SumUdf<K extends Comparable<K> & Serializable, VV extends Serializable, private static final class SumUdf<K extends Comparable<K> & Serializable, VV extends Serializable,
EV extends Serializable, M> extends RichReduceFunction<Tuple2<K, M>> EV extends Serializable, M> extends RichReduceFunction<Tuple2<K, M>>
implements ResultTypeQueryable<Tuple2<K, M>>{ implements ResultTypeQueryable<Tuple2<K, M>>{
Expand Down Expand Up @@ -244,6 +246,7 @@ public TypeInformation<Tuple2<K, M>> getProducedType() {
} }
} }


@SuppressWarnings("serial")
private static final class ApplyUdf<K extends Comparable<K> & Serializable, private static final class ApplyUdf<K extends Comparable<K> & Serializable,
VV extends Serializable, EV extends Serializable, M> extends RichFlatJoinFunction<Tuple2<K, M>, VV extends Serializable, EV extends Serializable, M> extends RichFlatJoinFunction<Tuple2<K, M>,
Vertex<K, VV>, Vertex<K, VV>> implements ResultTypeQueryable<Vertex<K, VV>> { Vertex<K, VV>, Vertex<K, VV>> implements ResultTypeQueryable<Vertex<K, VV>> {
Expand Down
Expand Up @@ -28,6 +28,7 @@
* @param <VV> the vertex value type * @param <VV> the vertex value type
* @param <EV> the edge value type * @param <EV> the edge value type
*/ */
@SuppressWarnings("serial")
public class Neighbor<VV extends Serializable, EV extends Serializable> public class Neighbor<VV extends Serializable, EV extends Serializable>
extends Tuple2<VV, EV> { extends Tuple2<VV, EV> {


Expand Down
Expand Up @@ -22,6 +22,7 @@


import java.io.Serializable; import java.io.Serializable;


@SuppressWarnings("serial")
public abstract class SumFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable { public abstract class SumFunction<VV extends Serializable, EV extends Serializable, M> implements Serializable {


public abstract M sum(M arg0, M arg1); public abstract M sum(M arg0, M arg1);
Expand All @@ -44,6 +45,7 @@ public abstract class SumFunction<VV extends Serializable, EV extends Serializab
// Internal methods // Internal methods
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


@SuppressWarnings("unused")
private IterationRuntimeContext runtimeContext; private IterationRuntimeContext runtimeContext;


public void init(IterationRuntimeContext iterationRuntimeContext) { public void init(IterationRuntimeContext iterationRuntimeContext) {
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void after() throws Exception{
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


@Test @Test
public void testGreedyGraphColoring() throws Exception { public void testConnectedComponents() throws Exception {
GSAConnectedComponentsExample.main(new String[]{edgesPath, resultPath, "16"}); GSAConnectedComponentsExample.main(new String[]{edgesPath, resultPath, "16"});
expectedResult = "1 1\n" + expectedResult = "1 1\n" +
"2 1\n" + "2 1\n" +
Expand All @@ -86,7 +86,7 @@ public void testGreedyGraphColoring() throws Exception {


@Test @Test
public void testSingleSourceShortestPath() throws Exception { public void testSingleSourceShortestPath() throws Exception {
GSASingleSourceShortestPathsExample.main(new String[]{edgesPath, resultPath, "1", "16"}); GSASingleSourceShortestPathsExample.main(new String[]{"1", edgesPath, resultPath, "16"});
expectedResult = "1 0.0\n" + expectedResult = "1 0.0\n" +
"2 12.0\n" + "2 12.0\n" +
"3 13.0\n" + "3 13.0\n" +
Expand All @@ -101,12 +101,12 @@ public void testSingleSourceShortestPath() throws Exception {
// Sample data // Sample data
// -------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------


private static final String EDGES = "1 2 12.0\n" + private static final String EDGES = "1 2 12.0\n" +
"1 3 13.0\n" + "1 3 13.0\n" +
"2 3 23.0\n" + "2 3 23.0\n" +
"3 4 34.0\n" + "3 4 34.0\n" +
"3 5 35.0\n" + "3 5 35.0\n" +
"4 5 45.0\n" + "4 5 45.0\n" +
"5 1 51.0\n" + "5 1 51.0\n" +
"6 7 67.0\n"; "6 7 67.0\n";
} }

0 comments on commit 4e3165e

Please sign in to comment.