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

    https://github.com/apache/metron/pull/1289#discussion_r239577727
  
    --- 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 --
    
    Yep, I will change it to debug.


---

Reply via email to