Class AbstractInmemEphemeralQueue<ID,​DATA>

    • Constructor Detail

      • AbstractInmemEphemeralQueue

        public AbstractInmemEphemeralQueue()
    • Method Detail

      • initEphemeralStorage

        protected void initEphemeralStorage​(int hintSize)
      • doRemoveFromEphemeralStorage

        protected void doRemoveFromEphemeralStorage​(IQueueMessage<ID,​DATA> msg)
      • ensureEphemeralSize

        protected void ensureEphemeralSize()
      • doPutToEphemeralStorage

        protected void doPutToEphemeralStorage​(IQueueMessage<ID,​DATA> msg)
      • getOrphanMessages

        public Collection<IQueueMessage<ID,​DATA>> getOrphanMessages​(long thresholdTimestampMs)
        Get all orphan messages (messages that were left in ephemeral storage for a long time).
        Parameters:
        thresholdTimestampMs - message is orphan if message's timestampMillis + thresholdTimestampMs < now . Which means getOrphanMessages(10000) will return orphan messages that have stayed in ephemeral storage for more than 10000 milliseconds.
        Returns:
        null or empty collection if there is no orphan message
      • ephemeralSize

        public int ephemeralSize()
        Get number of items currently in ephemeral storage.

        Note: ephemeral storage implementation is optional, depends on implementation.

        Returns:
        negative number if ephemeral size can not be queried