Package org.infinispan.scattered
Interface BiasManager
-
public interface BiasManager
This component tracks if this node can read the data stored locally despite not being an owner and which nodes will read the local data that is primary-owned by this node. Since tracking these remote nodes has a memory overhead this component can deliberately revoke the bias sending theRevokeBiasCommand
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BiasManager.Revocation
-
Method Summary
All Methods Instance Methods Abstract 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
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.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
-
addLocalBias
void addLocalBias(Object key, int topologyId)
Allow reading local data if the topology is still actual.- Parameters:
key
-topologyId
-
-
revokeLocalBias
void revokeLocalBias(Object key)
Stop reading local data.- Parameters:
key
-
-
revokeLocalBiasForSegments
void revokeLocalBiasForSegments(IntSet segments)
Stop reading local data from this segment.- Parameters:
segments
-
-
hasLocalBias
boolean hasLocalBias(Object key)
Check if we can read local data and update last-read timestamp for this key.- Parameters:
key
-- Returns:
-
startRevokingRemoteBias
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. 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.- Parameters:
key
-newBiased
-- Returns:
-
renewRemoteBias
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.- Parameters:
key
-origin
-
-
clear
void clear()
The cache has been cleared and therefore all biases are forgotten.
-
-