An open API service indexing awesome lists of open source software.

https://github.com/streamr-dev/streamr-flink

Streamr integration library for Apache Flink
https://github.com/streamr-dev/streamr-flink

Last synced: 3 months ago
JSON representation

Streamr integration library for Apache Flink

Awesome Lists containing this project

README

          

# Streamr Integeration library for Apache Flink
## How to use

Add this to your pom-xml file:
```

com.streamr.labs
streamr_flink
0.1

```

Import the Streamr subscriber or publisher for Flink with:
```
import com.streamr.labs.streamr_flink.StreamrPublish;
import com.streamr.labs.streamr_flink.StreamrSubscribe;
```

Example code:
``` java
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
StreamrSubscribe streamrSub = new StreamrSubscribe("YOUR_STREAMR_API_KEY", "YOUR_SUB_STREAM_ID");
StreamrPublish streamPub = new StreamrPublish("YOUR_STREAMR_APIKEY", "YOUR_PUB_STREAM_ID");

DataStreamSource> tramDataSource = env.addSource(streamrSub);
// Filter the 6T trams.
DataStream> stream = tramDataSource.filter(new FilterFunction>() {
@Override
public boolean filter(Map s) throws Exception {
return (s.containsKey("desi") && s.get("desi").toString().contains("6"));
}
});
// Add the publish sink
stream.print();
stream.addSink(streamPub);

env.execute("Trams");
```

For more info go to https://github.com/streamr-dev/streamr-apache-flink-integration