gjacoby126 commented on a change in pull request #737: PHOENIX-5773 Index tool 
output tables should support multiple simulta…
URL: https://github.com/apache/phoenix/pull/737#discussion_r395322329
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
 ##########
 @@ -257,16 +258,29 @@ private void logToIndexToolResultTable() throws 
IOException {
         long scanMaxTs = scan.getTimeRange().getMax();
         byte[] keyPrefix = Bytes.toBytes(Long.toString(scanMaxTs));
         byte[] regionName = 
Bytes.toBytes(region.getRegionInfo().getRegionNameAsString());
-        // The row key for the result table is the max timestamp of the scan + 
the table region name + scan start row
-        // + scan stop row
-        byte[] rowKey = new byte[keyPrefix.length + regionName.length + 
scan.getStartRow().length +
-                scan.getStopRow().length];
-        Bytes.putBytes(rowKey, 0, keyPrefix, 0, keyPrefix.length);
-        Bytes.putBytes(rowKey, keyPrefix.length, regionName, 0, 
regionName.length);
-        Bytes.putBytes(rowKey, keyPrefix.length + regionName.length, 
scan.getStartRow(), 0,
-                scan.getStartRow().length);
-        Bytes.putBytes(rowKey, keyPrefix.length + regionName.length + 
scan.getStartRow().length,
-                scan.getStopRow(), 0, scan.getStopRow().length);
+        int targetOffset = 0;
 
 Review comment:
   Extracting the index tool result and index tool output writing code into 
separate classes (with read methods!) would facilitate testing -- I agree with 
@swaroopak that this needs some tests, I'd say probably for both insert and 
read. Adding read methods would also make life easier for utilities, whether in 
Phoenix or outside, to be able to programmatically parse the result and output 
tables. Otherwise a whole lot of boilerplate byte parsing has to be rewritten 
each time. 

----------------------------------------------------------------
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

Reply via email to