Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6386 Bulkload generates unverified index rows - #1144
Conversation
stoty
commented
Feb 18, 2021
💔 -1 overall
This message was automatically generated. |
virajjasani
left a comment
There was a problem hiding this comment.
Left few comments, looks good overall
| for (Cell kv : keyValueList) { | ||
| list.add(kv); | ||
| cellsForTable.add(kv); | ||
| } |
There was a problem hiding this comment.
nit: can be replaced with cellsForTable.addAll(keyValueList)
| for(int i=0; i < keyValues.size() ; i++) { | ||
| Cell kv = keyValues.get(i); |
There was a problem hiding this comment.
can be replaced by
for (Cell kv : keyValues) {
There was a problem hiding this comment.
I purposefully chose this construct, as we're processing a lot a objects, and this is reportedly faster and easier on memory / GC.
| * | ||
| * @param keyValues will be modified | ||
| */ | ||
| public void setVerfied(List<Cell> keyValues) { |
There was a problem hiding this comment.
nit: "s/setVerfied/setVerified"
| private byte[] emptyKeyValueCF; | ||
| private int emptyKeyValueCFLength; | ||
| private byte[] emptyKeyValueQualifier; | ||
| private int emptyKeyValueQualifierLength; |
There was a problem hiding this comment.
nit: good to mark all final
| checkIndexTableIsVerfied("TABLE3_IDX"); | ||
| } | ||
| private void checkIndexTableIsVerfied(String indexTableName) throws SQLException, IOException { |
There was a problem hiding this comment.
nit: "s/checkIndexTableIsVerfied/checkIndexTableIsVerified"
| import org.apache.hadoop.hbase.client.Admin; | ||
| import org.apache.hadoop.hbase.client.Result; |
There was a problem hiding this comment.
Few unused imports, nothing urgent, can be removed while committing changes
| if(indexStatusUpdaters[i] != null) { | ||
| indexStatusUpdaters[i].setVerfied(keyValueList); | ||
| } |
There was a problem hiding this comment.
This should solve the problem of verifying index rows right?
There was a problem hiding this comment.
Strictly speaking, we are not verifying them, as we're generating the records in bulk, and we assume that they are correct (we assume that the bluk load job runs fully).
We're just setting the status to verified to avoid repairing the freshly generated index rows.
stoty
left a comment
There was a problem hiding this comment.
Thanks for the thorough review @virajjasani
| import org.apache.hadoop.hbase.client.Admin; | ||
| import org.apache.hadoop.hbase.client.Result; |
| checkIndexTableIsVerfied("TABLE3_IDX"); | ||
| } | ||
| private void checkIndexTableIsVerfied(String indexTableName) throws SQLException, IOException { |
| if(indexStatusUpdaters[i] != null) { | ||
| indexStatusUpdaters[i].setVerfied(keyValueList); | ||
| } |
There was a problem hiding this comment.
Strictly speaking, we are not verifying them, as we're generating the records in bulk, and we assume that they are correct (we assume that the bluk load job runs fully).
We're just setting the status to verified to avoid repairing the freshly generated index rows.
| private byte[] emptyKeyValueCF; | ||
| private int emptyKeyValueCFLength; | ||
| private byte[] emptyKeyValueQualifier; | ||
| private int emptyKeyValueQualifierLength; |
| * | ||
| * @param keyValues will be modified | ||
| */ | ||
| public void setVerfied(List<Cell> keyValues) { |
| for(int i=0; i < keyValues.size() ; i++) { | ||
| Cell kv = keyValues.get(i); |
There was a problem hiding this comment.
I purposefully chose this construct, as we're processing a lot a objects, and this is reportedly faster and easier on memory / GC.
| for (Cell kv : keyValueList) { | ||
| list.add(kv); | ||
| cellsForTable.add(kv); | ||
| } |
stoty
commented
Feb 22, 2021
💔 -1 overall
This message was automatically generated. |
stoty
commented
Feb 22, 2021
@virajjasani If the changes look good can you add a formal +1 / approved ? |
No description provided.