org.apache.spark.streaming.flume.sink

SparkSink

class SparkSink extends AbstractSink with Logging with Configurable

A sink that uses Avro RPC to run a server that can be polled by Spark's FlumePollingInputDStream. This sink has the following configuration parameters:

hostname - The hostname to bind to. Default: 0.0.0.0 port - The port to bind to. (No default - mandatory) timeout - Time in seconds after which a transaction is rolled back, if an ACK is not received from Spark within that time threads - Number of threads to use to receive requests from Spark (Default: 10)

This sink is unlike other Flume sinks in the sense that it does not push data, instead the process method in this sink simply blocks the SinkRunner the first time it is called. This sink starts up an Avro IPC server that uses the SparkFlumeProtocol.

Each time a getEventBatch call comes, creates a transaction and reads events from the channel. When enough events are read, the events are sent to the Spark receiver and the thread itself is blocked and a reference to it saved off.

When the ack for that batch is received, the thread which created the transaction is is retrieved and it commits the transaction with the channel from the same thread it was originally created in (since Flume transactions are thread local). If a nack is received instead, the sink rolls back the transaction. If no ack is received within the specified timeout, the transaction is rolled back too. If an ack comes after that, it is simply ignored and the events get re-sent.

Linear Supertypes
Configurable, Logging, AbstractSink, Sink, NamedComponent, LifecycleAware, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SparkSink
  2. Configurable
  3. Logging
  4. AbstractSink
  5. Sink
  6. NamedComponent
  7. LifecycleAware
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SparkSink()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def configure(ctx: Context): Unit

    Definition Classes
    SparkSink → Configurable
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getChannel(): Channel

    Definition Classes
    AbstractSink → Sink
  13. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  14. def getLifecycleState(): LifecycleState

    Definition Classes
    AbstractSink → LifecycleAware
  15. def getName(): String

    Definition Classes
    AbstractSink → NamedComponent
  16. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  19. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  21. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  22. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  23. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  24. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  25. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  26. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  27. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  28. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  29. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def process(): Status

    Definition Classes
    SparkSink → Sink
  34. def setChannel(arg0: Channel): Unit

    Definition Classes
    AbstractSink → Sink
  35. def setName(arg0: String): Unit

    Definition Classes
    AbstractSink → NamedComponent
  36. def start(): Unit

    Definition Classes
    SparkSink → AbstractSink → LifecycleAware
  37. def stop(): Unit

    Definition Classes
    SparkSink → AbstractSink → LifecycleAware
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  39. def toString(): String

    Definition Classes
    AbstractSink → AnyRef → Any
  40. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Configurable

Inherited from Logging

Inherited from AbstractSink

Inherited from Sink

Inherited from NamedComponent

Inherited from LifecycleAware

Inherited from AnyRef

Inherited from Any

Ungrouped