flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/3] [FLINK-12] Clean up configuration object - Remove class loader (was inconsistently used and set) - Objects are stored in their type, rather than as a string
Date Fri, 03 Oct 2014 12:40:37 GMT
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/iterative/DanglingPageRankITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/iterative/DanglingPageRankITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/iterative/DanglingPageRankITCase.java
index 0c6f0a5..39617b4 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/iterative/DanglingPageRankITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/iterative/DanglingPageRankITCase.java
@@ -16,34 +16,19 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.iterative;
 
-import java.util.Collection;
-
 import org.apache.flink.api.common.Plan;
-import org.apache.flink.configuration.Configuration;
 import org.apache.flink.test.iterative.nephele.DanglingPageRankNepheleITCase;
 import org.apache.flink.test.recordJobs.graph.DanglingPageRank;
 import org.apache.flink.test.util.RecordAPITestBase;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
 
-@RunWith(Parameterized.class)
 public class DanglingPageRankITCase extends RecordAPITestBase {
 
 	protected String pagesPath;
 	protected String edgesPath;
 	protected String resultPath;
 	
-	
-	public DanglingPageRankITCase(Configuration config) {
-		super(config);
-		setTaskManagerNumSlots(DOP);
-	}
-	
-	
 	@Override
 	protected void preSubmit() throws Exception {
 		pagesPath = createTempFile("pages.txt", DanglingPageRankNepheleITCase.TEST_VERTICES);
@@ -55,22 +40,13 @@ public class DanglingPageRankITCase extends RecordAPITestBase {
 	protected Plan getTestJob() {
 		DanglingPageRank pr = new DanglingPageRank();
 		Plan plan = pr.getPlan(
-			config.getString("PageRankITCase#NoSubtasks", "1"), 
+			String.valueOf(DOP),
 			pagesPath,
 			edgesPath,
 			resultPath,
-			config.getString("PageRankITCase#NumIterations", "25"),	// max iterations
+			"25",	// max iterations
 			"5",	// num vertices
 			"1");	// num dangling vertices
 		return plan;
 	}
-
-
-	@Parameters
-	public static Collection<Object[]> getConfigurations() {
-		Configuration config1 = new Configuration();
-		config1.setInteger("PageRankITCase#NoSubtasks", DOP);
-		config1.setString("PageRankITCase#NumIterations", "25");
-		return toParameterList(config1);
-	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/iterative/PageRankITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/iterative/PageRankITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/iterative/PageRankITCase.java
index 96d2b15..8e42dd7 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/iterative/PageRankITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/iterative/PageRankITCase.java
@@ -16,20 +16,12 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.iterative;
 
-import java.util.Collection;
-
 import org.apache.flink.api.common.Plan;
-import org.apache.flink.configuration.Configuration;
 import org.apache.flink.test.recordJobs.graph.SimplePageRank;
 import org.apache.flink.test.util.RecordAPITestBase;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
 
-@RunWith(Parameterized.class)
 public class PageRankITCase extends RecordAPITestBase {
 	
 	private static final String VERTICES = "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n";
@@ -40,12 +32,6 @@ public class PageRankITCase extends RecordAPITestBase {
 	protected String edgesPath;
 	protected String resultPath;
 	
-	
-	public PageRankITCase(Configuration config) {
-		super(config);
-		setTaskManagerNumSlots(DOP);
-	}
-	
 	@Override
 	protected void preSubmit() throws Exception {
 		pagesPath = createTempFile("pages.txt", VERTICES);
@@ -57,21 +43,12 @@ public class PageRankITCase extends RecordAPITestBase {
 	protected Plan getTestJob() {
 		SimplePageRank pr = new SimplePageRank();
 		Plan plan = pr.getPlan(
-			config.getString("NumSubtasks", "1"), 
+			String.valueOf(DOP), 
 			pagesPath,
 			edgesPath,
 			resultPath,
-			config.getString("NumIterations", "5"),	// max iterations
+			"5",	// max iterations
 			"10");	// num vertices
 		return plan;
 	}
-
-
-	@Parameters
-	public static Collection<Object[]> getConfigurations() {
-		Configuration config1 = new Configuration();
-		config1.setInteger("NumSubtasks", DOP);
-		config1.setString("NumIterations", "5");
-		return toParameterList(config1);
-	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/ConnectedComponentsNepheleITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/ConnectedComponentsNepheleITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/ConnectedComponentsNepheleITCase.java
index 8b4bbc8..8227f97 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/ConnectedComponentsNepheleITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/ConnectedComponentsNepheleITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.iterative.nephele;
 
 import java.io.BufferedReader;

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankNepheleITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankNepheleITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankNepheleITCase.java
index 2ebe86f..3696225 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankNepheleITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankNepheleITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.iterative.nephele;
 
 import org.apache.flink.runtime.jobgraph.JobGraph;

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankWithCombinerNepheleITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankWithCombinerNepheleITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankWithCombinerNepheleITCase.java
index a357b13..76438aa 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankWithCombinerNepheleITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/iterative/nephele/DanglingPageRankWithCombinerNepheleITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.iterative.nephele;
 
 import org.apache.flink.runtime.jobgraph.JobGraph;

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/ComputeEdgeDegreesITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/ComputeEdgeDegreesITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/ComputeEdgeDegreesITCase.java
index ac54346..0a6d29d 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/ComputeEdgeDegreesITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/ComputeEdgeDegreesITCase.java
@@ -52,7 +52,7 @@ public class ComputeEdgeDegreesITCase extends RecordAPITestBase {
 	@Override
 	protected Plan getTestJob() {
 		ComputeEdgeDegrees computeDegrees = new ComputeEdgeDegrees();
-		return computeDegrees.getPlan(config.getString("ComputeEdgeDegreesTest#NumSubtasks", "4"),
+		return computeDegrees.getPlan(String.valueOf(config.getInteger("NumSubtasks", 4)),
 				edgesPath, resultPath);
 	}
 
@@ -64,7 +64,7 @@ public class ComputeEdgeDegreesITCase extends RecordAPITestBase {
 	@Parameters
 	public static Collection<Object[]> getConfigurations() {
 		Configuration config = new Configuration();
-		config.setInteger("ComputeEdgeDegreesTest#NumSubtasks", DOP);
+		config.setInteger("NumSubtasks", DOP);
 		return toParameterList(config);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesOnEdgesWithDegreesITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesOnEdgesWithDegreesITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesOnEdgesWithDegreesITCase.java
index 1c25f37..c758f32 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesOnEdgesWithDegreesITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesOnEdgesWithDegreesITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import java.util.Collection;
@@ -54,7 +53,7 @@ public class EnumTrianglesOnEdgesWithDegreesITCase extends RecordAPITestBase
{
 	protected Plan getTestJob() {
 		EnumTrianglesOnEdgesWithDegrees enumTriangles = new EnumTrianglesOnEdgesWithDegrees();
 		return enumTriangles.getPlan(
-				config.getString("EnumTrianglesTest#NumSubtasks", "4"),
+				String.valueOf(config.getInteger("NumSubtasks", 4)),
 				edgesPath, resultPath);
 	}
 
@@ -66,7 +65,7 @@ public class EnumTrianglesOnEdgesWithDegreesITCase extends RecordAPITestBase
{
 	@Parameters
 	public static Collection<Object[]> getConfigurations() {
 		Configuration config = new Configuration();
-		config.setInteger("EnumTrianglesTest#NumSubtasks", DOP);
+		config.setInteger("NumSubtasks", DOP);
 		return toParameterList(config);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesRDFITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesRDFITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesRDFITCase.java
index a45fe44..f0a1288 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesRDFITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/EnumTrianglesRDFITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import org.apache.flink.api.common.Plan;
@@ -60,7 +59,7 @@ public class EnumTrianglesRDFITCase extends RecordAPITestBase {
 	protected Plan getTestJob() {
 		EnumTrianglesRdfFoaf enumTriangles = new EnumTrianglesRdfFoaf();
 		return enumTriangles.getPlan(
-				config.getString("EnumTrianglesTest#NoSubtasks", new Integer(DOP).toString()), edgesPath,
resultPath);
+				String.valueOf(config.getInteger("NumSubtasks", DOP)), edgesPath, resultPath);
 	}
 
 	@Override
@@ -71,7 +70,7 @@ public class EnumTrianglesRDFITCase extends RecordAPITestBase {
 	@Parameters
 	public static Collection<Object[]> getConfigurations() {
 		Configuration config = new Configuration();
-		config.setInteger("EnumTrianglesTest#NoSubtasks", DOP);
+		config.setInteger("NumSubtasks", DOP);
 		return toParameterList(config);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/MergeOnlyJoinITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/MergeOnlyJoinITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/MergeOnlyJoinITCase.java
index e5a1ef3..ae3b8b7 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/MergeOnlyJoinITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/MergeOnlyJoinITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import org.apache.flink.api.common.Plan;
@@ -82,11 +81,11 @@ public class MergeOnlyJoinITCase extends RecordAPITestBase {
 	protected Plan getTestJob() {
 		MergeOnlyJoin mergeOnlyJoin = new MergeOnlyJoin();
 		return mergeOnlyJoin.getPlan(
-				config.getString("MergeOnlyJoinTest#NoSubtasks", "1"), 
+				String.valueOf(config.getInteger("MergeOnlyJoinTest#NoSubtasks", 1)), 
 				input1Path,
 				input2Path,
 				resultPath,
-				config.getString("MergeOnlyJoinTest#NoSubtasksInput2", "1"));
+				String.valueOf(config.getInteger("MergeOnlyJoinTest#NoSubtasksInput2", 1)));
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/PairwiseSPITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/PairwiseSPITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/PairwiseSPITCase.java
index 28b5046..231f196 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/PairwiseSPITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/PairwiseSPITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import java.util.Collection;
@@ -71,7 +70,8 @@ public class PairwiseSPITCase extends RecordAPITestBase {
 	@Override
 	protected Plan getTestJob() {
 		PairwiseSP a2aSP = new PairwiseSP();
-		return a2aSP.getPlan(config.getString("All2AllSPTest#NoSubtasks", new Integer(DOP).toString()),
+		return a2aSP.getPlan(
+				String.valueOf(config.getInteger("All2AllSPTest#NoSubtasks", DOP)),
 				rdfDataPath,
 				resultPath,
 				"true");

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery10ITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery10ITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery10ITCase.java
index ffa1cef..a6a9897 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery10ITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery10ITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import org.apache.flink.api.common.Plan;
@@ -181,7 +180,7 @@ public class TPCHQuery10ITCase extends RecordAPITestBase {
 	protected Plan getTestJob() {
 		TPCHQuery10 tpchq10 = new TPCHQuery10();
 		return tpchq10.getPlan(
-				config.getString("TPCHQuery10Test#NoSubtasks", "1"),
+				String.valueOf(config.getInteger("TPCHQuery10Test#NoSubtasks", 1)),
 				ordersPath,
 				lineitemsPath,
 				customersPath,

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/02314adc/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery3ITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery3ITCase.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery3ITCase.java
index 89e0f42..461d6c0 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery3ITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recordJobTests/TPCHQuery3ITCase.java
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.flink.test.recordJobTests;
 
 import java.util.Collection;
@@ -142,7 +141,7 @@ public class TPCHQuery3ITCase extends RecordAPITestBase {
 
 		TPCHQuery3 tpch3 = new TPCHQuery3();
 		return tpch3.getPlan(
-				config.getString("dop", "1"), 
+				String.valueOf(config.getInteger("dop", 1)), 
 				ordersPath,
 				lineitemsPath,
 				resultPath);


Mime
View raw message