Class DocumentRouteSelectorPolicy

  • All Implemented Interfaces:
    com.yahoo.config.subscription.ConfigSubscriber.SingleSubscriber<DocumentrouteselectorpolicyConfig>, DocumentProtocolRoutingPolicy, com.yahoo.messagebus.routing.RoutingPolicy

    public class DocumentRouteSelectorPolicy
    extends java.lang.Object
    implements DocumentProtocolRoutingPolicy, com.yahoo.config.subscription.ConfigSubscriber.SingleSubscriber<DocumentrouteselectorpolicyConfig>
    This policy is responsible for selecting among the given recipient routes according to the configured document selection properties. To facilitate this the "routing" plugin in the vespa model builds a mapping from the route names to a document selector and a feed name of every search cluster. This can very well be extended to include storage at a later time.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentRouteSelectorPolicy​(java.lang.String configId)
      This policy is constructed with a configuration identifier that can be subscribed to for the document selector config.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure​(DocumentrouteselectorpolicyConfig cfg)
      This method is called when configuration arrives from the config server.
      void destroy()  
      java.lang.String getError()
      This is a safety mechanism to allow the constructor to fail and signal that it can not be used.
      void merge​(com.yahoo.messagebus.routing.RoutingContext context)  
      void select​(com.yahoo.messagebus.routing.RoutingContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocumentRouteSelectorPolicy

        public DocumentRouteSelectorPolicy​(java.lang.String configId)
        This policy is constructed with a configuration identifier that can be subscribed to for the document selector config. If the string is either null or empty it will default to the proper one.
        Parameters:
        configId - The configuration identifier to subscribe to.
    • Method Detail

      • getError

        public java.lang.String getError()
        This is a safety mechanism to allow the constructor to fail and signal that it can not be used.
        Returns:
        The error string, or null if no error.
      • configure

        public void configure​(DocumentrouteselectorpolicyConfig cfg)
        This method is called when configuration arrives from the config server. The received config object is traversed and a local map is constructed and swapped with the current config map.
        Specified by:
        configure in interface com.yahoo.config.subscription.ConfigSubscriber.SingleSubscriber<DocumentrouteselectorpolicyConfig>
        Parameters:
        cfg - The configuration object given by subscription.
      • select

        public void select​(com.yahoo.messagebus.routing.RoutingContext context)
        Specified by:
        select in interface com.yahoo.messagebus.routing.RoutingPolicy
      • merge

        public void merge​(com.yahoo.messagebus.routing.RoutingContext context)
        Specified by:
        merge in interface com.yahoo.messagebus.routing.RoutingPolicy
      • destroy

        public void destroy()
        Specified by:
        destroy in interface com.yahoo.messagebus.routing.RoutingPolicy