Class ClusterNodeInfoDocument

    • Constructor Detail

      • ClusterNodeInfoDocument

        public ClusterNodeInfoDocument()
    • 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 java.lang.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 java.lang.Long getRecoveryBy()
        Returns:
        the id of the cluster node performing recovery or null if currently not set.
      • getClusterId

        public int getClusterId()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Document
      • all

        public static java.util.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 java.lang.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.