Interface RoutedAlias
-
- All Known Implementing Classes:
CategoryRoutedAlias
,TimeRoutedAlias
public interface RoutedAlias
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RoutedAlias.SupportedRouterTypes
Types supported.
-
Field Summary
Fields Modifier and Type Field Description static String
CREATE_COLLECTION_PREFIX
static Set<String>
MINIMAL_REQUIRED_PARAMS
static String
ROUTED_ALIAS_NAME_CORE_PROP
static String
ROUTER_FIELD
static String
ROUTER_TYPE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description String
computeInitialCollectionName()
Create the initial collection for this RoutedAlias if applicable.String
createCollectionsIfRequired(AddUpdateCommand cmd)
Create any required collections and return the name of the collection to which the current document should be sent.static RoutedAlias
fromProps(String aliasName, Map<String,String> props)
Factory method for implementations of this interface.Map<String,String>
getAliasMetadata()
String
getAliasName()
The name of the alias.Set<String>
getOptionalParams()
Set<String>
getRequiredParams()
String
getRouteField()
static SolrException
newAliasMustExistException(String aliasName)
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
-
ROUTER_TYPE_NAME
static final String ROUTER_TYPE_NAME
- See Also:
- Constant Field Values
-
ROUTER_FIELD
static final String ROUTER_FIELD
- See Also:
- Constant Field Values
-
CREATE_COLLECTION_PREFIX
static final String CREATE_COLLECTION_PREFIX
- See Also:
- Constant Field Values
-
ROUTED_ALIAS_NAME_CORE_PROP
static final String ROUTED_ALIAS_NAME_CORE_PROP
- See Also:
- Constant Field Values
-
-
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 bygetAliasName()
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
-
-