org.apache.storm.redis.trident

## Class WordCountLookupMapper

- java.lang.Object
- - org.apache.storm.redis.trident.WordCountLookupMapper

- All Implemented Interfaces:
    Serializable, RedisLookupMapper, RedisMapper, TupleMapper

      public class WordCountLookupMapper
      extends Object
      implements RedisLookupMapper

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WordCountLookupMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `declareOutputFields(OutputFieldsDeclarer declarer)` declare what are the fields that this code will output.
    `RedisDataTypeDescription` | `getDataTypeDescription()` Returns descriptor which defines data type.
    `String` | `getKeyFromTuple(ITuple tuple)` Extracts key from tuple.
    `String` | `getValueFromTuple(ITuple tuple)` Extracts value from tuple.
    `List<Values>` | `toTuple(ITuple input, Object value)` Converts return value from Redis to a list of storm values that can be emitted.

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

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

- - ### Constructor Detail

    - #### WordCountLookupMapper

          public WordCountLookupMapper()

  - ### Method Detail

    - #### toTuple

          public List<Values> toTuple(ITuple input,
                                      Object value)

      Description copied from interface: `RedisLookupMapper`

      Converts return value from Redis to a list of storm values that can be emitted.

      Specified by:
        `toTuple` in interface `RedisLookupMapper`
      Parameters:
        `input` - the input tuple.
        `value` - Redis query response value. Can be String, Boolean, Long regarding of data type.
      Returns:
        a List of storm values that can be emitted. Each item in list is emitted as an output tuple.

    - #### declareOutputFields

          public void declareOutputFields(OutputFieldsDeclarer declarer)

      Description copied from interface: `RedisLookupMapper`

      declare what are the fields that this code will output.

      Specified by:
        `declareOutputFields` in interface `RedisLookupMapper`
      Parameters:
        `declarer` - OutputFieldsDeclarer

    - #### getDataTypeDescription

          public RedisDataTypeDescription getDataTypeDescription()

      Description copied from interface: `RedisMapper`

      Returns descriptor which defines data type.

      Specified by:
        `getDataTypeDescription` in interface `RedisMapper`
      Returns:
        data type descriptor

    - #### getKeyFromTuple

          public String getKeyFromTuple(ITuple tuple)

      Description copied from interface: `TupleMapper`

      Extracts key from tuple.

      Specified by:
        `getKeyFromTuple` in interface `TupleMapper`
      Parameters:
        `tuple` - source tuple
      Returns:
        key

    - #### getValueFromTuple

          public String getValueFromTuple(ITuple tuple)

      Description copied from interface: `TupleMapper`

      Extracts value from tuple.

      Specified by:
        `getValueFromTuple` in interface `TupleMapper`
      Parameters:
        `tuple` - source tuple
      Returns:
        value

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