Class TieredStoredProcedureStaleRecordProcessor
java.lang.Object
net.solarnetwork.central.scheduler.JobSupport
net.solarnetwork.central.common.job.JdbcCallJob
net.solarnetwork.central.common.job.StaleRecordProcessor
net.solarnetwork.central.common.job.TieredStaleRecordProcessor
net.solarnetwork.central.common.job.TieredStoredProcedureStaleRecordProcessor
- All Implemented Interfaces:
Runnable,ManagedJob
- Direct Known Subclasses:
StaleAuditNodeServiceProcessor,StaleAuditUserServiceProcessor
Tiered stale datum processor that calls a stored procedure to process stale
rows.
- Since:
- 1.7
-
Field Summary
Fields inherited from class net.solarnetwork.central.scheduler.JobSupport
DEFAULT_CRON, DEFAULT_JITTER, DEFAULT_MAX_ITERATIONS, DEFAULT_MAX_WAIT, DEFAULT_PARALLELISM, log -
Constructor Summary
ConstructorsConstructorDescriptionTieredStoredProcedureStaleRecordProcessor(org.springframework.jdbc.core.JdbcOperations jdbcOps, String taskDescription) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final intexecute(AtomicInteger remainingCount) Execute the stale processing task.protected voidProcess a procedure result set row.Methods inherited from class net.solarnetwork.central.common.job.TieredStaleRecordProcessor
executeJobTask, getTierProcessMax, getTierProcessType, run, setTierProcessMax, setTierProcessTypeMethods inherited from class net.solarnetwork.central.common.job.JdbcCallJob
getJdbcCall, getJdbcOps, setJdbcCallMethods inherited from class net.solarnetwork.central.scheduler.JobSupport
executeParallelJob, getGroupId, getId, getJitter, getMaximumIterations, getMaximumWaitMs, getParallelism, getParallelTaskExecutor, getSchedule, setGroupId, setId, setJitter, setMaximumIterations, setMaximumWaitMs, setParallelism, setParallelTaskExecutor, setSchedule
-
Constructor Details
-
TieredStoredProcedureStaleRecordProcessor
public TieredStoredProcedureStaleRecordProcessor(org.springframework.jdbc.core.JdbcOperations jdbcOps, String taskDescription) Constructor.- Parameters:
jdbcOps- the JdbcOperations to usetaskDescription- a description of the task to use in log statements- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
execute
Description copied from class:TieredStaleRecordProcessorExecute the stale processing task.- Specified by:
executein classTieredStaleRecordProcessor- Parameters:
remainingCount- the maximum remaining number of rows to process- Returns:
- number of rows processed
-
processResultRow
Process a procedure result set row.The
ResultSetwill be positioned on a valid result row when invoked. This implementation will log the column values at DEBUG level.- Parameters:
rs- the result set- Throws:
SQLException- if any SQL error occurs
-