Interface QueueStore<T>

Type Parameters:
T - queue item type

public interface QueueStore<T>
QueueStore makes a queue backed by a central data store; such as database, disk, etc.
  • Method Details

    • store

      void store(Long key, T value)
      Stores the key-value pair.
      key - key of the entry to store
      value - value of the entry to store
    • storeAll

      void storeAll(Map<Long,T> map)
      Stores multiple entries. Implementation of this method can optimize the store operation by storing all entries in one database connection for instance.
      map - map of entries to store
    • delete

      void delete(Long key)
      Deletes the entry with a given key from the store.
      key - key to delete from the store.
    • deleteAll

      void deleteAll(Collection<Long> keys)
      Deletes multiple entries from the store.
      keys - keys of the entries to delete.
    • load

      T load(Long key)
      Loads the value of a given key.

      Implementation can use any means of loading the given key; such as an O/R mapping tool, simple SQL, reading a file, etc.

      key - the key of the requested value
      value of the key
    • loadAll

      Map<Long,T> loadAll(Collection<Long> keys)
      Loads the given keys. This is a batch load operation so that implementation can optimize the multiple loads.

      Set the bulk-load property to configure batch loading. When the queue is initialized, items are loaded from QueueStore in bulks. Bulk load is the size of these bulks. The default value of bulk-load is 250.

      keys - keys of the value entries to load
      map of loaded key-value pairs. May return null if no values loaded.
    • loadAllKeys

      Set<Long> loadAllKeys()
      Loads all of the keys from the store.

      The items identified by the keys will be loaded in the iteration order of the returned Set

      all the keys from the store. May return null if no keys loaded.