写入多个HBASE表,如何使用context.write(hkey,put)?

时间:2017-06-21 18:55:24

标签: hadoop mapreduce hbase

我是Hadoop MapReduce的新手。我想从我的reducer函数执行多个表写操作。这将是类似的,如果有任何东西写入Table1然后我也希望表2中的相同内容。

我查看了Write to multiple tables in HBASE这样的帖子并检查了" MultiTableOutputFormat"。但我不明白,根据减速器功能的帖子,我应该使用

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

  2. context.write(new ImmutableBytesWritable(Bytes.toBytes("tableName2")),put2);

  3. 我不明白,如果我们这样做,那么我们在哪里定义我们想要更新值的行。例如,我看到了一些代码片段,并看到它们以context.write(hkey, put)的形式写入表中。我认为hkey不是表名,而是表示表中的某个特定行。

    我该如何处理?

0 个答案:

没有答案