akka.actor.mailbox.filebased.filequeue
Class PersistentQueue

java.lang.Object
  extended by akka.actor.mailbox.filebased.filequeue.PersistentQueue

public class PersistentQueue
extends java.lang.Object


Constructor Summary
PersistentQueue(java.lang.String persistencePath, java.lang.String name, FileBasedMailboxSettings settings, LoggingAdapter log)
           
 
Method Summary
 boolean add(byte[] value)
           
 boolean add(byte[] value, long expiry)
          Add a value to the end of the queue, transactionally.
 long bytes()
           
 void close()
          Close the queue's journal file.
 void configure(FileBasedMailboxSettings settings)
           
 void confirmRemove(int xid)
           
 long currentAge()
           
 void destroyJournal()
           
 int discardExpired()
           
 OverlaySetting<java.lang.Object> discardOldWhenFull()
           
 java.lang.String[] dumpConfig()
           
 scala.Tuple2<java.lang.String,java.lang.String>[] dumpStats()
           
 OverlaySetting<scala.Option<PersistentQueue>> expiredQueue()
           
 void flush()
           
 boolean inReadBehind()
           
 boolean isClosed()
           
 long journalSize()
           
 OverlaySetting<java.lang.Object> keepJournal()
           
 long length()
           
 OverlaySetting<java.lang.Object> maxAge()
           
 OverlaySetting<java.lang.Object> maxItems()
           
 OverlaySetting<java.lang.Object> maxItemSize()
           
 OverlaySetting<java.lang.Object> maxJournalOverflow()
           
 OverlaySetting<java.lang.Object> maxJournalSize()
           
 OverlaySetting<java.lang.Object> maxJournalSizeAbsolute()
           
 OverlaySetting<java.lang.Object> maxMemorySize()
           
 OverlaySetting<java.lang.Object> maxSize()
           
 long memoryBytes()
           
 long memoryLength()
           
 java.lang.String name()
           
 int openTransactionCount()
           
 scala.collection.immutable.List<java.lang.Object> openTransactionIds()
           
<T> OverlaySetting<T>
overlay(scala.Function0<T> base)
           
 void pauseReads()
           
 scala.Option<QItem> peek()
          Peek at the head item in the queue, if there is one.
 scala.Option<QItem> remove()
          Remove and return an item from the queue, if there is one.
 scala.Option<QItem> remove(boolean transaction)
          Remove and return an item from the queue, if there is one.
 void replayJournal()
           
 void resumeReads()
           
 FileBasedMailboxSettings settings()
           
 void setup()
           
 OverlaySetting<java.lang.Object> syncJournal()
           
 scala.collection.immutable.List<QItem> toList()
           
 long totalDiscarded()
           
 long totalExpired()
           
 long totalItems()
           
 void unremove(int xid)
          Return a transactionally-removed item to the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentQueue

public PersistentQueue(java.lang.String persistencePath,
                       java.lang.String name,
                       FileBasedMailboxSettings settings,
                       LoggingAdapter log)
Method Detail

name

public java.lang.String name()

settings

public FileBasedMailboxSettings settings()

overlay

public <T> OverlaySetting<T> overlay(scala.Function0<T> base)

maxItems

public final OverlaySetting<java.lang.Object> maxItems()

maxSize

public final OverlaySetting<java.lang.Object> maxSize()

maxItemSize

public final OverlaySetting<java.lang.Object> maxItemSize()

maxAge

public final OverlaySetting<java.lang.Object> maxAge()

maxJournalSize

public final OverlaySetting<java.lang.Object> maxJournalSize()

maxMemorySize

public final OverlaySetting<java.lang.Object> maxMemorySize()

maxJournalOverflow

public final OverlaySetting<java.lang.Object> maxJournalOverflow()

maxJournalSizeAbsolute

public final OverlaySetting<java.lang.Object> maxJournalSizeAbsolute()

discardOldWhenFull

public final OverlaySetting<java.lang.Object> discardOldWhenFull()

keepJournal

public final OverlaySetting<java.lang.Object> keepJournal()

syncJournal

public final OverlaySetting<java.lang.Object> syncJournal()

expiredQueue

public final OverlaySetting<scala.Option<PersistentQueue>> expiredQueue()

openTransactionCount

public int openTransactionCount()

openTransactionIds

public scala.collection.immutable.List<java.lang.Object> openTransactionIds()

length

public long length()

totalItems

public long totalItems()

bytes

public long bytes()

journalSize

public long journalSize()

totalExpired

public long totalExpired()

currentAge

public long currentAge()

totalDiscarded

public long totalDiscarded()

isClosed

public boolean isClosed()

memoryLength

public long memoryLength()

memoryBytes

public long memoryBytes()

inReadBehind

public boolean inReadBehind()

configure

public void configure(FileBasedMailboxSettings settings)

dumpConfig

public java.lang.String[] dumpConfig()

dumpStats

public scala.Tuple2<java.lang.String,java.lang.String>[] dumpStats()

add

public boolean add(byte[] value,
                   long expiry)
Add a value to the end of the queue, transactionally.


add

public boolean add(byte[] value)

peek

public scala.Option<QItem> peek()
Peek at the head item in the queue, if there is one.


remove

public scala.Option<QItem> remove(boolean transaction)
Remove and return an item from the queue, if there is one.

Parameters:
transaction - true if this should be considered the first part of a transaction, to be committed or rolled back (put back at the head of the queue)

remove

public scala.Option<QItem> remove()
Remove and return an item from the queue, if there is one.


unremove

public void unremove(int xid)
Return a transactionally-removed item to the queue. This is a rolled- back transaction.


confirmRemove

public void confirmRemove(int xid)

flush

public void flush()

close

public void close()
Close the queue's journal file. Not safe to call on an active queue.


pauseReads

public void pauseReads()

resumeReads

public void resumeReads()

setup

public void setup()

destroyJournal

public void destroyJournal()

replayJournal

public void replayJournal()

toList

public scala.collection.immutable.List<QItem> toList()

discardExpired

public final int discardExpired()