flyingfromchina
flyingfromchina

Reputation: 9691

Is there an efficient way to find the sequence file for a given key?

My map-reduce job writes the final results to sequence files. Is there any efficient way to find the sequence file for a given key?

Upvotes: 0

Views: 64

Answers (1)

Chris White
Chris White

Reputation: 30089

If the key emitted from the mapper is the same key output in the reducer, then you can run your seach key through the used partitioner (Hash Paritioner is the default), passing the key and the number of reducers the job was originally run. This should give you the reducer number the key was sent to, and hence the part-r-xxxxx file which should contain it.

Upvotes: 2

Related Questions