Package org.camunda.bpm.engine.impl.cmd
Class HistoryCleanupCmd
java.lang.Object
org.camunda.bpm.engine.impl.cmd.HistoryCleanupCmd
- Author:
- Svetlana Dorokhova
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
acquireExclusiveLock
(CommandContext commandContext) protected HistoryCleanupContext
createCleanupContext
(int[] minuteChunk, int maxRetries) protected JobEntity
createJob
(int[] minuteChunk, int maxRetries) createJobs
(int[][] minuteChunks) execute
(CommandContext context) boolean
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.reconfigureJobs
(List<Job> historyCleanupJobs, int degreeOfParallelism, int[][] minuteChunks) protected boolean
shouldCreateJobs
(List<Job> jobs) protected boolean
shouldReconfigureJobs
(List<Job> jobs) protected boolean
shouldSuspendJobs
(List<Job> jobs) protected void
suspendJobs
(List<Job> jobs) protected boolean
protected void
writeUserOperationLog
(CommandContext commandContext)
-
Field Details
-
HISTORY_CLEANUP_JOB_DECLARATION
-
MAX_THREADS_NUMBER
public static final int MAX_THREADS_NUMBER- See Also:
-
-
Constructor Details
-
HistoryCleanupCmd
public HistoryCleanupCmd(boolean immediatelyDue)
-
-
Method Details
-
execute
-
getHistoryCleanupJobs
-
shouldCreateJobs
-
shouldReconfigureJobs
-
shouldSuspendJobs
-
willBeScheduled
protected boolean willBeScheduled() -
createJobs
-
reconfigureJobs
-
suspendJobs
-
createJob
-
createCleanupContext
-
writeUserOperationLog
-
acquireExclusiveLock
-
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).
-