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.int
getClusterId()
long
getCreated()
String
getLastWrittenRootRev()
the root-revision of the last background write (of unsaved modifications)long
getLeaseEndTime()
@Nullable Long
getRecoveryBy()
@Nullable String
getRuntimeId()
long
getStartTime()
boolean
isActive()
boolean
isBeingRecovered()
boolean
isBeingRecoveredBy(int clusterId)
Returnstrue
if the cluster node represented by this document is currently being recovered by the givenclusterId
.boolean
isInvisible()
Is the cluster node marked as invisibleboolean
isRecoveryNeeded(long currentTimeMillis)
Check if _lastRev recovery is needed for cluster node info document.String
toString()
-
-
-
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
-1
if 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:
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
@Nullable public @Nullable Long getRecoveryBy()
- Returns:
- the id of the cluster node performing recovery or
null
if 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:
true
if invisible;false
otherwise.
-
-