Class ClusterReader
java.lang.Object
org.apache.sling.discovery.oak.cluster.ClusterReader
Helper class to detect instances that are only partially started.
Partially in this context means that they have updated their
Oak lease but have not written the required data on the Sling
level (which includes the idmap, the synctoken and the leaderElectionid).
-
Constructor Summary
ConstructorDescriptionClusterReader
(ResourceResolver resourceResolver, Config config, IdMapService idMapService, Map<Integer, InstanceInfo> seenLocalInstances) -
Method Summary
Modifier and TypeMethodDescriptionreadInstance
(int clusterNodeId, boolean failOnMissingSyncToken, long seqNum) Reads all discovery.oak related data for clusterNodeId and fills the internal structure with the resulting info - or remembers that the clusterNode was incomplete (partially started)
-
Constructor Details
-
ClusterReader
public ClusterReader(ResourceResolver resourceResolver, Config config, IdMapService idMapService, Map<Integer, InstanceInfo> seenLocalInstances)
-
-
Method Details
-
readInstance
public InstanceReadResult readInstance(int clusterNodeId, boolean failOnMissingSyncToken, long seqNum) throws PersistenceException Reads all discovery.oak related data for clusterNodeId and fills the internal structure with the resulting info - or remembers that the clusterNode was incomplete (partially started)- Parameters:
clusterNodeId
- the clusterNodeId to be read- Returns:
- the instance if it is has all required data stored (which does not necessarily mean it has completely started - syncToken is not checked at this stage yet)
- Throws:
PersistenceException
-