public class LocalQCacheOpQueueWithStats extends Object implements LocalQCacheOpQueue
LocalQCacheOpQueue.
Contains statsTotal with statistics for queue since "the beginning" and
statsSnapshot with statistics for queue since last
statsSnapshot() call.
See: statsTotal() and statsSnapshot()| Modifier and Type | Class and Description |
|---|---|
static class |
LocalQCacheOpQueueWithStats.QueueStats |
LocalQCacheOpQueue.QueueId| Modifier and Type | Method and Description |
|---|---|
boolean |
add(LocalQCacheOp localQCacheOp)
transactional add of
LocalQCacheOp to the queue;
when operation finished we "guarantee" that the LocalQCacheOp is persisted |
void |
backupQueue(String prefix)
Note: use with caution
This method is mainly designed to handle critical state of the queue storage by backing up the current queue
persistent store and recreating a new one.
|
void |
close()
closes the queue and all resources connected with this queue (like processing thread(s), files);
closing a queue is definitive - it will never be open (i.e.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasPermission() |
LocalQCacheOpQueue.QueueId |
id() |
boolean |
isClosed()
Some operations (
LocalQCacheOpQueue.add(LocalQCacheOp), LocalQCacheOpQueue.remove(), LocalQCacheOpQueue.peek(), LocalQCacheOpQueue.peekOrBlock()) on a
closed queue will throw a IllegalStateException. |
String |
name() |
LocalQCacheOp |
peek()
Allows to see whats on the head of the queue without removing it
|
LocalQCacheOp |
peekOrBlock()
see
LocalQCacheOpQueue.peek() but will block when the queue is empty; |
void |
remove()
remove
LocalQCacheOp from head of the queue |
int |
size() |
Long |
usableSpaceInBytes() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitnodeQueueNumber, nodeQueueNumberForCurrentThreadpublic void close()
LocalQCacheOpQueueclose in interface LocalQCacheOpQueuepublic boolean isClosed()
LocalQCacheOpQueueLocalQCacheOpQueue.add(LocalQCacheOp), LocalQCacheOpQueue.remove(), LocalQCacheOpQueue.peek(), LocalQCacheOpQueue.peekOrBlock()) on a
closed queue will throw a IllegalStateException.
This method allows to check if the queue has not been closed.isClosed in interface LocalQCacheOpQueuepublic String name()
name in interface LocalQCacheOpQueuepublic LocalQCacheOpQueue.QueueId id()
id in interface LocalQCacheOpQueueLocalQCacheOpQueue.QueueIdpublic boolean add(LocalQCacheOp localQCacheOp) throws IllegalStateException
LocalQCacheOpQueueLocalQCacheOp to the queue;
when operation finished we "guarantee" that the LocalQCacheOp is persistedadd in interface LocalQCacheOpQueueIllegalStateException - when queue is closed@Nullable public LocalQCacheOp peek() throws IllegalStateException
LocalQCacheOpQueuepeek in interface LocalQCacheOpQueueIllegalStateException - when queue is closed@Nullable public LocalQCacheOp peekOrBlock() throws InterruptedException, IllegalStateException
LocalQCacheOpQueueLocalQCacheOpQueue.peek() but will block when the queue is empty;peekOrBlock in interface LocalQCacheOpQueueInterruptedExceptionIllegalStateException - when queue is closed (when calling this method queue is already closed)public void remove()
throws NoSuchElementException,
IllegalStateException
LocalQCacheOpQueueLocalQCacheOp from head of the queueremove in interface LocalQCacheOpQueueNoSuchElementException - when doing a remove on an empty queueIllegalStateException - when queue is closedpublic int size()
size in interface LocalQCacheOpQueuepublic void backupQueue(String prefix) throws IOException
LocalQCacheOpQueueLocalQCacheOpQueue.backupQueue(String) is called between LocalQCacheOpQueue.peek()
and LocalQCacheOpQueue.remove() this can cause LocalQCacheOpQueue.remove() to delete a different
LocalQCacheOp then expected or may throw NoSuchElementException if the new queue after
LocalQCacheOpQueue.backupQueue(String) is empty.backupQueue in interface LocalQCacheOpQueueIOException@Nullable public Long usableSpaceInBytes()
usableSpaceInBytes in interface LocalQCacheOpQueuepublic boolean hasPermission()
hasPermission in interface LocalQCacheOpQueueCopyright © 2002-2021 Atlassian. All Rights Reserved.