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 also ClusterNodeInfo.
  • 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

      @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 is ACQUIRED.
    • isRecoveryNeeded

      public boolean isRecoveryNeeded(long currentTimeMillis)
      Check if _lastRev recovery is needed for cluster node info document. Returns true if both of the below conditions are true:
      • 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)
      Returns true if the cluster node represented by this document is currently being recovered by the given clusterId.
      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()
    • toString

      public String toString()
      Overrides:
      toString in class Document
    • 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.