abstract class ConsumerStrategy[K, V] extends AnyRef
Choice of how to create and configure underlying Kafka Consumers on driver and executors. See ConsumerStrategies to obtain instances. Kafka 0.10 consumers can require additional, sometimes complex, setup after object instantiation. This interface encapsulates that process, and allows it to be checkpointed.
- K
type of Kafka message key
- V
type of Kafka message value
- Alphabetic
- By Inheritance
- ConsumerStrategy
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ConsumerStrategy()
Abstract Value Members
-
abstract
def
executorKafkaParams: Map[String, AnyRef]
Kafka configuration parameters to be used on executors.
Kafka configuration parameters to be used on executors. Requires "bootstrap.servers" to be set with Kafka broker(s) specified in host1:port1,host2:port2 form.
-
abstract
def
onStart(currentOffsets: Map[TopicPartition, Long]): Consumer[K, V]
Must return a fully configured Kafka Consumer, including subscribed or assigned topics.
Must return a fully configured Kafka Consumer, including subscribed or assigned topics. See Kafka docs. This consumer will be used on the driver to query for offsets only, not messages. The consumer must be returned in a state that it is safe to call poll(0) on.
- currentOffsets
A map from TopicPartition to offset, indicating how far the driver has successfully read. Will be empty on initial start, possibly non-empty on restart from checkpoint.
Concrete 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( ... ) @native() @HotSpotIntrinsicCandidate()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def serviceConsumer: Consumer[K, V]
-
def
setAuthenticationConfigIfNeeded(kafkaParams: Map[String, AnyRef]): Map[String, AnyRef]
Updates the parameters with security if needed.
Updates the parameters with security if needed. Added a function to hide internals and reduce code duplications because all strategy uses it.
- Attributes
- protected
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated