[
https://issues.apache.org/jira/browse/STORM-1919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15350663#comment-15350663
]
ASF GitHub Bot commented on STORM-1919:
---------------------------------------
Github user darionyaphet commented on a diff in the pull request:
https://github.com/apache/storm/pull/1517#discussion_r68543199
--- Diff: external/storm-redis/README.md ---
@@ -21,13 +21,16 @@ use it as a maven dependency:
### For normal Bolt
-Storm-redis provides basic Bolt implementations, ```RedisLookupBolt``` and
```RedisStoreBolt```.
+Storm-redis provides basic Bolt implementations, ```RedisLookupBolt``` and
```RedisStoreBolt```, and ```RedisFilterBolt```.
-As name represents its usage, ```RedisLookupBolt``` retrieves value from
Redis using key, and ```RedisStoreBolt``` stores key / value to Redis. One
tuple will be matched to one key / value pair, and you can define match pattern
to ```TupleMapper```.
+As name represents its usage, ```RedisLookupBolt``` retrieves value from
Redis using key, and ```RedisStoreBolt``` stores key / value to Redis, and
```RedisFilterBolt``` filters out tuple which key or field doesn't exist on
Redis.
-You can also choose data type from ```RedisDataTypeDescription``` to use.
Please refer ```RedisDataTypeDescription.RedisDataType``` to see what data
types are supported. In some data types (hash and sorted set), it requires
additional key and converted key from tuple becomes element.
+One tuple will be matched to one key / value pair, and you can define
match pattern to ```TupleMapper```.
-These interfaces are combined with ```RedisLookupMapper``` and
```RedisStoreMapper``` which fit ```RedisLookupBolt``` and ```RedisStoreBolt```
respectively.
+You can also choose data type from ```RedisDataTypeDescription``` to use.
Please refer ```RedisDataTypeDescription.RedisDataType``` to see what data
types are supported. In some data types (hash and sorted set, and set if only
RedisFilterBolt), it requires additional key and converted key from tuple
becomes element.
+
+These interfaces are combined with ```RedisLookupMapper``` and
```RedisStoreMapper``` and ```RedisFilterMapper``` which fit
```RedisLookupBolt``` and ```RedisStoreBolt```, and ```RedisFilterBolt```
respectively.
+(When you want to implement RedisFilterMapper, be sure to set
declareOutputFields() to declare same fields to input stream, since FilterBolt
forwards input tuples when they exist on Redis.)
--- End diff --
Actually `RedisFilterMapper` and `RedisLookupMapper` are the same . It get
a key from tuple then use to query from `Redis` . The difference is
`RedisFilterBolt` use `RedisFilterMapper` and `RedisLookupBolt` use
`RedisLookupMapper` . Should the tow mappers could extends from one basic
abstract class ?
`RedisFilterMapper` and `RedisLookupBolt` will not use getValueFromTuple()
, this method will always return `null`. So maybe I will open another ticket to
discuss Mapper Structure .
> Introduce FilterBolt on storm-redis
> -----------------------------------
>
> Key: STORM-1919
> URL: https://issues.apache.org/jira/browse/STORM-1919
> Project: Apache Storm
> Issue Type: New Feature
> Components: storm-redis
> Reporter: Jungtaek Lim
> Assignee: Jungtaek Lim
>
> While discussing about STORM-1880, it would be better to have FilterBolt
> explicitly instead of letting users set up their lookup mapper to act as
> filter.
> There's other benefit here: we can use exists / hexists on STRING / HASH
> datatype instead of retrieving actual value which reduces execution time /
> latency from Redis side.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)