Class

org.apache.spark.streaming.flume.sink

SparkSink

Related Doc: package sink

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SparkSink()

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  16. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  17. def log: Logger

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def process(): Status

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  37. def toString(): String

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

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

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

    Permalink
    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