Package com.yahoo.search.query.context
Class QueryContext
java.lang.Object
com.yahoo.search.query.context.QueryContext
- All Implemented Interfaces:
Cloneable
A proxy to the Execution.trace() which exists for legacy reasons.
Calls to this is forwarded to owningQuery.getModel().getExecution().trace().
- Author:
- Steinar Knutsen, bratseth
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
getProperty
(String name) Returns a property set anywhere in this context.com.yahoo.processing.execution.Execution.Trace
getTrace()
Returns the execution trace this delegates tovoid
Adds a key-value which will be logged to the access log for this query (by doing toString() on the value).Iterator<com.yahoo.processing.execution.Execution.Trace.LogValue>
Returns the values to be written to the access log for thisboolean
void
setProperty
(String name, Object value) Adds a property key-value to this context.toString()
Returns a short string description of this (includes the first few messages only, and no newlines)void
void
Adds a context message to this context
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
QueryContext
-
-
Method Details
-
trace
Adds a context message to this context -
trace
-
logValue
Adds a key-value which will be logged to the access log for this query (by doing toString() on the value). Multiple values may be set to the same key. A value cannot be removed once set. -
logValueIterator
Returns the values to be written to the access log for this -
setProperty
Adds a property key-value to this context. If the same name is set multiple times, the behavior is thus:- Within a single context (thread/query clone), the last value set is used
- Across multiple traces, the last value from the last deepest nested thread/clone is used. In the case of multiple threads writing the value concurrently to their clone, it is of course undefined which one will be used.
- Parameters:
name
- the name of the propertyvalue
- the value of the property, or null to set this property to null
-
getProperty
Returns a property set anywhere in this context. Note that even though this call is itself "thread robust", the object values returned may in some scenarios not be written behind a synchronization barrier, so when accessing objects which are not inherently thread safe, synchronization should be considered.Note that this method have a time complexity which is proportional to the number of cloned/created queries times the average number of properties in each.
-
toString
Returns a short string description of this (includes the first few messages only, and no newlines) -
render
- Throws:
IOException
-
cloneFor
-
getTrace
public com.yahoo.processing.execution.Execution.Trace getTrace()Returns the execution trace this delegates to -
clone
-