Class FederationOptions
- java.lang.Object
-
- com.yahoo.search.searchchain.model.federation.FederationOptions
-
- All Implemented Interfaces:
java.lang.Cloneable
@Immutable public class FederationOptions extends java.lang.Object implements java.lang.Cloneable
Options for controlling federation to a single source. This is a value object.- Author:
- Tony Vaagenes
-
-
Constructor Summary
Constructors Constructor Description FederationOptions()
Creates a set of default options: Mandatory, no timeout restriction and not used by defaultFederationOptions(java.lang.Boolean optional, java.lang.Integer timeoutInMilliseconds, java.lang.Boolean useByDefault)
Creates a request with no separate requestTimeoutInMillisecondsFederationOptions(java.lang.Boolean optional, java.lang.Integer timeoutInMilliseconds, java.lang.Integer requestTimeoutInMilliseconds, java.lang.Boolean useByDefault)
Creates a fully specified set of options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(FederationOptions other)
boolean
equals(java.lang.Object other)
boolean
getOptional()
int
getRequestTimeoutInMilliseconds()
Returns the amount of time we should allow this target execution to run, or -1 to use defaultlong
getSearchChainExecutionTimeoutInMilliseconds(long queryTimeout)
int
getTimeoutInMilliseconds()
Returns the amount of time we should wait for this target, or -1 to use defaultboolean
getUseByDefault()
int
hashCode()
FederationOptions
inherit(FederationOptions parent)
FederationOptions
setOptional(java.lang.Boolean newOptional)
Returns a set of options which are the same of this but with optional set to the given valueFederationOptions
setRequestTimeoutInMilliseconds(java.lang.Integer newRequestTimeoutInMilliseconds)
Returns a set of options which are the same of this but with request timeout set to the given valueFederationOptions
setTimeoutInMilliseconds(java.lang.Integer newTimeoutInMilliseconds)
Returns a set of options which are the same of this but with timeout set to the given valueFederationOptions
setUseByDefault(java.lang.Boolean newUseByDefault)
Returns a set of options which are the same of this but with default set to the given valuejava.lang.String
toString()
-
-
-
Constructor Detail
-
FederationOptions
public FederationOptions(java.lang.Boolean optional, java.lang.Integer timeoutInMilliseconds, java.lang.Boolean useByDefault)
Creates a request with no separate requestTimeoutInMilliseconds
-
FederationOptions
public FederationOptions(java.lang.Boolean optional, java.lang.Integer timeoutInMilliseconds, java.lang.Integer requestTimeoutInMilliseconds, java.lang.Boolean useByDefault)
Creates a fully specified set of options- Parameters:
optional
- whether this should be optionaltimeoutInMilliseconds
- the max time to wait for a result from this source, or null to use the timeout of the queryrequestTimeoutInMilliseconds
- 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 sourcesuseByDefault
- 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 Detail
-
setOptional
public FederationOptions setOptional(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
equals
public boolean equals(FederationOptions other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-