HBASE-26688 Threads shared EMPTY_RESULT may lead to unexpected client job down. (#4048)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Yutong Xiao 2022-01-25 14:48:56 +08:00 committed by Duo Zhang
parent 4aa31ce0cd
commit 0771c04a32
1 changed files with 6 additions and 3 deletions

View File

@ -913,16 +913,19 @@ public class Result implements CellScannable, CellScanner {
@Override @Override
public Cell current() { public Cell current() {
if (cells == null if (isEmpty()
|| cellScannerIndex == INITIAL_CELLSCANNER_INDEX || cellScannerIndex == INITIAL_CELLSCANNER_INDEX
|| cellScannerIndex >= cells.length) || cellScannerIndex >= cells.length) {
return null; return null;
}
return this.cells[cellScannerIndex]; return this.cells[cellScannerIndex];
} }
@Override @Override
public boolean advance() { public boolean advance() {
if (cells == null) return false; if (isEmpty()) {
return false;
}
cellScannerIndex++; cellScannerIndex++;
if (cellScannerIndex < this.cells.length) { if (cellScannerIndex < this.cells.length) {
return true; return true;