com.knowgate.scheduler
Class AtomFeeder

java.lang.Object
  extended by com.knowgate.scheduler.AtomFeeder

public class AtomFeeder
extends java.lang.Object

Feeds atoms to RAM based AtomQueue


Constructor Summary
AtomFeeder()
           
 
Method Summary
 void feedQueue(JDCConnection oConn, AtomQueue oQueue)
          Feed RAM queue with pending Atoms from k_job_atoms table
 int getMaxBatchSize()
           
 DBSubset loadAtoms(JDCConnection oConn, int iWorkerThreads)
          Load an Atom batch into k_job_atoms table Atoms will be taken by looking up pending Jobs by its execution date and extracting Atoms for nearest Jobs in time.
 DBSubset loadAtoms(JDCConnection oConn, java.lang.String sJobId)
          Load Atoms for a given Job into k_job_atoms table On each loadAtoms() no more than iWorkerThreads Jobs will be loaded at a time.
 void setMaxBatchSize(int iMaxBatch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomFeeder

public AtomFeeder()
Method Detail

setMaxBatchSize

public void setMaxBatchSize(int iMaxBatch)

getMaxBatchSize

public int getMaxBatchSize()

loadAtoms

public DBSubset loadAtoms(JDCConnection oConn,
                          int iWorkerThreads)
                   throws java.sql.SQLException

Load an Atom batch into k_job_atoms table

Atoms will be taken by looking up pending Jobs by its execution date and extracting Atoms for nearest Jobs in time.
On each loadAtoms() no more than iWorkerThreads Jobs will be loaded at a time.

Parameters:
oConn - Database Connection
iWorkerThreads - Number of worker thread. This parameter will limit the number of loaded Jobs as the program will try to use a one to one ratio between Jobs and WorkerThreads.
Returns:
DBSubset with loaded Jobs
Throws:
java.sql.SQLException

loadAtoms

public DBSubset loadAtoms(JDCConnection oConn,
                          java.lang.String sJobId)
                   throws java.sql.SQLException

Load Atoms for a given Job into k_job_atoms table

On each loadAtoms() no more than iWorkerThreads Jobs will be loaded at a time.

Parameters:
oConn - Database Connection
sJodId - GUID of Job for witch atoms are to be loaded.
Returns:
DBSubset with loaded Job
Throws:
java.sql.SQLException

feedQueue

public void feedQueue(JDCConnection oConn,
                      AtomQueue oQueue)
               throws java.sql.SQLException

Feed RAM queue with pending Atoms from k_job_atoms table

Parameters:
oConn - Database Connection
oQueue - AtomQueue
Throws:
java.sql.SQLException