Skip to content

Instantly share code, notes, and snippets.

@arigesher
Created August 6, 2014 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arigesher/bfed4136c766712dcd24 to your computer and use it in GitHub Desktop.
Save arigesher/bfed4136c766712dcd24 to your computer and use it in GitHub Desktop.
Overview of the Transactions API for AtlasDB
public interface Transaction {
/**
* Selects a one or more rows, each consisting of multiple cells.
*/
SortedMap<byte[], RowResult<byte[]>> getRows(String tableName, Iterable<byte[]> rows,
ColumnSelection columnSelection);
/**
* Selects specific cells (a Cell is a tuple of row id and field id)
*/
Map<Cell, byte[]> get(String tableName, Set<Cell> cells);
/**
* Pulls back a set of rows specified by a range of keys.
*/
BatchingVisitable<RowResult<byte[]>> getRange(String tableName, RangeRequest rangeRequest);
/**
* Pulls backs multiple sets of rows specified by multiple key ranges
*/
@Idempotent
Iterable<BatchingVisitable<RowResult<byte[]>>> getRanges(String tableName, Iterable<RangeRequest> rangeRequests);
/**
* Puts values into the key-value store. If you put a null or the empty byte array, then
* this is treated like a delete to the store.
*/
void put(String tableName, Map<Cell, byte[]> values);
/**
* Deletes values from the key-value store.
*/
void delete(String tableName, Set<Cell> keys);
/**
* Aborts the transaction. Can be called repeatedly.
*/
void abort();
/**
* Commits the transaction. Can be called repeatedly, but will only commit the first time.
*/
void commit() throws TransactionFailedException;
/**
* A temp table allows a long running read only transaction the ability to store temporary
* results. A temp table may not be read by any other transactions.
*/
String createNewTempTable(int maxValueSizeInBytes);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment