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_PARAMS
Optional parameters for creating a category routed alias excluding parameters for collection creation.static Set<String>
REQUIRED_ROUTER_PARAMS
Parameters required for creating a category routed aliasstatic String
ROUTER_MAX_CARDINALITY
static String
ROUTER_MUST_MATCH
static String
UNINITIALIZED
-
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 String
computeInitialCollectionName()
Create the initial collection for this RoutedAlias if applicable.String
createCollectionsIfRequired(AddUpdateCommand cmd)
Method to possibly create a collection.Map<String,String>
getAliasMetadata()
String
getAliasName()
The name of the alias.Set<String>
getOptionalParams()
Set<String>
getRequiredParams()
String
getRouteField()
boolean
updateParsedCollectionAliases(ZkController zkController)
Ensure our parsed version of the alias collection list is up to date.void
validateRouteValue(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:RoutedAlias
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.- Specified by:
updateParsedCollectionAliases
in interfaceRoutedAlias
-
getAliasName
public String getAliasName()
Description copied from interface:RoutedAlias
The name of the alias. This name is used in place of a collection name for both queries and updates.- Specified by:
getAliasName
in interfaceRoutedAlias
- Returns:
- The name of the Alias.
-
getRouteField
public String getRouteField()
- Specified by:
getRouteField
in interfaceRoutedAlias
-
validateRouteValue
public void validateRouteValue(AddUpdateCommand cmd) throws SolrException
Description copied from interface:RoutedAlias
Check that the value we will be routing on is legal for this type of routed alias.- Specified by:
validateRouteValue
in 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:
createCollectionsIfRequired
in 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:RoutedAlias
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.- Specified by:
computeInitialCollectionName
in interfaceRoutedAlias
- Returns:
- optional string of initial collection name
-
getAliasMetadata
public Map<String,String> getAliasMetadata()
- Specified by:
getAliasMetadata
in interfaceRoutedAlias
- Returns:
- get alias related metadata
-
getRequiredParams
public Set<String> getRequiredParams()
- Specified by:
getRequiredParams
in interfaceRoutedAlias
-
getOptionalParams
public Set<String> getOptionalParams()
- Specified by:
getOptionalParams
in interfaceRoutedAlias
-
-