flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject flink git commit: [FLINK-2493] Simplify names of example program JARs
Date Wed, 09 Sep 2015 14:53:32 GMT
Repository: flink
Updated Branches:
  refs/heads/master 0a005700d -> bbddda776


[FLINK-2493] Simplify names of example program JARs

This closes #1094


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

Branch: refs/heads/master
Commit: bbddda776a21124d665ade95dfbf7642b81988fc
Parents: 0a00570
Author: chenliang613 <chenliang@chenliangdeMacBook-Pro.local>
Authored: Sat Sep 5 09:16:53 2015 +0800
Committer: Fabian Hueske <fhueske@apache.org>
Committed: Wed Sep 9 16:49:18 2015 +0200

----------------------------------------------------------------------
 docs/apis/cli.md                           | 16 +++++++-------
 docs/apis/examples.md                      |  4 ++--
 docs/quickstart/run_example_quickstart.md  |  4 ++--
 docs/quickstart/setup_quickstart.md        |  2 +-
 docs/setup/gce_setup.md                    |  2 +-
 docs/setup/yarn_setup.md                   |  6 ++---
 flink-dist/src/main/assemblies/bin.xml     |  1 +
 flink-examples/flink-java-examples/pom.xml | 29 +++++++++++++++++++++++++
 8 files changed, 47 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/apis/cli.md
----------------------------------------------------------------------
diff --git a/docs/apis/cli.md b/docs/apis/cli.md
index 5117bbb..6bd2352 100644
--- a/docs/apis/cli.md
+++ b/docs/apis/cli.md
@@ -46,43 +46,43 @@ The command line can be used to
 
 -   Run example program with no arguments.
 
-        ./bin/flink run ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
+        ./bin/flink run ./examples/WordCount.jar
 
 -   Run example program with arguments for input and result files
 
-        ./bin/flink run ./examples/flink-java-examples-{{ site.version }}-WordCount.jar \
+        ./bin/flink run ./examples/WordCount.jar \
                                file:///home/user/hamlet.txt file:///home/user/wordcount_out
 
 -   Run example program with parallelism 16 and arguments for input and result files
 
-        ./bin/flink run -p 16 ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
\
+        ./bin/flink run -p 16 ./examples/WordCount.jar \
                                 file:///home/user/hamlet.txt file:///home/user/wordcount_out
 
 -   Run example program with flink log output disabled
 
-            ./bin/flink run -q ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
+            ./bin/flink run -q ./examples/WordCount.jar
 
 -   Run example program on a specific JobManager:
 
         ./bin/flink run -m myJMHost:6123 \
-                               ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
\
+                               ./examples/WordCount.jar \
                                file:///home/user/hamlet.txt file:///home/user/wordcount_out
 
 -   Run example program with a specific class as an entry point:
 
         ./bin/flink run -c org.apache.flink.examples.java.wordcount.WordCount \
-                               ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
\
+                               ./examples/WordCount.jar \
                                file:///home/user/hamlet.txt file:///home/user/wordcount_out
 
 -   Run example program using a [per-job YARN cluster]({{site.baseurl}}/setup/yarn_setup.html#run-a-single-flink-job-on-hadoop-yarn)
with 2 TaskManagers:
 
         ./bin/flink run -m yarn-cluster -yn 2 \
-                               ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
\
+                               ./examples/WordCount.jar \
                                hdfs:///user/hamlet.txt hdfs:///user/wordcount_out
 
 -   Display the optimized execution plan for the WordCount example program as JSON:
 
-        ./bin/flink info ./examples/flink-java-examples-{{ site.version }}-WordCount.jar
\
+        ./bin/flink info ./examples/WordCount.jar \
                                 file:///home/user/hamlet.txt file:///home/user/wordcount_out
 
 -   List scheduled and running jobs (including their JobIDs):

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/apis/examples.md
----------------------------------------------------------------------
diff --git a/docs/apis/examples.md b/docs/apis/examples.md
index 4dc7c74..d22b436 100644
--- a/docs/apis/examples.md
+++ b/docs/apis/examples.md
@@ -42,7 +42,7 @@ Each binary release of Flink contains an `examples` directory with jar files
for
 To run the WordCount example, issue the following command:
 
 ~~~bash
-./bin/flink run ./examples/flink-java-examples-{{site.version}}-WordCount.jar
+./bin/flink run ./examples/WordCount.jar
 ~~~
 
 The other examples can be started in a similar way.
@@ -50,7 +50,7 @@ The other examples can be started in a similar way.
 Note that many examples run without passing any arguments for them, by using build-in data.
To run WordCount with real data, you have to pass the path to the data:
 
 ~~~bash
-./bin/flink run ./examples/flink-java-examples-{{site.version}}-WordCount.jar /path/to/some/text/data
/path/to/result
+./bin/flink run ./examples/WordCount.jar /path/to/some/text/data /path/to/result
 ~~~
 
 Note that non-local file systems require a schema prefix, such as `hdfs://`.

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/quickstart/run_example_quickstart.md
----------------------------------------------------------------------
diff --git a/docs/quickstart/run_example_quickstart.md b/docs/quickstart/run_example_quickstart.md
index fb1d798..9d03095 100644
--- a/docs/quickstart/run_example_quickstart.md
+++ b/docs/quickstart/run_example_quickstart.md
@@ -36,7 +36,7 @@ Flink contains a data generator for K-Means.
 mkdir kmeans
 cd kmeans
 # Run data generator
-java -cp ../examples/flink-java-examples-{{ site.version }}-KMeans.jar:../lib/flink-dist-{{
site.version }}.jar \
+java -cp ../examples/KMeans.jar:../lib/flink-dist-{{ site.version }}.jar \
   org.apache.flink.examples.java.clustering.util.KMeansDataGenerator \
   -points 500 -k 10 -stddev 0.08 -output `pwd`
 ~~~
@@ -93,7 +93,7 @@ The Flink web client allows to submit Flink programs using a graphical user
inte
 		1. Open web client on  <a href="http://localhost:8080/launch.html">localhost:8080</a>
<br>
 		2. Upload the K-Mean job JAR file. 
 			{% highlight bash %}
-			./examples/flink-java-examples-*-KMeans.jar
+			./examples/KMeans.jar
 			{% endhighlight %} </br>
 		3. Select it in the left box to see how the operators in the plan are connected to each
other. <br>
 		4. Enter the arguments and options in the lower left box: <br>

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/quickstart/setup_quickstart.md
----------------------------------------------------------------------
diff --git a/docs/quickstart/setup_quickstart.md b/docs/quickstart/setup_quickstart.md
index bd976a7..a06aafb 100644
--- a/docs/quickstart/setup_quickstart.md
+++ b/docs/quickstart/setup_quickstart.md
@@ -86,7 +86,7 @@ Run the __Word Count example__ to see Flink at work.
 * __Start the example program__:
   
   ~~~bash
-  $ bin/flink run ./examples/flink-java-examples-{{site.version}}-WordCount.jar file://`pwd`/hamlet.txt
file://`pwd`/wordcount-result.txt
+  $ bin/flink run ./examples/WordCount.jar file://`pwd`/hamlet.txt file://`pwd`/wordcount-result.txt
   ~~~
 
 * You will find a file called __wordcount-result.txt__ in your current directory.

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/setup/gce_setup.md
----------------------------------------------------------------------
diff --git a/docs/setup/gce_setup.md b/docs/setup/gce_setup.md
index 15477dd..f6499dc 100644
--- a/docs/setup/gce_setup.md
+++ b/docs/setup/gce_setup.md
@@ -95,7 +95,7 @@ To bring up the Flink cluster on Google Compute Engine, execute:
 
     ./bdutil shell
     cd /home/hadoop/flink-install/bin
-    ./flink run ../examples/flink-java-examples-*-WordCount.jar gs://dataflow-samples/shakespeare/othello.txt
gs://<bucket_name>/output
+    ./flink run ../examples/WordCount.jar gs://dataflow-samples/shakespeare/othello.txt gs://<bucket_name>/output
 
 ## Shut down your cluster
 

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/docs/setup/yarn_setup.md
----------------------------------------------------------------------
diff --git a/docs/setup/yarn_setup.md b/docs/setup/yarn_setup.md
index 2b9cecc..7f6950c 100644
--- a/docs/setup/yarn_setup.md
+++ b/docs/setup/yarn_setup.md
@@ -48,7 +48,7 @@ Once the session has been started, you can submit jobs to the cluster using
the
 curl -O <flink_hadoop2_download_url>
 tar xvzf flink-{{ site.version }}-bin-hadoop2.tgz
 cd flink-{{ site.version }}/
-./bin/flink run -m yarn-cluster -yn 4 -yjm 1024 -ytm 4096 ./examples/flink-java-examples-{{
site.version }}-WordCount.jar
+./bin/flink run -m yarn-cluster -yn 4 -yjm 1024 -ytm 4096 ./examples/WordCount.jar
 ~~~
 
 ## Apache Flink on Hadoop YARN using a YARN Session
@@ -180,7 +180,7 @@ Use the *run* action to submit a job to YARN. The client is able to determine
th
 ~~~bash
 wget -O LICENSE-2.0.txt http://www.apache.org/licenses/LICENSE-2.0.txt
 hadoop fs -copyFromLocal LICENSE-2.0.txt hdfs:/// ...
-./bin/flink run ./examples/flink-java-examples-{{site.version }}-WordCount.jar \
+./bin/flink run ./examples/WordCount.jar \
         hdfs:///..../LICENSE-2.0.txt hdfs:///.../wordcount-result.txt
 ~~~
 
@@ -206,7 +206,7 @@ Please note that the client then expects the `-yn` value to be set (number
of Ta
 ***Example:***
 
 ~~~bash
-./bin/flink run -m yarn-cluster -yn 2 ./examples/flink-java-examples-{{site.version }}-WordCount.jar

+./bin/flink run -m yarn-cluster -yn 2 ./examples/WordCount.jar 
 ~~~
 
 The command line options of the YARN session are also available with the `./bin/flink` tool.


http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/flink-dist/src/main/assemblies/bin.xml
----------------------------------------------------------------------
diff --git a/flink-dist/src/main/assemblies/bin.xml b/flink-dist/src/main/assemblies/bin.xml
index 7480f79..960fd30 100644
--- a/flink-dist/src/main/assemblies/bin.xml
+++ b/flink-dist/src/main/assemblies/bin.xml
@@ -160,6 +160,7 @@ under the License.
 				<exclude>flink-java-examples-${project.version}-sources.jar</exclude>
 				<exclude>flink-java-examples-${project.version}-tests.jar</exclude>
 				<exclude>flink-java-examples-${project.version}-javadoc.jar</exclude>
+				<exclude>flink-java-examples-${project.version}-*.jar</exclude>
 			</excludes>
 		</fileSet>
 

http://git-wip-us.apache.org/repos/asf/flink/blob/bbddda77/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 8448a93..0ed2df6 100644
--- a/flink-examples/flink-java-examples/pom.xml
+++ b/flink-examples/flink-java-examples/pom.xml
@@ -322,6 +322,35 @@ under the License.
 					
 				</executions>
 			</plugin>
+
+			<!--simplify the name of example JARs for build-target/examples -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<version>1.7</version>
+				<executions>
+					<execution>
+						<id>rename</id>
+						<phase>package</phase>
+						<goals>
+							<goal>run</goal>
+						</goals>
+						<configuration> 
+							<target>
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-KMeans.jar"
tofile="${project.basedir}/target/KMeans.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-ConnectedComponents.jar"
tofile="${project.basedir}/target/ConnectedComponents.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-EnumTrianglesBasic.jar"
tofile="${project.basedir}/target/EnumTrianglesBasic.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-EnumTrianglesOpt.jar"
tofile="${project.basedir}/target/EnumTrianglesOpt.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-PageRankBasic.jar"
tofile="${project.basedir}/target/PageRankBasic.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-TransitiveClosure.jar"
tofile="${project.basedir}/target/TransitiveClosure.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-WebLogAnalysis.jar"
tofile="${project.basedir}/target/WebLogAnalysis.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-WordCount.jar"
tofile="${project.basedir}/target/WordCount.jar" />
+								<copy file="${project.basedir}/target/flink-java-examples-${project.version}-WordCountPOJO.jar"
tofile="${project.basedir}/target/WordCountPOJO.jar" />
+							</target>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 


Mime
View raw message