Class RowStatisticsCompactionObserver.RowStatisticsScanner
- All Implemented Interfaces:
Closeable
,AutoCloseable
,InternalScanner
,Shipper
- Enclosing class:
- RowStatisticsCompactionObserver
-
Field Summary
Modifier and TypeFieldDescriptionprivate RawCellBuilder
private final RowStatisticsRecorder
private Cell
private final RegionCoprocessorEnvironment
private final RowStatisticsImpl
private final Counter
private final Counter
private final InternalScanner
private final Shipper
-
Constructor Summary
ConstructorDescriptionRowStatisticsScanner
(InternalScanner scanner, RowStatisticsImpl rowStatistics, RegionCoprocessorEnvironment regionEnv, RowStatisticsRecorder customRecorder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the scanner and releases any resources it has allocatedprivate void
consumeCells
(List<? super ExtendedCell> result) boolean
next
(List<? super ExtendedCell> result) Grab the next row's worth of values.boolean
next
(List<? super ExtendedCell> result, ScannerContext scannerContext) Grab the next row's worth of values.private void
record()
private boolean
rowChanged
(Cell cell) void
shipped()
Called after a batch of rows scanned and set to be returned to client.
-
Field Details
-
scanner
-
shipper
-
rowStatistics
-
regionEnv
-
rowStatisticsDropped
-
rowStatisticsPutFailed
-
customRecorder
-
cellBuilder
-
lastCell
-
-
Constructor Details
-
RowStatisticsScanner
public RowStatisticsScanner(InternalScanner scanner, RowStatisticsImpl rowStatistics, RegionCoprocessorEnvironment regionEnv, RowStatisticsRecorder customRecorder)
-
-
Method Details
-
next
public boolean next(List<? super ExtendedCell> result, ScannerContext scannerContext) throws IOException Description copied from interface:InternalScanner
Grab the next row's worth of values.The generic type for the output list
result
means we will only addExtendedCell
to it. This is useful for the code in HBase as we can pass List<ExtendedCell> here to avoid casting, but may cause some troubles for coprocessors which implement this method. In general, all cells created via theCellBuilder
are actuallyExtendedCell
s, so if you want to add something to theresult
list, you can just cast it toExtendedCell
, although it is marked as IA.Private.- Specified by:
next
in interfaceInternalScanner
- Parameters:
result
- return output array. We will only add ExtendedCell to this list, but for CP users, you'd better just useRawCell
asExtendedCell
is IA.Private.- Returns:
- true if more rows exist after this one, false if scanner is done
- Throws:
IOException
-
next
Description copied from interface:InternalScanner
Grab the next row's worth of values.The generic type for the output list
result
means we will only addExtendedCell
to it. This is useful for the code in HBase as we can pass List<ExtendedCell> here to avoid casting, but may cause some troubles for coprocessors which implement this method. In general, all cells created via theCellBuilder
are actuallyExtendedCell
s, so if you want to add something to theresult
list, you can just cast it toExtendedCell
, although it is marked as IA.Private.- Specified by:
next
in interfaceInternalScanner
- Parameters:
result
- return output array. We will only add ExtendedCell to this list, but for CP users, you'd better just useRawCell
asExtendedCell
is IA.Private.- Returns:
- true if more rows exist after this one, false if scanner is done
- Throws:
IOException
-
close
Description copied from interface:InternalScanner
Closes the scanner and releases any resources it has allocated- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceInternalScanner
- Throws:
IOException
-
shipped
Description copied from interface:Shipper
Called after a batch of rows scanned and set to be returned to client. Any in between cleanup can be done here.- Specified by:
shipped
in interfaceShipper
- Throws:
IOException
-
consumeCells
-
rowChanged
-
record
-