[ 
https://issues.apache.org/jira/browse/METRON-1467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389653#comment-16389653
 ] 

ASF GitHub Bot commented on METRON-1467:
----------------------------------------

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

    https://github.com/apache/metron/pull/947#discussion_r172866140
  
    --- 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 --
    
    It seems like we only want notified of a full cache when ERROR logging is 
set. Is that the case? In the `JoinRemoveListener` we end up doing some work 
that we probably don't need to do unless ERROR logging is set.  One easy fix 
would be to only add the "remove listener" if `LOG.isDebugEnabled()`.


> Replace guava caches in places where the keyspace might be large
> ----------------------------------------------------------------
>
>                 Key: METRON-1467
>                 URL: https://issues.apache.org/jira/browse/METRON-1467
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Casey Stella
>            Priority: Major
>
> Based on the performance tuning exercise as part of METRON-1460, guava has 
> difficulties with cache sizes over 10k.  We, unfortunately, are quite 
> demanding of guava in this regard so we should transition a few uses of guava 
> to Caffeine:
>  * Stellar processor cache
>  * The JoinBolt cache
>  * The Enrichment Bolt Cache
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to