Class CompiledQueryProfile
- java.lang.Object
-
- com.yahoo.component.AbstractComponent
-
- com.yahoo.search.query.profile.compiled.CompiledQueryProfile
-
- All Implemented Interfaces:
com.yahoo.component.Component
,com.yahoo.component.Deconstructable
,java.lang.Cloneable
,java.lang.Comparable<com.yahoo.component.Component>
public class CompiledQueryProfile extends com.yahoo.component.AbstractComponent implements java.lang.Cloneable
A query profile in a state where it is optimized for fast lookups.- Author:
- bratseth
-
-
Constructor Summary
Constructors Constructor Description CompiledQueryProfile(com.yahoo.component.ComponentId id, QueryProfileType type, DimensionalMap<ValueWithSource> entries, DimensionalMap<QueryProfileType> types, DimensionalMap<java.lang.Object> references, DimensionalMap<java.lang.Object> unoverridables, CompiledQueryProfileRegistry registry)
Creates a new query profile from an id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompiledQueryProfile
clone()
java.lang.Object
get(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
java.lang.Object
get(java.lang.String name)
java.lang.Object
get(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> context)
java.lang.Object
get(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
DimensionalMap<ValueWithSource>
getEntries()
Returns all the entries from the profileDimensionalMap<java.lang.Object>
getReferences()
Returns the references reachable from this, or an empty map (never null) if noneCompiledQueryProfileRegistry
getRegistry()
Returns the registry this belongs to, or null if none (in which case runtime profile reference assignment won't work)QueryProfileType
getType()
Returns the type of this or null if it has no typeQueryProfileType
getType(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context)
Returns the type of a given prefix reachable from this profile, or null if noneDimensionalMap<QueryProfileType>
getTypes()
Returns the types reachable from this, or an empty map (never null) if noneboolean
isOverridable(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context)
Returns whether or not the given field name can be overridden at runtime.java.util.Map<java.lang.String,java.lang.Object>
listValues(com.yahoo.processing.request.CompoundName prefix)
Return all objects that start with the given prefix path using no context.java.util.Map<java.lang.String,java.lang.Object>
listValues(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context)
Return all objects that start with the given prefix path.java.util.Map<java.lang.String,java.lang.Object>
listValues(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
Adds all objects that start with the given path prefix to the given value map.java.util.Map<java.lang.String,java.lang.Object>
listValues(java.lang.String prefix)
java.util.Map<java.lang.String,java.lang.Object>
listValues(java.lang.String prefix, java.util.Map<java.lang.String,java.lang.String> context)
Return all objects that start with the given prefix path.java.util.Map<java.lang.String,ValueWithSource>
listValuesWithSources(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
java.lang.String
toString()
-
-
-
Constructor Detail
-
CompiledQueryProfile
public CompiledQueryProfile(com.yahoo.component.ComponentId id, QueryProfileType type, DimensionalMap<ValueWithSource> entries, DimensionalMap<QueryProfileType> types, DimensionalMap<java.lang.Object> references, DimensionalMap<java.lang.Object> unoverridables, CompiledQueryProfileRegistry registry)
Creates a new query profile from an id.
-
-
Method Detail
-
getRegistry
public CompiledQueryProfileRegistry getRegistry()
Returns the registry this belongs to, or null if none (in which case runtime profile reference assignment won't work)
-
getType
public QueryProfileType getType()
Returns the type of this or null if it has no type
-
isOverridable
public final boolean isOverridable(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context)
Returns whether or not the given field name can be overridden at runtime. Attempts to override values which cannot be overridden will not fail but be ignored. Default: true.- Parameters:
name
- the name of the field to checkcontext
- the context in which to check, or null if none
-
getType
public final QueryProfileType getType(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context)
Returns the type of a given prefix reachable from this profile, or null if none
-
getTypes
public DimensionalMap<QueryProfileType> getTypes()
Returns the types reachable from this, or an empty map (never null) if none
-
getReferences
public DimensionalMap<java.lang.Object> getReferences()
Returns the references reachable from this, or an empty map (never null) if none
-
listValues
public final java.util.Map<java.lang.String,java.lang.Object> listValues(com.yahoo.processing.request.CompoundName prefix)
Return all objects that start with the given prefix path using no context. Use "" to list all.For example, if {a.d => "a.d-value" ,a.e => "a.e-value", b.d => "b.d-value", then calling listValues("a") will return {"d" => "a.d-value","e" => "a.e-value"}
-
listValues
public final java.util.Map<java.lang.String,java.lang.Object> listValues(java.lang.String prefix)
-
listValues
public final java.util.Map<java.lang.String,java.lang.Object> listValues(java.lang.String prefix, java.util.Map<java.lang.String,java.lang.String> context)
Return all objects that start with the given prefix path. Use "" to list all.For example, if {a.d => "a.d-value" ,a.e => "a.e-value", b.d => "b.d-value", then calling listValues("a") will return {"d" => "a.d-value","e" => "a.e-value"}
-
listValues
public final java.util.Map<java.lang.String,java.lang.Object> listValues(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context)
Return all objects that start with the given prefix path. Use "" to list all.For example, if {a.d => "a.d-value" ,a.e => "a.e-value", b.d => "b.d-value", then calling listValues("a") will return {"d" => "a.d-value","e" => "a.e-value"}
-
listValues
public java.util.Map<java.lang.String,java.lang.Object> listValues(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
Adds all objects that start with the given path prefix to the given value map. Use "" to list all.For example, if {a.d => "a.d-value" ,a.e => "a.e-value", b.d => "b.d-value", then calling listValues("a") will return {"d" => "a.d-value","e" => "a.e-value"}
-
listValuesWithSources
public java.util.Map<java.lang.String,ValueWithSource> listValuesWithSources(com.yahoo.processing.request.CompoundName prefix, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
-
get
public final java.lang.Object get(java.lang.String name)
-
get
public final java.lang.Object get(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> context)
-
get
public final java.lang.Object get(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
-
get
public final java.lang.Object get(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,java.lang.String> context, com.yahoo.processing.request.Properties substitution)
-
getEntries
public final DimensionalMap<ValueWithSource> getEntries()
Returns all the entries from the profile
-
clone
public CompiledQueryProfile clone()
- Overrides:
clone
in classcom.yahoo.component.AbstractComponent
-
toString
public java.lang.String toString()
- Overrides:
toString
in classcom.yahoo.component.AbstractComponent
-
-