Class CircuitBreaker

    • Constructor Detail

      • CircuitBreaker

        public CircuitBreaker()
    • Method Detail

      • init

        public void init​(org.apache.solr.common.util.NamedList<?> args)
        Description copied from interface: NamedListInitializedPlugin
        init will be called just once, immediately after creation.

        Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself

        Specified by:
        init in interface NamedListInitializedPlugin
        args - non-null list of initialization parameters (may be empty)
      • isTripped

        public abstract boolean isTripped()
        Check if circuit breaker is tripped.
      • getErrorMessage

        public abstract String getErrorMessage()
        Get error message when the circuit breaker triggers
      • setRequestTypes

        public void setRequestTypes​(List<String> requestTypes)
        Set the request types for which this circuit breaker should be checked. If not called, the circuit breaker will be checked for the SolrRequest.SolrRequestType.QUERY request type only.
        requestTypes - list of strings representing request types
        IllegalArgumentException - if the request type is not valid
      • getRequestTypes

        public Set<org.apache.solr.client.solrj.SolrRequest.SolrRequestType> getRequestTypes()
      • getErrorCode

        public static org.apache.solr.common.SolrException.ErrorCode getErrorCode​(List<CircuitBreaker> trippedCircuitBreakers)
        Remove in 10.0
        Return the proper error code to use in exception. For legacy use of CircuitBreaker we return 503 for backward compatibility, else return 429.