Class FederationOptions

java.lang.Object
com.yahoo.search.searchchain.model.federation.FederationOptions
All Implemented Interfaces:
Cloneable

public class FederationOptions extends Object implements Cloneable
Options for controlling federation to a single source. This is a value object.
Author:
Tony Vaagenes
  • Constructor Details

    • FederationOptions

      public FederationOptions(Boolean optional, Integer timeoutInMilliseconds, Boolean useByDefault)
      Creates a request with no separate requestTimeoutInMilliseconds
    • FederationOptions

      public FederationOptions(Boolean optional, Integer timeoutInMilliseconds, Integer requestTimeoutInMilliseconds, Boolean useByDefault)
      Creates a fully specified set of options
      Parameters:
      optional - whether this should be optional
      timeoutInMilliseconds - the max time to wait for a result from this source, or null to use the timeout of the query
      requestTimeoutInMilliseconds - the max time to allow this request to live, or null to make this the same as timeoutInMilliseconds. Setting this higher than timeoutInMilliseconds is useful to use queries to populate the cache of slow sources
      useByDefault - whether this should be invoked by default
    • FederationOptions

      public FederationOptions()
      Creates a set of default options: Mandatory, no timeout restriction and not used by default
  • Method Details

    • setOptional

      public FederationOptions setOptional(Boolean newOptional)
      Returns a set of options which are the same of this but with optional set to the given value
    • setTimeoutInMilliseconds

      public FederationOptions setTimeoutInMilliseconds(Integer newTimeoutInMilliseconds)
      Returns a set of options which are the same of this but with timeout set to the given value
    • setRequestTimeoutInMilliseconds

      public FederationOptions setRequestTimeoutInMilliseconds(Integer newRequestTimeoutInMilliseconds)
      Returns a set of options which are the same of this but with request timeout set to the given value
    • setUseByDefault

      public FederationOptions setUseByDefault(Boolean newUseByDefault)
      Returns a set of options which are the same of this but with default set to the given value
    • getOptional

      public boolean getOptional()
    • getTimeoutInMilliseconds

      public int getTimeoutInMilliseconds()
      Returns the amount of time we should wait for this target, or -1 to use default
    • getRequestTimeoutInMilliseconds

      public int getRequestTimeoutInMilliseconds()
      Returns the amount of time we should allow this target execution to run, or -1 to use default
    • getSearchChainExecutionTimeoutInMilliseconds

      public long getSearchChainExecutionTimeoutInMilliseconds(long queryTimeout)
    • getUseByDefault

      public boolean getUseByDefault()
    • inherit

      public FederationOptions inherit(FederationOptions parent)
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(FederationOptions other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object