Package org.alfresco.solr.tracker
Class ExplicitShardIdWithDynamicPropertyRouter
java.lang.Object
org.alfresco.solr.tracker.ComposableDocRouter
org.alfresco.solr.tracker.ExplicitShardIdWithDynamicPropertyRouter
- All Implemented Interfaces:
DocRouter
Routes a document only if the shardInstance matches the provided shardId.
The access control information is duplicated in each shard.
The target shard identifier is provided using a (configurable) property of the incoming document.
- Author:
- agazzarini
- See Also:
-
Field Summary
Fields inherited from class org.alfresco.solr.tracker.ComposableDocRouter
logger -
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.Methods inherited from class org.alfresco.solr.tracker.ComposableDocRouter
debug, negativeReturnValue
-
Constructor Details
-
ExplicitShardIdWithDynamicPropertyRouter
public ExplicitShardIdWithDynamicPropertyRouter() -
ExplicitShardIdWithDynamicPropertyRouter
public ExplicitShardIdWithDynamicPropertyRouter(boolean isInStandaloneMode)
-
-
Method Details
-
routeAcl
Description copied from interface:DocRouterChecks 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
Description copied from interface:DocRouterChecks 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
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.- Parameters:
shardProperty- custom property used to configure the Router. Note not all routers need that.- Returns:
- pair of key, value
-