Clarifications

This commit is contained in:
Andrea Cavalli 2023-12-09 17:57:02 +01:00
parent 665e5cdf30
commit 4a4af2576d
3 changed files with 6 additions and 6 deletions

View File

@ -70,7 +70,7 @@ public abstract class SocketConnection extends BaseConnection {
@Override
public <T> T get(Arena arena,
long transactionId,
long transactionOrUpdateId,
long columnId,
MemorySegment @NotNull [] keys,
GetCallback<? super MemorySegment, T> callback) throws RocksDBException {

View File

@ -73,13 +73,13 @@ public interface RocksDBAPI {
/**
* Get an element from the specified position
* @param arena arena
* @param transactionId transaction id, update id for retry operations, or 0
* @param transactionOrUpdateId transaction id, update id for retry operations, or 0
* @param columnId column id
* @param keys column keys, or empty array if not needed
* @param callback the callback will be executed on the same thread, exactly once.
*/
<T> T get(Arena arena,
long transactionId,
long transactionOrUpdateId,
long columnId,
@NotNull MemorySegment @NotNull[] keys,
GetCallback<? super MemorySegment, T> callback) throws RocksDBException;

View File

@ -481,20 +481,20 @@ public class EmbeddedDB implements RocksDBAPI, Closeable {
@Override
public <T> T get(Arena arena,
long transactionId,
long transactionOrUpdateId,
long columnId,
MemorySegment @NotNull [] keys,
GetCallback<? super MemorySegment, T> callback) throws it.cavallium.rockserver.core.common.RocksDBException {
// Column id
var col = getColumn(columnId);
Tx tx = transactionId != 0 ? getTransaction(transactionId, true) : null;
Tx tx = transactionOrUpdateId != 0 ? getTransaction(transactionOrUpdateId, true) : null;
long updateId;
if (callback instanceof Callback.CallbackForUpdate<?>) {
if (tx == null) {
tx = openTransactionInternal(MAX_TRANSACTION_DURATION_MS, true);
updateId = allocateTransactionInternal(tx);
} else {
updateId = transactionId;
updateId = transactionOrUpdateId;
}
} else {
updateId = 0;