...
Below is the list of components that are required for CC execution. Each component contains a minimal set of required methods. This section may serve as a hint for implementros.
Implements methods for accessing multi-version data under txn context. One per data table partition. Contains all primary and secondary indexes.
Code Block | ||
---|---|---|
| ||
// PutsInserts a row. and Thisadds callit updatesin primarythe andindexes. allReturns secondarya indexesrowId afterfor acquiringthe necessaryinserted locksrow. CompletableFuture<Void>CompletableFuture<RowId> put(Tuple row, UUID txId); // RemovesUpdates a row and related index entries. This call updates primary and all secondary indexes after acquiring necessary locks Returns a previous value. CompletableFuture<Tuple> update(RowId rowId, Tuple newVal, UUID txId); // Removes a row and related index entries. Returns a removed row. CompletableFuture<Tuple> remove(TupleRowId keyTuplerowId, UUID txId); // ExecutesGet thea querytuple inby RW moderowId. AsyncCursor<Tuple>CompletableFuture<Tuple> queryget(@NullableRowId Query queryrowId, UUID txId); // Executes the query in RORW mode. Cursor<Tuple>AsyncCursor<RowId> query(@Nullable Query query, TimestampUUID readTstxId); // Invokes a closure over Executes the setquery ofin records matching the filter. Returns a number of modified rows. CompletableFuture<Long> invoke(InvokeClosure closure, @Nullable Filter filter, UUID txIdRO mode. Cursor<Tuple> query(@Nullable Query query, Timestamp readTs); // Commits a transaction with a timestamp. CompletableFuture<Boolean> commit(UUID txId, Timestamp commitTs); // Aborts a transaction CompletableFuture<Boolean> abort(UUID txId); |
...
The proposed operations should support batches.
...
Used to manage locks (easily guessed). It has a volatile state, which is lost on restart. One per table/index. Used by MVStore to acquire/release locks as required by CC protocol.
LockManager LockTable provides the following operations:
Lock provides the following operations:
Holds a transaction state. Currently two states are supported: COMMITTED and ABORTED. One per data node. Used by MVStore to resolve write intents and for txn recovery purposes.
...