priyankporwal commented on a change in pull request #672: PHOENIX-5658
IndexTool to verify index rows inline
URL: https://github.com/apache/phoenix/pull/672#discussion_r365467593
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
##########
@@ -285,17 +286,25 @@ private void logToIndexToolOutputTable(byte[]
dataRowKey, byte[] indexRowKey, lo
String errorMsg) {
try (Table hTable =
ServerUtil.ConnectionFactory.getConnection(ServerUtil.ConnectionType.INDEX_WRITER_CONNECTION,
env).getTable(TableName.valueOf(IndexTool.OUTPUT_TABLE_NAME)))
{
- byte[] rowKey = new byte[Long.BYTES];
- Bytes.putLong(rowKey, 0, scan.getTimeRange().getMax());
+ byte[] rowKey;
+ if (dataRowKey != null) {
+ int length = Long.BYTES + dataRowKey.length;
+ rowKey = new byte[length];
+ Bytes.putLong(rowKey, 0, scan.getTimeRange().getMax());
+ for (int i = Long.BYTES, j = 0; i < length; i++, j++) {
Review comment:
Nit: System.arraycopy() might perform better than byte-by-byte copy. I
assume it's java equivalent of memcpy.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services