问题
I am new to Hadoop MapReduce. I would like to perform multiple tables writes from my reducer function. Which will be something like, if anything is getting written to Table1 then I want the same content in table 2 also.
I have gone through the posts like Write to multiple tables in HBASE and checked the "MultiTableOutputFormat". But what I don't understand there is that according to the post in reducer function I should just use
context.write(new ImmutableBytesWritable(Bytes.toBytes("tableName1")),put1);
context.write(new ImmutableBytesWritable(Bytes.toBytes("tableName2")),put2);
I don't understand that if we do this then where are we defining the row where we want to update the value. Like for example I saw some code snippets and saw them writing into the table as context.write(hkey, put)
. Where I think hkey
is not the table name instead it represents some particular row in the table.
How should I deal with this?
来源:https://stackoverflow.com/questions/44684129/writing-to-multiple-hbase-tables-how-do-i-use-context-writehkey-put