Class TestSupplier
java.lang.Object
com._1c.g5.v8.internal.derived.scheduler.TestSupplier
- All Implemented Interfaces:
IDerivedDataTaskSupplier
Test supplier implementation
-
Nested Class Summary
Nested classes/interfaces inherited from interface com._1c.g5.v8.internal.derived.scheduler.IDerivedDataTaskSupplier
IDerivedDataTaskSupplier.MultithreadingPolicy, IDerivedDataTaskSupplier.TaskStatus
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFirst
(DerivedDataComputationTask task, DerivedDataSegmentBucket stage) void
void
addLast
(DerivedDataComputationTask task, DerivedDataSegmentBucket stage) boolean
Checks if the supplier has a status change since the last call of this method.void
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
setBlocked
(boolean blocked) void
setChanged
(Boolean changed) void
setTaskProcessor
(ITaskProcessor taskProcessor) void
Tries to unblock the supplier, if blocked
-
Constructor Details
-
TestSupplier
public TestSupplier()
-
-
Method Details
-
addFirst
-
addLast
-
addFirst
-
addLast
-
dropTasks
public void dropTasks() -
getAvailableTaskStatus
Description copied from interface:IDerivedDataTaskSupplier
Gets the information on the next available task (if any).- Specified by:
getAvailableTaskStatus
in interfaceIDerivedDataTaskSupplier
- Returns:
- The task status for a next available task. Never
null
-
getMultithreadingPolicy
Description copied from interface:IDerivedDataTaskSupplier
Gets the current desired multithreading policy for current set of tasks of this supplier.- Specified by:
getMultithreadingPolicy
in interfaceIDerivedDataTaskSupplier
- Returns:
- Gets the current policy. Cannot be
null
-
getNextTask
Description copied from interface:IDerivedDataTaskSupplier
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 theIDerivedDataTaskSupplier.getAvailableTaskStatus()
and subsequent call of this method- Specified by:
getNextTask
in interfaceIDerivedDataTaskSupplier
- Returns:
- The next task if available. Can be
null
in case if the state was changed since the last call of theIDerivedDataTaskSupplier.getAvailableTaskStatus()
-
getTaskProcessor
Description copied from interface:IDerivedDataTaskSupplier
Gets the processing logic for the given task. It's up to this logic to perform any processing/notifications during the DD computation process- Specified by:
getTaskProcessor
in interfaceIDerivedDataTaskSupplier
- Parameters:
computationTask
- The computation task, cannot benull
- Returns:
- The
ITaskProcessor
which is able to perform the DD computation for this task. Cannot benull
-
registerNotificationCallback
Description copied from interface:IDerivedDataTaskSupplier
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- Specified by:
registerNotificationCallback
in interfaceIDerivedDataTaskSupplier
- Parameters:
notificationCallback
- The callback from theDerivedDataTaskScheduler
, cannot benull
-
setTaskProcessor
-
getSupplierId
Description copied from interface:IDerivedDataTaskSupplier
Gets the supplier id for easier discrimination by the scheduling facility. The identifier should be unique in the current session of the EDT- Specified by:
getSupplierId
in interfaceIDerivedDataTaskSupplier
- Returns:
- The supplier identifier. Cannot be
null
-
processAccumulatedContexts
public void processAccumulatedContexts()Description copied from interface:IDerivedDataTaskSupplier
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- Specified by:
processAccumulatedContexts
in interfaceIDerivedDataTaskSupplier
-
checkStatusChange
public boolean checkStatusChange()Description copied from interface:IDerivedDataTaskSupplier
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- Specified by:
checkStatusChange
in interfaceIDerivedDataTaskSupplier
- Returns:
- True if there is a status change since the last call of this method
-
setChanged
-
setBlocked
public void setBlocked(boolean blocked) -
tryToUnblock
public void tryToUnblock()Description copied from interface:IDerivedDataTaskSupplier
Tries to unblock the supplier, if blocked- Specified by:
tryToUnblock
in interfaceIDerivedDataTaskSupplier
-
getActiveNonPriorityTasksResetRequiredStage
Description copied from interface:IDerivedDataTaskSupplier
Checks if a supplier requests a reset of currently computed non-priority tasks (e.g. due to more prioritable operation is appeared)- Specified by:
getActiveNonPriorityTasksResetRequiredStage
in interfaceIDerivedDataTaskSupplier
- Returns:
- Stage to reset non-priority tasks (if any).
null
if not reset is required
-