Class JournalQueue
- java.lang.Object
-
- net.timewalker.ffmq4.storage.data.impl.journal.JournalQueue
-
public final class JournalQueue extends Object
FIFO queue ofAbstractJournalOperationobjects
-
-
Constructor Summary
Constructors Constructor Description JournalQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLast(AbstractJournalOperation op)Append an operation at the end of the queueAbstractJournalOperationgetFirst()Return the first operation in queuevoidmigrateTo(JournalQueue otherQueue)Migrate all operations to the given target queueAbstractJournalOperationremoveFirst()Remove the first available journal operation in queueintsize()Get the queue size
-
-
-
Method Detail
-
getFirst
public AbstractJournalOperation getFirst()
Return the first operation in queue- Returns:
- the first operation in queue
-
addLast
public void addLast(AbstractJournalOperation op)
Append an operation at the end of the queue- Parameters:
op- a journal operation
-
removeFirst
public AbstractJournalOperation removeFirst()
Remove the first available journal operation in queue- Returns:
- a journal operation
- Throws:
NoSuchElementException- if queue is empty
-
migrateTo
public void migrateTo(JournalQueue otherQueue)
Migrate all operations to the given target queue- Parameters:
otherQueue- target journal queue
-
size
public int size()
Get the queue size- Returns:
- number of operations in queue
-
-