This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new fbd22f0 HBASE-26688 Threads shared EMPTY_RESULT may lead to
unexpected client job down. (#4048)
fbd22f0 is described below
commit fbd22f06bff8546e6d7a8757b3cf2f8eaed88f6b
Author: Yutong Xiao <[email protected]>
AuthorDate: Tue Jan 25 14:48:56 2022 +0800
HBASE-26688 Threads shared EMPTY_RESULT may lead to unexpected client job
down. (#4048)
Signed-off-by: Duo Zhang <[email protected]>
---
.../src/main/java/org/apache/hadoop/hbase/client/Result.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 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 1ef1633..138432aa 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,16 +913,19 @@ public class Result implements CellScannable, CellScanner
{
@Override
public Cell current() {
- if (cells == null
+ if (isEmpty()
|| cellScannerIndex == INITIAL_CELLSCANNER_INDEX
- || cellScannerIndex >= cells.length)
+ || cellScannerIndex >= cells.length) {
return null;
+ }
return this.cells[cellScannerIndex];
}
@Override
public boolean advance() {
- if (cells == null) return false;
+ if (isEmpty()) {
+ return false;
+ }
cellScannerIndex++;
if (cellScannerIndex < this.cells.length) {
return true;