class KafkaSource extends Metrics
A source of data for stream loading that is backed by Kafka.
Not thread safe, create separate instances when loading data from multiple threads.
- Alphabetic
- By Inheritance
- KafkaSource
- Metrics
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new KafkaSource(consumerProperties: Properties, topics: Either[Seq[String], Pattern], pollTimeout: Duration, watermarkProviderFactory: () => WatermarkProvider)(implicit timeProvider: TimeProvider = TimeProvider.system)
- consumerProperties
Kafka consumer properties to use.
- topics
Topics to subscribe to, either a list or a pattern of topics.
- pollTimeout
Timeout when polling data from Kafka.
- watermarkProviderFactory
Factory for constructing watermark providers.
Type Members
- class AssignableGauge[T <: AnyRef] extends AnyRef
- Definition Classes
- Metrics
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(): Unit
Closes the source and all underlying resources.
- def createAssignableGauge[T <: AnyRef](name: String, tdf: ToDoubleFunction[T], tags: Seq[MetricTag] = Seq()): AssignableGauge[T]
- Attributes
- protected
- Definition Classes
- Metrics
- def createCounter(name: String, tags: Seq[MetricTag] = Seq()): Counter
- Attributes
- protected
- Definition Classes
- Metrics
- def createDistribution(name: String, tags: Seq[MetricTag] = Seq()): DistributionSummary
- Attributes
- protected
- Definition Classes
- Metrics
- def createGauge[T <: AnyRef](name: String, metric: T, tdf: ToDoubleFunction[T], tags: Seq[MetricTag] = Seq()): Gauge
- Attributes
- protected
- Definition Classes
- Metrics
- def createTimer(name: String, tags: Seq[MetricTag] = Seq(), maxDuration: Duration = null): Timer
- Attributes
- protected
- Definition Classes
- Metrics
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initialize(): KafkaContext
Initializes the source by creating a Kafka consumer using the provided configuration.
Initializes the source by creating a Kafka consumer using the provided configuration.
- returns
A KafkaContext that can later be used for offset committing.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def metricsRoot: String
A common prefix for all created metrics.
A common prefix for all created metrics.
- Attributes
- protected
- Definition Classes
- KafkaSource → Metrics
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def poll(): Iterable[StreamRecord]
Polls Kafka for new records.
Polls Kafka for new records.
- returns
An iterator of polled records.
- def removeMeters(meters: Meter*): Unit
- Attributes
- protected
- Definition Classes
- Metrics
- def seek(partition: TopicPartition, position: StreamPosition): Unit
Resets the consumer offsets to the given stream position.
Resets the consumer offsets to the given stream position. Should be called in the subscription callback.
- partition
Kafka topic partition to seek.
- position
Stream position to seek to.
- def subscribe(listener: ConsumerRebalanceListener): Unit
Subscribes to the Kafka topics provided in the constructor.
Subscribes to the Kafka topics provided in the constructor.
- listener
The callback for assignment/revocation, users should perform any needed seeking here using
seek()
.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()