Class StatisticsCollector
java.lang.Object
com.semedy.reasoner.reasoning.processes.StatisticsCollector
- All Implemented Interfaces:
ReasoningMonitor
Monitor to collect data about the evaluation to optimize during rule compiling and rule execution
- Author:
- angele
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
considerEDBRelations
(IntensionalDB idb, ExtensionalDB[] edbs) upfront determining all relevant edb relationsgetLiteralInformation
(Rule rule, Literal body) void
postBuiltinExecution
(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, long numResultTuples, ReasoningRelation result, String msg) Called after a built-in has been executedvoid
postEvaluation
(String query) Called immediately after evaluationvoid
postJoin
(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, ReasoningRelation[] relationB, long numResultTuples, ReasoningRelation result, String joinType, String msg) Called after a join or negation is executed.void
postRuleEvaluation
(Rule rule) called after a rule has been evaluatedvoid
preBuiltinExecution
(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, String msg) Called before a built-in is executed (only for aggregations or connector built-ins)void
preEvalution
(String query) Called before evaluation startsvoid
preFreeMemory
(String message, long memoryInBytes) called before freeing up "memoryInBytes" memoryvoid
preJoin
(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, ReasoningRelation[] relationB, String msg) Called before a join or negation is executed.void
preMemoryAllocation
(String message, long memoryInBytes) called before memory of size "memoryInBytes" will be allocatedvoid
preRuleEvaluation
(Rule rule) called before a rule is evaluatedvoid
setBuiltins
(BuiltinProvider builtins) Set the builtin providervoid
Set the intensional db, e.g. to utilize the rule graphvoid
setReasoningSymbolTable
(SymbolTable symbolTable) Set the symbol table
-
Constructor Details
-
StatisticsCollector
public StatisticsCollector()
-
-
Method Details
-
preMemoryAllocation
Description copied from interface:ReasoningMonitor
called before memory of size "memoryInBytes" will be allocated- Specified by:
preMemoryAllocation
in interfaceReasoningMonitor
-
preFreeMemory
Description copied from interface:ReasoningMonitor
called before freeing up "memoryInBytes" memory- Specified by:
preFreeMemory
in interfaceReasoningMonitor
-
preRuleEvaluation
Description copied from interface:ReasoningMonitor
called before a rule is evaluated- Specified by:
preRuleEvaluation
in interfaceReasoningMonitor
- Parameters:
rule
- , the rule
-
postRuleEvaluation
Description copied from interface:ReasoningMonitor
called after a rule has been evaluated- Specified by:
postRuleEvaluation
in interfaceReasoningMonitor
- Parameters:
rule
- , the rule
-
preJoin
public void preJoin(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, ReasoningRelation[] relationB, String msg) Description copied from interface:ReasoningMonitor
Called before a join or negation is executed.
NOTE All relation arguments should be considered temporary.
This means the content of these relations will change during the
reasoning process and cannot be accessed after this method returns.- Specified by:
preJoin
in interfaceReasoningMonitor
- Parameters:
rule
- the ruleliteral
- the body literaloperatorName
- the operatorreceiverName
- the next receiverrelationA
- the left relationrelationB
- the bottom relationmsg
- an additional message (might benull
)
-
postJoin
public void postJoin(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, ReasoningRelation[] relationB, long numResultTuples, ReasoningRelation result, String joinType, String msg) throws IOException, EDBException Description copied from interface:ReasoningMonitor
Called after a join or negation is executed.
NOTE All relation arguments should be considered temporary.
This means the content of these relations will change during the
reasoning process and cannot be accessed after this method returns.- Specified by:
postJoin
in interfaceReasoningMonitor
- Parameters:
rule
- the ruleliteral
- the body literaloperatorName
- the operatorreceiverName
- the next receiverrelationA
- the left relationrelationB
- the bottom relationnumResultTuples
- the number of (new) result tuplesresult
- the result relation. NOTE: This relation contains both new and existing tuples.joinType
- , the type of joinmsg
- an additional message (might benull
)- Throws:
IOException
EDBException
-
preBuiltinExecution
public void preBuiltinExecution(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, String msg) Description copied from interface:ReasoningMonitor
Called before a built-in is executed (only for aggregations or connector built-ins)- Specified by:
preBuiltinExecution
in interfaceReasoningMonitor
-
postBuiltinExecution
public void postBuiltinExecution(Rule rule, Literal literal, String operatorName, String receiverName, ReasoningRelation[] relationA, long numResultTuples, ReasoningRelation result, String msg) Description copied from interface:ReasoningMonitor
Called after a built-in has been executed- Specified by:
postBuiltinExecution
in interfaceReasoningMonitor
-
preEvalution
Description copied from interface:ReasoningMonitor
Called before evaluation starts- Specified by:
preEvalution
in interfaceReasoningMonitor
-
postEvaluation
Description copied from interface:ReasoningMonitor
Called immediately after evaluation- Specified by:
postEvaluation
in interfaceReasoningMonitor
-
setIntensionalDB
Description copied from interface:ReasoningMonitor
Set the intensional db, e.g. to utilize the rule graph- Specified by:
setIntensionalDB
in interfaceReasoningMonitor
-
setReasoningSymbolTable
Description copied from interface:ReasoningMonitor
Set the symbol table- Specified by:
setReasoningSymbolTable
in interfaceReasoningMonitor
-
getLiteralInformation
-
setBuiltins
Description copied from interface:ReasoningMonitor
Set the builtin provider- Specified by:
setBuiltins
in interfaceReasoningMonitor
- Parameters:
builtins
- built-in provider
-
considerEDBRelations
public void considerEDBRelations(IntensionalDB idb, ExtensionalDB[] edbs) throws IOException, EDBException Description copied from interface:ReasoningMonitor
upfront determining all relevant edb relations- Specified by:
considerEDBRelations
in interfaceReasoningMonitor
- Throws:
IOException
EDBException
-