org.apache.storm.sql.kafka

## Class RecordTranslatorSchemeAdapter

- java.lang.Object
- - org.apache.storm.sql.kafka.RecordTranslatorSchemeAdapter

- All Implemented Interfaces:
    Serializable, Func<org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer>,List<Object>>, RecordTranslator<ByteBuffer,ByteBuffer>

      public class RecordTranslatorSchemeAdapter
      extends Object
      implements RecordTranslator<ByteBuffer,ByteBuffer>

  RecordTranslator that delegates to a Scheme.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.apache.storm.kafka.spout.RecordTranslator

      `DEFAULT_STREAM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RecordTranslatorSchemeAdapter(Scheme delegate)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<Object>` | `apply(org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer> record)` Translate the ConsumerRecord into a list of objects that can be emitted.
    `Fields` | `getFieldsFor(String stream)` Get the fields associated with a stream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.storm.kafka.spout.RecordTranslator

      `streams`

- - ### Constructor Detail

    - #### RecordTranslatorSchemeAdapter

          public RecordTranslatorSchemeAdapter(Scheme delegate)

  - ### Method Detail

    - #### apply

          public List<Object> apply(org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer> record)

      Description copied from interface: `RecordTranslator`

      Translate the ConsumerRecord into a list of objects that can be emitted.

      Specified by:
        `apply` in interface `Func<org.apache.kafka.clients.consumer.ConsumerRecord<ByteBuffer,ByteBuffer>,List<Object>>`
      Specified by:
        `apply` in interface `RecordTranslator<ByteBuffer,ByteBuffer>`
      Parameters:
        `record` - the record to translate
      Returns:
        the objects in the tuple. Return a `KafkaTuple` if you want to route the tuple to a non-default stream. Return `null` to discard an invalid `ConsumerRecord` if `KafkaSpoutConfig.Builder.setEmitNullTuples(boolean)` is set to `false`.

    - #### getFieldsFor

          public Fields getFieldsFor(String stream)

      Description copied from interface: `RecordTranslator`

      Get the fields associated with a stream. The streams passed in are returned by the `RecordTranslator.streams()` method.

      Specified by:
        `getFieldsFor` in interface `RecordTranslator<ByteBuffer,ByteBuffer>`
      Parameters:
        `stream` - the stream the fields are for
      Returns:
        the fields for that stream.

Copyright © 2021 The Apache Software Foundation. All rights reserved.