Writing to multiple HBASE Tables, how do I use context.write(hkey, put)?

て烟熏妆下的殇ゞ 提交于 2019-12-11 06:46:41

问题


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

  1. context.write(new ImmutableBytesWritable(Bytes.toBytes("tableName1")),put1);

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!