sergehuber commented on code in PR #760: URL: https://github.com/apache/unomi/pull/760#discussion_r3362984107
########## services/src/main/java/org/apache/unomi/services/impl/scheduler/SchedulerServiceImpl.java: ########## @@ -17,57 +17,2015 @@ package org.apache.unomi.services.impl.scheduler; +import org.apache.unomi.api.PartialList; import org.apache.unomi.api.services.SchedulerService; +import org.apache.unomi.api.tasks.ScheduledTask; +import org.apache.unomi.api.tasks.ScheduledTask.TaskStatus; +import org.apache.unomi.api.tasks.TaskExecutor; +import org.osgi.framework.BundleContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.time.Duration; import java.time.ZonedDateTime; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; /** + * Implementation of the SchedulerService that provides task scheduling and execution capabilities. + * This implementation supports: + * - Persistent and in-memory tasks + * - Single-node and cluster execution + * - Task dependencies and waiting queues + * - Lock management and crash recovery + * - Execution history and metrics tracking + * - Pending operations queue for initialization + * + * Task Lifecycle: + * 1. SCHEDULED: Initial state, task is ready to execute + * 2. WAITING: Task is waiting for dependencies or lock + * 3. RUNNING: Task is currently executing + * 4. COMPLETED/FAILED/CANCELLED/CRASHED: Terminal states + * + * Lock Management: + * - Tasks can be configured to allow/disallow parallel execution + * - Locks are managed differently for persistent and in-memory tasks + * - Lock timeout mechanism prevents deadlocks + * + * Clustering Support: + * - Tasks can be configured to run on specific nodes or all nodes + * - Lock ownership prevents duplicate execution + * - Crash recovery handles node failures + * + * Pending Operations: + * - Operations that require subservices are queued during initialization + * - Operations are executed once all required services are available + * - Supports different operation types with appropriate handling + * * @author dgaillard Review Comment: Fixed in commit 9eefd885: @author tag removed. Per ASF policy, authorship is tracked via git history rather than inline annotations. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
