org.apache.spark.streaming.twitter
Class TwitterUtils

Object
  extended by org.apache.spark.streaming.twitter.TwitterUtils

public class TwitterUtils
extends Object


Constructor Summary
TwitterUtils()
           
 
Method Summary
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc)
          Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret.
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc, twitter4j.auth.Authorization twitterAuth)
          Create a input stream that returns tweets received from Twitter.
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc, twitter4j.auth.Authorization twitterAuth, String[] filters)
          Create a input stream that returns tweets received from Twitter.
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc, twitter4j.auth.Authorization twitterAuth, String[] filters, StorageLevel storageLevel)
          Create a input stream that returns tweets received from Twitter.
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc, String[] filters)
          Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret.
static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc, String[] filters, StorageLevel storageLevel)
          Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret.
static ReceiverInputDStream<twitter4j.Status> createStream(StreamingContext ssc, scala.Option<twitter4j.auth.Authorization> twitterAuth, scala.collection.Seq<String> filters, StorageLevel storageLevel)
          Create a input stream that returns tweets received from Twitter.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwitterUtils

public TwitterUtils()
Method Detail

createStream

public static ReceiverInputDStream<twitter4j.Status> createStream(StreamingContext ssc,
                                                                  scala.Option<twitter4j.auth.Authorization> twitterAuth,
                                                                  scala.collection.Seq<String> filters,
                                                                  StorageLevel storageLevel)
Create a input stream that returns tweets received from Twitter.

Parameters:
ssc - StreamingContext object
twitterAuth - Twitter4J authentication, or None to use Twitter4J's default OAuth authorization; this uses the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret
filters - Set of filter strings to get only those tweets that match them
storageLevel - Storage level to use for storing the received objects
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc)
Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret. Storage level of the data will be the default StorageLevel.MEMORY_AND_DISK_SER_2.

Parameters:
jssc - JavaStreamingContext object
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc,
                                                                      String[] filters)
Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret. Storage level of the data will be the default StorageLevel.MEMORY_AND_DISK_SER_2.

Parameters:
jssc - JavaStreamingContext object
filters - Set of filter strings to get only those tweets that match them
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc,
                                                                      String[] filters,
                                                                      StorageLevel storageLevel)
Create a input stream that returns tweets received from Twitter using Twitter4J's default OAuth authentication; this requires the system properties twitter4j.oauth.consumerKey, twitter4j.oauth.consumerSecret, twitter4j.oauth.accessToken and twitter4j.oauth.accessTokenSecret.

Parameters:
jssc - JavaStreamingContext object
filters - Set of filter strings to get only those tweets that match them
storageLevel - Storage level to use for storing the received objects
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc,
                                                                      twitter4j.auth.Authorization twitterAuth)
Create a input stream that returns tweets received from Twitter. Storage level of the data will be the default StorageLevel.MEMORY_AND_DISK_SER_2.

Parameters:
jssc - JavaStreamingContext object
twitterAuth - Twitter4J Authorization
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc,
                                                                      twitter4j.auth.Authorization twitterAuth,
                                                                      String[] filters)
Create a input stream that returns tweets received from Twitter. Storage level of the data will be the default StorageLevel.MEMORY_AND_DISK_SER_2.

Parameters:
jssc - JavaStreamingContext object
twitterAuth - Twitter4J Authorization
filters - Set of filter strings to get only those tweets that match them
Returns:
(undocumented)

createStream

public static JavaReceiverInputDStream<twitter4j.Status> createStream(JavaStreamingContext jssc,
                                                                      twitter4j.auth.Authorization twitterAuth,
                                                                      String[] filters,
                                                                      StorageLevel storageLevel)
Create a input stream that returns tweets received from Twitter.

Parameters:
jssc - JavaStreamingContext object
twitterAuth - Twitter4J Authorization object
filters - Set of filter strings to get only those tweets that match them
storageLevel - Storage level to use for storing the received objects
Returns:
(undocumented)