因此,当从使用 TableOutputFormat 的 MapReduce 作业写入 HBase 时,它多久写入一次 HBase。我不认为它会为每一行执行一个 put 命令。
在 MapReduce 中使用时如何控制 AutoFlush 和 Write Ahead Log (WAL)?
最佳答案
TableOutputFormat 禁用 AutoFlush 并使用在 hbase.client.write.buffer 指定的写入缓冲区(默认为 2MB),一旦缓冲区已满,它会自动刷新到 HBase。您可以通过将属性添加到作业配置来更改它:
config.set("hbase.client.write.buffer", 16777216);//16MB 缓冲区
WAL 是默认启用的,它可以在每次放置时被禁用,但通常不鼓励这样做:
myPut.setWriteToWal(false);
关于hadoop - HBase mapReduce TableOutputFormat如何使用Flush和WAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28437940/