@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class AbstractKuduScannerBuilder<S extends AbstractKuduScannerBuilder<? super S,T>,T> extends Object
Modifier and Type | Method and Description |
---|---|
S |
addColumnRangePredicate(ColumnRangePredicate predicate)
Deprecated.
|
S |
addColumnRangePredicatesRaw(byte[] predicateBytes)
Deprecated.
|
S |
addPredicate(KuduPredicate predicate)
Adds a predicate to the scan.
|
S |
batchSizeBytes(int batchSizeBytes)
Sets the maximum number of bytes returned by the scanner, on each batch.
|
abstract T |
build() |
S |
cacheBlocks(boolean cacheBlocks)
Sets the block caching policy for the scanner.
|
S |
exclusiveUpperBound(PartialRow partialRow)
Add an upper bound (exclusive) primary key for the scan.
|
S |
exclusiveUpperBoundRaw(byte[] endPrimaryKey)
Deprecated.
|
S |
keepAlivePeriodMs(long keepAlivePeriodMs)
Set the period at which to send keep-alive requests to the tablet
server to ensure that this scanner will not time out.
|
S |
limit(long limit)
Sets a limit on the number of rows that will be returned by the scanner.
|
S |
lowerBound(PartialRow partialRow)
Add a lower bound (inclusive) primary key for the scan.
|
S |
lowerBoundRaw(byte[] startPrimaryKey)
Deprecated.
|
S |
prefetching(boolean prefetching)
Enables prefetching of rows for the scanner, i.e.
|
S |
readMode(AsyncKuduScanner.ReadMode readMode)
Sets the read mode, the default is to read the latest values.
|
S |
replicaSelection(ReplicaSelection replicaSelection)
Sets the replica selection mechanism for this scanner.
|
S |
scanRequestTimeout(long scanRequestTimeout)
Sets how long each scan request to a server can last.
|
S |
setFaultTolerant(boolean isFaultTolerant)
Make scans resumable at another tablet server if current server fails if
isFaultTolerant is true.
|
S |
setProjectedColumnIndexes(List<Integer> columnIndexes)
Set which columns will be read by the Scanner.
|
S |
setProjectedColumnNames(List<String> columnNames)
Set which columns will be read by the Scanner.
|
S |
snapshotTimestampMicros(long timestamp)
Sets the timestamp the scan must be executed at, in microseconds since the Unix epoch.
|
public S readMode(AsyncKuduScanner.ReadMode readMode)
readMode
- a read mode for the scannerpublic S setFaultTolerant(boolean isFaultTolerant)
Scans are by default non fault-tolerant, and scans will fail if scanning an individual tablet fails (for example, if a tablet server crashes in the middle of a tablet scan). If isFaultTolerant is set to true, scans will be resumed at another tablet server in the case of failure. Fault-tolerant scans typically have lower throughput than non fault-tolerant scans. Fault tolerant scans use READ_AT_SNAPSHOT read mode. If no snapshot timestamp is provided, the server will pick one.
isFaultTolerant
- a boolean that indicates if scan is fault-tolerant@Deprecated public S addColumnRangePredicate(ColumnRangePredicate predicate)
addPredicate(KuduPredicate)
predicate
- predicate for a column to add@Deprecated public S addColumnRangePredicatesRaw(byte[] predicateBytes)
addPredicate(org.apache.kudu.client.KuduPredicate)
ColumnRangePredicate.toByteArray(List)
.predicateBytes
- predicates to addIllegalArgumentException
- thrown when the passed bytes aren't validpublic S addPredicate(KuduPredicate predicate)
predicate
- predicate to addpublic S setProjectedColumnNames(List<String> columnNames)
setProjectedColumnIndexes(List)
will reset the projected
columns to those specified in columnNames
.columnNames
- the names of columns to read, or 'null' to read all columns
(the default)public S setProjectedColumnIndexes(List<Integer> columnIndexes)
setProjectedColumnNames(List)
will reset the projected
columns to those specified in columnIndexes
.columnIndexes
- the indexes of columns to read, or 'null' to read all columns
(the default)public S batchSizeBytes(int batchSizeBytes)
Kudu may actually return more than this many bytes because it will not truncate a rowResult in the middle.
batchSizeBytes
- a strictly positive number of bytespublic S limit(long limit)
limit
- a positive longpublic S prefetching(boolean prefetching)
nextRows()
). Disabled by default.
NOTE: This is risky until KUDU-1260 is resolved.prefetching
- a boolean that indicates if the scanner should prefetch rowspublic S cacheBlocks(boolean cacheBlocks)
cacheBlocks
- a boolean that indicates if data blocks should be cached or notpublic S snapshotTimestampMicros(long timestamp)
timestamp
- a long representing an instant in microseconds since the unix epoch.IllegalArgumentException
- on build(), if the timestamp is less than 0 or if the
read mode was not set to READ_AT_SNAPSHOTpublic S scanRequestTimeout(long scanRequestTimeout)
KuduClient.getDefaultOperationTimeoutMs()
.scanRequestTimeout
- a long representing time in millisecondspublic S lowerBound(PartialRow partialRow)
partialRow
- a partial row with specified key columns@Deprecated public S lowerBoundRaw(byte[] startPrimaryKey)
lowerBound(PartialRow)
startPrimaryKey
- bytes containing an encoded start keypublic S exclusiveUpperBound(PartialRow partialRow)
partialRow
- a partial row with specified key columns@Deprecated public S exclusiveUpperBoundRaw(byte[] endPrimaryKey)
exclusiveUpperBound(PartialRow)
endPrimaryKey
- bytes containing an encoded end keypublic S replicaSelection(ReplicaSelection replicaSelection)
replicaSelection
- replication selection mechanism to usepublic S keepAlivePeriodMs(long keepAlivePeriodMs)
keepAlivePeriodMs
- the keep alive period in millisecondspublic abstract T build()