Class DBIDRangeRouter

  • All Implemented Interfaces:
    DocRouter

    public class DBIDRangeRouter
    extends Object
    implements DocRouter
    This routes documents within specific DBID ranges to specific shards. It adds new shards to the cluster without requiring a reindex. The access control information is duplicated in each shard. DBID range sharding is the only option to offer auto-scaling as opposed to defining your exact shard count at the start. All the other sharding methods require repartitioning in some way. For each shard, you specify the range of DBIDs to be included. As your repository grows you can add shards. To use this method, when creating a shard add a new configuration property:
    • shard.method=DB_ID_RANGE
    • shard.range=0-20000000
    • shard.instance=<shard.instance>
    Author:
    joel
    See Also:
    Search Services sharding methods
    • Constructor Detail

      • DBIDRangeRouter

        public DBIDRangeRouter​(long startRange,
                               long endRange)
    • Method Detail

      • setEndRange

        public void setEndRange​(long endRange)
      • setExpanded

        public void setExpanded​(boolean expanded)
      • setInitialized

        public void setInitialized​(boolean initialized)
      • getInitialized

        public boolean getInitialized()
      • getEndRange

        public long getEndRange()
      • getStartRange

        public long getStartRange()
      • getExpanded

        public boolean getExpanded()
      • 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.
      • getProperties

        public Map<String,​String> getProperties​(Optional<org.alfresco.service.namespace.QName> shardProperty)
        Description copied from interface: DocRouter
        Get additional properties to "shardProperty" depending on the Shard Method.
        Specified by:
        getProperties in interface DocRouter
        Parameters:
        shardProperty - custom property used to configure the Router. Note not all routers need that.
        Returns:
        pair of key, value