Package org.apache.fluo.api.client
Interface SnapshotBase
-
- All Known Subinterfaces:
Snapshot
,Transaction
,TransactionBase
- All Known Implementing Classes:
AbstractSnapshotBase
,AbstractTransactionBase
public interface SnapshotBase
Allows users to read from a Fluo table at a certain point in time- Since:
- 1.0.0
- See Also:
AbstractSnapshotBase
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<Bytes,Map<Column,Bytes>>
get(Collection<Bytes> rows, Set<Column> columns)
Map<Bytes,Map<Column,Bytes>>
get(Collection<Bytes> rows, Column... columns)
Map<RowColumn,Bytes>
get(Collection<RowColumn> rowColumns)
Map<Column,Bytes>
get(Bytes row, Set<Column> columns)
Bytes
get(Bytes row, Column column)
Map<Column,Bytes>
get(Bytes row, Column... columns)
Bytes
get(Bytes row, Column column, Bytes defaultValue)
default CompletableFuture<Bytes>
getAsync(Bytes row, Column column)
Asynchronous get, may retrieve the value in the background and return immediately.default CompletableFuture<Bytes>
getAsync(Bytes row, Column column, Bytes defaultValue)
Asynchronous get, may retrieve the value in the background and return immediately.Map<Column,String>
gets(CharSequence row, Set<Column> columns)
Wrapper forget(Bytes, Set)
that uses Strings.String
gets(CharSequence row, Column column)
Wrapper forget(Bytes, Column)
that uses Strings.Map<Column,String>
gets(CharSequence row, Column... columns)
Wrapper forget(Bytes, Set)
that uses Strings.String
gets(CharSequence row, Column column, String defaultValue)
Wrapper forget(Bytes, Column, Bytes)
that uses Strings.Map<String,Map<Column,String>>
gets(Collection<? extends CharSequence> rows, Set<Column> columns)
Wrapper forget(Collection, Set)
that uses Strings.Map<String,Map<Column,String>>
gets(Collection<? extends CharSequence> rows, Column... columns)
Wrapper forget(Collection, Set)
that uses Strings.Map<RowColumn,String>
gets(Collection<RowColumn> rowColumns)
Wrapper forget(Collection)
that uses Strings.default CompletableFuture<String>
getsAsync(String row, Column column)
Asynchronous get, may retrieve the value in the background and return immediately.default CompletableFuture<String>
getsAsync(String row, Column column, String defaultValue)
Asynchronous get, may retrieve the value in the background and return immediately.default Collection<String>
getScanTimeAuthorizations()
Returns the set of scan time authorization that are currently in use for filtering data.long
getStartTimestamp()
ScannerBuilder
scanner()
This method is the starting point for constructing a scanner.default void
setScanTimeAuthorizations(Collection<String> authorizations)
All reads done using this snapshot after this call will use the passed in authorizations to filter data.
-
-
-
Method Detail
-
get
Bytes get(Bytes row, Column column, Bytes defaultValue)
Retrieves the value (inBytes
) stored at a given row andColumn
. Returns the passed in defaultValue if does not exist.- Parameters:
defaultValue
- this will be returned if row+columns does not exists
-
get
Map<RowColumn,Bytes> get(Collection<RowColumn> rowColumns)
-
scanner
ScannerBuilder scanner()
This method is the starting point for constructing a scanner. Scanners can be constructed over aSpan
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()
-
gets
Map<RowColumn,String> gets(Collection<RowColumn> rowColumns)
Wrapper forget(Collection)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
Map<String,Map<Column,String>> gets(Collection<? extends CharSequence> rows, Set<Column> columns)
Wrapper forget(Collection, Set)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
Map<String,Map<Column,String>> gets(Collection<? extends CharSequence> rows, Column... columns)
Wrapper forget(Collection, Set)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
String gets(CharSequence row, Column column)
Wrapper forget(Bytes, Column)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
String gets(CharSequence row, Column column, String defaultValue)
Wrapper forget(Bytes, Column, Bytes)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
Map<Column,String> gets(CharSequence row, Set<Column> columns)
Wrapper forget(Bytes, Set)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
gets
Map<Column,String> gets(CharSequence row, Column... columns)
Wrapper forget(Bytes, Set)
that uses Strings. All strings are encoded and decoded using UTF-8.
-
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
-
-