|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.opennms.bb.dp.common.components.PollerThread | +--org.opennms.bb.dp.eventd.EventPersistd
Inner Class Summary | |
private class |
EventPersistd.CheckQueue
This class is designed to specifically override the add behaviour of the base class. |
Field Summary | |
private static int |
INIT_NUM_WRITERS
the number of initial threads to create in the thread pool |
private com.sun.media.jsdt.Channel |
m_channel
The channel on which events are sent out |
private String |
m_driver
database driver loaded from the properties file |
private PCQueue |
m_eventWriterQ
Queue to which this adds EventWriter objects which then run and add all the data collected to the database |
private PCQueue |
m_eventWriterReplyQ
The queue to which EventWriters add events that have been added to the database - these are then grouped 10 at a time and sent out |
private PollerThread |
m_jsdtSender
the jsdt sender |
private String |
m_passwd
database password loaded from the properties file |
private PCQueue |
m_readersQ
The queue from which EventReaders are received from |
private String |
m_url
database url loaded from the properties file |
private String |
m_user
database user loaded from the properties file |
private ThreadGroup |
m_writerGroup
The pool of db consumers |
private List |
m_writers
the pool of threads |
private int |
max_writers
the max number of threads to create in the thread pool |
Fields inherited from class org.opennms.bb.dp.common.components.PollerThread |
m_curOpStatus, STATUS_MASK, STATUS_NORMAL, STATUS_PAUSED, STATUS_PAUSING, STATUS_RESUMING, STATUS_SHUTDOWN, STATUS_STARTING, STATUS_TERMINATING |
Fields inherited from class java.lang.Thread |
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ |
Constructor Summary | |
EventPersistd(PCQueue readersQ)
Constructs the EventPeristd thread of the Eventd |
Method Summary | |
private void |
connect()
Creates the poller JSDT client and channel to be used by the EventWriter threads to send events out once events are added to the database |
void |
run()
Starts the thread pool. |
void |
shutdown()
Start the shutdown and notify run() to shutdown |
(package private) void |
threadsVsQueueSizeCheck(int entries)
After each read from the listenerQ, the threads in the thread pool call this method to adjust the number of threads in the pool if necessary If the number of entries in the queue is more than double the number of threads, the number of threads is increased by one until the configurable maximum number of threads is reached If the number of threads in thepool is more than double the number of entries in the queue, the number of threads is decreased by one until the predefined initial number of threads is reached |
Methods inherited from class org.opennms.bb.dp.common.components.PollerThread |
getCtrlStatus, getOpStatus, pauseOperation, pauseThread, resumeOperation, resumeThread, setCtrlStatus, setOpStatus, setUserStatus, shutdownThread |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int INIT_NUM_WRITERS
private PCQueue m_readersQ
private PCQueue m_eventWriterQ
private PCQueue m_eventWriterReplyQ
private String m_driver
private String m_url
private String m_user
private String m_passwd
private int max_writers
private ThreadGroup m_writerGroup
private List m_writers
private PollerThread m_jsdtSender
private com.sun.media.jsdt.Channel m_channel
Constructor Detail |
public EventPersistd(PCQueue readersQ) throws com.sun.media.jsdt.JSDTException, SQLException
readersQ
- the queue from which the events to be written
into the database are readjava.lang.NullPointerException
- Thrown if the database related
properties are not foundcom.sun.media.jsdt.JSDTException
- Thrown if the the JSDT
communication channel cannot be establishedMethod Detail |
void threadsVsQueueSizeCheck(int entries)
private void connect() throws com.sun.media.jsdt.JSDTException
throws
- JSDTException if connection is not successfulpublic void run()
run
in class Thread
public void shutdown()
shutdown
in class PollerThread
org.opennms.bb.dp.common.components.PollerThread
PollerThread.STATUS_TERMINATING
,
Object.notifyAll()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |