Class HazelcastQueueAdapter<T>

java.lang.Object
com.norconex.crawler.core.cluster.impl.hazelcast.HazelcastQueueAdapter<T>
All Implemented Interfaces:
CacheQueue<T>

public class HazelcastQueueAdapter<T> extends Object implements CacheQueue<T>
  • Constructor Details

    • HazelcastQueueAdapter

      public HazelcastQueueAdapter(com.hazelcast.collection.IQueue<Object> hzQueue, com.hazelcast.core.HazelcastInstance hzInstance, Class<T> valueType)
  • Method Details

    • add

      public void add(T item)
      Specified by:
      add in interface CacheQueue<T>
    • poll

      public T poll()
      Specified by:
      poll in interface CacheQueue<T>
    • pollBatch

      public List<T> pollBatch(int batchSize)
      Specified by:
      pollBatch in interface CacheQueue<T>
    • size

      public int size()
      Specified by:
      size in interface CacheQueue<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface CacheQueue<T>
    • clear

      public void clear()
      Specified by:
      clear in interface CacheQueue<T>
    • isPersistent

      public boolean isPersistent()
      Description copied from interface: CacheQueue
      Returns whether this queue persists data across restarts.
      Specified by:
      isPersistent in interface CacheQueue<T>
      Returns:
      true if the queue is persistent, false if ephemeral
    • getName

      public String getName()
      Description copied from interface: CacheQueue
      Gets the name of this cache.
      Specified by:
      getName in interface CacheQueue<T>
      Returns:
      cache name