package org.apache.spark.sql.kafka010
sealed trait KafkaDataConsumer {
// only required properties (vals and methods) that have no implementation
// the others follow
def internalConsumer: InternalKafkaConsumer
def release(): Unit
}
KafkaDataConsumer Contract
KafkaDataConsumer
is the contract for KafkaDataConsumers that use an InternalKafkaConsumer for the following:
KafkaDataConsumer
has to be released explicitly.
Property | Description |
---|---|
|
|
|
|
KafkaDataConsumer | Description |
---|---|
|
|
|
Note
|
KafkaDataConsumer is a Scala sealed trait which means that all the implementations are in the same compilation unit (a single file).
|
Getting Single Kafka ConsumerRecord — get
Method
get(
offset: Long,
untilOffset: Long,
pollTimeoutMs: Long,
failOnDataLoss: Boolean): ConsumerRecord[Array[Byte], Array[Byte]]
get
simply requests the InternalKafkaConsumer to get a single Kafka ConsumerRecord.
Note
|
|
Getting Single AvailableOffsetRange — getAvailableOffsetRange
Method
getAvailableOffsetRange(): AvailableOffsetRange
getAvailableOffsetRange
simply requests the InternalKafkaConsumer to get a single AvailableOffsetRange.
Note
|
|