Class CrossGroupTransactionExecutor

java.lang.Object
com.loomcache.server.sharding.CrossGroupTransactionExecutor

public class CrossGroupTransactionExecutor extends Object
Executes transactions atomically via Raft command serialization.

Protocol (Raft-serialized):

  1. Serialize the entire transaction (conditions + THEN/ELSE ops) as a single Raft command
  2. Submit via CrossGroupTransactionExecutor.RaftTransactionSubmitter — the command is committed to the Raft log
  3. On each node's state machine apply: evaluate conditions, execute THEN/ELSE ops atomically under the local transactionLock (protects map state during apply)

Raft log serialization provides mutual exclusion — no GroupLockManager needed. Both single-group and cross-group transactions use the same Raft-serialized path, eliminating the lock-domain mismatch where concurrent single-map and cross-group transactions could interleave on the same map.

Falls back to local lock-based execution when no Raft submitter is configured (single-node / test mode).

Per-operation map resolution (ESC-14)

The apply path resolves a DistributedMap for each (groupId, mapName) pair touched by the transaction. The mapName comes either from the per-op Transaction.Operation.mapName() override or from the group's single recorded map (legacy single-map cross-group TX case). All resolved maps are locked in (groupId asc, mapName asc) order before condition evaluation to keep the apply atomic even when a single Raft group carries multiple maps.
Since:
2.0