Package com.linkedin.venice.router.api
Class VeniceHostHealth
- java.lang.Object
-
- com.linkedin.venice.router.api.VeniceHostHealth
-
- All Implemented Interfaces:
HostHealthMonitor<Instance>
public class VeniceHostHealth extends java.lang.Object implements HostHealthMonitor<Instance>
VeniceHostHealth
the aggregate statistics for HostHealthStats. It recomputes the aggregate metrics for the host healthiness of the cluster.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<java.lang.String>
unhealthyHosts
-
Constructor Summary
Constructors Constructor Description VeniceHostHealth(LiveInstanceMonitor liveInstanceMonitor, StorageNodeClient storageNodeClient, VeniceRouterConfig config, RouteHttpRequestStats routeHttpRequestStats, AggHostHealthStats aggHostHealthStats)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isHostHealthy(Instance instance, java.lang.String partitionName)
To check if a host is healthy/responsive.void
setHostAsHealthy(Instance hostname)
If the host is marked as unhealthy before, remove it from the unhealthy host set and log this status change.void
setHostAsUnhealthy(Instance instance)
Mark that something is wrong with an entire host and it should not be used for queries.
-
-
-
Constructor Detail
-
VeniceHostHealth
public VeniceHostHealth(LiveInstanceMonitor liveInstanceMonitor, StorageNodeClient storageNodeClient, VeniceRouterConfig config, RouteHttpRequestStats routeHttpRequestStats, AggHostHealthStats aggHostHealthStats)
-
-
Method Detail
-
setHostAsUnhealthy
public void setHostAsUnhealthy(Instance instance)
Mark that something is wrong with an entire host and it should not be used for queries.- Parameters:
instance
-
-
setHostAsHealthy
public void setHostAsHealthy(Instance hostname)
If the host is marked as unhealthy before, remove it from the unhealthy host set and log this status change.- Parameters:
hostname
-
-
isHostHealthy
public boolean isHostHealthy(Instance instance, java.lang.String partitionName)
Description copied from interface:HostHealthMonitor
To check if a host is healthy/responsive.- Specified by:
isHostHealthy
in interfaceHostHealthMonitor<Instance>
- Parameters:
instance
- the host name, including the service port- Returns:
- the host is healthy or not
-
-