diff --git a/examples/bin/examples/twitter/twitter_realtime.spec b/examples/bin/examples/twitter/twitter_realtime.spec index 0006c88d72d..ed9039b0f0c 100644 --- a/examples/bin/examples/twitter/twitter_realtime.spec +++ b/examples/bin/examples/twitter/twitter_realtime.spec @@ -16,13 +16,22 @@ "contributors", "lat", "lon", + "source", + "retweet", "retweet_count", + "originator_screen_name", + "originator_follower_count", + "originator_friends_count", + "originator_verified", "follower_count", - "friendscount", + "friends_count", "lang", "utc_offset", "statuses_count", "user_id", + "screen_name", + "location", + "verified", "ts" ], "dimensionExclusions": [ @@ -65,6 +74,16 @@ "name": "total_statuses_count", "type": "doubleSum" }, + { + "fieldName": "originator_follower_count", + "name": "total_originator_follower_count", + "type": "doubleSum" + }, + { + "fieldName": "originator_friends_count", + "name": "total_originator_friends_count", + "type": "doubleSum" + }, { "fieldName": "text", "name": "text_hll", @@ -124,6 +143,26 @@ "fieldName": "retweet_count", "name": "max_retweet_count", "type": "max" + }, + { + "fieldName": "originator_follower_count", + "name": "min_originator_follower_count", + "type": "min" + }, + { + "fieldName": "originator_follower_count", + "name": "max_originator_follower_count", + "type": "max" + }, + { + "fieldName": "originator_friends_count", + "name": "min_originator_friends_count", + "type": "min" + }, + { + "fieldName": "originator_friends_count", + "name": "max_originator_friends_count", + "type": "max" } ], "granularitySpec": { diff --git a/examples/src/main/java/io/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java b/examples/src/main/java/io/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java index 79c4a6dd6aa..598e82c8676 100644 --- a/examples/src/main/java/io/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java +++ b/examples/src/main/java/io/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java @@ -50,6 +50,8 @@ import java.util.TreeMap; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static java.lang.Thread.sleep; @@ -82,6 +84,8 @@ import static java.lang.Thread.sleep; public class TwitterSpritzerFirehoseFactory implements FirehoseFactory { private static final Logger log = new Logger(TwitterSpritzerFirehoseFactory.class); + private static final Pattern sourcePattern = Pattern.compile("]*>(.*?)", Pattern.CASE_INSENSITIVE); + /** * max events to receive, -1 is infinite, 0 means nothing is delivered; use this to prevent * infinite space consumption or to prevent getting throttled at an inconvenient time @@ -278,6 +282,8 @@ public class TwitterSpritzerFirehoseFactory implements FirehoseFactory