src/main/java/org/deduplogger/logger/LogCache.java
/**
   * Flush all the messages inside the cache
   * @return  a list of evicted messages
   */
Flush all the messages inside the cache
@return  a list of evicted messages
Flush all the messages inside the cache @return a list of evicted messages
public List<String> flushAllMessages() {
    synchronized (cache) {
      List<String> result = new ArrayList<>();
      long now = System.currentTimeMillis();
      Iterator<Entry<String, LogMetadata>> itr = cache.entrySet().iterator();
      while (itr.hasNext()) {
        Map.Entry<String, LogMetadata> e = itr.next();
        LogMetadata metadata = e.getValue();
        if (e.getKey() != null) {
          if (metadata.getTimeStamp().size() > LOG_CACHE_THRESHOLD) {
            result.add(generateSingleEvictionSummary(e.getKey(), MESSAGE.EXIT.toString(), metadata));
            itr.remove();
          }
        }
      }
      return result;
    }
  }
public List < String > flushAllMessages ( ) { synchronized ( cache ) { List < String > result = new ArrayList < > ( ) ; long now = System . currentTimeMillis ( ) ; Iterator < Entry < String , LogMetadata > > itr = cache . entrySet ( ) . iterator ( ) ; while ( itr . hasNext ( ) ) { Map . Entry < String , LogMetadata > e = itr . next ( ) ; LogMetadata metadata = e . getValue ( ) ; if ( e . getKey ( ) != null ) { if ( metadata . getTimeStamp ( ) . size ( ) > LOG_CACHE_THRESHOLD ) { result . add ( generateSingleEvictionSummary ( e . getKey ( ) , MESSAGE . EXIT . toString ( ) , metadata ) ) ; itr . remove ( ) ; } } } return result ; } }
Flush all the messages inside the cache
 @return  a list of evicted messages
Flush all the messages inside the cache @return a list of evicted messages
//Print the log summary with time expiration info for the message if it stays in the cache more than //LOG_TIME_THRESHOLD and it appears more than 'LOG_CACHE_THRESHOLD' times