Package org.alfresco.solr.tracker
Class DateMonthRouter
- java.lang.Object
-
- org.alfresco.solr.tracker.DateMonthRouter
-
- All Implemented Interfaces:
DocRouter
public class DateMonthRouter extends java.lang.Object implements DocRouter
The date-based sharding assigns dates sequentially through shards based on the month. For example: If there are 12 shards, each month would be assigned sequentially to each shard, wrapping round and starting again for each year. The non-random assignment facilitates easier shard management - dropping shards or scaling out replication for some date range. Typical ageing strategies could be based on the created date or destruction date. Each shard contains copies of all the ACL information, so this information is replicated in each shard. However, if the property is not present on a node, sharding falls back to theDBIDRouterto randomly distribute these nodes. To use this method, when creating a shard add the new configuration properties:- shard.key=exif:dateTimeOriginal
- shard.method=DATE
- shard.instance=<shard.instance>
- shard.count=<shard.count>
- shard.date.grouping=3
- See Also:
- Search Services sharding methods
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description DateMonthRouter(java.lang.String groupparam)Creates a date month router
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getProperties(java.util.Optional<org.alfresco.service.namespace.QName> shardProperty)Get additional properties to "shardProperty" depending on the Shard Method.java.lang.BooleanrouteAcl(int numShards, int shardInstance, org.alfresco.solr.client.Acl acl)Checks if the incoming ACL document must be indexed on this shard.java.lang.BooleanrouteNode(int numShards, int shardInstance, org.alfresco.solr.client.Node node)Checks if the incoming Node must be indexed on this shard.
-
-
-
Method Detail
-
routeAcl
public java.lang.Boolean routeAcl(int numShards, int shardInstance, org.alfresco.solr.client.Acl acl)Description copied from interface:DocRouterChecks if the incoming ACL document must be indexed on this shard.
-
routeNode
public java.lang.Boolean routeNode(int numShards, int shardInstance, org.alfresco.solr.client.Node node)Description copied from interface:DocRouterChecks if the incoming Node must be indexed on this shard.- Specified by:
routeNodein interfaceDocRouter- Parameters:
numShards- 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 java.util.Map<java.lang.String,java.lang.String> getProperties(java.util.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
-
-