@Override public void flush(){
  if (!queue.isEmpty()) {
    List<AlertStreamEvent> events=new ArrayList<>();
    queue.drainTo(events);
    events.forEach(null);
    LOG.info("Flushed {} alerts",events.size());
  }
  lastFlushTime.set(System.currentTimeMillis());
}

@ Override public void flush ( ) { if ( ! queue . isEmpty ( ) ) { List < AlertStreamEvent > events = new ArrayList < > ( ) ; queue . drainTo ( events ) ; events . forEach ( null ) ; LOG . info ( "Flushed {} alerts" , events . size ( ) ) ; } lastFlushTime . set ( System . currentTimeMillis ( ) ) ; }
flush will be called in synchronous way like stormbolt . execute ( ) as storm outputcollector is not thread - safe
