org.infinispan.commands.remote.recovery.TxCompletionNotificationCommand Maven / Gradle / Ivy
package org.infinispan.commands.remote.recovery;
import static org.infinispan.commons.util.Util.toStr;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import javax.transaction.xa.Xid;
import org.infinispan.commands.TopologyAffectedCommand;
import org.infinispan.statetransfer.StateTransferManager;
import org.infinispan.transaction.impl.RemoteTransaction;
import org.infinispan.transaction.impl.TransactionTable;
import org.infinispan.transaction.xa.GlobalTransaction;
import org.infinispan.transaction.xa.recovery.RecoveryManager;
import org.infinispan.util.ByteString;
import org.infinispan.util.concurrent.CompletableFutures;
import org.infinispan.util.concurrent.locks.LockManager;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
/**
* Command for removing recovery related information from the cluster.
*
* @author [email protected]
* @since 5.0
*/
public class TxCompletionNotificationCommand extends RecoveryCommand implements TopologyAffectedCommand {
private static Log log = LogFactory.getLog(TxCompletionNotificationCommand.class);
public static final int COMMAND_ID = 22;
private Xid xid;
private long internalId;
private GlobalTransaction gtx;
private TransactionTable txTable;
private LockManager lockManager;
private StateTransferManager stateTransferManager;
private int topologyId = -1;
private TxCompletionNotificationCommand() {
super(null); // For command id uniqueness test
}
public TxCompletionNotificationCommand(Xid xid, GlobalTransaction gtx, ByteString cacheName) {
super(cacheName);
this.xid = xid;
this.gtx = gtx;
}
public void init(TransactionTable tt, LockManager lockManager, RecoveryManager rm, StateTransferManager stm) {
super.init(rm);
this.txTable = tt;
this.lockManager = lockManager;
this.stateTransferManager = stm;
}
public TxCompletionNotificationCommand(long internalId, ByteString cacheName) {
super(cacheName);
this.internalId = internalId;
}
public TxCompletionNotificationCommand(ByteString cacheName) {
super(cacheName);
}
@Override
public int getTopologyId() {
return topologyId;
}
@Override
public void setTopologyId(int topologyId) {
this.topologyId = topologyId;
}
@Override
public boolean isReturnValueExpected() {
return false;
}
@Override
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy