@InterfaceAudience.Private public final class ImmutableScan extends Scan
Scan.ReadType| Modifier and Type | Field and Description | 
|---|---|
| private Scan | delegateScan | 
DEFAULT_HBASE_CLIENT_SCANNER_ASYNC_PREFETCH, HBASE_CLIENT_SCANNER_ASYNC_PREFETCH, SCAN_ATTRIBUTES_METRICS_DATA, SCAN_ATTRIBUTES_METRICS_ENABLE, SCAN_ATTRIBUTES_TABLE_NAMEcolFamTimeRangeMap, consistency, filter, loadColumnFamiliesOnDemand, targetReplicaIdID_ATRIBUTE| Constructor and Description | 
|---|
| ImmutableScan(Scan scan)Create Immutable instance of Scan from given Scan object | 
| Modifier and Type | Method and Description | 
|---|---|
| Scan | addColumn(byte[] family,
         byte[] qualifier)Get the column from the specified family with the specified qualifier. | 
| Scan | addFamily(byte[] family)Get all columns from the specified family. | 
| boolean | doLoadColumnFamiliesOnDemand()Get the logical value indicating whether on-demand CF loading should be allowed. | 
| byte[] | getACL() | 
| boolean | getAllowPartialResults() | 
| byte[] | getAttribute(String name)Gets an attribute | 
| long | getAttributeSize() | 
| Map<String,byte[]> | getAttributesMap()Gets all attributes | 
| Authorizations | getAuthorizations() | 
| int | getBatch() | 
| boolean | getCacheBlocks()Get whether blocks should be cached for this Scan. | 
| int | getCaching() | 
| Map<byte[],TimeRange> | getColumnFamilyTimeRange() | 
| Consistency | getConsistency()Returns the consistency level for this operation | 
| byte[][] | getFamilies() | 
| Map<byte[],NavigableSet<byte[]>> | getFamilyMap()Getting the familyMap | 
| Filter | getFilter() | 
| Map<String,Object> | getFingerprint()Compile the table and column family (i.e. | 
| String | getId()This method allows you to retrieve the identifier for the operation if one
 was set. | 
| IsolationLevel | getIsolationLevel() | 
| int | getLimit() | 
| Boolean | getLoadColumnFamiliesOnDemandValue()Get the raw loadColumnFamiliesOnDemand setting; if it's not set, can be null. | 
| long | getMaxResultSize() | 
| int | getMaxResultsPerColumnFamily() | 
| int | getMaxVersions() | 
| (package private) long | getMvccReadPoint()Get the mvcc read point used to open a scanner. | 
| int | getPriority() | 
| Scan.ReadType | getReadType() | 
| int | getReplicaId()Returns region replica id where Query will fetch data from. | 
| int | getRowOffsetPerColumnFamily()Method for retrieving the scan's offset per row per column
 family (#kvs to be skipped) | 
| byte[] | getStartRow() | 
| byte[] | getStopRow() | 
| TimeRange | getTimeRange() | 
| boolean | hasFamilies() | 
| boolean | hasFilter() | 
| boolean | includeStartRow() | 
| boolean | includeStopRow() | 
| Boolean | isAsyncPrefetch() | 
| boolean | isGetScan() | 
| boolean | isNeedCursorResult() | 
| boolean | isRaw() | 
| boolean | isReversed()Get whether this scan is a reversed one. | 
| boolean | isScanMetricsEnabled() | 
| boolean | isSmall()Deprecated.  | 
| int | numFamilies() | 
| Scan | readAllVersions()Get all available versions. | 
| Scan | readVersions(int versions)Get up to the specified number of versions of each column. | 
| (package private) Scan | resetMvccReadPoint()Set the mvcc read point to -1 which means do not use it. | 
| Scan | setACL(Map<String,Permission> perms) | 
| Scan | setACL(String user,
      Permission perms) | 
| Scan | setAllowPartialResults(boolean allowPartialResults)Setting whether the caller wants to see the partial results when server returns
 less-than-expected cells. | 
| Scan | setAsyncPrefetch(boolean asyncPrefetch)Deprecated.  | 
| Scan | setAttribute(String name,
            byte[] value)Sets an attribute. | 
| Scan | setAuthorizations(Authorizations authorizations)Sets the authorizations to be used by this Query | 
| Scan | setBatch(int batch)Set the maximum number of cells to return for each call to next(). | 
| Scan | setCacheBlocks(boolean cacheBlocks)Set whether blocks should be cached for this Scan. | 
| Scan | setCaching(int caching)Set the number of rows for caching that will be passed to scanners. | 
| Scan | setColumnFamilyTimeRange(byte[] cf,
                        long minStamp,
                        long maxStamp)Get versions of columns only within the specified timestamp range,
 [minStamp, maxStamp) on a per CF bases. | 
| Scan | setConsistency(Consistency consistency)Sets the consistency level for this operation | 
| Scan | setFamilyMap(Map<byte[],NavigableSet<byte[]>> familyMap)Setting the familyMap | 
| Scan | setFilter(Filter filter)Apply the specified server-side filter when performing the Query. | 
| Scan | setId(String id)This method allows you to set an identifier on an operation. | 
| Scan | setIsolationLevel(IsolationLevel level)Set the isolation level for this query. | 
| Scan | setLimit(int limit)Set the limit of rows for this scan. | 
| Scan | setLoadColumnFamiliesOnDemand(boolean value)Set the value indicating whether loading CFs on demand should be allowed (cluster
 default is false). | 
| Scan | setMaxResultSize(long maxResultSize)Set the maximum result size. | 
| Scan | setMaxResultsPerColumnFamily(int limit)Set the maximum number of values to return per row per Column Family | 
| (package private) Scan | setMvccReadPoint(long mvccReadPoint)Set the mvcc read point used to open a scanner. | 
| Scan | setNeedCursorResult(boolean needCursorResult)When the server is slow or we scan a table with many deleted data or we use a sparse filter,
 the server will response heartbeat to prevent timeout. | 
| Scan | setOneRowLimit()Call this when you only want to get one row. | 
| Scan | setPriority(int priority) | 
| Scan | setRaw(boolean raw)Enable/disable "raw" mode for this scan. | 
| Scan | setReadType(Scan.ReadType readType)Set the read type for this scan. | 
| Scan | setReplicaId(int id)Specify region replica id where Query will fetch data from. | 
| Scan | setReversed(boolean reversed)Set whether this scan is a reversed one | 
| Scan | setRowOffsetPerColumnFamily(int offset)Set offset for the row per Column Family. | 
| Scan | setRowPrefixFilter(byte[] rowPrefix)Set a filter (using stopRow and startRow) so the result set only contains rows where the
 rowKey starts with the specified prefix. | 
| Scan | setScanMetricsEnabled(boolean enabled)Enable collection of  ScanMetrics. | 
| Scan | setSmall(boolean small)Deprecated.  | 
| Scan | setTimeRange(long minStamp,
            long maxStamp)Get versions of columns only within the specified timestamp range,
 [minStamp, maxStamp). | 
| Scan | setTimestamp(long timestamp)Get versions of columns with the specified timestamp. | 
| Scan | setTimeStamp(long timestamp)Deprecated.  | 
| String | toJSON()Produces a JSON object sufficient for description of a query
 in a debugging or logging context. | 
| String | toJSON(int maxCols)Produces a JSON object for fingerprint and details exposure in a
 parseable format. | 
| Map<String,Object> | toMap()Produces a Map containing a full summary of a query. | 
| Map<String,Object> | toMap(int maxCols)Compile the details beyond the scope of getFingerprint (row, columns,
 timestamps, etc.) into a Map along with the fingerprinted information. | 
| String | toString()Produces a string representation of this Operation. | 
| String | toString(int maxCols)Produces a string representation of this Operation. | 
| Scan | withStartRow(byte[] startRow)Set the start row of the scan. | 
| Scan | withStartRow(byte[] startRow,
            boolean inclusive)Set the start row of the scan. | 
| Scan | withStopRow(byte[] stopRow)Set the stop row of the scan. | 
| Scan | withStopRow(byte[] stopRow,
           boolean inclusive)Set the stop row of the scan. | 
createScanFromCursor, getScanMetrics, setMaxVersions, setMaxVersions, setStartRow, setStopRowprivate final Scan delegateScan
public ImmutableScan(Scan scan)
scan - Copy all values from Scanpublic Scan addFamily(byte[] family)
ScanOverrides previous calls to addColumn for this family.
public Scan addColumn(byte[] family, byte[] qualifier)
ScanOverrides previous calls to addFamily for this family.
public Scan setTimeRange(long minStamp, long maxStamp)
ScansetTimeRange in class ScanminStamp - minimum timestamp value, inclusivemaxStamp - maximum timestamp value, exclusiveScan.setMaxVersions(), 
Scan.setMaxVersions(int)@Deprecated public Scan setTimeStamp(long timestamp)
ScansetTimeStamp in class Scantimestamp - version timestampScan.setMaxVersions(), 
Scan.setMaxVersions(int)public Scan setTimestamp(long timestamp)
ScansetTimestamp in class Scantimestamp - version timestampScan.setMaxVersions(), 
Scan.setMaxVersions(int)public Scan setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp)
QuerysetColumnFamilyTimeRange in class Scancf - the column family for which you want to restrictminStamp - minimum timestamp value, inclusivemaxStamp - maximum timestamp value, exclusivepublic Scan withStartRow(byte[] startRow)
ScanIf the specified row does not exist, the Scanner will start from the next closest row after the specified row.
withStartRow in class ScanstartRow - row to start scanner at or afterpublic Scan withStartRow(byte[] startRow, boolean inclusive)
Scan
 If the specified row does not exist, or the inclusive is false, the Scanner
 will start from the next closest row after the specified row.
withStartRow in class ScanstartRow - row to start scanner at or afterinclusive - whether we should include the start row when scanpublic Scan withStopRow(byte[] stopRow)
ScanThe scan will include rows that are lexicographically less than the provided stopRow.
 Note: When doing a filter for a rowKey Prefix use
 Scan.setRowPrefixFilter(byte[]). The 'trailing 0' will not yield the desired result.
 
withStopRow in class ScanstopRow - row to end at (exclusive)public Scan withStopRow(byte[] stopRow, boolean inclusive)
Scan
 The scan will include rows that are lexicographically less than (or equal to if
 inclusive is true) the provided stopRow.
withStopRow in class ScanstopRow - row to end atinclusive - whether we should include the stop row when scanpublic Scan setRowPrefixFilter(byte[] rowPrefix)
ScanSet a filter (using stopRow and startRow) so the result set only contains rows where the rowKey starts with the specified prefix.
This is a utility method that converts the desired rowPrefix into the appropriate values for the startRow and stopRow to achieve the desired result.
This can safely be used in combination with setFilter.
NOTE: Doing a Scan.setStartRow(byte[]) and/or Scan.setStopRow(byte[])
 after this method will yield undefined results.
setRowPrefixFilter in class ScanrowPrefix - the prefix all rows must start with. (Set null to remove the filter.)public Scan readAllVersions()
ScanreadAllVersions in class Scanpublic Scan readVersions(int versions)
ScanreadVersions in class Scanversions - specified number of versions for each columnpublic Scan setBatch(int batch)
ScanScan.setAllowPartialResults(boolean).
 If you don't allow partial results, the number of cells in each Result must equal to your
 batch setting unless it is the last Result for current row. So this method is helpful in paging
 queries. If you just want to prevent OOM at client, use setAllowPartialResults(true) is better.setBatch in class Scanbatch - the maximum number of valuesResult.mayHaveMoreCellsInRow()public Scan setMaxResultsPerColumnFamily(int limit)
ScansetMaxResultsPerColumnFamily in class Scanlimit - the maximum number of values returned / row / CFpublic Scan setRowOffsetPerColumnFamily(int offset)
ScansetRowOffsetPerColumnFamily in class Scanoffset - is the number of kvs that will be skipped.public Scan setCaching(int caching)
ScanHConstants.HBASE_CLIENT_SCANNER_CACHING will
 apply.
 Higher caching values will enable faster scanners but will use more memory.setCaching in class Scancaching - the number of rows for cachingpublic Scan setMaxResultSize(long maxResultSize)
ScansetMaxResultSize in class ScanmaxResultSize - The maximum result size in bytes.public Scan setFilter(Filter filter)
QueryFilter.filterCell(org.apache.hadoop.hbase.Cell) is called AFTER all tests for ttl,
 column match, deletes and column family's max versions have been run.public Scan setFamilyMap(Map<byte[],NavigableSet<byte[]>> familyMap)
ScansetFamilyMap in class ScanfamilyMap - map of family to qualifierpublic Scan setCacheBlocks(boolean cacheBlocks)
ScanThis is true by default. When true, default settings of the table and family are used (this will never override caching blocks if the block cache is disabled for that family or entirely).
setCacheBlocks in class ScancacheBlocks - if false, default settings are overridden and blocks
 will not be cachedpublic Scan setReversed(boolean reversed)
ScanThis is false by default which means forward(normal) scan.
setReversed in class Scanreversed - if true, scan will be backward orderpublic Scan setAllowPartialResults(boolean allowPartialResults)
ScansetAllowPartialResults in class ScanResult.mayHaveMoreCellsInRow(), 
Scan.setBatch(int)public Scan setLoadColumnFamiliesOnDemand(boolean value)
QuerysetLoadColumnFamiliesOnDemand in class Scanpublic Scan setRaw(boolean raw)
Scan@Deprecated public Scan setSmall(boolean small)
ScanSmall scan should use pread and big scan can use seek + read seek + read is fast but can cause two problem (1) resource contention (2) cause too much network io [89-fb] Using pread for non-compaction read request https://issues.apache.org/jira/browse/HBASE-7266 On the other hand, if setting it true, we would do openScanner,next,closeScanner in one RPC call. It means the better performance for small scan. [HBASE-9488]. Generally, if the scan range is within one data block(64KB), it could be considered as a small scan.
setSmall in class ScanScan.setLimit(int), 
Scan.setReadType(ReadType), 
HBASE-17045public Scan setAttribute(String name, byte[] value)
AttributessetAttribute in interface AttributessetAttribute in class Scanname - attribute namevalue - attribute valuepublic Scan setId(String id)
OperationWithAttributespublic Scan setAuthorizations(Authorizations authorizations)
QuerysetAuthorizations in class Scanpublic Scan setACL(Map<String,Permission> perms)
public Scan setACL(String user, Permission perms)
public Scan setConsistency(Consistency consistency)
QuerysetConsistency in class Scanconsistency - the consistency levelpublic Scan setReplicaId(int id)
QueryQuery.setConsistency(Consistency) passing Consistency.TIMELINE to read data from
 a specific replicaId.
 setReplicaId in class Scanpublic Scan setIsolationLevel(IsolationLevel level)
QuerysetIsolationLevel in class Scanlevel - IsolationLevel for this querypublic Scan setPriority(int priority)
setPriority in class Scanpublic Scan setScanMetricsEnabled(boolean enabled)
ScanScanMetrics. For advanced users.setScanMetricsEnabled in class Scanenabled - Set to true to enable accumulating scan metrics@Deprecated public Scan setAsyncPrefetch(boolean asyncPrefetch)
setAsyncPrefetch in class Scanpublic Scan setLimit(int limit)
ScanThis condition will be tested at last, after all other conditions such as stopRow, filter, etc.
public Scan setOneRowLimit()
Scanlimit to 1, and also
 set readType to Scan.ReadType.PREAD.setOneRowLimit in class Scanpublic Scan setReadType(Scan.ReadType readType)
Scan
 Notice that we may choose to use pread even if you specific Scan.ReadType.STREAM here. For
 example, we will always use pread if this is a get scan.
setReadType in class ScanScan setMvccReadPoint(long mvccReadPoint)
ScansetMvccReadPoint in class ScanScan resetMvccReadPoint()
ScanresetMvccReadPoint in class Scanpublic Scan setNeedCursorResult(boolean needCursorResult)
ScanResult.isCursor()
 Result.getCursor()
 CursorsetNeedCursorResult in class Scanpublic long getMaxResultSize()
getMaxResultSize in class ScanScan.setMaxResultSize(long)public Map<byte[],NavigableSet<byte[]>> getFamilyMap()
ScangetFamilyMap in class Scanpublic int numFamilies()
numFamilies in class Scanpublic boolean hasFamilies()
hasFamilies in class Scanpublic byte[][] getFamilies()
getFamilies in class Scanpublic byte[] getStartRow()
getStartRow in class Scanpublic boolean includeStartRow()
includeStartRow in class Scanpublic byte[] getStopRow()
getStopRow in class Scanpublic boolean includeStopRow()
includeStopRow in class Scanpublic int getMaxVersions()
getMaxVersions in class Scanpublic int getBatch()
public int getMaxResultsPerColumnFamily()
getMaxResultsPerColumnFamily in class Scanpublic int getRowOffsetPerColumnFamily()
ScangetRowOffsetPerColumnFamily in class Scanpublic int getCaching()
getCaching in class Scanpublic TimeRange getTimeRange()
getTimeRange in class Scanpublic boolean hasFilter()
public boolean getCacheBlocks()
ScangetCacheBlocks in class Scanpublic boolean isReversed()
ScanisReversed in class Scanpublic boolean getAllowPartialResults()
getAllowPartialResults in class ScanResultScanner.next()public byte[] getACL()
public Map<String,Object> getFingerprint()
ScangetFingerprint in class Scanpublic Map<String,Object> toMap(int maxCols)
Scanpublic boolean isRaw()
@Deprecated public boolean isSmall()
ScanisSmall in class Scanpublic boolean isScanMetricsEnabled()
isScanMetricsEnabled in class Scanpublic Boolean isAsyncPrefetch()
isAsyncPrefetch in class Scanpublic int getLimit()
public Scan.ReadType getReadType()
getReadType in class Scanlong getMvccReadPoint()
ScangetMvccReadPoint in class Scanpublic boolean isNeedCursorResult()
isNeedCursorResult in class Scanpublic byte[] getAttribute(String name)
AttributesgetAttribute in interface AttributesgetAttribute in class OperationWithAttributesname - attribute namepublic Consistency getConsistency()
QuerygetConsistency in class Querypublic long getAttributeSize()
getAttributeSize in class OperationWithAttributespublic Map<String,byte[]> getAttributesMap()
AttributesgetAttributesMap in interface AttributesgetAttributesMap in class OperationWithAttributespublic Boolean getLoadColumnFamiliesOnDemandValue()
QuerygetLoadColumnFamiliesOnDemandValue in class Querypublic int getPriority()
getPriority in class OperationWithAttributespublic Map<byte[],TimeRange> getColumnFamilyTimeRange()
getColumnFamilyTimeRange in class Querypublic int getReplicaId()
QuerygetReplicaId in class Querypublic boolean doLoadColumnFamiliesOnDemand()
QuerydoLoadColumnFamiliesOnDemand in class Querypublic String getId()
OperationWithAttributesgetId in class OperationWithAttributespublic IsolationLevel getIsolationLevel()
getIsolationLevel in class Querypublic Authorizations getAuthorizations() throws DeserializationException
getAuthorizations in class QueryDeserializationExceptionpublic String toString(int maxCols)
Operationpublic String toString()
Operationpublic Map<String,Object> toMap()
Operationpublic String toJSON(int maxCols) throws IOException
OperationtoJSON in class OperationmaxCols - a limit on the number of columns to include in the JSONIOExceptionpublic String toJSON() throws IOException
OperationtoJSON in class OperationIOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.