org.infinispan.commands.write.InvalidateVersionsCommand Maven / Gradle / Ivy
package org.infinispan.commands.write;
import org.infinispan.commands.VisitableCommand;
import org.infinispan.commands.remote.BaseRpcCommand;
import org.infinispan.container.DataContainer;
import org.infinispan.container.versioning.InequalVersionComparisonResult;
import org.infinispan.container.versioning.SimpleClusteredVersion;
import org.infinispan.persistence.manager.OrderedUpdatesManager;
import org.infinispan.statetransfer.StateTransferLock;
import org.infinispan.statetransfer.StateTransferManager;
import org.infinispan.util.ByteString;
import org.infinispan.util.concurrent.CompletableFutures;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.concurrent.CompletableFuture;
/**
* Must be {@link VisitableCommand} as we want to catch it in persistence handling etc.
*
* @author Radim Vansa <[email protected]>
*/
public class InvalidateVersionsCommand extends BaseRpcCommand {
private static final Log log = LogFactory.getLog(InvalidateVersionsCommand.class);
private static final boolean trace = log.isTraceEnabled();
public static final int COMMAND_ID = 67;
// This is the topologyId in which this command is valid (in case that it comes from the state transfer)
private int topologyId;
private Object[] keys;
private int[] topologyIds;
private long[] versions;
// Removed means that the comparison will remove current versions as well
private boolean removed;
protected DataContainer dataContainer;
protected OrderedUpdatesManager orderedUpdatesManager;
protected StateTransferLock stateTransferLock;
protected StateTransferManager stateTransferManager;
public InvalidateVersionsCommand() {
this(null);
}
public InvalidateVersionsCommand(ByteString cacheName) {
super(cacheName);
}
public InvalidateVersionsCommand(ByteString cacheName, int topologyId, Object[] keys, int[] topologyIds, long[] versions, boolean removed) {
super(cacheName);
this.topologyId = topologyId;
this.keys = keys;
this.topologyIds = topologyIds;
this.versions = versions;
this.removed = removed;
}
public void init(DataContainer dataContainer, OrderedUpdatesManager orderedUpdatesManager,
StateTransferLock stateTransferLock, StateTransferManager stateTransferManager) {
this.dataContainer = dataContainer;
this.orderedUpdatesManager = orderedUpdatesManager;
this.stateTransferLock = stateTransferLock;
this.stateTransferManager = stateTransferManager;
}
@Override
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy