Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pulsar-io] Refine the key in redis sink when key is null (apache#11192)
### Motivation When the record has a null key, someone maybe confused by a NPE warn as below: ``` 11:26:22.730 [pool-5-thread-1] WARN org.apache.pulsar.io.redis.sink.RedisSink - Record flush thread was exception java.lang.NullPointerException: null at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) ~[?:1.8.0_291] at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) ~[?:1.8.0_291] at org.apache.pulsar.io.redis.sink.RedisSink.flush(RedisSink.java:127) ~[pulsar-io-redis-2.8.0.nar-unpacked/:?] at org.apache.pulsar.io.redis.sink.RedisSink.lambda$write$1(RedisSink.java:94) ~[pulsar-io-redis-2.8.0.nar-unpacked/:?] ``` We can use an empty string as key when its key is null as other sinks do. ### Modifications - Use an empty string as key when its key is null.
- Loading branch information