Class RedisBackedGridModel
java.lang.Object
org.openqa.selenium.grid.distributor.GridModel
org.openqa.selenium.grid.distributor.redis.RedisBackedGridModel
Redis-backed implementation of
GridModel. All grid state is stored in Redis, enabling
multiple Distributor replicas to share a consistent view of the grid without any JVM-local state.
Key schema:
grid:node:{nodeId}:status— JSON-serializedNodeStatusgrid:nodes:UP / DOWN / DRAINING— Redisson RSet of NodeId stringsgrid:node:{nodeId}:lastTouch— epoch-millis of last heartbeatgrid:node:{nodeId}:healthFailCount— consecutive failure countgrid:slot:{nodeId}:{slotUUID}:session—"RESERVED"or JSON(Session)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(NodeStatus node) Adds a node to the grid model, typically starting with DOWN availability until health checks pass.Gets a snapshot of all node statuses currently in the grid model.voidRemoves nodes that have been unresponsive for too long.voidrefresh(NodeStatus status) Refreshes a node's status in the grid model.voidReleases a session, making its slot available again.voidRemoves a node from the grid model.booleanAttempts to reserve a specific slot on a node.voidsetAvailability(NodeId id, Availability availability) Sets the availability status for a node.voidsetSession(SlotId slotId, @Nullable Session session) Updates a reserved slot to contain an actual session.voidtouch(NodeStatus nodeStatus) Updates the timestamp for a node to prevent it from being considered stale.voidupdateHealthCheckCount(NodeId id, Availability availability) Updates the health check count for a node based on its availability.
-
Constructor Details
-
RedisBackedGridModel
-
-
Method Details
-
add
Description copied from class:GridModelAdds a node to the grid model, typically starting with DOWN availability until health checks pass. -
refresh
Description copied from class:GridModelRefreshes a node's status in the grid model. -
touch
Description copied from class:GridModelUpdates the timestamp for a node to prevent it from being considered stale. May also update the node's availability if reported differently. -
remove
-
purgeDeadNodes
public void purgeDeadNodes()Description copied from class:GridModelRemoves nodes that have been unresponsive for too long.- Specified by:
purgeDeadNodesin classGridModel
-
setAvailability
Description copied from class:GridModelSets the availability status for a node.- Specified by:
setAvailabilityin classGridModel- Parameters:
id- The ID of the nodeavailability- The new availability status
-
reserve
-
getSnapshot
Description copied from class:GridModelGets a snapshot of all node statuses currently in the grid model.- Specified by:
getSnapshotin classGridModel- Returns:
- A set of node statuses
-
release
-
setSession
Description copied from class:GridModelUpdates a reserved slot to contain an actual session.- Specified by:
setSessionin classGridModel- Parameters:
slotId- The ID of the slot to updatesession- The session to associate with the slot, or null to clear
-
updateHealthCheckCount
Description copied from class:GridModelUpdates the health check count for a node based on its availability.- Specified by:
updateHealthCheckCountin classGridModel- Parameters:
id- The ID of the nodeavailability- The current availability status
-