Class ConcurrentQueueFile

    • Constructor Detail

      • ConcurrentQueueFile

        public ConcurrentQueueFile​(QueueFile delegate)
    • Method Detail

      • add

        public void add​(byte[] data,
                        int offset,
                        int count)
                 throws IOException
        Description copied from interface: QueueFile
        Adds an element to the end of the queue.
        Specified by:
        add in interface QueueFile
        Parameters:
        data - to copy bytes from
        offset - to start from in buffer
        count - number of bytes to copy
        Throws:
        IOException
      • peek

        @Nullable
        public @org.jetbrains.annotations.Nullable byte[] peek()
                                                        throws IOException
        Description copied from interface: QueueFile
        Reads the eldest element. Returns null if the queue is empty.
        Specified by:
        peek in interface QueueFile
        Returns:
        the eldest element.
        Throws:
        IOException
      • size

        public int size()
        Description copied from interface: QueueFile
        Returns the number of elements in this queue.
        Specified by:
        size in interface QueueFile
      • storageBytes

        public long storageBytes()
        Description copied from interface: QueueFile
        Returns the storage size (on-disk file size) in bytes.
        Specified by:
        storageBytes in interface QueueFile
        Returns:
        file size in bytes.
      • usedBytes

        public long usedBytes()
        Description copied from interface: QueueFile
        Returns the number of bytes used for data.
        Specified by:
        usedBytes in interface QueueFile
        Returns:
        bytes used.
      • availableBytes

        public long availableBytes()
        Description copied from interface: QueueFile
        Returns the number of bytes available for adding new tasks without growing the file.
        Specified by:
        availableBytes in interface QueueFile
        Returns:
        bytes available.
      • iterator

        @NotNull
        public @NotNull Iterator<byte[]> iterator()
        Specified by:
        iterator in interface Iterable<byte[]>