Package com.yahoo.container.handler
Class ClustersStatus
java.lang.Object
com.yahoo.component.AbstractComponent
com.yahoo.container.handler.ClustersStatus
- All Implemented Interfaces:
com.yahoo.component.Component
,com.yahoo.component.Deconstructable
,Comparable<com.yahoo.component.Component>
public class ClustersStatus
extends com.yahoo.component.AbstractComponent
A component which tracks the up/down status of any clusters which should influence
the up down status of this container itself, as well as the separate fact (from config)
that such clusters are present. This is a separate fact because we might know we have clusters configured,
but we don't have positive information that they are up yet, and in this case we should be down.
This is a separate component which has no dependencies such that the status tracked in this
will survive reconfiguration events and inform other components even immediately after a reconfiguration
(where the true statue of clusters may not yet be available).
This is multithread safe.
- Author:
- bratseth
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.yahoo.component.AbstractComponent
isDeconstructable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this container should receive traffic based on the state of thisvoid
setClusters
(Set<String> clusters) Sets the current clusters of this containerMethods inherited from class com.yahoo.component.AbstractComponent
clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
-
Constructor Details
-
ClustersStatus
@Inject public ClustersStatus()
-
-
Method Details
-
setClusters
Sets the current clusters of this container -
containerShouldReceiveTraffic
Returns whether this container should receive traffic based on the state of this- Parameters:
require
- requirement for being up, ALL or ONE.
-