Package org.alfresco.solr.tracker
Class PropertyRouter
java.lang.Object
org.alfresco.solr.tracker.PropertyRouter
- All Implemented Interfaces:
DocRouter
Routes based on a text property field.
In this method, the value of some property is hashed and this hash is used to assign the node to a random shard.
All nodes with the same property value will be assigned to the same shard.
Each shard will duplicate all the ACL information.
To use this method, when creating a shard add the new configuration properties:
- shard.key=cm:creator
- shard.method=PROPERTY
- shard.instance=<shard.instance>
- shard.count=<shard.count>
- shard.regex=^\d{4}
- Author:
- Gethin James
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProperties(Optional<org.alfresco.service.namespace.QName> shardProperty) Get additional properties to "shardProperty" depending on the Shard Method.routeAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl) Checks if the incoming ACL document must be indexed on this shard.routeNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node) Checks if the incoming Node must be indexed on this shard.
-
Constructor Details
-
PropertyRouter
-
-
Method Details
-
routeAcl
Description copied from interface:DocRouterChecks if the incoming ACL document must be indexed on this shard. -
routeNode
Description copied from interface:DocRouterChecks if the incoming Node must be indexed on this shard.- Specified by:
routeNodein interfaceDocRouter- Parameters:
shardCount- the total shard count.shardInstance- the owning shard instance (i.e. instance number).node- theNodeinstance.- Returns:
- true if the
Nodeinstance must be indexed in the shard which owns thisDocRouterinstance, false otherwise.
-
getProperties
public Map<String,String> getProperties(Optional<org.alfresco.service.namespace.QName> shardProperty) Description copied from interface:DocRouterGet additional properties to "shardProperty" depending on the Shard Method.- Specified by:
getPropertiesin interfaceDocRouter- Parameters:
shardProperty- custom property used to configure the Router. Note not all routers need that.- Returns:
- pair of key, value
-