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)
protected JobEntity
createJob(int[] minuteChunk)
protected java.util.List<Job>
createJobs(int degreeOfParallelism, int[][] minuteChunks)
Job
execute(CommandContext commandContext)
protected java.util.List<Job>
getHistoryCleanupJobs()
protected boolean
isHistoryCleanupEnabled(CommandContext commandContext)
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 commandContext)
-
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 degreeOfParallelism, 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)
-
createCleanupContext
protected HistoryCleanupContext createCleanupContext(int[] minuteChunk)
-
writeUserOperationLog
protected void writeUserOperationLog(CommandContext commandContext)
-
isHistoryCleanupEnabled
protected boolean isHistoryCleanupEnabled(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).
-
-