Interface SnapshotBase

    • Method Detail

      • get

        Bytes get​(Bytes row,
                  Column column)
        Retrieves the value (in Bytes) stored at a given row and Column. Returns null if does not exist.
      • get

        Bytes get​(Bytes row,
                  Column column,
                  Bytes defaultValue)
        Retrieves the value (in Bytes) stored at a given row and Column. Returns the passed in defaultValue if does not exist.
        Parameters:
        defaultValue - this will be returned if row+columns does not exists
      • get

        Map<Column,​Bytes> get​(Bytes row,
                                    Set<Column> columns)
        Given a row and set of Columns, retrieves a map that contains the values at those Columns. Only columns that exist will be returned in map.
      • get

        Map<Column,​Bytes> get​(Bytes row,
                                    Column... columns)
        Given a row and list of Columns, retrieves a map that contains the values at those Columns. Only columns that exist will be returned in map.
      • scanner

        ScannerBuilder scanner()
        This method is the starting point for constructing a scanner. Scanners can be constructed over a Span and/or with a subset of columns. Below is simple example of building a scanner.
         
           Transaction tx = ...;
           Span span = Span.exact("row4");
           Column col1 = new Column("fam1","qual1");
           Column col2 = new Column("fam1","qual2");
        
           //create a scanner over row4 fetching columns fam1:qual1 and fam1:qual2
           CellScanner cs = tx.scanner().over(span).fetch(col1,col2).build();
           for(RowColumnValue rcv : cs) {
             //do stuff with rcv
           }
         
         

        The following example shows how to build a row scanner.

         
           RowScanner rs = tx.scanner().over(span).fetch(col1, col2).byRow().build();
           for (ColumnScanner colScanner : rs) {
             Bytes row = colScanner.getRow();
             for (ColumnValue cv : colScanner) {
               // do stuff with the columns and values in the row
             }
           }
         
         
        Returns:
        A scanner builder.
        See Also:
        TransactionBase.withReadLock()
      • getStartTimestamp

        long getStartTimestamp()
        Returns:
        transactions start timestamp allocated from Oracle.
      • getsAsync

        default CompletableFuture<String> getsAsync​(String row,
                                                    Column column)
        Asynchronous get, may retrieve the value in the background and return immediately.
        Since:
        2.0.0
      • getsAsync

        default CompletableFuture<String> getsAsync​(String row,
                                                    Column column,
                                                    String defaultValue)
        Asynchronous get, may retrieve the value in the background and return immediately.
        Since:
        2.0.0
      • getAsync

        default CompletableFuture<Bytes> getAsync​(Bytes row,
                                                  Column column)
        Asynchronous get, may retrieve the value in the background and return immediately.
        Since:
        2.0.0
      • getAsync

        default CompletableFuture<Bytes> getAsync​(Bytes row,
                                                  Column column,
                                                  Bytes defaultValue)
        Asynchronous get, may retrieve the value in the background and return immediately.
        Since:
        2.0.0
      • setScanTimeAuthorizations

        default void setScanTimeAuthorizations​(Collection<String> authorizations)
        All reads done using this snapshot after this call will use the passed in authorizations to filter data.
        Since:
        2.0.0
      • getScanTimeAuthorizations

        default Collection<String> getScanTimeAuthorizations()
        Returns the set of scan time authorization that are currently in use for filtering data. The empty set indicates no filtering is being done using scan time authorizations.
        Since:
        2.0.0