classStreamer extends TypedStreamingActor[String] with CounterActor
Simply showing what the streaming actor does for the sake of the demo. It is a
org.apache.spark.streaming.receivers.Receiver. This receiver tracks the number
of blocks of data pushed to Spark so that the demo can shut down once we assert
the expected data has been saved to Cassandra.
The additional behavior of a Counter simply supports the demo shutdown once
the Stream has sent all the randomly generated data to the Spark DStream for
processing. Once completed, the Streamer triggers an Akka DeathWatch by
self ! PoisonPill
trait CounterActor extends Actor with Logging {
protectedval scale = 30privatevar count = 0protecteddef increment(): Unit = {
count += 1if (count == scale) self ! PoisonPill
}
}
Linear Supertypes
CounterActor, Logging, TypedStreamingActor[String], SparkStreamingActor, Receiver, Actor, AnyRef, Any
This member is added by an implicit conversion from Streamer to
ArrowAssoc[Streamer] performed by method any2ArrowAssoc in scala.Predef.
Shadowing
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error. To access this member you can use a type ascription:
This member is added by an implicit conversion from Streamer to
Ensuring[Streamer] performed by method any2Ensuring in scala.Predef.
Shadowing
This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error. To access this member you can use a type ascription:
(streamer: Ensuring[Streamer]).x
Definition Classes
Ensuring
Annotations
@deprecated
Deprecated
(Since version 2.10.0) Use resultOfEnsuring instead
Simply showing what the streaming actor does for the sake of the demo. It is a
org.apache.spark.streaming.receivers.Receiver
. This receiver tracks the number of blocks of data pushed to Spark so that the demo can shut down once we assert the expected data has been saved to Cassandra.The additional behavior of a Counter simply supports the demo shutdown once the Stream has sent all the randomly generated data to the Spark
DStream
for processing. Once completed, the Streamer triggers an Akka DeathWatch by