org.apache.storm.hbase.topology

## Class WordCountValueMapper

- java.lang.Object
- - org.apache.storm.hbase.topology.WordCountValueMapper

- All Implemented Interfaces:
    Serializable, HBaseValueMapper

      public class WordCountValueMapper
      extends Object
      implements HBaseValueMapper

  Takes a Hbase result and returns a value list that has a value instance for each column and corresponding value. So if the result from Hbase was

       WORD, COUNT apple, 10 bannana, 20

  this will return

        [WORD, apple]
          [COUNT, 10]  [WORD, banana]
          [COUNT, 20]

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WordCountValueMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `declareOutputFields(OutputFieldsDeclarer declarer)` declares the output fields for the lookup bolt.
    `List<Values>` | `toValues(ITuple tuple, org.apache.hadoop.hbase.client.Result result)` Map to values.

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

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

- - ### Constructor Detail

    - #### WordCountValueMapper

          public WordCountValueMapper()

  - ### Method Detail

    - #### toValues

          public List<Values> toValues(ITuple tuple,
                                       org.apache.hadoop.hbase.client.Result result)
                                throws Exception

      Description copied from interface: `HBaseValueMapper`

      Map to values.

      Specified by:
        `toValues` in interface `HBaseValueMapper`
      Parameters:
        `tuple` - tuple
        `result` - HBase lookup result instance
      Returns:
        list of values that should be emitted by the lookup bolt
      Throws:
        `Exception`

    - #### declareOutputFields

          public void declareOutputFields(OutputFieldsDeclarer declarer)

      Description copied from interface: `HBaseValueMapper`

      declares the output fields for the lookup bolt.

      Specified by:
        `declareOutputFields` in interface `HBaseValueMapper`

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