Package org.infinispan.scattered.impl
Class BiasManagerImpl
java.lang.Object
org.infinispan.scattered.impl.BiasManagerImpl
- All Implemented Interfaces:
BiasManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.scattered.BiasManager
BiasManager.Revocation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getRemoteBias
(Object key) boolean
hasLocalBias
(Object key) Check if we can read local data and update last-read timestamp for this key.void
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
(IntSet segments) Stop reading local data from this segment.void
start()
startRevokingRemoteBias
(Object key, Address newBiased) Check if there are any nodes that have local bias, and starting replacing them with the provided address.
-
Constructor Details
-
BiasManagerImpl
public BiasManagerImpl()
-
-
Method Details
-
start
public void start() -
onTopologyChange
-
addLocalBias
Description copied from interface:BiasManager
Allow reading local data if the topology is still actual.- Specified by:
addLocalBias
in interfaceBiasManager
-
revokeLocalBias
Description copied from interface:BiasManager
Stop reading local data.- Specified by:
revokeLocalBias
in interfaceBiasManager
-
revokeLocalBiasForSegments
Description copied from interface:BiasManager
Stop reading local data from this segment.- Specified by:
revokeLocalBiasForSegments
in interfaceBiasManager
-
hasLocalBias
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
- Specified by:
getRemoteBias
in interfaceBiasManager
-
startRevokingRemoteBias
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
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
-