Skip to content

Commit

Permalink
IGNITE-23604 Remove redundant TableDrivenImplicitTransactionWrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtern committed Dec 20, 2024
1 parent c4cae55 commit 3cc258a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <RowT> AsyncCursor<InternalSqlRow> execute(
);

/**
* Returns {@code true} if the plan is executed inside a transaction, {@code false} otherwise.
* Returns {@code true} if the plan is to be executed within a transaction (explicit or implicit), {@code false} otherwise.
*/
boolean transactional();
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public <RowT> Publisher<RowT> indexLookup(
@Override
public <RowT> CompletableFuture<RowT> primaryKeyLookup(
ExecutionContext<RowT> ctx,
@Nullable InternalTransaction explicitTx,
InternalTransaction tx,
RowFactory<RowT> rowFactory,
RowT key,
BitSet requiredColumns
Expand All @@ -230,7 +230,7 @@ public <RowT> CompletableFuture<RowT> primaryKeyLookup(

BinaryRowEx keyRow = converter.toKeyRow(ctx, key);

return internalTable.get(keyRow, explicitTx)
return internalTable.get(keyRow, tx)
.thenApply(tableRow -> {
if (tableRow == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import org.apache.ignite.internal.tx.InternalTransaction;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.sql.SqlException;
import org.jetbrains.annotations.Nullable;

/**
* Ignite table implementation.
Expand Down Expand Up @@ -200,7 +199,7 @@ public TableDescriptor descriptor() {
/** {@inheritDoc} */
@Override
public <RowT> CompletableFuture<Void> insert(
@Nullable InternalTransaction explicitTx,
InternalTransaction tx,
ExecutionContext<RowT> ectx,
RowT row
) {
Expand All @@ -213,7 +212,7 @@ public <RowT> CompletableFuture<Void> insert(

BinaryRowEx tableRow = rowConverter.toFullRow(ectx, validatedRow);

return table.insert(tableRow, explicitTx)
return table.insert(tableRow, tx)
.thenApply(success -> {
if (success) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public IgniteKeyValueGet lookupNode() {
@Override
public <RowT> AsyncCursor<InternalSqlRow> execute(
ExecutionContext<RowT> ctx,
@Nullable InternalTransaction tx,
InternalTransaction tx,
ExecutableTableRegistry tableRegistry,
@Nullable QueryPrefetchCallback firstPageReadyCallback
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public IgniteKeyValueModify modifyNode() {
@Override
public <RowT> AsyncCursor<InternalSqlRow> execute(
ExecutionContext<RowT> ctx,
@Nullable InternalTransaction tx,
InternalTransaction tx,
ExecutableTableRegistry tableRegistry,
@Nullable QueryPrefetchCallback firstPageReadyCallback
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ public QueryTransactionWrapper getOrStartImplicit(boolean readOnly, boolean tabl

if (tx == null) {
transaction = txManager.begin(observableTimeTracker, tableDriven, readOnly);

if (tableDriven) {
result = new TableDrivenImplicitTransactionWrapper(transaction, txTracker);
} else {
result = new QueryTransactionWrapperImpl(transaction, true, txTracker);
}
result = new QueryTransactionWrapperImpl(transaction, true, txTracker);
} else {
transaction = tx.unwrap();
result = tx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ScriptTransactionContext(
* Starts a new implicit transaction if there is no external or script-driven transaction.
*
* @param readOnly Indicates whether the read-only transaction or read-write transaction should be started.
* @param tableDriven Indicates whether the implicit transaction will be managed by the table manager or the SQL engine.
* @param tableDriven Indicates whether the implicit transaction will be partially managed by the table storage.
* @return Transaction wrapper.
*/
@Override
Expand Down

This file was deleted.

0 comments on commit 3cc258a

Please sign in to comment.