Package com._1c.g5.v8.derived
Interface IDerivedDataManager
-
public interface IDerivedDataManager
Derived data manager is responsible for providing clients with the unified access to the DD management functionality, including status tracking.
-
-
Field Summary
Fields Modifier and Type Field Description static String
SERVICE_NAME
Service name for recovery orchestrator
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addObjectStatusListener(IDerivedDataObjectStatusListener listener, long bmObjectId, String... segments)
Adds listener for DD status changes of the given object and set of tracked DD segments.void
addObjectStatusListener(IDerivedDataObjectStatusListener listener, Map<Long,Collection<String>> scope)
Adds listener for DD status changes of the given DD change scope.void
addStatusListener(IDerivedDataStatusListener listener)
Adds listener that will be notified about derived data status changes.void
blockAsyncPipeline(boolean forcedStop)
Blocks the async.void
disableImplicitWaiting()
Disables implicit waiting of the DD independenly of the current system status.void
enableImplicitWaiting()
Enables implicit waiting of the DD independenly of the current system status.DerivedDataStatus
getDerivedDataStatus()
Gets the current status of DD for the corresponding BM model.boolean
isAllComputed()
Checks if all derived data parts are computed.boolean
isComputed(long bmObjectId, String segmentId)
Checks if the given part is computed for the given BM object.boolean
isComputed(long bmObjectId, String partId, boolean strict)
Checks if the given part is computed for the given BM object.boolean
isComputed(long bmObjectId, Collection<String> segmentIds)
Checks if the given parts are computed for the given BM object.boolean
isComputed(String... segmentIds)
Checks if the given DD segments are computed (if applicable) for all the BM objects.boolean
isComputed(Collection<String> segmentIds)
Checks if the given parts are computed (if applicable) for all the BM objects.void
recomputeAll()
Forces the DD mechanism to recompute all the known parts of all the known objects.void
removeObjectStatusListener(IDerivedDataObjectStatusListener listener)
Removes specific DD object status listener instance from the notification chain.void
removeStatusListener(IDerivedDataStatusListener listener)
Removes listener that will be notified about derived data status changes.void
startMassiveComputing()
Enables the massive computing mode for the DD pipeline.void
unblockAsyncPipeline(boolean forcedStop)
Force unblocking of the async.boolean
updateDerviedData(IDerivedDataUpdate update, long waitTimeout)
Updates derivided data using the providedIDerivedDataUpdate
updatevoid
waitAccumulatedDerivedDataComputation(Object computationCause)
Computes synchronous derived data pending for the current session (if any).boolean
waitAllComputations(long timeout)
Wait till all computations are finished or waiting time exceeds the specified value.boolean
waitComputation(long timeout, boolean priority, String... scope)
Waits completion of the given scopevoid
waitComputation(Map<Long,Collection<String>> scope)
Waits till the given scope of computations is finished.boolean
waitComputation(Map<Long,Collection<String>> scope, long timeout)
Waits till the given scope of computations is finished or waiting time exceeds the specified value.boolean
waitComputationExt(Map<Object,Collection<String>> scope, long timeout)
Waits till the given scope of computations is finished or waiting time exceeds the specified value.boolean
waitImportandDataComputations(long timeout)
Waits all important DD's to be computed.
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
Service name for recovery orchestrator- See Also:
- Constant Field Values
-
-
Method Detail
-
addObjectStatusListener
void addObjectStatusListener(IDerivedDataObjectStatusListener listener, long bmObjectId, String... segments)
Adds listener for DD status changes of the given object and set of tracked DD segments.- 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 theremoveObjectStatusListener(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 benull
or 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
void addObjectStatusListener(IDerivedDataObjectStatusListener listener, Map<Long,Collection<String>> scope)
Adds 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.- 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 theremoveObjectStatusListener(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 containnull
or empty sets of tracked DD segments.
-
addStatusListener
void addStatusListener(IDerivedDataStatusListener listener)
Adds listener that will be notified about derived data status changes.- Parameters:
listener
- the listener that should be notified
-
blockAsyncPipeline
void blockAsyncPipeline(boolean forcedStop)
Blocks the async. processing pipeline. This methods waits until all current DD operations are finished before return from the call.- 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.
-
disableImplicitWaiting
void disableImplicitWaiting()
Disables implicit waiting of the DD independenly of the current system status. Used during the explicitely managed operations, like merging, etc.
-
enableImplicitWaiting
void enableImplicitWaiting()
Enables implicit waiting of the DD independenly of the current system status. Used during the explicitely managed operations, like merging, etc.
-
getDerivedDataStatus
DerivedDataStatus getDerivedDataStatus()
Gets the current status of DD for the corresponding BM model.- Returns:
- The overall status of the DD facility.
-
isAllComputed
boolean isAllComputed()
Checks if all derived data parts are computed.- Returns:
true
if computed,false
otherwise
-
isComputed
boolean isComputed(Collection<String> segmentIds)
Checks if the given parts are computed (if applicable) for all the BM objects.- Parameters:
partIds
- the IDs of the parts to check- Returns:
true
if computed,false
otherwise
-
isComputed
boolean isComputed(long bmObjectId, Collection<String> segmentIds)
Checks if the given parts are computed for the given BM object.- Parameters:
bmObjectId
- the ID of the BM object to checkpartIds
- the IDs of the parts to check- Returns:
true
if computed,false
otherwise
-
isComputed
boolean isComputed(long bmObjectId, String segmentId)
Checks if the given part is computed for the given BM object.- Parameters:
bmObjectId
- the ID of the BM object to checksegmentId
- the ID of the part to check- Returns:
true
if computed,false
otherwise
-
isComputed
boolean isComputed(long bmObjectId, String partId, boolean strict)
Checks if the given part is computed for the given BM object.- 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:
true
if computed,false
otherwise
-
isComputed
boolean isComputed(String... segmentIds)
Checks if the given DD segments are computed (if applicable) for all the BM objects.- Parameters:
segmentIds
- Array of the DD segment Ids to check- Returns:
true
if computed,false
otherwise
-
recomputeAll
void recomputeAll()
Forces the DD mechanism to recompute all the known parts of all the known objects.
-
removeObjectStatusListener
void removeObjectStatusListener(IDerivedDataObjectStatusListener listener)
Removes specific DD object status listener instance from the notification chain. All subscriptions of the given listener instance will be removed as a result.- Parameters:
listener
- The listener that should be removed. Cannot benull
.
-
removeStatusListener
void removeStatusListener(IDerivedDataStatusListener listener)
Removes listener that will be notified about derived data status changes.- Parameters:
listener
- the listener that should be removed.
-
unblockAsyncPipeline
void unblockAsyncPipeline(boolean forcedStop)
Force unblocking of the async. pipeline. Could stay blocked after the call of this method if async. DD computation prerequisites are not met yet.- Parameters:
forcedStop
- Unblocks the forced block in case if true. Unblocks usual lock instead.
-
updateDerviedData
boolean updateDerviedData(IDerivedDataUpdate update, long waitTimeout)
Updates derivided data using the providedIDerivedDataUpdate
update- 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
-
waitAccumulatedDerivedDataComputation
void waitAccumulatedDerivedDataComputation(Object computationCause) throws InterruptedException
Computes synchronous derived data pending for the current session (if any). The computation is synchronous.- Parameters:
computationCause
- The object bound to the computation context and used to track computations. Can benull
- Throws:
InterruptedException
-
waitAllComputations
boolean waitAllComputations(long timeout) throws InterruptedException
Wait till all computations are finished or waiting time exceeds the specified value.- Parameters:
timeout
- the maximum time to wait in milliseconds- Returns:
true
if all derived data has been computed by the time this method returns,false
otherwise- Throws:
InterruptedException
- if any thread interrupted the current thread before or while the current thread was waiting for the computations.
-
waitImportandDataComputations
boolean waitImportandDataComputations(long timeout) throws InterruptedException
Waits all important DD's to be computed. The rule to select important DD's is the following:
- All data from
DerivedDataSegmentBucket.SYNC
bucket - All data from
DerivedDataSegmentBucket.AFTER_SYNC
bucket - All data from
DerivedDataSegmentBucket.NORMAL
bucket having a priority greater thenDerivedDataSegmentDefinition.LOW_PRIORITY
- Parameters:
timeout
- the maximum time to wait in milliseconds- Returns:
true
if all derived data has been computed by the time this method returns,false
otherwise- Throws:
InterruptedException
- if any thread interrupted the current thread before or while the current thread was waiting for the computations.
- All data from
-
waitComputation
boolean waitComputation(long timeout, boolean priority, String... scope) throws InterruptedException
Waits completion of the given scope- 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
void waitComputation(Map<Long,Collection<String>> scope) throws InterruptedException
Waits till the given scope of computations is finished.- 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
boolean waitComputation(Map<Long,Collection<String>> scope, long timeout) throws InterruptedException
Waits till the given scope of computations is finished or waiting time exceeds the specified value.- 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:
true
if the given scope has been computed by the time this method returns,false
otherwise- Throws:
InterruptedException
- if any thread interrupted the current thread before or while the current thread was waiting for the computation.
-
waitComputationExt
boolean waitComputationExt(Map<Object,Collection<String>> scope, long timeout) throws InterruptedException
Waits till the given scope of computations is finished or waiting time exceeds the specified value.- 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:
true
if the given scope has been computed by the time this method returns,false
otherwise- Throws:
InterruptedException
- if any thread interrupted the current thread before or while the current thread was waiting for the computation.
-
startMassiveComputing
void startMassiveComputing()
Enables the massive computing mode for the DD pipeline. The mode is being desingaged after computing of all registered important tasks
-
-