You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by rm...@apache.org on 2014/08/14 22:23:23 UTC

git commit: Adjusted examples packaging to only create jars for fully self-contained examples.

Repository: incubator-flink
Updated Branches:
  refs/heads/master 7abe636e1 -> a87559aee


Adjusted examples packaging to only create jars for fully self-contained examples.


Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/a87559ae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/a87559ae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/a87559ae

Branch: refs/heads/master
Commit: a87559aee53a1c1bd3ef79a68e02f1a86d6ebfd2
Parents: 7abe636
Author: Stephan Ewen <se...@apache.org>
Authored: Wed Aug 13 22:10:48 2014 +0200
Committer: Robert Metzger <rm...@apache.org>
Committed: Thu Aug 14 22:22:17 2014 +0200

----------------------------------------------------------------------
 flink-examples/flink-java-examples/pom.xml      |  35 +---
 .../example/java/wordcount/WordCountPOJO.java   | 175 -------------------
 flink-examples/flink-scala-examples/pom.xml     |  61 +------
 .../WordCountPOJOITCase.java                    |  62 +++----
 4 files changed, 40 insertions(+), 293 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/a87559ae/flink-examples/flink-java-examples/pom.xml
----------------------------------------------------------------------
diff --git a/flink-examples/flink-java-examples/pom.xml b/flink-examples/flink-java-examples/pom.xml
index 97ebdec..9742c41 100644
--- a/flink-examples/flink-java-examples/pom.xml
+++ b/flink-examples/flink-java-examples/pom.xml
@@ -198,7 +198,11 @@ under the License.
 						</configuration>
 					</execution>
 					
+					<!-- These queries are currently not self-contained -->
+
 					<!-- TPC-H Query 10 -->
+
+					<!--
 					<execution>
 						<id>TPCHQuery10</id>
 						<phase>package</phase>
@@ -218,9 +222,10 @@ under the License.
 								<include>**/java/relational/TPCHQuery10$*.class</include>
 							</includes>
 						</configuration>
-					</execution>
+					</execution> -->
 				
 					<!-- TPC-H Query 3 -->
+					<!--
 					<execution>
 						<id>TPCHQuery3</id>
 						<phase>package</phase>
@@ -240,7 +245,7 @@ under the License.
 								<include>**/java/relational/TPCHQuery3$*.class</include>
 							</includes>
 						</configuration>
-					</execution>
+					</execution> -->
 		
 					<!-- WebLogAnalysis -->
 					<execution>
@@ -291,32 +296,6 @@ under the License.
 						</configuration>
 					</execution>
 
-					<!-- WordCountPOJO
-
-					Note: disabled for now, because of problems with POJO types
-
-					<execution>
-						<id>WordCountPOJO</id>
-						<phase>package</phase>
-						<goals>
-							<goal>jar</goal>
-						</goals>
-						<configuration>
-							<classifier>WordCountPOJO</classifier>
-
-							<archive>
-								<manifestEntries>
-									<program-class>org.apache.flink.example.java.wordcount.WordCountPOJO</program-class>
-								</manifestEntries>
-							</archive>
-
-							<includes>
-								<include>**/java/wordcount/WordCountPOJO.class</include>
-								<include>**/java/wordcount/WordCountPOJO$*.class</include>
-								<include>**/java/wordcount/util/WordCountData.class</include>
-							</includes>
-						</configuration>
-					</execution> -->
 				</executions>
 			</plugin>
 		</plugins>

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/a87559ae/flink-examples/flink-java-examples/src/main/java/org/apache/flink/example/java/wordcount/WordCountPOJO.java
----------------------------------------------------------------------
diff --git a/flink-examples/flink-java-examples/src/main/java/org/apache/flink/example/java/wordcount/WordCountPOJO.java b/flink-examples/flink-java-examples/src/main/java/org/apache/flink/example/java/wordcount/WordCountPOJO.java
deleted file mode 100644
index 72d2699..0000000
--- a/flink-examples/flink-java-examples/src/main/java/org/apache/flink/example/java/wordcount/WordCountPOJO.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.flink.example.java.wordcount;
-
-import org.apache.flink.api.common.functions.FlatMapFunction;
-import org.apache.flink.util.Collector;
-import org.apache.flink.api.java.DataSet;
-import org.apache.flink.api.java.ExecutionEnvironment;
-import org.apache.flink.example.java.wordcount.util.WordCountData;
-
-/**
- * Implements the "WordCount" program that computes a simple word occurrence histogram
- * over text files.
- *
- * <p>
- * The input is a plain text file with lines separated by newline characters.
- *
- * <p>
- * Usage: <code>WordCount &lt;text path&gt; &lt;result path&gt;</code><br>
- * If no parameters are provided, the program is run with default data from {@link org.apache.flink.example.java.wordcount.util.WordCountData}.
- *
- * <p>
- * This example shows how to:
- * <ul>
- * <li>write a simple Flink program.
- * <li>POJO data types with key expressions.
- * <li>write and use user-defined functions.
- * </ul>
- *
- */
-@SuppressWarnings("serial")
-public class WordCountPOJO {
-
-	// *************************************************************************
-	//     PROGRAM
-	// *************************************************************************
-
-	public static void main(String[] args) throws Exception {
-		// ====================================================================
-		// IMPORTANT
-		//
-		// Note: this example is currently not working, because support for
-		// POJO types has been disabled. As soon as all known issues (see [1])
-		// are fixed, we will enable POJO support again.
-		//
-		// [1] https://mail-archives.apache.org/mod_mbox/incubator-flink-dev/201407.mbox/%3C53D96049.1060509%40cse.uta.edu%3E
-		// ====================================================================
-//
-//		parseParameters(args);
-//
-//		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
-//
-//		// get input data
-//		DataSet<String> text = getTextDataSet(env);
-//
-//		DataSet<WC> counts = text
-//					.flatMap(new Tokenizer())
-//					.groupBy("word")
-//					.reduce(new ReduceFunction<WC>() {
-//							public WC reduce(WC value1, WC value2) {
-//								return new WC(value1.word, value1.count + value2.count);
-//							}
-//						});
-//
-//		// emit result
-//		if(fileOutput) {
-//			counts.writeAsText(outputPath);
-//		} else {
-//			counts.print();
-//		}
-//
-//		env.execute("WordCount with custom data types example");
-	}
-
-	// *************************************************************************
-	//     USER DATA TYPES (POJOs)
-	// *************************************************************************
-	
-	public static class WC {
-		public String word;
-		public int count;
-
-		public WC() {
-		}
-
-		public WC(String word, int count) {
-			this.word = word;
-			this.count = count;
-		}
-
-		@Override
-		public String toString() {
-			return word + " " + count;
-		}
-	}
-	
-	// *************************************************************************
-	//     USER FUNCTIONS
-	// *************************************************************************
-
-	/**
-	 * Implements the string tokenizer that splits sentences into words as a user-defined
-	 * FlatMapFunction. The function takes a line (String) and splits it into
-	 * multiple WC POJOs as "(word, 1)".
-	 */
-	public static final class Tokenizer implements FlatMapFunction<String, WC> {
-
-		@Override
-		public void flatMap(String value, Collector<WC> out) {
-			// normalize and split the line
-			String[] tokens = value.toLowerCase().split("\\W+");
-
-			// emit the pairs
-			for (String token : tokens) {
-				if (token.length() > 0) {
-					out.collect(new WC(token, 1));
-				}
-			}
-		}
-	}
-
-	// *************************************************************************
-	//     UTIL METHODS
-	// *************************************************************************
-
-	private static boolean fileOutput = false;
-	private static String textPath;
-	private static String outputPath;
-
-	private static void parseParameters(String[] args) {
-
-		if(args.length > 0) {
-			// parse input arguments
-			fileOutput = true;
-			if(args.length == 2) {
-				textPath = args[0];
-				outputPath = args[1];
-			} else {
-				System.err.println("Usage: WordCount <text path> <result path>");
-				System.exit(1);
-			}
-		} else {
-			System.out.println("Executing WordCount example with built-in default data.");
-			System.out.println("  Provide parameters to read input data from a file.");
-			System.out.println("  Usage: WordCount <text path> <result path>");
-		}
-	}
-
-	private static DataSet<String> getTextDataSet(ExecutionEnvironment env) {
-		if(fileOutput) {
-			// read the text file from given input path
-			return env.readTextFile(textPath);
-		} else {
-			// get default test text data
-			return WordCountData.getDefaultTextLineDataSet(env);
-		}
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/a87559ae/flink-examples/flink-scala-examples/pom.xml
----------------------------------------------------------------------
diff --git a/flink-examples/flink-scala-examples/pom.xml b/flink-examples/flink-scala-examples/pom.xml
index 3076ab9..2f706fb 100644
--- a/flink-examples/flink-scala-examples/pom.xml
+++ b/flink-examples/flink-scala-examples/pom.xml
@@ -144,6 +144,7 @@ under the License.
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>
 				<executions>
+					<!-- These examples are currently not self-contained
 
 					<execution>
 						<id>KMeans</id>
@@ -165,28 +166,6 @@ under the License.
 							</includes>
 						</configuration>
 					</execution>
-
-					<!--  Uncomment to rebuild the KMeansForTest jar
-					<execution>
-						<id>KMeansForTest</id>
-						<phase>package</phase>
-						<goals>
-							<goal>jar</goal>
-						</goals>
-				
-						<configuration>
-							<classifier>KMeansForTest</classifier>
-							<archive>
-								<manifestEntries>
-									<program-class>org.apache.flink.examples.scala.testing.KMeansForTest</program-class>
-								</manifestEntries>
-							</archive>
-				
-							<includes>
-								<include>**/testing/KMeansForTest*.class</include>
-							</includes>
-						</configuration>
-					</execution> -->
 		
 					<execution>
 						<id>ComputeEdgeDegrees</id>
@@ -295,43 +274,7 @@ under the License.
 						</configuration>
 					</execution>
 					
-					<!--  These examples need not yet supported features
-					<execution>
-						<id>TransitiveClosureNaive</id>
-						<phase>package</phase>
-						<goals>
-							<goal>jar</goal>
-						</goals>
-						<configuration>
-							<classifier>TransitiveClosureNaive</classifier>
-							<archive>
-								<manifestEntries>
-									<program-class>org.apache.flink.examples.scala.graph.TransitiveClosureNaiveDescriptor</program-class>
-								</manifestEntries>
-							</archive>
-							<includes>
-								<include>**/graph/TransitiveClosureNaive*.class</include>
-							</includes>
-						</configuration>
-					</execution>
-					<execution>
-						<id>TransitiveClosureRD</id>
-						<phase>package</phase>
-						<goals>
-							<goal>jar</goal>
-						</goals>
-						<configuration>
-							<classifier>TransitiveClosureRD</classifier>
-							<archive>
-								<manifestEntries>
-									<program-class>org.apache.flink.examples.scala.graph.TransitiveClosureRDDescriptor</program-class>
-								</manifestEntries>
-							</archive>
-							<includes>
-								<include>**/graph/TransitiveClosureRD*.class</include>
-							</includes>
-						</configuration>
-					</execution> -->
+					-->
 		
 				</executions>
 			</plugin>

http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/a87559ae/flink-tests/src/test/java/org/apache/flink/test/exampleJavaPrograms/WordCountPOJOITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/exampleJavaPrograms/WordCountPOJOITCase.java b/flink-tests/src/test/java/org/apache/flink/test/exampleJavaPrograms/WordCountPOJOITCase.java
index 7e16fd4..5639ed7 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/exampleJavaPrograms/WordCountPOJOITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/exampleJavaPrograms/WordCountPOJOITCase.java
@@ -15,34 +15,34 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-package org.apache.flink.test.exampleJavaPrograms;
-
-import org.apache.flink.example.java.wordcount.WordCountPOJO;
-import org.apache.flink.test.testdata.WordCountData;
-import org.apache.flink.test.util.JavaProgramTestBase;
-import org.junit.Ignore;
-
-@Ignore
-public class WordCountPOJOITCase extends JavaProgramTestBase {
-
-	protected String textPath;
-	protected String resultPath;
-
-	
-	@Override
-	protected void preSubmit() throws Exception {
-		textPath = createTempFile("text.txt", WordCountData.TEXT);
-		resultPath = getTempDirPath("result");
-	}
-
-	@Override
-	protected void postSubmit() throws Exception {
-		compareResultsByLinesInMemory(WordCountData.COUNTS, resultPath);
-	}
-	
-	@Override
-	protected void testProgram() throws Exception {
-		WordCountPOJO.main(new String[]{textPath, resultPath});
-	}
-}
+//
+//package org.apache.flink.test.exampleJavaPrograms;
+//
+////import org.apache.flink.example.java.wordcount.WordCountPOJO;
+//import org.apache.flink.test.testdata.WordCountData;
+//import org.apache.flink.test.util.JavaProgramTestBase;
+//import org.junit.Ignore;
+//
+//@Ignore
+//public class WordCountPOJOITCase extends JavaProgramTestBase {
+//
+//	protected String textPath;
+//	protected String resultPath;
+//
+//	
+//	@Override
+//	protected void preSubmit() throws Exception {
+//		textPath = createTempFile("text.txt", WordCountData.TEXT);
+//		resultPath = getTempDirPath("result");
+//	}
+//
+//	@Override
+//	protected void postSubmit() throws Exception {
+//		compareResultsByLinesInMemory(WordCountData.COUNTS, resultPath);
+//	}
+//	
+//	@Override
+//	protected void testProgram() throws Exception {
+//		WordCountPOJO.main(new String[]{textPath, resultPath});
+//	}
+//}