Package org.infinispan.scattered.impl
Class BiasManagerImpl
- java.lang.Object
-
- org.infinispan.scattered.impl.BiasManagerImpl
-
- All Implemented Interfaces:
BiasManager
public class BiasManagerImpl extends Object implements BiasManager
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.scattered.BiasManager
BiasManager.Revocation
-
-
Constructor Summary
Constructors Constructor Description BiasManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocalBias(Object key, int topologyId)
Allow reading local data if the topology is still actual.void
clear()
The cache has been cleared and therefore all biases are forgotten.List<Address>
getRemoteBias(Object key)
boolean
hasLocalBias(Object key)
Check if we can read local data and update last-read timestamp for this key.void
onTopologyChange(TopologyChangedEvent event)
void
renewRemoteBias(Object key, Address origin)
Notify the component that the node is reading the biased entry and the bias should not be revoked unless necessary.void
revokeLocalBias(Object key)
Stop reading local data.void
revokeLocalBiasForSegments(org.infinispan.commons.util.IntSet segments)
Stop reading local data from this segment.void
start()
BiasManager.Revocation
startRevokingRemoteBias(Object key, Address newBiased)
Check if there are any nodes that have local bias, and starting replacing them with the provided address.
-
-
-
Method Detail
-
start
public void start()
-
onTopologyChange
public void onTopologyChange(TopologyChangedEvent event)
-
addLocalBias
public void addLocalBias(Object key, int topologyId)
Description copied from interface:BiasManager
Allow reading local data if the topology is still actual.- Specified by:
addLocalBias
in interfaceBiasManager
-
revokeLocalBias
public void revokeLocalBias(Object key)
Description copied from interface:BiasManager
Stop reading local data.- Specified by:
revokeLocalBias
in interfaceBiasManager
-
revokeLocalBiasForSegments
public void revokeLocalBiasForSegments(org.infinispan.commons.util.IntSet segments)
Description copied from interface:BiasManager
Stop reading local data from this segment.- Specified by:
revokeLocalBiasForSegments
in interfaceBiasManager
-
hasLocalBias
public boolean hasLocalBias(Object key)
Description copied from interface:BiasManager
Check if we can read local data and update last-read timestamp for this key.- Specified by:
hasLocalBias
in interfaceBiasManager
- Returns:
-
getRemoteBias
public List<Address> getRemoteBias(Object key)
- Specified by:
getRemoteBias
in interfaceBiasManager
-
startRevokingRemoteBias
public BiasManager.Revocation startRevokingRemoteBias(Object key, Address newBiased)
Description copied from interface:BiasManager
Check if there are any nodes that have local bias, and starting replacing them with the provided address. The caller can find out the currently biased nodes fromBiasManager.Revocation.biased()
and is expected to sendRevokeBiasCommand
to the holders and when this completes callBiasManager.Revocation.complete()
orBiasManager.Revocation.fail()
. This method returnsnull
when there is no need to revoke any bias on remote nodes. WhenBiasManager.Revocation.shouldRevoke()
returns false, the caller should set up a handler throughBiasManager.Revocation.handleCompose(Supplier)
and retry calling this method in the handler.- Specified by:
startRevokingRemoteBias
in interfaceBiasManager
- Returns:
-
renewRemoteBias
public void renewRemoteBias(Object key, Address origin)
Description copied from interface:BiasManager
Notify the component that the node is reading the biased entry and the bias should not be revoked unless necessary.- Specified by:
renewRemoteBias
in interfaceBiasManager
-
clear
public void clear()
Description copied from interface:BiasManager
The cache has been cleared and therefore all biases are forgotten.- Specified by:
clear
in interfaceBiasManager
-
-