org.infinispan.transaction.impl.RemoteTransaction Maven / Gradle / Ivy
package org.infinispan.transaction.impl;
import org.infinispan.commands.write.WriteCommand;
import org.infinispan.commons.equivalence.AnyEquivalence;
import org.infinispan.commons.equivalence.Equivalence;
import org.infinispan.commons.util.CollectionFactory;
import org.infinispan.container.entries.CacheEntry;
import org.infinispan.context.Flag;
import org.infinispan.transaction.xa.GlobalTransaction;
import org.infinispan.transaction.xa.InvalidTransactionException;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Map;
import static org.infinispan.commons.util.Util.toStr;
/**
* Defines the state of a remotely originated transaction.
*
* @author [email protected]
* @since 4.0
*/
public class RemoteTransaction extends AbstractCacheTransaction implements Cloneable {
private static final Log log = LogFactory.getLog(RemoteTransaction.class);
private static final boolean trace = log.isTraceEnabled();
/**
* This int should be set to the highest topology id for transactions received via state transfer. During state
* transfer we do not migrate lookedUpEntries to save bandwidth. If lookedUpEntriesTopology is less than the
* topology of the CommitCommand that is received this indicates the preceding PrepareCommand was received by
* previous owner before state transfer or the data has now changed owners and the current owner
* now has to re-execute prepare to populate lookedUpEntries (and acquire the locks).
*/
// Default value of MAX_VALUE basically means it hasn't yet received what topology id this is for the entries
private volatile int lookedUpEntriesTopology = Integer.MAX_VALUE;
private volatile TotalOrderRemoteTransactionState transactionState;
private final Object transactionStateLock = new Object();
public RemoteTransaction(WriteCommand[] modifications, GlobalTransaction tx, int topologyId,
Equivalence
© 2015 - 2025 Weber Informatics LLC | Privacy Policy