Interface LocalQCriticalHandler
- All Known Implementing Classes:
TapeLocalQCriticalHandler
public interface LocalQCriticalHandler
Helper for handling critical situations like being unable to peek, add, remove from queue.
This cause of this situation can be a corrupted file, no space left, etc and generally in such
case we don't want the Jira node instance to break. The general idea is to try to recover if possible,
if not ignore replication messages and log/notify that the cluster is inconsistent.
Note that the wrapper for the queue
LocalQCacheOpQueue
can not change. The logic for replacing the file,
clearing should be hidden inside the queue LocalQCacheOpQueue
.
Note it is possible the queue would turn in to /dev/null if this is the only option to keep on going. We should favour
performance and stability over consistency here.-
Method Summary
Modifier and TypeMethodDescriptionboolean
handleCriticalAdd
(LocalQCacheOpQueue queue, LocalQCacheOp toAdd, Throwable t) Should try to "somehow" solve the critical situation of adding on this queue, may retry adding to queue.boolean
handleCriticalPeek
(LocalQCacheOpQueue queue, Throwable t) Should try to "somehow" solve the critical situation of peeking on this queue.boolean
handleCriticalRemove
(LocalQCacheOpQueue queue, LocalQCacheOp toRemove, Throwable t) Should try to "somehow" solve the critical situation of removing on this queue, may retry removing from queue.
-
Method Details
-
handleCriticalAdd
Should try to "somehow" solve the critical situation of adding on this queue, may retry adding to queue.- Returns:
- true if the critical situation was "somehow" handled; it does not mean that
LocalQCacheOp
was successfully added
-
handleCriticalPeek
Should try to "somehow" solve the critical situation of peeking on this queue.- Returns:
- true if the critical situation was "somehow" handled;
-
handleCriticalRemove
Should try to "somehow" solve the critical situation of removing on this queue, may retry removing from queue.- Returns:
- true if the critical situation was "somehow" handled; it does not mean that last
LocalQCacheOp
was successfully removed
-