@InterfaceAudience.Public @InterfaceStability.Evolving public class KuduScanner extends Object
AsyncKuduScanner
. Offers the same API but with blocking methods.Modifier and Type | Class and Description |
---|---|
static class |
KuduScanner.KuduScannerBuilder
A Builder class to build
KuduScanner . |
Modifier and Type | Method and Description |
---|---|
RowResultIterator |
close()
Closes this scanner (don't forget to call this when you're done with it!).
|
long |
getBatchSizeBytes()
Returns the maximum number of bytes returned by the scanner, on each batch.
|
boolean |
getCacheBlocks()
Returns if this scanner was configured to cache data blocks or not.
|
long |
getLimit()
Returns the maximum number of rows that this scanner was configured to return.
|
Schema |
getProjectionSchema()
Returns the projection schema of this scanner.
|
AsyncKuduScanner.ReadMode |
getReadMode()
Returns the ReadMode for this scanner.
|
long |
getScanRequestTimeout()
Returns the current value of the scanner's scan request timeout.
|
boolean |
hasMoreRows()
Tells if the last rpc returned that there might be more rows to scan.
|
boolean |
isClosed() |
void |
keepAlive()
Keep the current remote scanner alive.
|
RowResultIterator |
nextRows()
Scans a number of rows.
|
public boolean hasMoreRows()
public RowResultIterator nextRows() throws KuduException
Once this method returns null
once (which indicates that this
Scanner
is done scanning), calling it again leads to an undefined
behavior.
KuduException
- if anything went wrong.public final void keepAlive() throws KuduException
Keep the current remote scanner alive on the Tablet server for an additional time-to-live. This is useful if the interval in between nextRows() calls is big enough that the remote scanner might be garbage collected. The scanner time-to-live can be configured on the tablet server via the --scanner_ttl_ms configuration flag and has a default of 60 seconds.
This does not invalidate any previously fetched results.
Note that an exception thrown by this method should not be taken as indication that the scan has failed. Subsequent calls to nextRows() might still be successful, particularly if the scanner is configured to be fault tolerant.
KuduException
- if anything went wrong.public boolean isClosed()
public RowResultIterator close() throws KuduException
Closing a scanner already closed has no effect.
KuduException
- if anything went wrong.public long getLimit()
public boolean getCacheBlocks()
public long getBatchSizeBytes()
public AsyncKuduScanner.ReadMode getReadMode()
public Schema getProjectionSchema()
public long getScanRequestTimeout()
Copyright © 2018 The Apache Software Foundation. All rights reserved.