Interface ClusterNodeHeartbeatDao

All Known Implementing Classes:
BambooClusterNodeHeartBeatRawJdbcDao

@Internal public interface ClusterNodeHeartbeatDao
Specialised for Bamboo.
  • Method Details

    • getNodeId

      @NotNull @NotNull String getNodeId()
      Returns the globally unique Identifier for this cluster node.
      Returns:
      the globally unique Identifier for this cluster node.
    • writeHeartBeat

      void writeHeartBeat(long time)
      Writes a heartbeat for this node at the given time. Caller will pass the time to stamp; in production this would normally be System.currentTimeMillis().
      Parameters:
      time - the time in millis to write as the heartbeat.
    • getLastHeartbeatTime

      @Nullable Long getLastHeartbeatTime(@NotNull @NotNull String nodeId)
      Returns the last time a heartbeat was sent by the given node.

      A null value indicates no heartbeats have been sent by this node.

      Parameters:
      nodeId - the node
      Returns:
      the last time a heartbeat was sent by the given node.
    • findNodesWithHeartbeatsAfter

      @NotNull @NotNull Collection<String> findNodesWithHeartbeatsAfter(long time)
    • findNodesInfoWithHeartbeatsAfter

      @NotNull @NotNull List<BambooNodeInfo> findNodesInfoWithHeartbeatsAfter(long time)
      Get all nodes in the database together with their heartbeats in the time window specified by the time argument.
      Parameters:
      time - the time in millis specifying the time window for the query
      Returns:
      list of nodes
      Since:
      9.4.0
    • findAll

      Deprecated.
      since 9.4.0 use findAllNodesInfo()
      Get all heartbeats. The information about nodes' primary and alive attributes is not accurate.
    • findAllNodesInfo

      @NotNull @NotNull List<BambooNodeInfo> findAllNodesInfo()
      Get all present in the database nodes together with their heartbeats.
      Returns:
      list of nodes
      Since:
      9.4.0
    • deleteNode

      void deleteNode(@NotNull @NotNull String nodeId)
      Remove node by the given id.
      Since:
      9.4.0
    • ensureNodeHeartbeatTableExists

      void ensureNodeHeartbeatTableExists()
      Creates heartbeat table if required.