com.voidsearch.voidbase.storage.queuetree
Class QueueTreeStorage

java.lang.Object
  extended by com.voidsearch.voidbase.storage.queuetree.QueueTreeStorage
All Implemented Interfaces:
SupervisedStorage

public class QueueTreeStorage
extends java.lang.Object
implements SupervisedStorage


Field Summary
protected static org.slf4j.Logger logger
           
protected static QueueTreeStorage singleton
           
 
Constructor Summary
protected QueueTreeStorage()
           
 
Method Summary
 void blockOperation(StorageOperation op)
           
 java.lang.Object clone()
           
 void createQueue(java.lang.String queueName, int size)
           
 void decrementMemorySize(java.lang.Object obj)
           
 void deleteAll()
           
 void deleteQueue(java.lang.String queueName)
           
 void enableOperation(StorageOperation op)
           
static QueueTreeStorage factory()
           
 void flushAll()
           
 void flushQueue(java.lang.String queueName)
           
 java.util.List getFIFO(java.lang.String queueName, int count)
           
 java.util.List getFIFO(java.lang.String queueName, int count, long timestamp)
           
 long getMemorySize()
           
static long getMemorySize(java.lang.Object obj)
           
 java.util.LinkedHashMap<java.lang.String,java.lang.Object> getMetadataMap(java.lang.String queueName)
           
 long getSize()
           
 long getTotalEntries()
           
 long getTotalQueries()
           
 void incrementMemorySize(java.lang.Object obj)
           
 java.util.LinkedList listQueues()
           
 void putFIFO(java.lang.String queueName, java.lang.Object value)
           
 boolean queueExists(java.lang.String name)
           
 void resizeQueue(java.lang.String queueName, int size)
           
 void updateQueryCounters()
           
 void updateQueryCounters(StorageOperation op)
           
 void updateStats(StorageStats stats)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger

singleton

protected static QueueTreeStorage singleton
Constructor Detail

QueueTreeStorage

protected QueueTreeStorage()
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

factory

public static QueueTreeStorage factory()

createQueue

public void createQueue(java.lang.String queueName,
                        int size)
                 throws QueueAlreadyExistsException,
                        SupervisionException
Throws:
QueueAlreadyExistsException
SupervisionException

resizeQueue

public void resizeQueue(java.lang.String queueName,
                        int size)
                 throws InvalidQueueException,
                        SupervisionException
Throws:
InvalidQueueException
SupervisionException

queueExists

public boolean queueExists(java.lang.String name)
                    throws SupervisionException
Throws:
SupervisionException

deleteQueue

public void deleteQueue(java.lang.String queueName)
                 throws InvalidQueueException,
                        SupervisionException
Throws:
InvalidQueueException
SupervisionException

deleteAll

public void deleteAll()
               throws SupervisionException
Throws:
SupervisionException

flushQueue

public void flushQueue(java.lang.String queueName)
                throws SupervisionException
Throws:
SupervisionException

flushAll

public void flushAll()
              throws SupervisionException
Throws:
SupervisionException

getMetadataMap

public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getMetadataMap(java.lang.String queueName)

putFIFO

public void putFIFO(java.lang.String queueName,
                    java.lang.Object value)
             throws InvalidQueueException,
                    SupervisionException
Throws:
InvalidQueueException
SupervisionException

getFIFO

public java.util.List getFIFO(java.lang.String queueName,
                              int count)
                       throws InvalidQueueException,
                              SupervisionException
Throws:
InvalidQueueException
SupervisionException

getFIFO

public java.util.List getFIFO(java.lang.String queueName,
                              int count,
                              long timestamp)
                       throws InvalidQueueException,
                              SupervisionException
Throws:
InvalidQueueException
SupervisionException

listQueues

public java.util.LinkedList listQueues()
                                throws SupervisionException
Throws:
SupervisionException

blockOperation

public void blockOperation(StorageOperation op)
                    throws SupervisionException
Specified by:
blockOperation in interface SupervisedStorage
Throws:
SupervisionException

enableOperation

public void enableOperation(StorageOperation op)
                     throws SupervisionException
Specified by:
enableOperation in interface SupervisedStorage
Throws:
SupervisionException

updateStats

public void updateStats(StorageStats stats)
Specified by:
updateStats in interface SupervisedStorage

updateQueryCounters

public void updateQueryCounters()

updateQueryCounters

public void updateQueryCounters(StorageOperation op)

getSize

public long getSize()

getTotalEntries

public long getTotalEntries()

getTotalQueries

public long getTotalQueries()
Specified by:
getTotalQueries in interface SupervisedStorage

incrementMemorySize

public void incrementMemorySize(java.lang.Object obj)

decrementMemorySize

public void decrementMemorySize(java.lang.Object obj)

getMemorySize

public static long getMemorySize(java.lang.Object obj)

getMemorySize

public long getMemorySize()
Specified by:
getMemorySize in interface SupervisedStorage


Copyright © 2009. All Rights Reserved.