BigtableExtendedScan (Cloud Bigtable HBase Client for Java 1.12.0 API)

com.google.cloud.bigtable.hbase

Class BigtableExtendedScan

  • All Implemented Interfaces:
    Attributes


    public class BigtableExtendedScan
    extends Scan
    This is a Cloud Bigtable specific extension of Scan. 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 in Table.getScanner(Scan).
    • Constructor Detail

      • BigtableExtendedScan

        public BigtableExtendedScan()
    • Method Detail

      • addRangeWithPrefix

        public void addRangeWithPrefix(byte[] prefix)
        Creates a RowRange based on a prefix. This is similar to Scan.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 of Scan.setStartRow(byte[]) and Scan.setStopRow(byte[]). Other ranges can be constructed by creating a RowRange and calling addRange(RowRange)
        Parameters:
        startRow - a byte array.
        stopRow - a byte array.
      • addRange

        public void addRange(com.google.bigtable.v2.RowRange range)
        Adds an arbitrary RowRange 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 - a RowRange 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.