
public abstract class BatchPersister<T> extends Object implements Runnable, org.lsst.ccs.framework.ClearAlertHandler
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.services.alert.AlertService |
alertService |
protected static org.lsst.ccs.utilities.logging.Logger |
log |
| Constructor and Description |
|---|
BatchPersister(int nMax,
boolean flushAtCommit)
Constructor for a batch persister.
|
BatchPersister(int nMax,
boolean flushAtCommit,
int threads)
Constructor for a batch persister.
|
BatchPersister(int nMax,
boolean flushAtCommit,
int threads,
int threadQueueSize)
Constructor for a batch persister.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToQueue(T obj) |
org.lsst.ccs.framework.ClearAlertHandler.ClearAlertCode |
canClearAlert(org.lsst.ccs.bus.data.Alert alert,
org.lsst.ccs.bus.states.AlertState alertState) |
static ExecutorService |
newFixedThreadPoolBoundedQueue(int nThreads,
int nQueue) |
abstract void |
persist(T obj,
org.hibernate.Session sess)
Called from inside an open transaction.
|
void |
run() |
protected static final org.lsst.ccs.utilities.logging.Logger log
@LookupField(strategy=TREE) protected org.lsst.ccs.services.alert.AlertService alertService
public BatchPersister(int nMax,
boolean flushAtCommit,
int threads,
int threadQueueSize)
nMax - The maximum number of entities to persist in a single
transaction.flushAtCommit - true if the session that process the batch should be set to
FlushMode.COMMITthreads - database feeding threadsthreadQueueSize - The size of the queue; if negative the queue is unbound.public BatchPersister(int nMax,
boolean flushAtCommit,
int threads)
nMax - The maximum number of entities to persist in a single
transaction.flushAtCommit - true if the session that process the batch should be set to
FlushMode.COMMITthreads - database feeding threadspublic BatchPersister(int nMax,
boolean flushAtCommit)
nMax - The maximum number of entities to persist in a single
transaction.flushAtCommit - true if the session that process the batch should be set to
FlushMode.COMMITpublic static ExecutorService newFixedThreadPoolBoundedQueue(int nThreads, int nQueue)
public org.lsst.ccs.framework.ClearAlertHandler.ClearAlertCode canClearAlert(org.lsst.ccs.bus.data.Alert alert,
org.lsst.ccs.bus.states.AlertState alertState)
canClearAlert in interface org.lsst.ccs.framework.ClearAlertHandlerpublic void addToQueue(T obj)
public abstract void persist(T obj, org.hibernate.Session sess)
obj - sess - Copyright © 2021 LSST. All rights reserved.