Class ExplicitShardIdWithStaticPropertyRouter

  • All Implemented Interfaces:
    DocRouter

    public class ExplicitShardIdWithStaticPropertyRouter
    extends ComposableDocRouter
    Routes the incoming nodes (not ACLs!) on the shard explicitly indicated in Node.getExplicitShardId() method. The access control information is duplicated in each shard.


    WARNING: This is an experimental feature that is subject to change. The current known issues are:

    • Incompatibility with the "Purge" action on the Alfresco Admin Console
    • Incompatibility with the "Purge on Startup" option on the Alfresco Admin Console
    As a result, when this router is used and the purge action is invoked you may experience a wrong shard subscription registration order. That would cause a wrong distribution of the indexed data across the cluster. Note that if "Purge on restart" option on the Admin Console is checked by default, then before building a Solr cluster which uses this router, please make sure the check has been disabled.

    Since:
    1.4
    Author:
    Elia, agazzarini
    • Constructor Detail

      • ExplicitShardIdWithStaticPropertyRouter

        public ExplicitShardIdWithStaticPropertyRouter()
      • ExplicitShardIdWithStaticPropertyRouter

        public ExplicitShardIdWithStaticPropertyRouter​(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.