Package com._1c.g5.v8.internal.derived
Class DerivedDataManager
java.lang.Object
com._1c.g5.v8.internal.derived.DerivedDataManager
- All Implemented Interfaces:
IContextActivationCallback,IDerivedDataManager,IScopeTrackerController,IComputationTaskManager,IDerivedDataTaskSupplier
public final class DerivedDataManager
extends Object
implements IDerivedDataManager, IComputationTaskManager, IDerivedDataTaskSupplier, IScopeTrackerController, IContextActivationCallback
Standard implementation of
IDerivedDataManager interface and
IComputationTaskManager mix-in.-
Nested Class Summary
Nested classes/interfaces inherited from interface com._1c.g5.v8.internal.derived.scheduler.IDerivedDataTaskSupplier
IDerivedDataTaskSupplier.MultithreadingPolicy, IDerivedDataTaskSupplier.TaskStatus -
Field Summary
Fields inherited from interface com._1c.g5.v8.derived.IDerivedDataManager
SERVICE_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDerivedDataManager(String projectId, IDerivedDataInfoRepository derivedDataInfoRepository, IDerivedDataContextManager contextManager, IContextTransactionManager contextTransactionManager, IDerivedDataServiceLockController lockController, Supplier<Boolean> synchronizationActiveStateSupplier, Collection<DerivedDataSegmentDefinition> segmentDefinitions, Set<String> filteredSegments, IAsyncProcessingPipeline pipeline, Collection<IDerivedDataComputer> computers, Collection<IContextCollector> fullRebuildCollectors, Collection<IRemovalContextCollector> removalCollectors, Collection<IDerivedDataUpdate> restorationUpdates, Collection<IDerivedDataUpdate> forcedDataUpdates) Construct a new instance, performs basic initialization. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateContexts(String segmentId) Reactivates collected async computing contexts for a specified segment.voidaddObjectStatusListener(IDerivedDataObjectStatusListener listener, long bmObjectId, String... segments) Adds listener for DD status changes of the given object and set of tracked DD segments.voidaddObjectStatusListener(IDerivedDataObjectStatusListener listener, Map<Long, Collection<String>> scope) Adds listener for DD status changes of the given DD change scope.voidaddStatusListener(IDerivedDataStatusListener listener) Adds listener that will be notified about derived data status changes.voidApplies all forced updates provided byIDerivedDataConfigurationContributor'svoidblockAsyncPipeline(boolean forcedStop) Blocks the async. processing pipeline.voidblockAsyncPipeline(boolean forcedStop, boolean wait) Blocks the async. processing pipelinebooleanChecks if the supplier has a status change since the last call of this method.voidcompleteWrappingOperationIfApplicable(Object bmOperationHandle) Complete implicit wrapping operation if the implicit wrapping operation were started earlier in this threadvoiddeactivateContexts(String segmentId) Deactivates collected async computing contexts for a specified segmentvoidDisables auto-wrapping of BM tasks with orchestrator operations for the current thread.voidDisables implicit waiting of the DD independenly of the current system status.voidDumps current pipeline statevoidEnables an auto-wrapping of BM tasks with orchestrator operations for the current thread.voidEnables implicit waiting of the DD independenly of the current system status.Checks if a supplier requests a reset of currently computed non-priority tasks (e.g. due to more prioritable operation is appeared)Gets the current pipeline status of the async. pipeline.Gets the information on the next available task (if any).Gets the current status of DD for the corresponding BM model.Gets the sync event consumer for the integration with the event processing flow ofIBmModel.Gets the current desired multithreading policy for current set of tasks of this supplier.Gets the next task for the processing.getSegmentName(String segmentId) Gets the human-readable segment name for the given pipeline segment.Gets the supplier id for easier discrimination by the scheduling facility.getTaskProcessor(DerivedDataComputationTask computationTask) Gets the processing logic for the given task.voidimplicitDerivedDataWait(Object computationCause) Waits for the derived data computation from the BM task that is wrapped by the implicit/explicit orchestrated operationbooleanChecks if all derived data parts are computed.booleanisComputed(long bmObjectId, String segmentId) Checks if the given part is computed for the given BM object.booleanisComputed(long bmObjectId, String partId, boolean strict) Checks if the given part is computed for the given BM object.booleanisComputed(long bmObjectId, Collection<String> segmentIds) Checks if the given parts are computed for the given BM object.booleanisComputed(String... segmentIds) Checks if the given DD segments are computed (if applicable) for all the BM objects.booleanisComputed(Collection<String> segmentIds) Checks if the given parts are computed (if applicable) for all the BM objects.booleanisIdle()Checks if the computation pipeline is idlebooleanisLongRunningSegment(String segmentId) Checks if the given async.booleanChecks if the scope tracking is activevoidMarks a current thread as a current modal operation participant.voidnotifyContextsAreScheduled(boolean notifyListeners) Notifies the task manager about finishing of the computation or new DD part scheduling.voidPrepares the async. computation facility for closing.voidProcesses accumulated DD contexts and update the DD pipeline.voidprocessUnfinishedCommits(List<IBmUnfinishedCommitInfo> commitInfo) Processes unfinished commits in case of EDT failure restoration.voidForces the DD mechanism to recompute all the known parts of all the known objects.voidregisterNotificationCallback(ISchedulerNotificationCallback notificationCallback) DerivedDataTaskSchedulerregisters a notification callback on start by calling this method.voidRemoves specific DD object status listener instance from the notification chain.voidremoveOperation(Object handle) Removes the previously scheduled operation.voidRemoves listener that will be notified about derived data status changes.renderStatusText(String segmentId) Renders human-readable status of the given async.voidresetActiveWrappingOperationContext(OperationContext operationContext) Resets the active wrapping operation context associated with the current thread.voidResets the lock being set earlierscheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, DerivedDataSegmentBucket stage, IModalOperationController modalOperationController) Schedules the orchestrated modal operation.scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, DerivedDataSegmentBucket stage) Schedules the orchestrated operation.setStageLock(DerivedDataSegmentBucket stage, boolean allowDataComputing) Locks the async. pipeline stage (to support manual operations with external pipeline state control).voidstart(IBmModel bmModel, BiConsumer<BmEvent, Boolean> bmEventConsumer) Starts task preparation process.voidEnables the massive computing mode for the DD pipeline.voidstartWrappingOperationIfNesessary(Object bmOperationHandle) Starts implicit wrapping operation for the specifiedIBmTaskin this thread in case if no operation is manually started alreadyvoidstop()Stops task preparation process.voidsupplyImplicitOperationContextIfApplicable(Object computationCause, Runnable asyncEventScheduler) Computes synchronous derived data pending for the current session (if any).voidTries to unblock the supplier, if blockedvoidunblockAsyncPipeline(boolean forcedStop) Force unblocking of the async. pipeline.booleanupdateDerivedData(IDerivedDataUpdate update, long waitTimeout, Object computationCause) Updates derivided data using the providedIDerivedDataUpdateupdatebooleanupdateDerviedData(IDerivedDataUpdate update, long waitTimeout) Updates derivided data using the providedIDerivedDataUpdateupdatebooleanwaitAllComputations(long timeout) Wait till all computations are finished or waiting time exceeds the specified value.booleanwaitComputation(long timeout, boolean priority, String... scope) Waits completion of the given scopevoidwaitComputation(Map<Long, Collection<String>> scope) Waits till the given scope of computations is finished.booleanwaitComputation(Map<Long, Collection<String>> scope, long timeout) Waits till the given scope of computations is finished or waiting time exceeds the specified value.booleanwaitComputationExt(Map<Object, Collection<String>> scope, long timeout) Waits till the given scope of computations is finished or waiting time exceeds the specified value.booleanwaitImportantDataComputations(long timeout) Waits all important DD's to be computed.booleanwaitOperationComputation(Object handle, long timeout) Waits the given operation computation
-
Constructor Details
-
DerivedDataManager
public DerivedDataManager(String projectId, IDerivedDataInfoRepository derivedDataInfoRepository, IDerivedDataContextManager contextManager, IContextTransactionManager contextTransactionManager, IDerivedDataServiceLockController lockController, Supplier<Boolean> synchronizationActiveStateSupplier, Collection<DerivedDataSegmentDefinition> segmentDefinitions, Set<String> filteredSegments, IAsyncProcessingPipeline pipeline, Collection<IDerivedDataComputer> computers, Collection<IContextCollector> fullRebuildCollectors, Collection<IRemovalContextCollector> removalCollectors, Collection<IDerivedDataUpdate> restorationUpdates, Collection<IDerivedDataUpdate> forcedDataUpdates) Construct a new instance, performs basic initialization.- Parameters:
projectId- The unique identifier of the DT project. May not benullderivedDataInfoRepository- The repository to persistderived data info. May not benull.contextManager- Thederived data contextmanager. May not benull.contextTransactionManager- The DD context operation facility. May not benull.lockController- The external derived data calculation lock controlling service. May not benull.segmentDefinitions- A collection ofsegment definitions. May not benull.filteredSegments- The set of segment ids that should be ommitted during the computation. May not benull. May be emptypipeline- The processing pipeline for asynchronous derived data. May not benull.computers- A collection ofcomputers. May not benull.fullRebuildCollectors- A collection offull rebuild collectors. May not benull.removalCollectors- A collection ofremoval collectors. May not benull.restorationUpdates- A collection ofrestoration update scenarios. May not benull.forcedDataUpdates- A collection offorced data update scenarios. May not benull.
-
-
Method Details
-
addObjectStatusListener
public void addObjectStatusListener(IDerivedDataObjectStatusListener listener, long bmObjectId, String... segments) Description copied from interface:IDerivedDataManagerAdds listener for DD status changes of the given object and set of tracked DD segments.- Specified by:
addObjectStatusListenerin interfaceIDerivedDataManager- Parameters:
listener- The listener instance. Cannot benull. One can re-use the same instance of the listener to subscribe for different sets of objects and segments, but in this case the call to theIDerivedDataManager.removeObjectStatusListener(com._1c.g5.v8.derived.IDerivedDataObjectStatusListener)will remove all subscriptions.bmObjectId- The identifier of the object which DD changes are being notified via the supplied listener. Cannot benullor empty due to performance reasons. To track down computation of the entire DD segment useIDerivedDataManager#addStatusListener(IDerivedDataStatusListener)instead}.segments- DD segment filter allows to subscribe for specific segments of DD. Cannot benull
-
addObjectStatusListener
public void addObjectStatusListener(IDerivedDataObjectStatusListener listener, Map<Long, Collection<String>> scope) Description copied from interface:IDerivedDataManagerAdds listener for DD status changes of the given DD change scope. The scope is defined as a map of BM object identifiers to the respective traked DD segments.- Specified by:
addObjectStatusListenerin interfaceIDerivedDataManager- Parameters:
listener- The listener instance. Cannot benull. One can re-use the same instance of the listener to subscribe for different sets of objects and segments, but in this case the call to theIDerivedDataManager.removeObjectStatusListener(com._1c.g5.v8.derived.IDerivedDataObjectStatusListener)will remove all subscriptions.scope- Tracked DD segments mapped to corresponding BM object ids. Cannot benull. Scope entries cannot containnullor empty sets of tracked DD segments.
-
addStatusListener
Description copied from interface:IDerivedDataManagerAdds listener that will be notified about derived data status changes.- Specified by:
addStatusListenerin interfaceIDerivedDataManager- Parameters:
listener- the listener that should be notified
-
blockAsyncPipeline
public void blockAsyncPipeline(boolean forcedStop) Description copied from interface:IDerivedDataManagerBlocks the async. processing pipeline. This methods waits until all current DD operations are finished before return from the call.- Specified by:
blockAsyncPipelinein interfaceIDerivedDataManager- Parameters:
forcedStop- Locks pipeline in forced mode. In case if true, could be unlocked only with corresponding value of the flag. Forced lock is being used to prevent file sycnhronization opearions/etc to remove manually defined locks.
-
blockAsyncPipeline
public void blockAsyncPipeline(boolean forcedStop, boolean wait) Description copied from interface:IDerivedDataManagerBlocks the async. processing pipeline- Specified by:
blockAsyncPipelinein interfaceIDerivedDataManager- Parameters:
forcedStop- Locks pipeline in forced mode. In case if true, could be unlocked only with corresponding value of the flag. Forced lock is being used to prevent file sycnhronization opearions/etc to remove manually defined locks.wait- Wait until all running operations in the current pipeline are completed
-
prepareForClose
public void prepareForClose()Description copied from interface:IDerivedDataManagerPrepares the async. computation facility for closing. Blocks all unnecessary data computations and scheduled operations and waits until all required computations are done- Specified by:
prepareForClosein interfaceIDerivedDataManager
-
disableImplicitWaiting
public void disableImplicitWaiting()Description copied from interface:IDerivedDataManagerDisables implicit waiting of the DD independenly of the current system status. Used during the explicitely managed operations, like merging, etc.- Specified by:
disableImplicitWaitingin interfaceIDerivedDataManager
-
enableImplicitWaiting
public void enableImplicitWaiting()Description copied from interface:IDerivedDataManagerEnables implicit waiting of the DD independenly of the current system status. Used during the explicitely managed operations, like merging, etc.- Specified by:
enableImplicitWaitingin interfaceIDerivedDataManager
-
getAsyncPipelineStatus
Gets the current pipeline status of the async. pipeline.- Specified by:
getAsyncPipelineStatusin interfaceIComputationTaskManager- Returns:
- The status of the pipeline.
-
getAvailableTaskStatus
Description copied from interface:IDerivedDataTaskSupplierGets the information on the next available task (if any).- Specified by:
getAvailableTaskStatusin interfaceIDerivedDataTaskSupplier- Returns:
- The task status for a next available task. Never
null
-
getDerivedDataStatus
Description copied from interface:IDerivedDataManagerGets the current status of DD for the corresponding BM model.- Specified by:
getDerivedDataStatusin interfaceIDerivedDataManager- Returns:
- The overall status of the DD facility.
-
isIdle
public boolean isIdle()Description copied from interface:IDerivedDataManagerChecks if the computation pipeline is idle- Specified by:
isIdlein interfaceIDerivedDataManager- Returns:
- True if no computations are done/possible at the moment
-
getActiveNonPriorityTasksResetRequiredStage
Description copied from interface:IDerivedDataTaskSupplierChecks if a supplier requests a reset of currently computed non-priority tasks (e.g. due to more prioritable operation is appeared)- Specified by:
getActiveNonPriorityTasksResetRequiredStagein interfaceIDerivedDataTaskSupplier- Returns:
- Stage to reset non-priority tasks (if any).
nullif not reset is required
-
getMultithreadingPolicy
Description copied from interface:IDerivedDataTaskSupplierGets the current desired multithreading policy for current set of tasks of this supplier.- Specified by:
getMultithreadingPolicyin interfaceIDerivedDataTaskSupplier- Returns:
- Gets the current policy. Cannot be
null
-
getNextTask
Description copied from interface:IDerivedDataTaskSupplierGets 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:
getNextTaskin interfaceIDerivedDataTaskSupplier- Returns:
- The next task if available. Can be
nullin case if the state was changed since the last call of theIDerivedDataTaskSupplier.getAvailableTaskStatus()
-
getSegmentName
Description copied from interface:IComputationTaskManagerGets the human-readable segment name for the given pipeline segment.- Specified by:
getSegmentNamein interfaceIComputationTaskManager- Parameters:
segmentId- The identifier of the target segment.- Returns:
- The the name of the segment.
-
getSupplierId
Description copied from interface:IDerivedDataTaskSupplierGets the supplier id for easier discrimination by the scheduling facility. The identifier should be unique in the current session of the EDT- Specified by:
getSupplierIdin interfaceIDerivedDataTaskSupplier- Returns:
- The supplier identifier. Cannot be
null
-
getTaskProcessor
Description copied from interface:IDerivedDataTaskSupplierGets 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:
getTaskProcessorin interfaceIDerivedDataTaskSupplier- Parameters:
computationTask- The computation task, cannot benull- Returns:
- The
ITaskProcessorwhich is able to perform the DD computation for this task. Cannot benull
-
isAllComputed
public boolean isAllComputed()Description copied from interface:IDerivedDataManagerChecks if all derived data parts are computed.- Specified by:
isAllComputedin interfaceIDerivedDataManager- Returns:
trueif computed,falseotherwise
-
isComputed
Description copied from interface:IDerivedDataManagerChecks if the given parts are computed (if applicable) for all the BM objects.- Specified by:
isComputedin interfaceIDerivedDataManager- Returns:
trueif computed,falseotherwise
-
isComputed
Checks if the given parts are computed for the given BM object.- Specified by:
isComputedin interfaceIDerivedDataManager- Parameters:
bmObjectId- the ID of the BM object to check- Returns:
trueif computed,falseotherwise
-
isComputed
Description copied from interface:IDerivedDataManagerChecks if the given part is computed for the given BM object.- Specified by:
isComputedin interfaceIDerivedDataManager- Parameters:
bmObjectId- the ID of the BM object to checksegmentId- the ID of the part to check- Returns:
trueif computed,falseotherwise
-
isComputed
Description copied from interface:IDerivedDataManagerChecks if the given part is computed for the given BM object.- Specified by:
isComputedin interfaceIDerivedDataManager- Parameters:
bmObjectId- the ID of the BM object to checkpartId- the ID of the part to checkstrict- In strict mode caller expecting, that part must be calculated. In case if part is still not indicated, the method will return false- Returns:
trueif computed,falseotherwise
-
isComputed
Description copied from interface:IDerivedDataManagerChecks if the given DD segments are computed (if applicable) for all the BM objects.- Specified by:
isComputedin interfaceIDerivedDataManager- Parameters:
segmentIds- Array of the DD segment Ids to check- Returns:
trueif computed,falseotherwise
-
isLongRunningSegment
Description copied from interface:IComputationTaskManagerChecks if the given async. DD segment is a long-running one.- Specified by:
isLongRunningSegmentin interfaceIComputationTaskManager- Parameters:
segmentId- The target segment identifier.- Returns:
- True if the segment is long-running one; false otherwise.
-
notifyContextsAreScheduled
public void notifyContextsAreScheduled(boolean notifyListeners) Description copied from interface:IComputationTaskManagerNotifies the task manager about finishing of the computation or new DD part scheduling.- Specified by:
notifyContextsAreScheduledin interfaceIComputationTaskManager- Parameters:
notifyListeners- Notify task listeners.
-
processUnfinishedCommits
Processes unfinished commits in case of EDT failure restoration.- Parameters:
commitInfo- The list of commit data records that need to be processed. Cannot benull
-
applyForcedUpdates
public void applyForcedUpdates()Description copied from interface:IDerivedDataManagerApplies all forced updates provided byIDerivedDataConfigurationContributor's- Specified by:
applyForcedUpdatesin interfaceIDerivedDataManager
-
recomputeAll
public void recomputeAll()Description copied from interface:IDerivedDataManagerForces the DD mechanism to recompute all the known parts of all the known objects.- Specified by:
recomputeAllin interfaceIDerivedDataManager
-
registerNotificationCallback
Description copied from interface:IDerivedDataTaskSupplierDerivedDataTaskSchedulerregisters 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:
registerNotificationCallbackin interfaceIDerivedDataTaskSupplier- Parameters:
notificationCallback- The callback from theDerivedDataTaskScheduler, cannot benull
-
removeObjectStatusListener
Description copied from interface:IDerivedDataManagerRemoves specific DD object status listener instance from the notification chain. All subscriptions of the given listener instance will be removed as a result.- Specified by:
removeObjectStatusListenerin interfaceIDerivedDataManager- Parameters:
listener- The listener that should be removed. Cannot benull.
-
removeStatusListener
Description copied from interface:IDerivedDataManagerRemoves listener that will be notified about derived data status changes.- Specified by:
removeStatusListenerin interfaceIDerivedDataManager- Parameters:
listener- the listener that should be removed.
-
renderStatusText
Renders human-readable status of the given async. DD pipeline segment.- Specified by:
renderStatusTextin interfaceIComputationTaskManager- Parameters:
segmentId- The identifier of the taget segment.- Returns:
- The rendered status of the pipeline segment.
-
start
Starts task preparation process.- Parameters:
bmModel-bmRawEventHandler-
-
stop
public void stop()Stops task preparation process. -
unblockAsyncPipeline
public void unblockAsyncPipeline(boolean forcedStop) Description copied from interface:IDerivedDataManagerForce unblocking of the async. pipeline. Could stay blocked after the call of this method if async. DD computation prerequisites are not met yet.- Specified by:
unblockAsyncPipelinein interfaceIDerivedDataManager- Parameters:
forcedStop- Unblocks the forced block in case if true. Unblocks usual lock instead.
-
updateDerviedData
Description copied from interface:IDerivedDataManagerUpdates derivided data using the providedIDerivedDataUpdateupdate- Specified by:
updateDerviedDatain interfaceIDerivedDataManager- Parameters:
update- The update to performwaitTimeout- Waiting time (in milliseconds) for the updated DD to be re-computed; 0 means no wait- Returns:
- True if the requested DD were computed until the end of the waiting period; false otherwise
-
updateDerivedData
public boolean updateDerivedData(IDerivedDataUpdate update, long waitTimeout, Object computationCause) Description copied from interface:IDerivedDataManagerUpdates derivided data using the providedIDerivedDataUpdateupdate- Specified by:
updateDerivedDatain interfaceIDerivedDataManager- Parameters:
update- The update to performwaitTimeout- Waiting time (in milliseconds) for the updated DD to be scheduled in the pipelinecomputationCause- The designator of operation or service which caused the update. May benull- Returns:
- True if the requested DD were computed until the end of the waiting period; false otherwise
-
supplyImplicitOperationContextIfApplicable
public void supplyImplicitOperationContextIfApplicable(Object computationCause, Runnable asyncEventScheduler) throws InterruptedException Description copied from interface:IDerivedDataManagerComputes synchronous derived data pending for the current session (if any). The computation is synchronous.- Specified by:
supplyImplicitOperationContextIfApplicablein interfaceIDerivedDataManager- Parameters:
computationCause- The object bound to the computation context and used to track computations. Can benull- Throws:
InterruptedException
-
implicitDerivedDataWait
Description copied from interface:IDerivedDataManagerWaits for the derived data computation from the BM task that is wrapped by the implicit/explicit orchestrated operation- Specified by:
implicitDerivedDataWaitin interfaceIDerivedDataManager- Parameters:
computationCause- The cause of the computation. May not beNullPointerException- Throws:
InterruptedException
-
waitAllComputations
Description copied from interface:IDerivedDataManagerWait till all computations are finished or waiting time exceeds the specified value.- Specified by:
waitAllComputationsin interfaceIDerivedDataManager- Parameters:
timeout- the maximum time to wait in milliseconds- Returns:
trueif all derived data has been computed by the time this method returns,falseotherwise- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computations.
-
waitComputation
public boolean waitComputation(long timeout, boolean priority, String... scope) throws InterruptedException Description copied from interface:IDerivedDataManagerWaits completion of the given scope- Specified by:
waitComputationin interfaceIDerivedDataManager- Parameters:
timeout- The wait timeoutpriority- The data that is being waited are priority computationsscope- The scope (parts) to wait- Returns:
- True if the wait was successful; false if it was timed out
- Throws:
InterruptedException
-
waitComputation
Description copied from interface:IDerivedDataManagerWaits till the given scope of computations is finished.- Specified by:
waitComputationin interfaceIDerivedDataManager- Parameters:
scope- the scope of computations to wait for. The scope is a map, where the keys are BM objects whose derived data parts must be computed and the values are collections of the part IDs- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computation
-
waitComputation
public boolean waitComputation(Map<Long, Collection<String>> scope, long timeout) throws InterruptedExceptionDescription copied from interface:IDerivedDataManagerWaits till the given scope of computations is finished or waiting time exceeds the specified value.- Specified by:
waitComputationin interfaceIDerivedDataManager- Parameters:
scope- the scope of computations to wait for. The scope is a map, where the keys are BM objects whose derived data parts must be computed and the values are collections of the part IDstimeout- the maximum time to wait in milliseconds- Returns:
trueif the given scope has been computed by the time this method returns,falseotherwise- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computation.
-
waitOperationComputation
Description copied from interface:IDerivedDataManagerWaits the given operation computation- Specified by:
waitOperationComputationin interfaceIDerivedDataManager- Parameters:
handle- The operation computation handle. May not beNullPointerExceptiontimeout- the maximum time to wait in milliseconds- Returns:
trueif the given scope has been computed by the time this method returns,falseotherwise- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computation.
-
waitComputationExt
public boolean waitComputationExt(Map<Object, Collection<String>> scope, long timeout) throws InterruptedExceptionDescription copied from interface:IDerivedDataManagerWaits till the given scope of computations is finished or waiting time exceeds the specified value.- Specified by:
waitComputationExtin interfaceIDerivedDataManager- Parameters:
scope- the scope of computations to wait for. The scope is a map, where the keys are BM objects whose derived data parts must be computed and the values are collections of the part IDstimeout- the maximum time to wait in milliseconds- Returns:
trueif the given scope has been computed by the time this method returns,falseotherwise- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computation.
-
waitImportantDataComputations
Description copied from interface:IDerivedDataManagerWaits all important DD's to be computed. The rule to select important DD's is the following:
- All data from
DerivedDataSegmentBucket.SYNCbucket - All data from
DerivedDataSegmentBucket.AFTER_SYNCbucket - All data from
DerivedDataSegmentBucket.NORMALbucket having a priority greater thenDerivedDataSegmentDefinition.LOW_PRIORITY
- Specified by:
waitImportantDataComputationsin interfaceIDerivedDataManager- Parameters:
timeout- the maximum time to wait in milliseconds- Returns:
trueif all derived data has been computed by the time this method returns,falseotherwise- Throws:
InterruptedException- if any thread interrupted the current thread before or while the current thread was waiting for the computations.
- All data from
-
processAccumulatedContexts
public void processAccumulatedContexts()Description copied from interface:IDerivedDataTaskSupplierProcesses 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:
processAccumulatedContextsin interfaceIDerivedDataTaskSupplier
-
checkStatusChange
public boolean checkStatusChange()Description copied from interface:IDerivedDataTaskSupplierChecks 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:
checkStatusChangein interfaceIDerivedDataTaskSupplier- Returns:
- True if there is a status change since the last call of this method
-
tryToUnblock
public void tryToUnblock()Description copied from interface:IDerivedDataTaskSupplierTries to unblock the supplier, if blocked- Specified by:
tryToUnblockin interfaceIDerivedDataTaskSupplier
-
startMassiveComputing
public void startMassiveComputing()Description copied from interface:IDerivedDataManagerEnables the massive computing mode for the DD pipeline. The mode is being desingaged after computing of all registered important tasks- Specified by:
startMassiveComputingin interfaceIDerivedDataManager
-
scheduleOperation
public Object scheduleOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, OperationType operationType, boolean important, DerivedDataSegmentBucket stage) Description copied from interface:IDerivedDataManagerSchedules the orchestrated operation.- Specified by:
scheduleOperationin interfaceIDerivedDataManager- Parameters:
operation- The operation logic to schedule. May not benulloperationType- The type of the operation. May not benullimportant- The designator of an important operation. The system waits for important operations computation during closing of projects, etcstage- The target stage for the scheduling. May not benull- Returns:
- The operation handle for external operation referencing, may not be
null
-
scheduleModalOperation
public Object scheduleModalOperation(Consumer<org.eclipse.core.runtime.IProgressMonitor> operation, DerivedDataSegmentBucket stage, IModalOperationController modalOperationController) Description copied from interface:IDerivedDataManagerSchedules the orchestrated modal operation. SeeOperationType.MODALfor details- Specified by:
scheduleModalOperationin interfaceIDerivedDataManager- Parameters:
operation- The operation logic to schedule. May not benullstage- The target stage for the scheduling. May not benullmodalOperationController- The modal operation controller. May not benull- Returns:
- The operation handle for external operation referencing, may not be
null
-
setStageLock
public StageLockRequestResult setStageLock(DerivedDataSegmentBucket stage, boolean allowDataComputing) Description copied from interface:IDerivedDataManagerLocks the async. pipeline stage (to support manual operations with external pipeline state control). Locked bucket tasks are being computed yet the pipeline can't switch to the next stage. The pre-set lock is being activated only after switching of the pipeline to the target stage. Before the activation the lock doesn't affect the computation.- Specified by:
setStageLockin interfaceIDerivedDataManager- Parameters:
stage- The stage to lock. May not benull- Returns:
- The status of a target stage at the moment of a lock call. May not be
null
-
resetStageLock
Description copied from interface:IDerivedDataManagerResets the lock being set earlier- Specified by:
resetStageLockin interfaceIDerivedDataManager- Parameters:
stage- The stage to re-set the bucket. May not benull. If block isn't set - does nothing.
-
removeOperation
Description copied from interface:IDerivedDataManagerRemoves the previously scheduled operation. Does nothing if the operation is already removed/computed- Specified by:
removeOperationin interfaceIDerivedDataManager- Parameters:
handle- The operation handle taken from theIDerivedDataManager#scheduleOperation(Consumer, OperationType, DerivedDataSegmentBucket)call. May not be null.
-
markAsModalOperationParticipant
public void markAsModalOperationParticipant()Description copied from interface:IDerivedDataManagerMarks a current thread as a current modal operation participant. The mark is removed automatically on the completion of the corresponding modal operation- Specified by:
markAsModalOperationParticipantin interfaceIDerivedDataManager
-
startWrappingOperationIfNesessary
Description copied from interface:IDerivedDataManagerStarts implicit wrapping operation for the specifiedIBmTaskin this thread in case if no operation is manually started already- Specified by:
startWrappingOperationIfNesessaryin interfaceIDerivedDataManager- Parameters:
bmOperationHandle- The BM operation handle to wrap with the orchestrated operation. May not benull
-
completeWrappingOperationIfApplicable
Description copied from interface:IDerivedDataManagerComplete implicit wrapping operation if the implicit wrapping operation were started earlier in this thread- Specified by:
completeWrappingOperationIfApplicablein interfaceIDerivedDataManager- Parameters:
bmOperationHandle- The BM operation handle to wrap with the orchestrated operation. May not benull
-
resetActiveWrappingOperationContext
Description copied from interface:IDerivedDataManagerResets the active wrapping operation context associated with the current thread.- Specified by:
resetActiveWrappingOperationContextin interfaceIDerivedDataManager- Parameters:
operationContext- The context to reset. May not benull
-
getEventConsumer
Description copied from interface:IDerivedDataManagerGets the sync event consumer for the integration with the event processing flow ofIBmModel. Also it's possible to supply BM events directly to the consumer in complex scenarios of managed data updates- Specified by:
getEventConsumerin interfaceIDerivedDataManager- Returns:
- The DD
BmEventconsumer. May not benull
-
disableAutoWrapping
public void disableAutoWrapping()Description copied from interface:IDerivedDataManagerDisables auto-wrapping of BM tasks with orchestrator operations for the current thread. Used for async data computations being controlled directly by the async pipeline. The disablement stays on during the whole thread lifecycle- Specified by:
disableAutoWrappingin interfaceIDerivedDataManager
-
enableAutoWrapping
public void enableAutoWrapping()Description copied from interface:IDerivedDataManagerEnables an auto-wrapping of BM tasks with orchestrator operations for the current thread. Used to restore an auto-wrapping being disabled previously- Specified by:
enableAutoWrappingin interfaceIDerivedDataManager
-
isScopeTrackingActive
public boolean isScopeTrackingActive()Description copied from interface:IScopeTrackerControllerChecks if the scope tracking is active- Specified by:
isScopeTrackingActivein interfaceIScopeTrackerController- Returns:
- True if the scope tracking is active
-
deactivateContexts
Description copied from interface:IContextActivationCallbackDeactivates collected async computing contexts for a specified segment- Specified by:
deactivateContextsin interfaceIContextActivationCallback- Parameters:
segmentId- The async computing pipeline segment. Cannot benull
-
activateContexts
Description copied from interface:IContextActivationCallbackReactivates collected async computing contexts for a specified segment. Do nothing if contexts were not deactivated earlier- Specified by:
activateContextsin interfaceIContextActivationCallback- Parameters:
segmentId- The async computing pipeline segment. Cannot benull
-
dumpPipeline
public void dumpPipeline()Description copied from interface:IDerivedDataManagerDumps current pipeline state- Specified by:
dumpPipelinein interfaceIDerivedDataManager
-