Class ExplicitShardIdWithDynamicPropertyRouter

  • All Implemented Interfaces:
    DocRouter

    public class ExplicitShardIdWithDynamicPropertyRouter
    extends ComposableDocRouter
    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:
    Search Services sharding methods
    • 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.Boolean routeAcl​(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)
      Checks if the incoming ACL document must be indexed on this shard.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExplicitShardIdWithDynamicPropertyRouter

        public ExplicitShardIdWithDynamicPropertyRouter()
      • ExplicitShardIdWithDynamicPropertyRouter

        public ExplicitShardIdWithDynamicPropertyRouter​(boolean isInStandaloneMode)
    • Method Detail

      • routeAcl

        public java.lang.Boolean routeAcl​(int shardCount,
                                          int shardInstance,
                                          org.alfresco.solr.client.Acl acl)
        Description copied from interface: DocRouter
        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 DocRouter instance, false otherwise.
      • routeNode

        public java.lang.Boolean routeNode​(int shardCount,
                                           int shardInstance,
                                           org.alfresco.solr.client.Node node)
        Description copied from interface: DocRouter
        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 - the Node instance.
        Returns:
        true if the Node instance must be indexed in the shard which owns this DocRouter instance, 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: DocRouter
        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