From 742c5ef8765e1afdb4c9ddf80cb9bc26a009856f Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Wed, 26 Jan 2022 13:40:47 +0800 Subject: [PATCH] Revert "HBASE-26688 Threads shared EMPTY_RESULT may lead to unexpected client job down. (#4048)" This reverts commit fbd22f06bff8546e6d7a8757b3cf2f8eaed88f6b. (cherry picked from commit 0af543c57ce9fc278f11ee687d1d8837ced60e2a) Change-Id: Ibd551e46e0bb88aca8f40d71fbb0cabacd2ab735 --- .../main/java/org/apache/hadoop/hbase/client/Result.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java index 138432aada32..1ef1633d193e 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Result.java @@ -913,19 +913,16 @@ public CellScanner cellScanner() { @Override public Cell current() { - if (isEmpty() + if (cells == null || cellScannerIndex == INITIAL_CELLSCANNER_INDEX - || cellScannerIndex >= cells.length) { + || cellScannerIndex >= cells.length) return null; - } return this.cells[cellScannerIndex]; } @Override public boolean advance() { - if (isEmpty()) { - return false; - } + if (cells == null) return false; cellScannerIndex++; if (cellScannerIndex < this.cells.length) { return true;