Interface IDerivedDataTaskSupplier
- All Known Implementing Classes:
DerivedDataManager
,TestSupplier
public interface IDerivedDataTaskSupplier
This is a gateway between the DD pipeline (and it's manager) and the DD task scheduler. A single supplier
corresponds to a single DD process participant (project, usually). Supplier provides pull access to the
set of DD tasks requiring the computation.
The
DerivedDataTaskScheduler
using this interface to poll available suppliers for tasks and dispatch
them for the computation.
The supplier doesn't communicate any status information of the DD pipeline (e.g. blocking, etc), all comunications
are based on the fact of the task computation availability/possibility. It's up to DD pipeline to decide then
the pipeline has ready tasks to compute-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The multithreading computation policy that is preffered by the current DD stage of the supplier's DD pipeline.static class
Status of a task that may be supplied by a target supplier -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the supplier has a status change since the last call of this method.Checks if a supplier requests a reset of currently computed non-priority tasks (e.g. due to more prioritable operation is appeared)Gets the information on the next available task (if any).Gets the current desired multithreading policy for current set of tasks of this supplier.Gets the next task for the processing.Gets the supplier id for easier discrimination by the scheduling facility.getTaskProcessor
(DerivedDataComputationTask computationTask) Gets the processing logic for the given task.void
Processes accumulated DD contexts and update the DD pipeline.void
registerNotificationCallback
(ISchedulerNotificationCallback notificationCallback) DerivedDataTaskScheduler
registers a notification callback on start by calling this method.void
Tries to unblock the supplier, if blocked
-
Method Details
-
processAccumulatedContexts
void processAccumulatedContexts()Processes accumulated DD contexts and update the DD pipeline. This method is not thread safe, the caller should guarantee the calls synchronization to ensure the propert order of accumulated context application -
getAvailableTaskStatus
IDerivedDataTaskSupplier.TaskStatus getAvailableTaskStatus()Gets the information on the next available task (if any).- Returns:
- The task status for a next available task. Never
null
-
checkStatusChange
boolean checkStatusChange()Checks if the supplier has a status change since the last call of this method. The call should reset the change status of the supplier.\n The status change is used to re-check blocked suppliers, as they could be unblocked as a result of this status change- Returns:
- True if there is a status change since the last call of this method
-
tryToUnblock
void tryToUnblock()Tries to unblock the supplier, if blocked -
getMultithreadingPolicy
IDerivedDataTaskSupplier.MultithreadingPolicy getMultithreadingPolicy()Gets the current desired multithreading policy for current set of tasks of this supplier.- Returns:
- Gets the current policy. Cannot be
null
-
getNextTask
DerivedDataComputationTask getNextTask()Gets the next task for the processing. It's not required(yet recommended) for implementations to ensure the integrity of the task info request and task request. So it's possible for the task to disappear or change the priority during the call of thegetAvailableTaskStatus()
and subsequent call of this method- Returns:
- The next task if available. Can be
null
in case if the state was changed since the last call of thegetAvailableTaskStatus()
-
getSupplierId
String getSupplierId()Gets the supplier id for easier discrimination by the scheduling facility. The identifier should be unique in the current session of the EDT- Returns:
- The supplier identifier. Cannot be
null
-
getTaskProcessor
Gets the processing logic for the given task. It's up to this logic to perform any processing/notifications during the DD computation process- Parameters:
computationTask
- The computation task, cannot benull
- Returns:
- The
ITaskProcessor
which is able to perform the DD computation for this task. Cannot benull
-
registerNotificationCallback
DerivedDataTaskScheduler
registers a notification callback on start by calling this method. The provided callback should be used to notify scheduler about the availability of a new task. This API is used to increase the operativeness of the DD computations during the normal interractions with the EDT. Provided callback is fully controlled by the dispatcher, the clinet shouldn't pay any specific attention to its lifecycle- Parameters:
notificationCallback
- The callback from theDerivedDataTaskScheduler
, cannot benull
-
getActiveNonPriorityTasksResetRequiredStage
DerivedDataSegmentBucket getActiveNonPriorityTasksResetRequiredStage()Checks if a supplier requests a reset of currently computed non-priority tasks (e.g. due to more prioritable operation is appeared)- Returns:
- Stage to reset non-priority tasks (if any).
null
if not reset is required
-