Class HBDataCacheQueue<T>

java.lang.Object
org.alfresco.heartbeat.datasender.internal.HBDataCacheQueue<T>

public class HBDataCacheQueue<T> extends Object
Heartbeat cache implementation - data is consumed in batches and after that evicted from the cache.
Author:
Ancuta Morarasu
  • Field Details

    • cache

      protected final Queue<T> cache
  • Constructor Details

    • HBDataCacheQueue

      public HBDataCacheQueue()
  • Method Details

    • add

      public void add(T data)
    • addAll

      public void addAll(List<T> data)
    • removeAll

      public void removeAll(List<T> data)
    • clear

      public void clear()
    • persistCache

      public void persistCache()
    • loadCache

      public void loadCache()
    • size

      public int size()
    • setMaxEntries

      public void setMaxEntries(long maxEntries)
    • process

      public void process(int batchSize, Consumer<List<T>> consumer)
      Data is consumed in batches; if the processing is successful, the batch is removed from the cache.
      Parameters:
      batchSize - the size of the batch to process
      consumer - the batch processor