Package org.apache.sling.discovery.oak.cluster

## Class ClusterReader

- java.lang.Object
- - org.apache.sling.discovery.oak.cluster.ClusterReader

    public class ClusterReader
    extends Object

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

Constructors
`ClusterReader​(org.apache.sling.api.resource.ResourceResolver resourceResolver, Config config, org.apache.sling.discovery.commons.providers.spi.base.IdMapService idMapService, Map<Integer,​InstanceInfo> seenLocalInstances)`

### Method Summary

All Methods Instance Methods Concrete Methods
`InstanceReadResult` `readInstance​(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)

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClusterReader

    public ClusterReader​(org.apache.sling.api.resource.ResourceResolver resourceResolver,
                         Config config,
                         org.apache.sling.discovery.commons.providers.spi.base.IdMapService idMapService,
                         Map<Integer,​InstanceInfo> seenLocalInstances)

### Method Detail

#### readInstance

    public InstanceReadResult readInstance​(int clusterNodeId,
                                           boolean failOnMissingSyncToken,
                                           long seqNum)
                                    throws org.apache.sling.api.resource.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:
  `org.apache.sling.api.resource.PersistenceException`