Class ComparisonQueue
java.lang.Object
com._1c.g5.v8.dt.internal.compare.queue.ComparisonQueue
DT project comparison queue used in the comparison process for comparing model nodes.
It organizes comparison tasks represented by identifiers of model nodes to be compared by scheduling new tasks,
gathering next tasks to be executed, and prioritizing existing tasks on request.
-
Constructor Summary
ConstructorsConstructorDescriptionComparisonQueue
(ComparisonSession comparisonSession) Constructs a comparison queue. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Confirms the comparison process completion of a task with the specified id.gather()
Gathers a new task to be executed.int
Returns the total number of top objects in the queue.boolean
Checks if the queue is currently finished, that is, it has no pending or currently executed tasks.boolean
isScheduled
(Long id) Checks if the task is already scheduled but not processed yet.void
prioritize
(List<Long> nodeIds) Adds the specified nodes to the list of priority tasks.void
Reschedules the task at the end of the queue that failed to compare by some reason.void
rescheduleFailedComparison
(Long id, boolean heavy) void
schedule
(long nodeId) Schedules the comparison of the specified node.
-
Constructor Details
-
ComparisonQueue
Constructs a comparison queue.- Parameters:
comparisonSession
- the comparison session of the queue
-
-
Method Details
-
comparisonFinished
Confirms the comparison process completion of a task with the specified id.- Parameters:
id
- the completed task id, notnull
-
gather
Gathers a new task to be executed.- Returns:
- a new task id, may be
null
if the queue is empty or no tasks are currently available
-
getTotalTopObjects
public int getTotalTopObjects()Returns the total number of top objects in the queue.- Returns:
- the total number of top objects in the queue
-
isFinished
public boolean isFinished()Checks if the queue is currently finished, that is, it has no pending or currently executed tasks.- Returns:
true
if the queue is currently finished, andfalse
otherwise
-
isScheduled
Checks if the task is already scheduled but not processed yet.- Parameters:
id
- The comparison node to check.- Returns:
- True of the task is already scheduled. False otherwise.
-
prioritize
Adds the specified nodes to the list of priority tasks. This also includes recursive adding of all tasks that represent the children of these nodes to the priority list.- Parameters:
nodeIds
- the ids of the nodes to be added to priority tasks, notnull
-
rescheduleFailedComparison
Reschedules the task at the end of the queue that failed to compare by some reason.- Parameters:
id
- the task id to reschedule, notnull
-
rescheduleFailedComparison
-
schedule
public void schedule(long nodeId) Schedules the comparison of the specified node.- Parameters:
nodeId
- the scheduled node identifier
-