Class CacheBulkProcessor

java.lang.Object
org.codice.ddf.catalog.solr.cache.impl.CacheBulkProcessor

public class CacheBulkProcessor extends Object
Bulk adds metacards to the cache that are not needed immediately.
  • Constructor Details

    • CacheBulkProcessor

      public CacheBulkProcessor(SolrCache cache)
    • CacheBulkProcessor

      public CacheBulkProcessor(SolrCache cache, long delay, TimeUnit delayUnit, CacheStrategy cacheStrategy)
      Create a new cache bulk processor that will check added metacards for bulk processing at the configured delay interval.
      Parameters:
      cache - target Solr cache to bulk add metacards
      delay - delay between decision to bulk add
      delayUnit - units of the delay
  • Method Details

    • add

      public void add(List<ddf.catalog.data.Result> results)
      Adds metacards to be bulk added to cache. Metacards will be ignored if backlog grows too large. Metacard currently in backlog will be updated if added again.
      Parameters:
      results - metacards to add to current batch
    • shutdown

      public void shutdown()
      Shutdown scheduled tasks.
    • setFlushInterval

      public void setFlushInterval(long flushInterval)
    • setBatchSize

      public void setBatchSize(int batchSize)
    • setMaximumBacklogSize

      public void setMaximumBacklogSize(int maximumBacklogSize)
    • setCacheStrategy

      public void setCacheStrategy(CacheStrategy cacheStrategy)