Class ClusterNodeInfoDocument
java.lang.Object
org.apache.jackrabbit.oak.plugins.document.Document
org.apache.jackrabbit.oak.plugins.document.ClusterNodeInfoDocument
- All Implemented Interfaces:
CacheValue
A document storing cluster node info. See also
ClusterNodeInfo
.-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ClusterNodeInfoDocument>
all
(DocumentStore store) Returns all cluster node info documents currently available in the given document store.int
long
the root-revision of the last background write (of unsaved modifications)long
@Nullable Long
@Nullable String
long
boolean
isActive()
boolean
boolean
isBeingRecoveredBy
(int clusterId) Returnstrue
if the cluster node represented by this document is currently being recovered by the givenclusterId
.boolean
Is the cluster node marked as invisibleboolean
isRecoveryNeeded
(long currentTimeMillis) Check if _lastRev recovery is needed for cluster node info document.toString()
-
Constructor Details
-
ClusterNodeInfoDocument
public ClusterNodeInfoDocument()
-
-
Method Details
-
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
-1
if not available.
-
getRuntimeId
- Returns:
- the Runtime ID for this cluster node.
-
isActive
public boolean isActive() -
isBeingRecovered
public boolean isBeingRecovered()- Returns:
true
if the recovery lock state isACQUIRED
.
-
isRecoveryNeeded
public boolean isRecoveryNeeded(long currentTimeMillis) Check if _lastRev recovery is needed for cluster node info document. Returnstrue
if 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) Returnstrue
if the cluster node represented by this document is currently being recovered by the givenclusterId
.- Parameters:
clusterId
- the id of a cluster node.- Returns:
true
if being recovered by the given id;false
otherwise.
-
getRecoveryBy
- Returns:
- the id of the cluster node performing recovery or
null
if currently not set.
-
getClusterId
public int getClusterId() -
toString
-
all
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
the root-revision of the last background write (of unsaved modifications) -
isInvisible
public boolean isInvisible()Is the cluster node marked as invisible- Returns:
true
if invisible;false
otherwise.
-