Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.09 KB

hash.md

File metadata and controls

65 lines (46 loc) · 2.09 KB

Redis Hash Connector

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.

Connector Attributes

Source Attributes

Atrribute Value
Has Source Yes
Batch Yes
Stream No
Distributed No

Sink Attributes

Atrribute Value
Has Sink Yes
Distributed Yes

Getting Started

Installing

For installation and other prerequisites see the main page.

Usage

As a Source

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.

As a Sink

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.