org.apache.storm.kafka.bolt.selector

## Class FieldIndexTopicSelector

- java.lang.Object
- - org.apache.storm.kafka.bolt.selector.FieldIndexTopicSelector

- All Implemented Interfaces:
    Serializable, KafkaTopicSelector

      public class FieldIndexTopicSelector
      extends Object
      implements KafkaTopicSelector

  Uses field with a given index to select the topic name from a tuple .

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldIndexTopicSelector(int fieldIndex, String defaultTopicName)` Creates a new FieldIndexTopicSelector.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getTopic(Tuple tuple)`

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

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

- - ### Constructor Detail

    - #### FieldIndexTopicSelector

          public FieldIndexTopicSelector(int fieldIndex,
                                         String defaultTopicName)

      Creates a new FieldIndexTopicSelector.

      Parameters:
        `fieldIndex` - The index of the field containing the topic name
        `defaultTopicName` - The default topic name if the topic name cannot be read from the tuple

  - ### Method Detail

    - #### getTopic

          public String getTopic(Tuple tuple)

      Specified by:
        `getTopic` in interface `KafkaTopicSelector`

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