Interface DocRouter

All Known Implementing Classes:
ACLIDModRouter, ACLIDMurmurRouter, ComposableDocRouter, DateMonthRouter, DateQuarterRouter, DBIDRangeRouter, DBIDRouter, DocRouterWithFallback, ExplicitShardIdWithDynamicPropertyRouter, ExplicitShardIdWithStaticPropertyRouter, PropertyRouter

public interface DocRouter
Defines the logic used for distributing data across the shards. A DocRouter implementor instance is properly configured on each shard. Each time an incoming document D arrives to the shard S, the DocRouter (on the S instance) will be used for deciding if D needs to be managed (i.e. indexed) by S. The DocRouter contract requires a concrete implementor to provide the logic for understanding:
    • If an incoming ACL belongs to the receiving shard or not
      If an incoming Node belongs to the receiving shard or not
  • Author:
    Joel
    • Method Summary

      Modifier and Type
      Method
      Description
      default Map<String,String>
      getProperties(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.
    • Method Details

      • routeAcl

        Boolean routeAcl(int shardCount, int shardInstance, org.alfresco.solr.client.Acl acl)
        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

        Boolean routeNode(int shardCount, int shardInstance, org.alfresco.solr.client.Node node)
        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

        default Map<String,String> getProperties(Optional<org.alfresco.service.namespace.QName> shardProperty)
        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