Class ClusterNodeInfoDocument
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.Document
-
- org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfoDocument
-
- All Implemented Interfaces:
CacheValue
public class ClusterNodeInfoDocument extends Document
A document storing cluster node info. See alsoClusterNodeInfo.
-
-
Constructor Summary
Constructors Constructor Description ClusterNodeInfoDocument()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<ClusterNodeInfoDocument>all(DocumentStore store)Returns all cluster node info documents currently available in the given document store.intgetClusterId()longgetCreated()StringgetLastWrittenRootRev()the root-revision of the last background write (of unsaved modifications)longgetLeaseEndTime()@Nullable LonggetRecoveryBy()@Nullable StringgetRuntimeId()longgetStartTime()booleanisActive()booleanisBeingRecovered()booleanisBeingRecoveredBy(int clusterId)Returnstrueif the cluster node represented by this document is currently being recovered by the givenclusterId.booleanisInvisible()Is the cluster node marked as invisiblebooleanisRecoveryNeeded(long currentTimeMillis)Check if _lastRev recovery is needed for cluster node info document.StringtoString()
-
-
-
Method Detail
-
getCreated
public long getCreated()
- Returns:
- the timestamp when this document was created.
-
getLeaseEndTime
public long getLeaseEndTime()
-
getStartTime
public long getStartTime()
- Returns:
- the time when this cluster node was started or
-1if not available.
-
getRuntimeId
@Nullable public @Nullable String getRuntimeId()
- Returns:
- the Runtime ID for this cluster node.
-
isActive
public boolean isActive()
-
isBeingRecovered
public boolean isBeingRecovered()
- Returns:
trueif the recovery lock state isACQUIRED.
-
isRecoveryNeeded
public boolean isRecoveryNeeded(long currentTimeMillis)
Check if _lastRev recovery is needed for cluster node info document. Returnstrueif both of the below conditions aretrue:- State is Active
- Current time is past the leaseEnd time or there is a recovery lock on the cluster node info document
- Parameters:
currentTimeMillis- the current time in milliseconds since the start start of the epoch.
-
isBeingRecoveredBy
public boolean isBeingRecoveredBy(int clusterId)
Returnstrueif the cluster node represented by this document is currently being recovered by the givenclusterId.- Parameters:
clusterId- the id of a cluster node.- Returns:
trueif being recovered by the given id;falseotherwise.
-
getRecoveryBy
@Nullable public @Nullable Long getRecoveryBy()
- Returns:
- the id of the cluster node performing recovery or
nullif currently not set.
-
getClusterId
public int getClusterId()
-
all
public static List<ClusterNodeInfoDocument> all(DocumentStore store)
Returns all cluster node info documents currently available in the given document store.- Parameters:
store- the document store.- Returns:
- list of cluster node info documents.
-
getLastWrittenRootRev
public String getLastWrittenRootRev()
the root-revision of the last background write (of unsaved modifications)
-
isInvisible
public boolean isInvisible()
Is the cluster node marked as invisible- Returns:
trueif invisible;falseotherwise.
-
-