Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/1717#discussion_r16639433
--- Diff:
external/twitter/src/main/scala/org/apache/spark/streaming/twitter/TwitterUtils.scala
---
@@ -115,17 +148,45 @@ object TwitterUtils {
/**
* 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.
+ * @param jssc JavaStreamingContext object
+ * @param twitterAuth Twitter4J Authorization
+ * @param filters Set of filter strings to get only those tweets
that match them
+ * @param locations Set of longitude and latitude coordinates to get
only those tweets within the
+ bounding box defined by those points. Example:
{{-180.0,-90.0},{180.0,90.0}} gives any
+ geotagged tweet. If locations and filters are both nonempty,
then any tweet matching
+ either condition may be returned.
+ */
+ def createStream(
+ jssc: JavaStreamingContext,
+ twitterAuth: Authorization,
+ filters: Array[String],
+ locations: Array[Array[Double]]
+ ): JavaReceiverInputDStream[Status] = {
+ // Scala implicitly converts Array[T] to Seq[T], but not
Array[Array[T]] to Seq[Seq[T]]
+ createStream(jssc.ssc, Some(twitterAuth), filters,
locations.map(_.toList))
+ }
+
+
+ /**
+ * Create a input stream that returns tweets received from Twitter.
--- End diff --
Rather than changing this signature and adding another one (the above one),
it probably better (in terms binary compatibility) to add a single new method,
that is
```
def createStream(
jssc: JavaStreamingContext,
twitterAuth: Authorization,
filters: Array[String],
locations: Array[Array[Double]],
storageLevel: StorageLevel
): JavaReceiverInputDStream[Status] = {
```
Same applies to the Scala API.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]