Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.infinispan.interceptors.distribution;
import org.infinispan.commands.CommandsFactory;
import org.infinispan.commands.DataCommand;
import org.infinispan.commands.FlagAffectedCommand;
import org.infinispan.commands.LocalFlagAffectedCommand;
import org.infinispan.commands.read.AbstractDataCommand;
import org.infinispan.commands.read.GetCacheEntryCommand;
import org.infinispan.commands.read.GetKeyValueCommand;
import org.infinispan.commands.write.DataWriteCommand;
import org.infinispan.commands.write.InvalidateCommand;
import org.infinispan.commands.write.InvalidateL1Command;
import org.infinispan.commands.write.PutKeyValueCommand;
import org.infinispan.commands.write.PutMapCommand;
import org.infinispan.commands.write.RemoveCommand;
import org.infinispan.commands.write.ReplaceCommand;
import org.infinispan.commons.util.CollectionFactory;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.container.DataContainer;
import org.infinispan.container.EntryFactory;
import org.infinispan.container.entries.InternalCacheEntry;
import org.infinispan.context.Flag;
import org.infinispan.context.InvocationContext;
import org.infinispan.distribution.L1Manager;
import org.infinispan.factories.annotations.Inject;
import org.infinispan.factories.annotations.Start;
import org.infinispan.interceptors.base.BaseRpcInterceptor;
import org.infinispan.interceptors.locking.ClusteringDependentLogic;
import org.infinispan.statetransfer.StateTransferLock;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
/**
* Interceptor that handles L1 logic for non-transactional caches.
*
* @author Mircea Markus
* @author William Burns
* @deprecated Since 8.2, no longer public API.
*/
@Deprecated
public class L1NonTxInterceptor extends BaseRpcInterceptor {
private static final Log log = LogFactory.getLog(L1NonTxInterceptor.class);
private static final boolean trace = log.isTraceEnabled();
protected L1Manager l1Manager;
protected ClusteringDependentLogic cdl;
protected EntryFactory entryFactory;
protected CommandsFactory commandsFactory;
protected DataContainer dataContainer;
protected Configuration config;
protected StateTransferLock stateTransferLock;
private long l1Lifespan;
private long replicationTimeout;
/**
* This map holds all the current write synchronizers registered for a given key. This map is only added to when an
* operation is invoked that would cause a remote get to occur (which is controlled by whether or not the
* {@link L1NonTxInterceptor#skipL1Lookup(org.infinispan.commands.LocalFlagAffectedCommand, Object)} method returns
* true. This map MUST have the value inserted removed in a finally block after the remote get is done to
* prevent reference leaks.
*
* Having a value in this map allows for other concurrent operations that require a remote get to not have to
* actually perform a remote get as the first thread is doing this. So in this case any subsequent operations
* wanting the remote value can just call the
* {@link org.infinispan.interceptors.distribution.L1WriteSynchronizer#get()} method or one of it's overridden
* methods. Note the way to tell if another thread is performing the remote get is to use the
* {@link ConcurrentMap#putIfAbsent(Object, Object)} method and check if the return value is null or not.
*
* Having a value in this map allows for a concurrent write or L1 invalidation to try to stop the synchronizer from
* updating the L1 value by invoking it's
* {@link org.infinispan.interceptors.distribution.L1WriteSynchronizer#trySkipL1Update()} method. If this method
* returns false, then the write or L1 invalidation MUST wait for the synchronizer to complete before
* continuing to ensure it is able to remove the newly cached L1 value as it is now invalid. This waiting should be
* done by calling {@link org.infinispan.interceptors.distribution.L1WriteSynchronizer#get()} method or one of it's
* overridden methods. Failure to wait for the update to occur could cause a L1 data inconsistency as the
* invalidation may not invalidate the new value.
*/
private final ConcurrentMap