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

    https://github.com/apache/metron/pull/1289#discussion_r239568177
  
    --- Diff: 
metron-analytics/metron-profiler-common/src/main/java/org/apache/metron/profiler/DefaultMessageDistributor.java
 ---
    @@ -315,41 +308,51 @@ public DefaultMessageDistributor 
withPeriodDuration(int duration, TimeUnit units
       }
     
       /**
    -   * A listener that is notified when profiles expire from the active 
cache.
    +   * Notified synchronously when the active cache is modified.
        */
    -  private class ActiveCacheRemovalListener implements 
RemovalListener<Integer, ProfileBuilder>, Serializable {
    +  private class ActiveCacheWriter implements CacheWriter<Integer, 
ProfileBuilder>, Serializable {
    +
    +    @Override
    +    public void write(@Nonnull Integer key, @Nonnull ProfileBuilder value) 
{
    +      // do nothing
    +    }
     
         @Override
    -    public void onRemoval(@Nullable Integer key, @Nullable ProfileBuilder 
expired, @Nonnull RemovalCause cause) {
    -      LOG.warn("Profile expired from active cache; profile={}, entity={}",
    -              expired.getDefinition().getProfile(),
    -              expired.getEntity());
    +    public void delete(@Nonnull Integer key, @Nullable ProfileBuilder 
value, @Nonnull RemovalCause cause) {
    +      if(cause.wasEvicted()) {
    +        // add the profile to the expired cache
    +        expiredCache.put(key, value);
    +        LOG.info("Profile expired from active cache due to inactivity; 
profile={}, entity={}, cause={}",
    --- End diff --
    
    Will this LOG.info cause a lot of churn in the logs? In a production 
scenario, there could be a lot of entities per profile, right? And these could 
be expiring pretty often.  It seems like you could easily hit scenarios where 
thousands of entities are expiring and then clogging the logger up.  This seems 
like more a debugging log than anything else.


---

Reply via email to