Package org.apache.hadoop.hbase.client
Class BatchScanResultCache
java.lang.Object
org.apache.hadoop.hbase.client.BatchScanResultCache
- All Implemented Interfaces:
ScanResultCache
A scan result cache for batched scan, i.e,
scan.getBatch() > 0 && !scan.getAllowPartialResults()
.
If user setBatch(5) and rpc returns 3+5+5+5+3 cells, we should return 5+5+5+5+1 to user. setBatch doesn't mean setAllowPartialResult(true).
- Since:
- 2.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
private ExtendedCell
private boolean
private int
private int
Fields inherited from interface org.apache.hadoop.hbase.client.ScanResultCache
EMPTY_RESULT_ARRAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionResult[]
Add the given results to cache and get valid results back.void
clear()
Clear the cached result if any.private Result
int
Return the number of complete rows.private void
recordLastResult
(Result result) private Result
regroupResults
(Result result)
-
Field Details
-
batch
-
lastCell
-
lastResultPartial
-
partialResults
-
numCellsOfPartialResults
-
numberOfCompleteRows
-
-
Constructor Details
-
BatchScanResultCache
-
-
Method Details
-
recordLastResult
-
createCompletedResult
- Throws:
IOException
-
regroupResults
-
addAndGet
Description copied from interface:ScanResultCache
Add the given results to cache and get valid results back.- Specified by:
addAndGet
in interfaceScanResultCache
- Parameters:
results
- the results of a scan next. Must not be null.isHeartbeatMessage
- indicate whether the results is gotten from a heartbeat response.- Returns:
- valid results, never null.
- Throws:
IOException
-
clear
Description copied from interface:ScanResultCache
Clear the cached result if any. Called when scan error and we will start from a start of a row again.- Specified by:
clear
in interfaceScanResultCache
-
numberOfCompleteRows
Description copied from interface:ScanResultCache
Return the number of complete rows. Used to implement limited scan.- Specified by:
numberOfCompleteRows
in interfaceScanResultCache
-