Class ClustersStatus

  • All Implemented Interfaces:
    com.yahoo.component.Component, java.lang.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

      Nested Classes 
      Modifier and Type Class Description
      static class  ClustersStatus.Require  
    • Field Summary

      • Fields inherited from class com.yahoo.component.AbstractComponent

        isDeconstructable
    • Constructor Summary

      Constructors 
      Constructor Description
      ClustersStatus()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean containerShouldReceiveTraffic()
      Deprecated.
      boolean containerShouldReceiveTraffic​(ClustersStatus.Require require)
      Returns whether this container should receive traffic based on the state of this
      void setClusters​(java.util.Set<java.lang.String> clusters)
      Sets the current clusters of this container
      void setDown​(java.lang.Object clusterIdentifier)
      Deprecated.
      use setDown(String) instead
      void setReceiveTrafficByDefault​(boolean receiveTrafficByDefault)
      Deprecated.
      this is ignored
      void setUp​(java.lang.Object clusterIdentifier)
      Deprecated.
      use setUp(String) instead
      • Methods inherited from class com.yahoo.component.AbstractComponent

        clone, compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable, toString
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ClustersStatus

        @Inject
        public ClustersStatus()
    • Method Detail

      • setClusters

        public void setClusters​(java.util.Set<java.lang.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​(java.lang.Object clusterIdentifier)
        Deprecated.
        use setUp(String) instead
      • setDown

        @Deprecated
        public void setDown​(java.lang.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.