bulk select data for RuleEngine

XMLWordPrintable

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor
    • 5.18.0, 4.18.0
    • Affects Version/s: None
    • Component/s: None
    • None

      indexData() causes individual queries which is slow when there are a lot of rules.

      e.g. try to find what queries are individual and bulk fetch them in advance

        private void indexData() { 
          this.ruleCheckIndex = new HashMap<RuleCheck, Set<RuleDefinition>>();
          
          // loop through rules and get stems to bulk select
          Set<String> stemNames = new HashSet<String>();
          Set<String> stemIds = new HashSet<String>();
          for (RuleDefinition ruleDefinition : GrouperUtil.nonNull(this.ruleDefinitions)) {
            String stemName = ruleDefinition.getCheck().getCheckOwnerName();
            String stemId = ruleDefinition.getCheck().getCheckOwnerId();
            if (!StringUtils.isBlank(stemName) && stemName.contains(":")) {
              stemNames.add(stemName);
            }
            if (!StringUtils.isBlank(stemId)) {
              stemIds.add(stemId);
            }
          }
          // look up stems in batches by names then by ids to populate the cache
      
      

            Assignee:
            Vivek Sachdeva
            Reporter:
            Chris Hyzer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: