Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.scheduler
Class AtomFeeder

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

    public class AtomFeeder

extends java.lang.Object

Feeds atoms to RAM based AtomQueue

Constructor Summary
`AtomFeeder()` Create an Atom Feeder with a default batch size of 10000 atoms

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 with PENDING status for a given Job into k_job_atoms table On each loadAtoms() no more than iWorkerThreads Jobs will be loaded at a time.
`DBSubset` | `loadAtoms(JDCConnection oConn, java.lang.String sJobId, short iInitialStatus)` 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()

  Create an Atom Feeder with a default batch size of 10000 atoms

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,
                              short iInitialStatus)
                       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.
    `iInitialStatus` - Initial status for new Atoms
  Returns:
    DBSubset with loaded Job
  Throws:
    `java.sql.SQLException`

### loadAtoms

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

  Load Atoms with PENDING status 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD