Class 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
    • Constructor Detail

      • ClustersStatus

        @Inject
        public ClustersStatus()
    • Method Detail

      • setClusters

        public void setClusters​(Set<String> clusters)
        Sets the current clusters of this container
      • setReceiveTrafficByDefault

        @Deprecated
        public void setReceiveTrafficByDefault​(boolean receiveTrafficByDefault)
        Deprecated.
        this is ignored
      • setUp

        @Deprecated
        public void setUp​(Object clusterIdentifier)
        Deprecated.
        use setUp(String) instead
      • setDown

        @Deprecated
        public void setDown​(Object clusterIdentifier)
        Deprecated.
        use setDown(String) instead
      • containerShouldReceiveTraffic

        @Deprecated
        public boolean containerShouldReceiveTraffic()
        Deprecated.
      • containerShouldReceiveTraffic

        public boolean containerShouldReceiveTraffic​(ClustersStatus.Require require)
        Returns whether this container should receive traffic based on the state of this
        Parameters:
        require - requirement for being up, ALL or ONE.