Class CategoryRoutedAlias
- java.lang.Object
-
- org.apache.solr.cloud.api.collections.CategoryRoutedAlias
-
- All Implemented Interfaces:
RoutedAlias
public class CategoryRoutedAlias extends Object implements RoutedAlias
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.cloud.api.collections.RoutedAlias
RoutedAlias.SupportedRouterTypes
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>OPTIONAL_ROUTER_PARAMSOptional parameters for creating a category routed alias excluding parameters for collection creation.static Set<String>REQUIRED_ROUTER_PARAMSParameters required for creating a category routed aliasstatic StringROUTER_MAX_CARDINALITYstatic StringROUTER_MUST_MATCHstatic StringUNINITIALIZED-
Fields inherited from interface org.apache.solr.cloud.api.collections.RoutedAlias
CREATE_COLLECTION_PREFIX, MINIMAL_REQUIRED_PARAMS, ROUTED_ALIAS_NAME_CORE_PROP, ROUTER_FIELD, ROUTER_TYPE_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcomputeInitialCollectionName()Create the initial collection for this RoutedAlias if applicable.StringcreateCollectionsIfRequired(AddUpdateCommand cmd)Method to possibly create a collection.Map<String,String>getAliasMetadata()StringgetAliasName()The name of the alias.Set<String>getOptionalParams()Set<String>getRequiredParams()StringgetRouteField()booleanupdateParsedCollectionAliases(ZkController zkController)Ensure our parsed version of the alias collection list is up to date.voidvalidateRouteValue(AddUpdateCommand cmd)Check that the value we will be routing on is legal for this type of routed alias.
-
-
-
Field Detail
-
UNINITIALIZED
public static final String UNINITIALIZED
- See Also:
- Constant Field Values
-
ROUTER_MAX_CARDINALITY
public static final String ROUTER_MAX_CARDINALITY
- See Also:
- Constant Field Values
-
REQUIRED_ROUTER_PARAMS
public static final Set<String> REQUIRED_ROUTER_PARAMS
Parameters required for creating a category routed alias
-
ROUTER_MUST_MATCH
public static final String ROUTER_MUST_MATCH
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateParsedCollectionAliases
public boolean updateParsedCollectionAliases(ZkController zkController)
Description copied from interface:RoutedAliasEnsure 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.- Specified by:
updateParsedCollectionAliasesin interfaceRoutedAlias
-
getAliasName
public String getAliasName()
Description copied from interface:RoutedAliasThe name of the alias. This name is used in place of a collection name for both queries and updates.- Specified by:
getAliasNamein interfaceRoutedAlias- Returns:
- The name of the Alias.
-
getRouteField
public String getRouteField()
- Specified by:
getRouteFieldin interfaceRoutedAlias
-
validateRouteValue
public void validateRouteValue(AddUpdateCommand cmd) throws SolrException
Description copied from interface:RoutedAliasCheck that the value we will be routing on is legal for this type of routed alias.- Specified by:
validateRouteValuein interfaceRoutedAlias- Parameters:
cmd- the command containing the document- Throws:
SolrException
-
createCollectionsIfRequired
public String createCollectionsIfRequired(AddUpdateCommand cmd)
Method to possibly create a collection. It's possible that the collection will already have been created either by a prior invocation in this thread or another thread. This method is idempotent, multiple invocations are harmless.- Specified by:
createCollectionsIfRequiredin interfaceRoutedAlias- Parameters:
cmd- The command that might cause collection creation- Returns:
- the collection to which the the update should be directed, possibly a newly created collection.
-
computeInitialCollectionName
public String computeInitialCollectionName()
Description copied from interface:RoutedAliasCreate 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.- Specified by:
computeInitialCollectionNamein interfaceRoutedAlias- Returns:
- optional string of initial collection name
-
getAliasMetadata
public Map<String,String> getAliasMetadata()
- Specified by:
getAliasMetadatain interfaceRoutedAlias- Returns:
- get alias related metadata
-
getRequiredParams
public Set<String> getRequiredParams()
- Specified by:
getRequiredParamsin interfaceRoutedAlias
-
getOptionalParams
public Set<String> getOptionalParams()
- Specified by:
getOptionalParamsin interfaceRoutedAlias
-
-