From 58780094a999ee2e1395fad227379238a8ea0d32 Mon Sep 17 00:00:00 2001 From: Russell Jurney Date: Thu, 13 Jun 2013 17:59:17 -0700 Subject: [PATCH] Upgraded to twitter4j 3.0.3, twitter example now works with twitter4j.properties in place that lists key pairs. --- examples/pom.xml | 6 +++--- .../examples/twitter/TwitterSpritzerFirehoseFactory.java | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index c9632a3334b..4a1cbc929ac 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -125,17 +125,17 @@ org.twitter4j twitter4j-core - 2.2.6 + 3.0.3 org.twitter4j twitter4j-async - 2.2.6 + 3.0.3 org.twitter4j twitter4j-stream - 2.2.6 + 3.0.3 diff --git a/examples/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java b/examples/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java index 590b8d0d670..e87b5e44de2 100644 --- a/examples/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java +++ b/examples/src/main/java/druid/examples/twitter/TwitterSpritzerFirehoseFactory.java @@ -17,6 +17,7 @@ import twitter4j.StatusListener; import twitter4j.TwitterStream; import twitter4j.TwitterStreamFactory; import twitter4j.User; +import twitter4j.StallWarning; import java.io.IOException; import java.util.Arrays; @@ -31,7 +32,7 @@ import java.util.concurrent.TimeUnit; import static java.lang.Thread.sleep; /** - * Twitter "spritzer" Firehost Factory named "twitzer". + * Twitter "spritzer" Firehose Factory named "twitzer". * Builds a Firehose that emits a stream of * ?? * with timestamps along with ??. @@ -176,6 +177,11 @@ public class TwitterSpritzerFirehoseFactory implements FirehoseFactory { { ex.printStackTrace(); } + + @Override + public void onStallWarning(StallWarning warning) { + System.out.println("Got stall warning:" + warning); + } }; twitterStream.addListener(statusListener);