Here is what I want to do. Now I have some text files like this:
If you're going to process such files by MapReduce I'd take the following strategy:
context.nextKeyValue()instead of being called for each line.
To form keys I'd use UUID implementation
java.util.UUID. Something like:
UUID key = UUID.randomUUID();
It's enough if you're not generating billions records per second and your job does not take 100 years. :-)
Just note - UUID should be probably encoded in
ImmutableBytesWritable class, useful for such things.
OK, your reducer (if any) and output format is another story. You will definitely need output format to store your objects if you don't convert them to something like
Text during the mapping.