com.google.cloud.bigtable.hbase
Class BigtableExtendedScan
- java.lang.Object
-
- org.apache.hadoop.hbase.client.Operation
-
- org.apache.hadoop.hbase.client.OperationWithAttributes
-
- org.apache.hadoop.hbase.client.Query
-
- org.apache.hadoop.hbase.client.Scan
-
- com.google.cloud.bigtable.hbase.BigtableExtendedScan
-
- All Implemented Interfaces:
- Attributes
public class BigtableExtendedScan extends Scan
This is a Cloud Bigtable specific extension ofScan
. The Cloud Bigtable ReadRows API allows for an arbitrary set of ranges and row keys as part of a scan. Instance of BigtableExtendedScan can be used inTable.getScanner(Scan)
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.client.Scan
Scan.ReadType
-
-
Field Summary
-
Fields inherited from class org.apache.hadoop.hbase.client.Scan
DEFAULT_HBASE_CLIENT_SCANNER_ASYNC_PREFETCH, HBASE_CLIENT_SCANNER_ASYNC_PREFETCH, SCAN_ATTRIBUTES_METRICS_DATA, SCAN_ATTRIBUTES_METRICS_ENABLE, SCAN_ATTRIBUTES_TABLE_NAME
-
Fields inherited from class org.apache.hadoop.hbase.client.Query
colFamTimeRangeMap, consistency, filter, loadColumnFamiliesOnDemand, targetReplicaId
-
Fields inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
ID_ATRIBUTE
-
-
Constructor Summary
Constructors Constructor and Description BigtableExtendedScan()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addRange(byte[] startRow, byte[] stopRow)
Adds a range to scan.void
addRange(com.google.bigtable.v2.RowRange range)
Adds an arbitraryRowRange
to the request.void
addRangeWithPrefix(byte[] prefix)
Creates aRowRange
based on a prefix.void
addRowKey(byte[] rowKey)
Add a single row key to the output.com.google.bigtable.v2.RowSet
getRowSet()
Scan
setRowPrefixFilter(byte[] rowPrefix)
Scan
setStartRow(byte[] startRow)
Scan
setStopRow(byte[] stopRow)
-
Methods inherited from class org.apache.hadoop.hbase.client.Scan
addColumn, addFamily, createScanFromCursor, getAllowPartialResults, getBatch, getCacheBlocks, getCaching, getFamilies, getFamilyMap, getFilter, getFingerprint, getLimit, getMaxResultSize, getMaxResultsPerColumnFamily, getMaxVersions, getReadType, getRowOffsetPerColumnFamily, getScanMetrics, getStartRow, getStopRow, getTimeRange, hasFamilies, hasFilter, includeStartRow, includeStopRow, isAsyncPrefetch, isGetScan, isNeedCursorResult, isRaw, isReversed, isScanMetricsEnabled, isSmall, numFamilies, readAllVersions, readVersions, setACL, setACL, setAllowPartialResults, setAsyncPrefetch, setAttribute, setAuthorizations, setBatch, setCacheBlocks, setCaching, setColumnFamilyTimeRange, setConsistency, setFamilyMap, setFilter, setId, setIsolationLevel, setLimit, setLoadColumnFamiliesOnDemand, setMaxResultSize, setMaxResultsPerColumnFamily, setMaxVersions, setMaxVersions, setNeedCursorResult, setOneRowLimit, setPriority, setRaw, setReadType, setReplicaId, setReversed, setRowOffsetPerColumnFamily, setScanMetricsEnabled, setSmall, setTimeRange, setTimestamp, setTimeStamp, toMap, withStartRow, withStartRow, withStopRow, withStopRow
-
Methods inherited from class org.apache.hadoop.hbase.client.Query
doLoadColumnFamiliesOnDemand, getACL, getAuthorizations, getColumnFamilyTimeRange, getConsistency, getIsolationLevel, getLoadColumnFamiliesOnDemandValue, getReplicaId
-
Methods inherited from class org.apache.hadoop.hbase.client.OperationWithAttributes
getAttribute, getAttributeSize, getAttributesMap, getId, getPriority
-
-
-
-
Method Detail
-
setStartRow
public Scan setStartRow(byte[] startRow)
- Overrides:
setStartRow
in classScan
- Throws:
UnsupportedOperationException
- to avoid confusion. UseaddRange(byte[], byte[])
instead.
-
setStopRow
public Scan setStopRow(byte[] stopRow)
- Overrides:
setStopRow
in classScan
- Throws:
UnsupportedOperationException
- to avoid confusion. UseaddRange(byte[], byte[])
instead.
-
setRowPrefixFilter
public Scan setRowPrefixFilter(byte[] rowPrefix)
- Overrides:
setRowPrefixFilter
in classScan
- Throws:
UnsupportedOperationException
- to avoid confusion. UseaddRangeWithPrefix(byte[])
instead.
-
addRangeWithPrefix
public void addRangeWithPrefix(byte[] prefix)
Creates aRowRange
based on a prefix. This is similar toScan.setRowPrefixFilter(byte[])
.- Parameters:
prefix
- a byte array.
-
addRange
public void addRange(byte[] startRow, byte[] stopRow)
Adds a range to scan. This is similar to calling a combination ofScan.setStartRow(byte[])
andScan.setStopRow(byte[])
. Other ranges can be constructed by creating aRowRange
and callingaddRange(RowRange)
- Parameters:
startRow
- a byte array.stopRow
- a byte array.
-
addRange
public void addRange(com.google.bigtable.v2.RowRange range)
Adds an arbitraryRowRange
to the request. Ranges can have empty start keys or end keys. Ranges can also be inclusive/closed or exclusive/open. The default range is inclusive start and exclusive end.- Parameters:
range
- aRowRange
object.
-
addRowKey
public void addRowKey(byte[] rowKey)
Add a single row key to the output. This can be called multiple times with random rowKeys. Duplicate rowKeys will result in a single response in the scan results. Results of scans also return rows in lexicographically sorted order, and not based on the order in which row keys were added.- Parameters:
rowKey
- a byte array.
-
getRowSet
public com.google.bigtable.v2.RowSet getRowSet()
- Returns:
- the
RowSet
built until now, which includes lists of individual keys and row ranges.
-
-