Class 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
    • Field Summary

      • Fields inherited from class com.yahoo.component.AbstractComponent

        isDeconstructable
    • 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 profile
      DimensionalMap<java.lang.Object> getReferences()
      Returns the references reachable from this, or an empty map (never null) if none
      CompiledQueryProfileRegistry 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 type
      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
      DimensionalMap<QueryProfileType> getTypes()
      Returns the types reachable from this, or an empty map (never null) if none
      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.
      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()  
      • Methods inherited from class com.yahoo.component.AbstractComponent

        compareTo, deconstruct, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 check
        context - 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
      • 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)
      • clone

        public CompiledQueryProfile clone()
        Overrides:
        clone in class com.yahoo.component.AbstractComponent
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.yahoo.component.AbstractComponent