Class/Object

io.gearpump.streaming.kafka

KafkaSource

Related Docs: object KafkaSource | package kafka

Permalink

class KafkaSource extends TimeReplayableSource

Kafka source connectors that pulls a batch of messages (kafka.consumer.emit.batch.size) from multiple Kafka TopicAndPartition in a round-robin way.

This is a TimeReplayableSource which is able to replay messages given a start time. Each kafka message is tagged with a timestamp by io.gearpump.streaming.transaction.api.MessageDecoder and the (offset, timestamp) mapping is stored to a OffsetStorage. On recovery, we could retrieve the previously stored offset from the OffsetStorage by timestamp and start to read from there.

kafka message is wrapped into gearpump Message and further filtered by a TimeStampFilter such that obsolete messages are dropped.

Linear Supertypes
TimeReplayableSource, DataSource, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KafkaSource
  2. TimeReplayableSource
  3. DataSource
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KafkaSource(topics: String, zkConnect: String, offsetStorageFactory: OffsetStorageFactory, messageDecoder: MessageDecoder, timestampFilter: TimeStampFilter)

    Permalink

    topics

    comma-separated string of topics

    zkConnect

    kafka consumer config zookeeper.connect

    offsetStorageFactory

    io.gearpump.streaming.transaction.api.OffsetStorageFactory that creates io.gearpump.streaming.transaction.api.OffsetStorage

    messageDecoder

    decodes Message from raw bytes

    timestampFilter

    filters out message based on timestamp

  2. new KafkaSource(topics: String, zkConnect: String, offsetStorageFactory: OffsetStorageFactory)

    Permalink

    topics

    comma-separated string of topics

    zkConnect

    kafka consumer config zookeeper.connect

    offsetStorageFactory

    io.gearpump.streaming.transaction.api.OffsetStorageFactory that creates io.gearpump.streaming.transaction.api.OffsetStorage

  3. new KafkaSource(topics: String, properties: Properties, offsetStorageFactory: OffsetStorageFactory, messageDecoder: MessageDecoder, timestampFilter: TimeStampFilter)

    Permalink

    topics

    comma-separated string of topics

    properties

    kafka consumer config

    offsetStorageFactory

    io.gearpump.streaming.transaction.api.OffsetStorageFactory that creates io.gearpump.streaming.transaction.api.OffsetStorage

    messageDecoder

    decodes Message from raw bytes

    timestampFilter

    filters out message based on timestamp

  4. new KafkaSource(topics: String, properties: Properties, offsetStorageFactory: OffsetStorageFactory)

    Permalink

    topics

    comma-separated string of topics

    properties

    kafka consumer config

    offsetStorageFactory

    io.gearpump.streaming.transaction.api.OffsetStorageFactory that creates io.gearpump.streaming.transaction.api.OffsetStorage

  5. new KafkaSource(config: KafkaSourceConfig, offsetStorageFactory: OffsetStorageFactory, messageDecoder: MessageDecoder = new DefaultMessageDecoder, timestampFilter: TimeStampFilter = new DefaultTimeStampFilter, fetchThread: Option[FetchThread] = None, offsetManagers: Map[TopicAndPartition, KafkaOffsetManager] = ...)

    Permalink

    config

    kafka source config

    messageDecoder

    decodes Message from raw bytes

    timestampFilter

    filters out message based on timestamp

    fetchThread

    fetches messages and puts on a in-memory queue

    offsetManagers

    manages offset-to-timestamp storage for each kafka.common.TopicAndPartition

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 close(): Unit

    Permalink
    Definition Classes
    KafkaSource → DataSource
  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. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  16. def open(context: TaskContext, startTime: Option[TimeStamp]): Unit

    Permalink
    Definition Classes
    KafkaSource → DataSource
  17. def read(batchSize: Int): List[Message]

    Permalink
    Definition Classes
    KafkaSource → DataSource
  18. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from TimeReplayableSource

Inherited from DataSource

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped