public abstract class BatchPersister<T> extends Object implements Runnable, org.lsst.ccs.framework.HasLifecycle
| Modifier and Type | Field and Description |
|---|---|
protected org.lsst.ccs.services.alert.AlertService |
alertService |
protected int |
ingQueueSize |
protected int |
ingThreadsPoolSize |
protected Logger |
log |
protected org.lsst.ccs.services.AgentPeriodicTaskService |
periodicTaskService |
protected Queue<T> |
rq |
| Modifier and Type | Method and Description |
|---|---|
void |
addToQueue(T obj) |
void |
build() |
Duration |
getBatchProcessingPeriod()
Get the batch processing period.
|
void |
init() |
static ExecutorService |
newFixedThreadPoolBoundedQueue(int nThreads,
int nQueue) |
abstract void |
persist(T obj,
org.hibernate.Session sess)
Called from inside an open transaction.
|
void |
run() |
void |
shutdown() |
protected final Logger log
@LookupField(strategy=TREE) protected org.lsst.ccs.services.alert.AlertService alertService
@LookupField(strategy=TREE) protected org.lsst.ccs.services.AgentPeriodicTaskService periodicTaskService
protected int ingThreadsPoolSize
protected int ingQueueSize
public static ExecutorService newFixedThreadPoolBoundedQueue(int nThreads, int nQueue)
public void shutdown()
shutdown in interface org.lsst.ccs.framework.HasLifecyclepublic void build()
build in interface org.lsst.ccs.framework.HasLifecyclepublic void init()
init in interface org.lsst.ccs.framework.HasLifecyclepublic void addToQueue(T obj)
public abstract void persist(T obj, org.hibernate.Session sess)
obj - sess - public Duration getBatchProcessingPeriod()
Copyright © 2024 LSST. All rights reserved.