class_docstr: A Kafka Dataset that consumes the messages.
class_docstr_tok: ["A","Kafka","Dataset","that","consumes","the","messages","."]
docstr: Create a KafkaReader.
  
  Args:
      topics: A `tf.string` tensor containing one or more subscriptions,
              in the format of [topic:partition:offset:length],
              by default length is -1 for unlimited.
              eg. ["sampleTopic:0:0:10"] will fetch the first 10 messages from
              the 0th partition of sampleTopic.
              eg. ["sampleTopic:0:0:10","sampleTopic:1:0:10"] will fetch
              the first 10 messages from the 0th partition followed
              by the first 10 messages from the 1st partition of sampleTopic.
      servers: A list of bootstrap servers.
      group: The consumer group id.
      eof: If True, the kafka reader will stop on EOF.
      timeout: The timeout value for the Kafka Consumer to wait
              (in milliseconds).
      config_global: A `tf.string` tensor containing global configuration
                      properties in [Key=Value] format,
                      eg. ["enable.auto.commit=false",
                          "heartbeat.interval.ms=2000"],
                      please refer to 'Global configuration properties'
                      in librdkafka doc.
      config_topic: A `tf.string` tensor containing topic configuration
                      properties in [Key=Value] format,
                      eg. ["auto.offset.reset=earliest"],
                      please refer to 'Topic configuration properties'
                      in librdkafka doc.
      message_key: If True, the kafka will output both message value and key.
      message_offset: If True, the kafka will output both message value and offset,
                      the offset info like 'partition-index:offset'.
docstr_tok: ["Create","a","KafkaReader",".","Args",":","topics",":","A","`","tf.string","`","tensor","containing","one","or","more","subscriptions",",","in","the","format","of","[","topic",":","partition",":","offset",":","length","]",",","by","default","length","is","-1","for","unlimited",".","eg",".","[","``","sampleTopic:0:0:10","''","]","will","fetch","the","first","10","messages","from","the","0th","partition","of","sampleTopic",".","eg",".","[","``","sampleTopic:0:0:10","''",",","''","sampleTopic:1:0:10","''","]","will","fetch","the","first","10","messages","from","the","0th","partition","followed","by","the","first","10","messages","from","the","1st","partition","of","sampleTopic",".","servers",":","A","list","of","bootstrap","servers",".","group",":","The","consumer","group","id",".","eof",":","If","True",",","the","kafka","reader","will","stop","on","EOF",".","timeout",":","The","timeout","value","for","the","Kafka","Consumer","to","wait","(","in","milliseconds",")",".","config_global",":","A","`","tf.string","`","tensor","containing","global","configuration","properties","in","[","Key=Value","]","format",",","eg",".","[","``","enable.auto.commit=false","''",",","``","heartbeat.interval.ms=2000","''","]",",","please","refer","to","'Global","configuration","properties'","in","librdkafka","doc",".","config_topic",":","A","`","tf.string","`","tensor","containing","topic","configuration","properties","in","[","Key=Value","]","format",",","eg",".","[","``","auto.offset.reset=earliest","''","]",",","please","refer","to","'Topic","configuration","properties'","in","librdkafka","doc",".","message_key",":","If","True",",","the","kafka","will","output","both","message","value","and","key",".","message_offset",":","If","True",",","the","kafka","will","output","both","message","value","and","offset",",","the","offset","info","like","'partition-index",":","offset","'","."]
code: def __init__(
      self,
      topics,
      servers="localhost",
      group="",
      eof=False,
      timeout=1000,
      config_global=None,
      config_topic=None,
      message_key=False,
      message_offset=False,
  ):
      """Create a KafkaReader.
  
      Args:
          topics: A `tf.string` tensor containing one or more subscriptions,
                  in the format of [topic:partition:offset:length],
                  by default length is -1 for unlimited.
                  eg. ["sampleTopic:0:0:10"] will fetch the first 10 messages from
                  the 0th partition of sampleTopic.
                  eg. ["sampleTopic:0:0:10","sampleTopic:1:0:10"] will fetch
                  the first 10 messages from the 0th partition followed
                  by the first 10 messages from the 1st partition of sampleTopic.
          servers: A list of bootstrap servers.
          group: The consumer group id.
          eof: If True, the kafka reader will stop on EOF.
          timeout: The timeout value for the Kafka Consumer to wait
                  (in milliseconds).
          config_global: A `tf.string` tensor containing global configuration
                          properties in [Key=Value] format,
                          eg. ["enable.auto.commit=false",
                              "heartbeat.interval.ms=2000"],
                          please refer to 'Global configuration properties'
                          in librdkafka doc.
          config_topic: A `tf.string` tensor containing topic configuration
                          properties in [Key=Value] format,
                          eg. ["auto.offset.reset=earliest"],
                          please refer to 'Topic configuration properties'
                          in librdkafka doc.
          message_key: If True, the kafka will output both message value and key.
          message_offset: If True, the kafka will output both message value and offset,
                          the offset info like 'partition-index:offset'.
      """
      self._topics = tf.convert_to_tensor(
          topics, dtype=dtypes.string, name="topics"
      )
      self._servers = tf.convert_to_tensor(
          servers, dtype=dtypes.string, name="servers"
      )
      self._group = tf.convert_to_tensor(
          group, dtype=dtypes.string, name="group"
      )
      self._eof = tf.convert_to_tensor(
          eof, dtype=dtypes.bool, name="eof"
      )
      self._timeout = tf.convert_to_tensor(
          timeout, dtype=dtypes.int64, name="timeout"
      )
      config_global = config_global if config_global else []
      self._config_global = tf.convert_to_tensor(
          config_global, dtype=dtypes.string, name="config_global"
      )
      config_topic = config_topic if config_topic else []
      self._config_topic = tf.convert_to_tensor(
          config_topic, dtype=dtypes.string, name="config_topic"
      )
      self._message_key = message_key
      self._message_offset = message_offset
      super().__init__()
  
file_path: io/tensorflow_io/python/ops/kafka_deprecated_dataset_ops.py
imports: import warnings
  import tensorflow
  from tensorflow import dtypes
  from tensorflow.compat.v1 import data
  from tensorflow_io.python.ops import core_ops
  from tensorflow_io.python.utils import deprecation
label_desc: Use image node_id 1 to create a new KafkaDataset object from inherited base classes: data with example: obj = KafkaDataset(topics, servers, group, eof, timeout, config_global, config_topic, message_key, message_offset)