Redis Hashes are generic map data structures. More info can be found on the Redis data types page.
The Jet connectors we have here for them make it possible to read in such maps' content (in its entirety) or to write out (append) content to them.
Atrribute | Value |
---|---|
Has Source | Yes |
Batch | Yes |
Stream | No |
Distributed | No |
Atrribute | Value |
---|---|
Has Sink | Yes |
Distributed | Yes |
For installation and other prerequisites see the main page.
The Redis Hash source (RedisSources.hash()
) connects to a specific Redis Hash and reads in all key-value pairs from it.
Following is an example pipeline which reads in all entries from such a Hash and writes them out to a Hazelcast IMap.
RedisURI uri = RedisURI.create("redis://localhost/");
Pipeline.create()
.readFrom(RedisSources.hash("source", uri, "hash"))
.writeTo(Sinks.map("map"));
For more detail check out RedisSources & RedisSourceTest.
The Redis Hash sink (RedisSinks.hash()
) can be used to write out (append) data into a Redis Hash.
Following is an example pipeline which reads map entries from a Hazelcast IMap and writes them out into a Redis Hash.
RedisURI uri = RedisURI.create("redis://localhost/");
Pipeline.create()
.readFrom(Sources.map(map))
.writeTo(RedisSinks.hash("sink", uri, "hash"));
For more detail check out RedisSinks & RedisSinksTest.