Database Reference
In-Depth Information
The org.apache.hadoop.hbase.client package provides the Scan class with the
following constructors:
Constructor
Description
Scan()
The default scan constructor reads the entire
HBase table, including all the column families
and the respective columns
Scan(byte[] startRow)
Creates a scan operation starting at the
specified row
Scan(byte[] startRow, byte[]
stopRow)
Creates a scan operation for the range of
rows specified, including the start row and
excluding the stop row
Scan(byte[] startRow, Filter
filter)
Creates a scan operation starting at the
specified row and also applies the filter
Scan(Get get)
Builds a scan object with the same
specifications as Get
Scan(Scan scan)
Creates a new instance of this class while
copying all values
The behavior of the scan() operation looks similar to the get() operation, but the
difference between the two is also very much visible through constructors. In the
get() operation, we only deine the row key to get the results, whereas in a scan,
we can deine the optional startRow parameter, which signiies the starting row
key from where the scan needs to start reading data from the HBase table; this also
makes the results inclusive of the start row. Similarly, the constructors also deine
the optional stopRow parameter, which limits the scan to a speciic row key where
it should conclude the reading, and the results exclude the stop row.
Hence, using the partial key scan by using the start and stop keys, it is possible
to iterate over subsets of rows. We can also take an offset, limit the parameters,
and apply them to the rows on the client side.
The scan() operation does not look for an exact match for the
values deined for startRow and stopRow . The scan() operation
matches the irst row key for equality or greater than the given
startRow value. In case no start row is speciied, reading starts from
the beginning of the table. Similarly, the current row key should also
be equal to or greater than the stopRow value and in case no stop
row is speciied, the scan will read the data until the end of the table.
Search WWH ::




Custom Search