Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/3246#discussion_r22343430
--- Diff:
external/twitter/src/main/scala/org/apache/spark/streaming/twitter/TwitterUtils.scala
---
@@ -112,20 +269,91 @@ object TwitterUtils {
): JavaReceiverInputDStream[Status] = {
createStream(jssc.ssc, Some(twitterAuth), 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.
+ * @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, latitude pairs to get only those
tweets
+ * that falling within the requested bounding boxes
+ */
+ def createStream(
+ jssc: JavaStreamingContext,
+ twitterAuth: Authorization,
+ filters: Array[String],
+ locations: Array[Array[Double]]
+ ): JavaReceiverInputDStream[Status] = {
+ createStream(jssc.ssc, Some(twitterAuth), filters,
locations.map(_.toSeq).toSeq)
+ }
+
+ /**
+ * 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 locations Set of longitude, latitude pairs to get only those
tweets
+ * that falling within the requested bounding boxes
+ */
+ def createStream(
+ jssc: JavaStreamingContext,
+ twitterAuth: Authorization,
+ locations: Array[Array[Double]]
+ ): JavaReceiverInputDStream[Status] = {
+ createStream(jssc.ssc, Some(twitterAuth), Nil,
locations.map(_.toSeq).toSeq)
+ }
+
+ /**
+ * Create a input stream that returns tweets received from Twitter.
+ * @param jssc JavaStreamingContext object
+ * @param twitterAuth Twitter4J Authorization object
+ * @param filters Set of filter strings to get only those tweets
that match them
+ * @param storageLevel Storage level to use for storing the received
objects
+ */
+ def createStream(
+ jssc: JavaStreamingContext,
+ twitterAuth: Authorization,
+ filters: Array[String],
+ storageLevel: StorageLevel
+ ): JavaReceiverInputDStream[Status] = {
+ createStream(jssc.ssc, Some(twitterAuth), filters, Nil, storageLevel)
+ }
+
/**
* Create a input stream that returns tweets received from Twitter.
* @param jssc JavaStreamingContext object
* @param twitterAuth Twitter4J Authorization object
* @param filters Set of filter strings to get only those tweets
that match them
+ * @param locations Set of longitude, latitude pairs to get only those
tweets
+ * that falling within the requested bounding boxes
* @param storageLevel Storage level to use for storing the received
objects
*/
def createStream(
jssc: JavaStreamingContext,
twitterAuth: Authorization,
filters: Array[String],
+ locations: Array[Array[Double]],
+ storageLevel: StorageLevel
+ ): JavaReceiverInputDStream[Status] = {
+ createStream(jssc.ssc, Some(twitterAuth), filters,
locations.map(_.toSeq).toSeq, storageLevel)
+ }
+
+ /**
+ * Create a input stream that returns tweets received from Twitter.
+ * @param jssc JavaStreamingContext object
+ * @param twitterAuth Twitter4J Authorization object
+ * @param locations Set of longitude, latitude pairs to get only those
tweets
+ * that falling within the requested bounding boxes
+ * @param storageLevel Storage level to use for storing the received
objects
+ */
+ def createStream(
--- End diff --
There are *12* new overloads of `createStream` on top of the existing 4.
This seems like big overkill. There should be one version in Java/Scala that
takes all arguments, one each that takes minimal arguments, and any others
needed to retain binary compatibility. The rest seem superfluous.
---
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]