You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ka...@apache.org on 2020/01/28 07:11:49 UTC
[phoenix] branch 4.x-HBase-1.5 updated: PHOENIX-5694 Add MR job
counters for IndexTool inline verification (addendum)
This is an automated email from the ASF dual-hosted git repository.
kadir pushed a commit to branch 4.x-HBase-1.5
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/4.x-HBase-1.5 by this push:
new f587fee PHOENIX-5694 Add MR job counters for IndexTool inline verification (addendum)
f587fee is described below
commit f587fee5d6957f7981b1af88e8e1fe1727078158
Author: Kadir <ko...@salesforce.com>
AuthorDate: Mon Jan 27 23:07:35 2020 -0800
PHOENIX-5694 Add MR job counters for IndexTool inline verification (addendum)
---
.../phoenix/coprocessor/IndexRebuildRegionScanner.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
index 318440f..ed55489 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
@@ -434,7 +434,7 @@ public class IndexRebuildRegionScanner extends BaseRegionScanner {
}
@Override
- public boolean isFilterDone() { return hasMore; }
+ public boolean isFilterDone() { return false; }
private void logToIndexToolResultTable() throws IOException {
long scanMaxTs = scan.getTimeRange().getMax();
@@ -957,6 +957,7 @@ public class IndexRebuildRegionScanner extends BaseRegionScanner {
@Override
public boolean next(List<Cell> results) throws IOException {
+ Cell lastCell = null;
int rowCount = 0;
region.startRegionOperation();
try {
@@ -968,6 +969,7 @@ public class IndexRebuildRegionScanner extends BaseRegionScanner {
List<Cell> row = new ArrayList<Cell>();
hasMore = innerScanner.nextRaw(row);
if (!row.isEmpty()) {
+ lastCell = row.get(0);
Put put = null;
Delete del = null;
for (Cell cell : row) {
@@ -1039,8 +1041,14 @@ public class IndexRebuildRegionScanner extends BaseRegionScanner {
}
}
byte[] rowCountBytes = PLong.INSTANCE.toBytes(Long.valueOf(rowCount));
- final Cell aggKeyValue = KeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY, SINGLE_COLUMN_FAMILY,
- SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes, 0, rowCountBytes.length);
+ final Cell aggKeyValue;
+ if (lastCell == null) {
+ aggKeyValue = KeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY, SINGLE_COLUMN_FAMILY,
+ SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes, 0, rowCountBytes.length);
+ } else {
+ aggKeyValue = KeyValueUtil.newKeyValue(CellUtil.cloneRow(lastCell), SINGLE_COLUMN_FAMILY,
+ SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes, 0, rowCountBytes.length);
+ }
results.add(aggKeyValue);
return hasMore;
}