Class RoutedAlias
java.lang.Object
org.apache.solr.cloud.api.collections.RoutedAlias
- Direct Known Subclasses:
CategoryRoutedAlias,DimensionalRoutedAlias,TimeRoutedAlias
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract List<RoutedAlias.Action> calculateActions(String targetCol) Determine the combination of adds/deletes implied by the arrival of a document destined for the specified collection.Create any required collections and return the name of the collection to which the current document should be sent.static RoutedAliasFactory method for implementations of this interface.abstract StringThe name of the alias.protected abstract StringCalculate the head collection (i.e.static org.apache.solr.common.SolrExceptionnewAliasMustExistException(String aliasName) abstract booleanupdateParsedCollectionAliases(org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean conextualize) Ensure our parsed version of the alias collection list is up to date.abstract voidCheck that the value we will be routing on is legal for this type of routed alias.
-
Field Details
-
ROUTER_TYPE_NAME
- See Also:
-
ROUTER_FIELD
- See Also:
-
CREATE_COLLECTION_PREFIX
- See Also:
-
MINIMAL_REQUIRED_PARAMS
-
ROUTED_ALIAS_NAME_CORE_PROP
- See Also:
-
DIMENSIONAL
- See Also:
-
TIME
- See Also:
-
CATEGORY
- See Also:
-
-
Constructor Details
-
RoutedAlias
public RoutedAlias()
-
-
Method Details
-
newAliasMustExistException
-
fromProps
public static RoutedAlias fromProps(String aliasName, Map<String, String> props) throws org.apache.solr.common.SolrExceptionFactory 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 bygetAliasName()props- The properties from an overseer message.- Returns:
- An implementation appropriate for the supplied properties, or null if no type is specified.
- Throws:
org.apache.solr.common.SolrException- If the properties are invalid or the router type is unknown.
-
updateParsedCollectionAliases
public abstract boolean updateParsedCollectionAliases(org.apache.solr.common.cloud.ZkStateReader zkStateReader, boolean conextualize) 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. -
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.
-
validateRouteValue
public abstract void validateRouteValue(AddUpdateCommand cmd) throws org.apache.solr.common.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:
org.apache.solr.common.SolrException
-
createCollectionsIfRequired
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
-
getRequiredParams
-
getOptionalParams
-
getHeadCollectionIfOrdered
Calculate the head collection (i.e. the most recent one for a TRA) if this routed alias has an implicit order, or if the collection is unordered return the appropriate collection name for the value in the current document. This method should never return null. -
calculateActions
Determine the combination of adds/deletes implied by the arrival of a document destined for the specified collection.- Parameters:
targetCol- the collection for which a document is destined.- Returns:
- A list of actions across the DRA.
-