- Java 1.7+
- sbt
- Kafka 0.11 (+ Zookeeper)
- Flink 1.3.2
From the /cowbird-flink-common directory run:
sbt assembly
sbt publishLocal
The Akka configuration parameters should be set in order to execute the Fog layer. It can be done through the application.conf file in the /play-java-swan-cloud/conf/ directory.
The seed-nodes list should contain the address (and port) of the Cowbird manager.
sbt "runMain distributed.manager.CowbirdManagerApp 2551"
sbt "runMain distributed.node.CowbirdNodeApp $port"
sbt run
String myExpression = "self@test:value{MEAN,1000}";
try {
ValueExpression expression = (ValueExpression) ExpressionFactory.parse(myExpression);
identifier = FrontendManager.sharedInstance().registerValueExpression(expression, new ValueExpressionListener() {
@Override
public void onNewValues(String id, TimestampedValue[] newValues) {
if(newValues!=null && newValues.length>0) {
System.out.println("Test Sensor (Value):" + newValues[newValues.length-1].toString());
}
}
});
} catch (ExpressionParseException e) {
e.printStackTrace();
}
FrontendManager.sharedInstance().unregisterExpression(identifier);
The Flink application can be compiled using sbt:
sbt assembly
On a local deployment start the Flink session using the start-local.sh script that can be found in the Flink directory. Run the Flink job using the flink script:
./flink-1.3.2/bin/flink run ../path/to/distributed-cowbird/cowbird-flink/target/scala-2.11/cowbird-flink-assembly-1.0.jar
The streaming-oriented evalaution mode can be enabled using the --light-mode parameter when launching the Flink application.
./flink-1.3.2/bin/flink run ../path/to/distributed-cowbird/cowbird-flink/target/scala-2.11/cowbird-flink-assembly-1.0.jar --light-mode ON
In the /scripts directory some configuration scripts can be found.
The deploy_cowbird_kafka_topics.sh can be used to install the Kafka topics required to execute the application.