Class RemoveExpiredCommand
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
org.infinispan.commands.write.AbstractDataWriteCommand
org.infinispan.commands.write.RemoveCommand
org.infinispan.commands.write.RemoveExpiredCommand
- All Implemented Interfaces:
DataCommand, FlagAffectedCommand, MetadataAwareCommand, CacheRpcCommand, ReplicableCommand, SegmentSpecificCommand, TopologyAffectedCommand, TracedCommand, VisitableCommand, DataWriteCommand, WriteCommand, VersionAware, RemoteLockCommand
Removes an entry that is expired from memory
- Since:
- 8.0
- Author:
- William Burns
-
Nested Class Summary
Nested classes/interfaces inherited from interface VisitableCommand
VisitableCommand.LoadType -
Field Summary
Fields inherited from class RemoveCommand
metadata, successful, value, valueMatcherFields inherited from class AbstractDataWriteCommand
commandInvocationIdFields inherited from class AbstractDataCommand
cacheName, key, origin, segment, spanAttributes, topologyIdFields inherited from interface VisitableCommand
log -
Constructor Summary
ConstructorsConstructorDescriptionRemoveExpiredCommand(ByteString cacheName, Object key, Object value, Long lifespan, boolean maxIdle, int segment, long flagBitSet, CommandInvocationId commandInvocationId) -
Method Summary
Modifier and TypeMethodDescriptionacceptVisitor(InvocationContext ctx, Visitor visitor) Accept a visitor, and return the result of accepting this visitor.booleaninthashCode()booleanCertain commands only work based on a certain condition or state of the cache.booleanWhether this remove expired was fired because of max idlebooleanbooleanshouldReplicate(InvocationContext ctx, boolean requireReplicateIfRemote) Some commands may be successful but not need to be replicated to other nodes, stores or listeners.Returns aNodeVersionrepresenting the Infinispan version in which this command was added.toString()Methods inherited from class RemoveCommand
fail, getInternalMetadata, getMetadata, getValue, getValueMatcher, getWrappedMetadata, getWrappedValue, isReturnEntryNecessary, isReturnValueExpected, isSuccessful, loadType, nonExistant, setInternalMetadata, setMetadata, setValue, setValueMatcherMethods inherited from class AbstractDataWriteCommand
getAffectedKeys, getCommandInvocationId, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisitionMethods inherited from class AbstractDataCommand
getCacheName, getFlagsBitSet, getFlagsWithoutRemote, getKey, getOrigin, getSegment, getSpanAttributes, getTopologyId, getWrappedKey, printFlags, setFlagsBitSet, setKey, setOrigin, setSpanAttributes, setTopologyIdMethods inherited from interface CacheRpcCommand
getCacheName, getOrigin, setOriginMethods inherited from interface DataCommand
getKeyMethods inherited from interface DataWriteCommand
getInternalMetadata, setInternalMetadataMethods inherited from interface FlagAffectedCommand
addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, setFlagsBitSetMethods inherited from interface ReplicableCommand
getCommandId, readFrom, writeToMethods inherited from interface SegmentSpecificCommand
getSegmentMethods inherited from interface TopologyAffectedCommand
getTopologyId, setTopologyIdMethods inherited from interface TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface VisitableCommand
init, invokeAsyncMethods inherited from interface WriteCommand
isWriteOnly
-
Constructor Details
-
RemoveExpiredCommand
public RemoveExpiredCommand(ByteString cacheName, Object key, Object value, Long lifespan, boolean maxIdle, int segment, long flagBitSet, CommandInvocationId commandInvocationId)
-
-
Method Details
-
acceptVisitor
Description copied from interface:VisitableCommandAccept a visitor, and return the result of accepting this visitor.- Specified by:
acceptVisitorin interfaceVisitableCommand- Overrides:
acceptVisitorin classRemoveCommand- Parameters:
ctx- invocation contextvisitor- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable- in the event of problems
-
isConditional
public boolean isConditional()Description copied from interface:WriteCommandCertain commands only work based on a certain condition or state of the cache. For example,ConcurrentMap.putIfAbsent(Object, Object)only does anything if a condition is met, i.e., the entry in question is not already present. This method tests whether the command in question is conditional or not.- Specified by:
isConditionalin interfaceWriteCommand- Overrides:
isConditionalin classRemoveCommand- Returns:
- true if the command is conditional, false otherwise
-
shouldReplicate
Description copied from interface:WriteCommandSome commands may be successful but not need to be replicated to other nodes, stores or listeners. For example a unconditional remove may be performed on a key that doesn't exist. In that case the command is still successful but does not need to replicate that information other places.- Specified by:
shouldReplicatein interfaceWriteCommand- Overrides:
shouldReplicatein classRemoveCommand- Parameters:
ctx- invocation context if present, may be nullrequireReplicateIfRemote- if the command can replicate even if not a locally invoked command- Returns:
- whether the command should replicate
default just invokes
WriteCommand.isSuccessful()
-
supportedSince
Description copied from interface:ReplicableCommandReturns aNodeVersionrepresenting the Infinispan version in which this command was added. This value is used to ensure that when the cluster contains different Infinispan versions, only commands compatible with the oldest version are transmitted.Abstract classes should not implement this method as the version should be specific to an individual implementation. Similarly, implementations which extend another
ReplicableCommandshould always override this method.- Specified by:
supportedSincein interfaceReplicableCommand- Specified by:
supportedSincein interfaceVersionAware- Overrides:
supportedSincein classRemoveCommand- Returns:
- a
NodeVersioncorresponding to the Infinispan version this command was added.
-
toString
- Overrides:
toStringin classRemoveCommand
-
equals
- Overrides:
equalsin classRemoveCommand
-
hashCode
public int hashCode()- Overrides:
hashCodein classRemoveCommand
-
isMaxIdle
public boolean isMaxIdle()Whether this remove expired was fired because of max idle- Returns:
- if this command is max idle based expiration
-
getLifespan
-
logThrowable
-