Class ExecutionLoggerAdapter
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.ExecutionLoggerAdapter
-
- All Implemented Interfaces:
ILocalSearchAdapter
public final class ExecutionLoggerAdapter extends java.lang.Object implements ILocalSearchAdapter
- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description ExecutionLoggerAdapter(java.util.function.Consumer<java.lang.String> outputConsumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidduplicateMatchFound(MatchingFrame frame)Callback that is used to indicate that the previously reported match has been found as a duplicate, thus will be ignored from the match results.voidmatchFound(SearchPlan plan, MatchingFrame frame)Callback that is used to indicate that a match has been foundvoidnoMoreMatchesAvailable(LocalSearchMatcher lsMatcher)Callback method to indicate the end of a matching processvoidoperationExecuted(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isSuccessful)Callback method to indicate that an operation is executedvoidoperationSelected(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isBacktrack)Callback method to indicate the selection of an operation to executevoidpatternMatchingStarted(LocalSearchMatcher lsMatcher)Callback method to indicate the start of a matching processvoidplanChanged(java.util.Optional<SearchPlan> oldPlan, java.util.Optional<SearchPlan> newPlan)Callback method to indicate switching to a new plan during the execution of a pattern matching-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.localsearch.matcher.ILocalSearchAdapter
adapterRegistered, adapterUnregistered, executorInitializing
-
-
-
-
Method Detail
-
patternMatchingStarted
public void patternMatchingStarted(LocalSearchMatcher lsMatcher)
Description copied from interface:ILocalSearchAdapterCallback method to indicate the start of a matching process- Specified by:
patternMatchingStartedin interfaceILocalSearchAdapter- Parameters:
lsMatcher- the local search matcher that starts the matching
-
noMoreMatchesAvailable
public void noMoreMatchesAvailable(LocalSearchMatcher lsMatcher)
Description copied from interface:ILocalSearchAdapterCallback method to indicate the end of a matching process WARNING: It is not guaranteed that this method will be called; it is possible that a match process will end after a match is found and no other matches are accessed.- Specified by:
noMoreMatchesAvailablein interfaceILocalSearchAdapter- Parameters:
lsMatcher- the local search matcher that finished
-
planChanged
public void planChanged(java.util.Optional<SearchPlan> oldPlan, java.util.Optional<SearchPlan> newPlan)
Description copied from interface:ILocalSearchAdapterCallback method to indicate switching to a new plan during the execution of a pattern matching- Specified by:
planChangedin interfaceILocalSearchAdapter- Parameters:
oldPlan- the plan that is finished. Value is null when the first plan is starting.newPlan- the plan that will begin execution
-
operationSelected
public void operationSelected(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isBacktrack)
Description copied from interface:ILocalSearchAdapterCallback method to indicate the selection of an operation to execute- Specified by:
operationSelectedin interfaceILocalSearchAdapter- Parameters:
plan- the current plan executorframe- the current matching frameisBacktrack- if true, the selected operation was reached via backtracking
-
operationExecuted
public void operationExecuted(SearchPlan plan, ISearchOperation operation, MatchingFrame frame, boolean isSuccessful)
Description copied from interface:ILocalSearchAdapterCallback method to indicate that an operation is executed- Specified by:
operationExecutedin interfaceILocalSearchAdapter- Parameters:
plan- the current planframe- the current matching frameisSuccessful- if true, the operation executed successfully, or false if the execution failed and backtracking will happen
-
matchFound
public void matchFound(SearchPlan plan, MatchingFrame frame)
Description copied from interface:ILocalSearchAdapterCallback that is used to indicate that a match has been found- Specified by:
matchFoundin interfaceILocalSearchAdapter- Parameters:
plan- the search plan executor that found the matchframe- the frame that holds the substitutions of the variables that match
-
duplicateMatchFound
public void duplicateMatchFound(MatchingFrame frame)
Description copied from interface:ILocalSearchAdapterCallback that is used to indicate that the previously reported match has been found as a duplicate, thus will be ignored from the match results.- Specified by:
duplicateMatchFoundin interfaceILocalSearchAdapter- Parameters:
frame- the frame that holds the substitutions of the variables that match
-
-