Getting Started
Run Example of Glink
- 在Release页面下载Glinker二进制发布包.
- 解压发布包.
tar -zxvf glink-x.x.x-bin.tar.gz
- 运行Glink提供的Spatial Filter示例.
nc -lk 9999
cd glink-x.x.x/examples
flink run -c cn.edu.whu.glink.examples.datastream.SpatialFilterExample glink-examples-1.0.0.jar
该示例有两个查询几何, Polygon ((0 5,5 10,10 5,5 0,0 5))
和Polygon ((5 5,10 10,15 5,10 0,5 5))
, 用于过滤落在这两个多边形外部的点. 它监听9999
端口, 可在nc -lk 9999
窗口输入如下数据进行测试.
1,114.35,34.50
2,2,2
Use Glink in Program
- 下载Glink源代码.
git clone git@github.com:glink-incubator/glink.git
- 编译并安装Glink依赖到本地仓库.
mvn clean install -DskipTests
- 在新工程的
pom.xml
中引入Glink依赖.
<properties>
<glink.version>x.x.x</glink.version>
</properties>
<dependency>
<groupId>cn.edu.whu</groupId>
<artifactId>glink-core</artifactId>
<version>${glink.version}</version>
</dependency>
<dependency>
<groupId>cn.edu.whu</groupId>
<artifactId>glink-sql</artifactId>
<version>${glink.version}</version>
</dependency>
<dependency>
<groupId>cn.edu.whu</groupId>
<artifactId>glink-connector-geomesa</artifactId>
<version>${glink.version}</version>
<exclusions>
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>