Gelly: Flink Graph API

    Gelly is currently part of the libraries Maven project. All relevant classes are located in the org.apache.flink.graph package.

    Add the following dependency to your to use Gelly.

    Java

    Copied to clipboard!

    1. <dependency>
    2. <groupId>org.apache.flink</groupId>
    3. <version>1.15.0</version>
    4. </dependency>

    Copied to clipboard!

    Note that Gelly is not part of the binary distribution. See linking for instructions on packaging Gelly libraries into Flink user programs.

    The remaining sections provide a description of available methods and present several examples of how to use Gelly and how to mix it with the Flink DataSet API.

    Running Gelly Examples

    The Gelly library jars are provided in the [Flink distribution](http://nightlies.apache.org/flink/flink-docs-release-1.15/zh/docs/libs/gelly/overview/

    1. cp opt/flink-gelly_*.jar lib/
    2. cp opt/flink-gelly-scala_*.jar lib/

    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:

    The Gelly drivers can generate graph data or read the edge list from a CSV file (each node in a cluster must have access to the input file). The algorithm description, available inputs and outputs, and configuration are displayed when an algorithm is selected. Print usage for :

    Display graph metrics for a million vertex graph:

    The size of the graph is adjusted by the --scale and --edge_factor parameters. The provides access to additional configuration to adjust the power-law skew and random noise.

    1. wget -O - http://snap.stanford.edu/data/bigdata/communities/com-lj.ungraph.txt.gz | gunzip -c > com-lj.ungraph.txt
    2. ./bin/flink run -q examples/gelly/flink-gelly-examples_*.jar \
    3. --algorithm GraphMetrics --order undirected \
    4. --input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \
    5. --algorithm ClusteringCoefficient --order undirected \
    6. --input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \
    7. --output hash
    8. ./bin/flink run -q examples/gelly/flink-gelly-examples_*.jar \
    9. --algorithm JaccardIndex \
    10. --input CSV --type integer --simplify undirected --input_filename com-lj.ungraph.txt --input_field_delimiter $'\t' \

    Please submit feature requests and report issues on the user mailing list or . We welcome suggestions for new algorithms and features as well as code contributions.