提交 568e6428 编写于 作者: G Greg Hogan

[FLINK-6195] [build] Move gelly-examples jar from opt to examples

The opt directory should be reserved for Flink JARs which users may
optionally move to lib to be loaded by the runtime. flink-gelly-examples
is a user program so is moved to the examples folder.

This closes #3691
上级 3042b182
......@@ -71,24 +71,22 @@ The remaining sections provide a description of available methods and present se
Running Gelly Examples
----------------------
The Gelly library and examples jars are provided in the [Flink distribution](https://flink.apache.org/downloads.html "Apache Flink: Downloads")
in the folder **opt** (for versions older than Flink 1.2 these can be manually downloaded from
[Maven Central](http://search.maven.org/#search|ga|1|flink%20gelly)).
To run the Gelly examples the **flink-gelly** (for Java) or **flink-gelly-scala** (for Scala) jar must be copied to
Flink's **lib** directory.
The Gelly library jars are provided in the [Flink distribution](https://flink.apache.org/downloads.html "Apache Flink: Downloads")
in the **opt** directory (for versions older than Flink 1.2 these can be manually downloaded from
[Maven Central](http://search.maven.org/#search|ga|1|flink%20gelly)). To run the Gelly examples the **flink-gelly** (for
Java) or **flink-gelly-scala** (for Scala) jar must be copied to Flink's **lib** directory.
~~~bash
cp opt/flink-gelly_*.jar lib/
cp opt/flink-gelly-scala_*.jar lib/
~~~
Gelly's examples jar includes drivers for each of the library methods. After configuring and starting the cluster, list
the available algorithm classes:
Gelly's examples jar includes drivers for each of the library methods and is provided in the **examples** directory.
After configuring and starting the cluster, list the available algorithm classes:
~~~bash
./bin/start-cluster.sh
./bin/flink run opt/flink-gelly-examples_*.jar
./bin/flink run examples/flink-gelly-examples_*.jar
~~~
The Gelly drivers can generate graph data or read the edge list from a CSV file (each node in a cluster must have access
......@@ -96,13 +94,13 @@ to the input file). The algorithm description, available inputs and outputs, and
algorithm is selected. Print usage for [JaccardIndex](./library_methods.html#jaccard-index):
~~~bash
./bin/flink run opt/flink-gelly-examples_*.jar --algorithm JaccardIndex
./bin/flink run examples/flink-gelly-examples_*.jar --algorithm JaccardIndex
~~~
Display [graph metrics](./library_methods.html#metric) for a million vertex graph:
~~~bash
./bin/flink run opt/flink-gelly-examples_*.jar \
./bin/flink run examples/flink-gelly-examples_*.jar \
--algorithm GraphMetrics --order directed \
--input RMatGraph --type integer --scale 20 --simplify directed \
--output print
......@@ -119,17 +117,17 @@ Run a few algorithms and monitor the job progress in Flink's Web UI:
~~~bash
wget -O - http://snap.stanford.edu/data/bigdata/communities/com-lj.ungraph.txt.gz | gunzip -c > com-lj.ungraph.txt
./bin/flink run -q opt/flink-gelly-examples_*.jar \
./bin/flink run -q examples/flink-gelly-examples_*.jar \
--algorithm GraphMetrics --order undirected \
--input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \
--output print
./bin/flink run -q opt/flink-gelly-examples_*.jar \
./bin/flink run -q examples/flink-gelly-examples_*.jar \
--algorithm ClusteringCoefficient --order undirected \
--input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \
--output hash
./bin/flink run -q opt/flink-gelly-examples_*.jar \
./bin/flink run -q examples/flink-gelly-examples_*.jar \
--algorithm JaccardIndex \
--input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \
--output hash
......
......@@ -155,6 +155,19 @@ under the License.
<scope>compile</scope>
</dependency>
<!--
The following dependencies are packaged in 'examples/'
The scope of these dependencies needs to be 'provided' so that
they are not included into the 'flink-dist' uber jar.
-->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-gelly-examples_2.10</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<!--
The following dependencies are packaged in 'opt/'
The scope of these dependencies needs to be 'provided' so that
......@@ -220,13 +233,6 @@ under the License.
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-gelly-examples_2.10</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-ml_2.10</artifactId>
......
......@@ -59,6 +59,14 @@ under the License.
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</file>
<!-- copy jar file of the Gelly examples -->
<file>
<source>../flink-libraries/flink-gelly-examples/target/flink-gelly-examples_2.10-${project.version}.jar</source>
<outputDirectory>examples/</outputDirectory>
<destName>flink-gelly-examples_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>
</files>
<fileSets>
......
......@@ -52,13 +52,6 @@
<fileMode>0644</fileMode>
</file>
<file>
<source>../flink-libraries/flink-gelly-examples/target/flink-gelly-examples_2.10-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-gelly-examples_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>
<file>
<source>../flink-libraries/flink-gelly-scala/target/flink-gelly-scala_2.10-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
......
......@@ -108,7 +108,7 @@ public class Runner {
strBuilder
.appendNewLine()
.appendln("Select an algorithm to view usage: flink run opt/flink-gelly-examples_<version>.jar --algorithm <algorithm>")
.appendln("Select an algorithm to view usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm <algorithm>")
.appendNewLine()
.appendln("Available algorithms:");
......@@ -139,7 +139,7 @@ public class Runner {
.appendNewLine()
.appendln(algorithm.getLongDescription())
.appendNewLine()
.append("usage: flink run opt/flink-gelly-examples_<version>.jar --algorithm ")
.append("usage: flink run examples/flink-gelly-examples_<version>.jar --algorithm ")
.append(algorithmName)
.append(" [algorithm options] --input <input> [input options] --output <output> [output options]")
.appendNewLine()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册