How it works...
To generate some data for demonstration purposes, sample user data is populated into Redis via the script. We partitioned the sample data with the first seven characters of the user ID and stored it as a hash structure.
Due to the characteristics of the sample data in our MapReduce application, we first customized the InputFormat by extending the InputFormat class to create the InputSplit for each partition of the user data. One InputSplit is for one hash key.
In each split, a RedisHashRecordReader, which is a sub-class of RecordReader, is initiated to fetch the data of a hash key correspondingly. During the initiation of the RecordReader, the Jedis library is used to make a connection to the Redis Server, get the length of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access