Package org.alfresco.solr.tracker
Interface DocRouter
-
- All Known Implementing Classes:
ACLIDModRouter,ACLIDMurmurRouter,ComposableDocRouter,DateMonthRouter,DateQuarterRouter,DBIDRangeRouter,DBIDRouter,DocRouterWithFallback,ExplicitShardIdWithDynamicPropertyRouter,ExplicitShardIdWithStaticPropertyRouter,PropertyRouter
public interface DocRouterDefines the logic used for distributing data across the shards. ADocRouterimplementor instance is properly configured on each shard. Each time an incoming document D arrives to the shard S, the DocRouter (on the S instance) will be used for deciding if D needs to be managed (i.e. indexed) by S. TheDocRoutercontract requires a concrete implementor to provide the logic for understanding:- If an incoming ACL belongs to the receiving shard or not
- If an incoming Node belongs to the receiving shard or not
- Author:
- Joel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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 shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)Checks if the incoming ACL document must be indexed on this shard.java.lang.BooleanrouteNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node)Checks if the incoming Node must be indexed on this shard.
-
-
-
Method Detail
-
routeAcl
java.lang.Boolean routeAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)Checks if the incoming ACL document must be indexed on this shard.- Parameters:
shardCount- the total shard count.shardInstance- the owning shard instance (i.e. instance number).acl- the ACL.- Returns:
- true if the ACL must be indexed in the shard which owns this
DocRouterinstance, false otherwise.
-
routeNode
java.lang.Boolean routeNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node)Checks if the incoming Node must be indexed on this shard.- 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
default 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.- Parameters:
shardProperty- custom property used to configure the Router. Note not all routers need that.- Returns:
- pair of key, value
-
-