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

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields inherited from class com.yahoo.component.AbstractComponent

    isDeconstructable
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
    boolean
    Returns whether this container should receive traffic based on the state of this
    void
    setClusters(Set<String> clusters)
    Sets the current clusters of this container
    void
    setDown(Object clusterIdentifier)
    Deprecated.
    use setDown(String) instead
    void
    setReceiveTrafficByDefault(boolean receiveTrafficByDefault)
    Deprecated.
    this is ignored
    void
    setUp(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 Details

    • ClustersStatus

      @Inject public ClustersStatus()
  • Method Details

    • 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.