When I use HFileOutputFormat2 in mr job to build HFiles，in reducer it creates lots of files.
Here is the log:
It keep writing a new file every rowkey comes.
then I output more logs for detail and found the problem. Code HereGitHub
In my Case，I have two fimaly F1 & F2，and writer of F2 arrives the maxsize
,so rollRequested becomes true, but it's rowkey was the same with previousRow so writer won't be roll. When next rowkey comes with fimaly F1, both of rollRequested && Bytes.compareTo(this.previousRow, rowKey) != 0 is true，and writter of F1 will be roll , new Hfile create. And then same rowkey with fimaly F2 comes set rollRequested
true, and next rowkey with fimaly F1 comes writter of F1 rolled.
So, it will create a new Hfile for every rowkey with fimaly F1, and F2 will never be roll until job ends.
Here is my questions and part of solutions:
Q1. First whether hbase 2.0.0 support different family of same HbaseTable has different rowkey cut？Which means rowkeyA writes in the first HFile of F1，but may be the second HFile of F2. For hbase 1.x.x it doesn't support so we roll all the writter and won't get this problem. I guess the answer is "Yes,support" , we goes to Q2.
Q2. Do we allow same rowkey with same family, comes to HFileOutputFormat2.write?
If not, can we fix it this way, cause this rowKey will never be the same with previouseRow
If yes, should we need Map to record previouseRow