Github user cestella commented on a diff in the pull request:

    https://github.com/apache/metron/pull/947#discussion_r172870992
  
    --- Diff: 
metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/JoinBolt.java
 ---
    @@ -89,29 +91,25 @@ public void prepare(Map map, TopologyContext 
topologyContext, OutputCollector ou
         if (this.maxTimeRetain == null) {
           throw new IllegalStateException("maxTimeRetain must be specified");
         }
    -    loader = new CacheLoader<String, Map<String, Tuple>>() {
    -      @Override
    -      public Map<String, Tuple> load(String key) throws Exception {
    -        return new HashMap<>();
    -      }
    -    };
    -    cache = CacheBuilder.newBuilder().maximumSize(maxCacheSize)
    -            .expireAfterWrite(maxTimeRetain, 
TimeUnit.MINUTES).removalListener(new JoinRemoveListener())
    -            .build(loader);
    +    loader = s -> new HashMap<>();
    +    cache = Caffeine.newBuilder().maximumSize(maxCacheSize)
    +                         .expireAfterWrite(maxTimeRetain, TimeUnit.MINUTES)
    +                         .removalListener(new JoinRemoveListener())
    --- End diff --
    
    So, I believe this was intentionally done before this PR (I migrated this 
to the new caching strategy) and the idea is that if a removal is happening 
from the join cache under specific circumstances, we want to know about it 
because a message could be being dropped because the cache is being 
overwhelmed.  @merrimanr Can you chime in here on the rationale?


---

Reply via email to