Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/7600#discussion_r35289044
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/dstream/InputDStream.scala
---
@@ -47,6 +49,27 @@ abstract class InputDStream[T: ClassTag] (@transient
ssc_ : StreamingContext)
/** This is an unique identifier for the input stream. */
val id = ssc.getNewInputStreamId()
+ /**
+ * A rate estimator configured by the user to compute a dynamic
ingestion bound for this stream.
+ * @see `RateEstimator`
+ */
+ protected [streaming] val rateEstimator = newEstimator()
+
+ /**
+ * Return the configured estimator, or `noop` if none was specified.
+ */
+ private def newEstimator() =
+ ssc.conf.get("spark.streaming.RateEstimator", "noop") match {
+ case "noop" => new NoopRateEstimator()
+ case estimator => throw new IllegalArgumentException(s"Unknown rate
estimator: $estimator")
+ }
+
+
+ // Keep track of the freshest rate for this stream using the
rateEstimator
+ protected[streaming] val rateController: RateController = new
RateController(id, rateEstimator) {
--- End diff --
I think the rateController should be a option. By default, it will None.
Only when backpressure is enabled do we populate it.
---
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]