Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ object ActorSupervisorStrategy {
* should be same.
*/
@DeveloperApi
trait ActorHelper {
trait ActorHelper extends Logging{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to prior comments about logDebug/removing -- as an additional nit, please put a space after Logging.


self: Actor => // to ensure that this can be added to Actor classes only

/** Store an iterator of received data as a data block into Spark's memory. */
def store[T](iter: Iterator[T]) {
println("Storing iterator")
logDebug("Storing iterator")
context.parent ! IteratorData(iter)
}

Expand All @@ -84,6 +84,7 @@ trait ActorHelper {
* that Spark is configured to use.
*/
def store(bytes: ByteBuffer) {
logDebug("Storing Bytes")
context.parent ! ByteBufferData(bytes)
}

Expand All @@ -93,7 +94,7 @@ trait ActorHelper {
* being pushed into Spark's memory.
*/
def store[T](item: T) {
println("Storing item")
logDebug("Storing item")
context.parent ! SingleItemData(item)
}
}
Expand Down Expand Up @@ -157,15 +158,16 @@ private[streaming] class ActorReceiver[T: ClassTag](
def receive = {

case IteratorData(iterator) =>
println("received iterator")
logDebug("received iterator")
store(iterator.asInstanceOf[Iterator[T]])

case SingleItemData(msg) =>
println("received single")
logDebug("received single")
store(msg.asInstanceOf[T])
n.incrementAndGet

case ByteBufferData(bytes) =>
logDebug("received bytes")
store(bytes)

case props: Props =>
Expand Down