Interface RoutedAlias

    • Method Detail

      • newAliasMustExistException

        static SolrException newAliasMustExistException​(String aliasName)
      • fromProps

        static RoutedAlias fromProps​(String aliasName,
                                     Map<String,​String> props)
                              throws SolrException
        Factory method for implementations of this interface. There should be no reason to construct instances elsewhere, and routed alias types are encouraged to have package private constructors.
        Parameters:
        aliasName - The alias name (will be returned by getAliasName()
        props - The properties from an overseer message.
        Returns:
        An implementation appropriate for the supplied properties, or null if no type is specified.
        Throws:
        SolrException - If the properties are invalid or the router type is unknown.
      • updateParsedCollectionAliases

        boolean updateParsedCollectionAliases​(ZkController zkController)
        Ensure our parsed version of the alias collection list is up to date. If it was modified, return true. Note that this will return true if some other alias was modified or if properties were modified. These are spurious and the caller should be written to be tolerant of no material changes.
      • computeInitialCollectionName

        String computeInitialCollectionName()
        Create the initial collection for this RoutedAlias if applicable. Routed Aliases do not aggregate existing collections, instead they create collections on the fly. If the initial collection can be determined from initialization parameters it should be calculated here.
        Returns:
        optional string of initial collection name
      • getAliasName

        String getAliasName()
        The name of the alias. This name is used in place of a collection name for both queries and updates.
        Returns:
        The name of the Alias.
      • getRouteField

        String getRouteField()
      • validateRouteValue

        void validateRouteValue​(AddUpdateCommand cmd)
                         throws SolrException
        Check that the value we will be routing on is legal for this type of routed alias.
        Parameters:
        cmd - the command containing the document
        Throws:
        SolrException
      • createCollectionsIfRequired

        String createCollectionsIfRequired​(AddUpdateCommand cmd)
        Create any required collections and return the name of the collection to which the current document should be sent.
        Parameters:
        cmd - The command that might cause collection creation
        Returns:
        The name of the proper destination collection for the document which may or may not be a newly created collection
      • getAliasMetadata

        Map<String,​String> getAliasMetadata()
        Returns:
        get alias related metadata
      • getRequiredParams

        Set<String> getRequiredParams()
      • getOptionalParams

        Set<String> getOptionalParams()