Package org.camunda.bpm.engine.impl.cmd
Class HistoryCleanupCmd
- java.lang.Object
-
- org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd
-
-
Field Summary
Fields Modifier and Type Field Description static JobDeclaration
HISTORY_CLEANUP_JOB_DECLARATION
static int
MAX_THREADS_NUMBER
-
Constructor Summary
Constructors Constructor Description HistoryCleanupCmd(boolean immediatelyDue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
acquireExclusiveLock(CommandContext commandContext)
protected HistoryCleanupContext
createCleanupContext(int[] minuteChunk, int maxRetries)
protected JobEntity
createJob(int[] minuteChunk, int maxRetries)
protected java.util.List<Job>
createJobs(int[][] minuteChunks)
Job
execute(CommandContext context)
protected java.util.List<Job>
getHistoryCleanupJobs()
boolean
isRetryable()
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.protected java.util.List<Job>
reconfigureJobs(java.util.List<Job> historyCleanupJobs, int degreeOfParallelism, int[][] minuteChunks)
protected boolean
shouldCreateJobs(java.util.List<Job> jobs)
protected boolean
shouldReconfigureJobs(java.util.List<Job> jobs)
protected boolean
shouldSuspendJobs(java.util.List<Job> jobs)
protected void
suspendJobs(java.util.List<Job> jobs)
protected boolean
willBeScheduled()
protected void
writeUserOperationLog(CommandContext commandContext)
-
-
-
Field Detail
-
HISTORY_CLEANUP_JOB_DECLARATION
public static final JobDeclaration HISTORY_CLEANUP_JOB_DECLARATION
-
MAX_THREADS_NUMBER
public static final int MAX_THREADS_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public Job execute(CommandContext context)
-
getHistoryCleanupJobs
protected java.util.List<Job> getHistoryCleanupJobs()
-
shouldCreateJobs
protected boolean shouldCreateJobs(java.util.List<Job> jobs)
-
shouldReconfigureJobs
protected boolean shouldReconfigureJobs(java.util.List<Job> jobs)
-
shouldSuspendJobs
protected boolean shouldSuspendJobs(java.util.List<Job> jobs)
-
willBeScheduled
protected boolean willBeScheduled()
-
createJobs
protected java.util.List<Job> createJobs(int[][] minuteChunks)
-
reconfigureJobs
protected java.util.List<Job> reconfigureJobs(java.util.List<Job> historyCleanupJobs, int degreeOfParallelism, int[][] minuteChunks)
-
suspendJobs
protected void suspendJobs(java.util.List<Job> jobs)
-
createJob
protected JobEntity createJob(int[] minuteChunk, int maxRetries)
-
createCleanupContext
protected HistoryCleanupContext createCleanupContext(int[] minuteChunk, int maxRetries)
-
writeUserOperationLog
protected void writeUserOperationLog(CommandContext commandContext)
-
acquireExclusiveLock
protected void acquireExclusiveLock(CommandContext commandContext)
-
isRetryable
public boolean isRetryable()
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The History Cleanup command only executes internal code, so we are certain that a retry of a failed reconfiguraton will not impact user data, and may be performed multiple times.- Specified by:
isRetryable
in interfaceCommand<Job>
- Returns:
- true if the
CrdbTransactionRetryInterceptor
can make a transparent retry of this command upon failure with aCrdbTransactionRetryException
(only used when running on CockroachDB).
-
-