Class DBIDRouter

java.lang.Object
org.alfresco.solr.tracker.DBIDRouter
All Implemented Interfaces:
DocRouter

public class DBIDRouter extends Object implements DocRouter
DBID murmur hash based document router. This method is available in Alfresco Search Services 1.0 and later versions and is the default sharding option in Solr 6. Nodes are evenly distributed over the shards at random based on the murmur hash of the DBID. The access control information is duplicated in each shard. The distribution of nodes over each shard is very even and shards grow at the same rate. Also, this is the fall back method if any other sharding information is unavailable. To use this method, when creating a shard add a new configuration property:
  • shard.method=DB_ID
  • shard.instance=<shard.instance>
  • shard.count=<shard.count>
Author:
Joel
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.alfresco.solr.tracker.DocRouter

    getProperties
  • Constructor Details

    • DBIDRouter

      public DBIDRouter()
  • Method Details

    • routeAcl

      public 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.
      Specified by:
      routeAcl in interface DocRouter
      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 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.
      Specified by:
      routeNode in interface DocRouter
      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.