Return-Path:
private static final Double DEFAULT_PRICE = 1000.;
-private static final StockPrice DEFAULT_STOCK_PRICE = new StockPrice("", DEFAULT_PRICE);
+private static final StockPrice DEFAULT_STOCK_PRICE = new StockPrice("", DEFAULT_PRICE);
//Use delta policy to create price change warnings
DataStream<String> priceWarnings = stockStream.groupBy("symbol")
@@ -504,13 +505,13 @@ every 30 seconds.
return Math.abs(oldDataPoint.price - newDataPoint.price);
}
}, DEFAULT_STOCK_PRICE))
-.mapWindow(new SendWarning()).flatten();
+.mapWindow(new SendWarning()).flatten();
//Count the number of warnings every half a minute
DataStream<Count> warningsPerStock = priceWarnings.map(new MapFunction<String, Count>() {
@Override
public Count map(String value) throws Exception {
- return new Count(value, 1);
+ return new Count(value, 1);
}
}).groupBy("symbol").window(Time.of(30, TimeUnit.SECONDS)).sum("count").flatten();
@@ -592,7 +593,7 @@ but for the sake of this example we generate dummy tweet data.
//Read a stream of tweets
-DataStream<String> tweetStream = env.addSource(new TweetSource());
+DataStream<String> tweetStream = env.addSource(new TweetSource());
//Extract the stock symbols
DataStream<String> mentionedSymbols = tweetStream.flatMap(
@@ -615,7 +616,7 @@ but for the sake of this example we generate dummy tweet data.
DataStream<Count> tweetsPerStock = mentionedSymbols.map(new MapFunction<String, Count>() {
@Override
public Count map(String value) throws Exception {
- return new Count(value, 1);
+ return new Count(value, 1);
}
}).groupBy("symbol").window(Time.of(30, TimeUnit.SECONDS)).sum("count").flatten();
@@ -625,8 +626,8 @@ but for the sake of this example we generate dummy tweet data.
@Override
public void invoke(Collector<String> collector) throws Exception {
- random = new Random();
- stringBuilder = new StringBuilder();
+ random = new Random();
+ stringBuilder = new StringBuilder();
while (true) {
stringBuilder.setLength(0);
@@ -708,7 +709,7 @@ these data streams are potentially infinite, we apply the join on a
//Compute rolling correlation
DataStream<Double> rollingCorrelation = tweetsAndWarning
.window(Time.of(30, TimeUnit.SECONDS))
- .mapWindow(new WindowCorrelation());
+ .mapWindow(new WindowCorrelation());
rollingCorrelation.print();
http://git-wip-us.apache.org/repos/asf/flink-web/blob/c3e5f146/content/news/2015/03/02/february-2015-in-flink.html
----------------------------------------------------------------------
diff --git a/content/news/2015/03/02/february-2015-in-flink.html b/content/news/2015/03/02/february-2015-in-flink.html
index f5305c7..92e9150 100644
--- a/content/news/2015/03/02/february-2015-in-flink.html
+++ b/content/news/2015/03/02/february-2015-in-flink.html
@@ -38,7 +38,7 @@
@@ -50,7 +50,7 @@
- Quickstart
+ Quickstart
@@ -50,7 +50,7 @@
- Quickstart
+ Quickstart