Package org.apache.storm.redis.trident
Class WordCountLookupMapper
java.lang.Object
org.apache.storm.redis.trident.WordCountLookupMapper
- All Implemented Interfaces:
Serializable
,RedisLookupMapper
,RedisMapper
,TupleMapper
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
declareOutputFields
(OutputFieldsDeclarer declarer) declare what are the fields that this code will output.Returns descriptor which defines data type.getKeyFromTuple
(ITuple tuple) Extracts key from tuple.getValueFromTuple
(ITuple tuple) Extracts value from tuple.Converts return value from Redis to a list of storm values that can be emitted.
-
Constructor Details
-
WordCountLookupMapper
public WordCountLookupMapper()
-
-
Method Details
-
toTuple
Description copied from interface:RedisLookupMapper
Converts return value from Redis to a list of storm values that can be emitted.- Specified by:
toTuple
in interfaceRedisLookupMapper
- 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
Description copied from interface:RedisLookupMapper
declare what are the fields that this code will output.- Specified by:
declareOutputFields
in interfaceRedisLookupMapper
- Parameters:
declarer
- OutputFieldsDeclarer
-
getDataTypeDescription
Description copied from interface:RedisMapper
Returns descriptor which defines data type.- Specified by:
getDataTypeDescription
in interfaceRedisMapper
- Returns:
- data type descriptor
-
getKeyFromTuple
Description copied from interface:TupleMapper
Extracts key from tuple.- Specified by:
getKeyFromTuple
in interfaceTupleMapper
- Parameters:
tuple
- source tuple- Returns:
- key
-
getValueFromTuple
Description copied from interface:TupleMapper
Extracts value from tuple.- Specified by:
getValueFromTuple
in interfaceTupleMapper
- Parameters:
tuple
- source tuple- Returns:
- value
-