IRISLIB database
MetricBuilder Class Reference
Inheritance diagram for MetricBuilder:
Collaboration diagram for MetricBuilder:

Public Member Functions

_.Library.Status CalculateCcUniMetrics (_.Library.Integer pCcUniId, _.Library.Integer pHeadId, _.Library.Integer pTailId, pValues)
 
_.Library.Status CalculateCrcUniMetrics (_.Library.Integer pCrcUniId, _.Library.Integer pHeadId, _.Library.Integer pRelationId, _.Library.Integer pTailId, pValues)
 
_.Library.Status CalculateEntUniMetrics (_.Library.Integer pEntUniId, _.Library.String pEntUniValue, pValues)
 
_.Library.Status CalculatePathMetrics (_.Library.Integer pPathId, _.Library.List pEntities, pValues)
 
_.Library.Status CalculateSentenceMetrics (_.Library.Integer pSentenceId, pValues)
 
_.Library.Status CalculateSourceMetrics (_.Library.Integer pSourceId, pValues)
 
_.Library.Status OnAfterBuildMetrics ()
 
_.Library.Status OnAfterBuildMetricsBatch (_.Library.Integer pFrom, _.Library.Integer pTo)
 
_.Library.Status OnAfterBuildMetricsForGroup ()
 
_.Library.Status OnAfterBuildMetricsForSource (_.Library.Integer pSrcId)
 
_.Library.Status OnBeforeBuildMetrics ()
 
_.Library.Status OnBeforeBuildMetricsBatch (_.Library.Integer pFrom, _.Library.Integer pTo)
 
_.Library.Status OnBeforeBuildMetricsForGroup ()
 
_.Library.Status OnBeforeBuildMetricsForSource (_.Library.Integer pSrcId)
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.Library.Status Build (_.Library.String pDomainId, _.iKnow.Filters.Filter pSourceFilter, _.Library.Boolean pVerbose, _.Library.Boolean pAsync)
 
_.Library.Status BuildAll (_.Library.String pDomainId, _.Library.List pMetrics, _.Library.String pSrcFilter, _.Library.Boolean pVerbose, _.Library.Boolean pAsync)
 
_.Library.Status BuildIndex (_.Library.Integer pDomainId, _.Library.Integer pMetricId, _.Library.String pTarget)
 

Public Attributes

 CurrentFieldId
 If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current. More...
 
 CurrentFieldName
 If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current. More...
 
 CurrentFieldValue
 If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current. More...
 
 CurrentFieldValueId
 If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current. More...
 
 CurrentSrcId
 If <property>Type</property> = $$$IKMTRTYPESOURCE, this property contains the current. More...
 
 DomainId
 @qualifier final   More...
 
 SrcFilter
 @qualifier final   More...
 
 Target
 @qualifier final   More...
 
 Type
 @qualifier final   More...
 

Static Public Attributes

 BATCHSIZE = None
 Indicates how many entries a process will reserve for itself to calculate per batch. More...
 
 SUPPORTSMULTIPROCESS = None
 This parameter indicates whether or not this MetricBuilder implementation supports. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

The <package>iKnow.Metrics</package> infrastructure is deprecated in favour of the more SQL-oriented approach offered through <class>iKnow.Tables.Utils</class>, where you can add computed fields at different levels and choose whether they need to be persisted or not.

Subclasses of this class should implement at least one of the Calculate***Metrics() methods in this interface to support calculating custom metrics for the corresponding target and type. Supported metrics should then register this subclass as their "builder class" in their definition (see <class>iKnow.Metrics.MetricDefinition</class>).

Metric Builder implementations are invoked through their <method>Build</method> or <method>BuildAll</method> methods and will then start building all applicable metrics, forwarding the actual metric calculations to the Calculate***Metrics() implementations (for example, <method>CalculateEntUniMetrics</method> for target $$$IKMTRENTITY and type $$$IKMTRTYPEDOMAIN). Instances of these implementations will be running in parallel if <parameter>SUPPORTSMULTIPROCESS</parameter> is set to 1 (default = 1), or will run single-threaded otherwise.

Note: When Calculate***Metrics() methods don't return any values for a particular target element, the existing metric value is retained (if any). Returning "" for a value will overwrite (erase) the existing value.

Member Function Documentation

◆ Build()

_.Library.Status Build ( _.Library.String  pDomainId,
_.iKnow.Filters.Filter  pSourceFilter,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pAsync 
)
static

Builds all the metrics referring this class in their BuilderClass property. See also

<method>BuildAll</method>.

◆ BuildAll()

_.Library.Status BuildAll ( _.Library.String  pDomainId,
_.Library.List  pMetrics,
_.Library.String  pSrcFilter,
_.Library.Boolean  pVerbose,
_.Library.Boolean  pAsync 
)
static

This is the main method to be invoked to build all the Metrics for a given domain,

optionally limited to a number of metrics specified by ID through pMetrics. It will build a list of all MetricBuilder implementations referred by registered metrics and then run through all targets and types. For each target, it will first invoke all MetricBuilder implementations NOT supporting parallel processing (with <parameter>SUPPORTSMULTIPROCESS</parameter>=0) and then spawn a number of jobs to take care of the ones that can run in parallel. These spawned processes will reserve batches of the target element (for example a batch of entities) and then let all MetricBuilder implementations that support metrics for that target run through them and calculate any metric values using the different Calculate***Metrics() methods.

Note: metrics can only be calculated in a domain in which they are already registered. See the Register() method in the <class>iKnow.Metrics.MetricDefinition</class> class for more details.

◆ BuildIndex()

_.Library.Status BuildIndex ( _.Library.Integer  pDomainId,
_.Library.Integer  pMetricId,
_.Library.String  pTarget 
)
static

This method builds an index for a particular Metric and Target.

Note: no indices will be built for metrics of type $$$IKMTRTYPESOURCE, as these intra-source entries will be sorted on the fly when calling any applicable sorted queries.

◆ CalculateCcUniMetrics()

_.Library.Status CalculateCcUniMetrics ( _.Library.Integer  pCcUniId,
_.Library.Integer  pHeadId,
_.Library.Integer  pTailId,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting CCs. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given unique CC pCcUniId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ CalculateCrcUniMetrics()

_.Library.Status CalculateCrcUniMetrics ( _.Library.Integer  pCrcUniId,
_.Library.Integer  pHeadId,
_.Library.Integer  pRelationId,
_.Library.Integer  pTailId,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting CRCs. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given unique CRC pCrcUniId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ CalculateEntUniMetrics()

_.Library.Status CalculateEntUniMetrics ( _.Library.Integer  pEntUniId,
_.Library.String  pEntUniValue,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting entities. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given unique entity pEntUniId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ CalculatePathMetrics()

_.Library.Status CalculatePathMetrics ( _.Library.Integer  pPathId,
_.Library.List  pEntities,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting Paths. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given path pPathId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ CalculateSentenceMetrics()

_.Library.Status CalculateSentenceMetrics ( _.Library.Integer  pSentenceId,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting sentences. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given sentence pSentenceId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ CalculateSourceMetrics()

_.Library.Status CalculateSourceMetrics ( _.Library.Integer  pSourceId,
  pValues 
)

This is the main method a custom MetricBuilder should implement to support metrics

targeting sources. Depending on the value of <property>Type</property>, the properties <property>CurrentSrcId</property> (for $$$IKMTRTYPESOURCE), <property>CurrentFieldName</property> and <property>CurrentFieldValue</property> (for $$$IKMTRTYPEGROUP) or neither of these (for $$$IKMTRTYPEDOMAIN) will define the scope for which metrics should be calculated.

For a given source pSourceId in the context of a given source pSrcId, this method should calculate all metrics it knows about and return them through pValues in an array indexed by metric name: pValues(metricName) = value

◆ OnAfterBuildMetrics()

_.Library.Status OnAfterBuildMetrics ( )

Utility method called after a MetricBuilder instance starts building any metrics, in which

custom code can be executed to clean up any auxiliary objects or data structures.

Note: depending on the value of <parameter>SUPPORTSMULTIPROCESS</parameter>, multiple MetricBuilder instances can be running alongside one another

◆ OnAfterBuildMetricsBatch()

_.Library.Status OnAfterBuildMetricsBatch ( _.Library.Integer  pFrom,
_.Library.Integer  pTo 
)

Utility method called after a MetricBuilder starts building any metrics for a batch

of elements, for metrics of type $$$IKMTRTYPEDOMAIN

◆ OnAfterBuildMetricsForGroup()

_.Library.Status OnAfterBuildMetricsForGroup ( )

Utility method called after a MetricBuilder instance finishes building any metrics for the

group identified by <property>CurrentFieldName</property> and <property>CurrentFieldValue</property>, for metrics of type $$$IKMTRTYPEGROUP.

◆ OnAfterBuildMetricsForSource()

_.Library.Status OnAfterBuildMetricsForSource ( _.Library.Integer  pSrcId)

Utility method called after a MetricBuilder starts building any metrics for the

source identified by pSrcId, for metrics of type $$$IKMTRTYPESOURCE.

◆ OnBeforeBuildMetrics()

_.Library.Status OnBeforeBuildMetrics ( )

Utility method called before a MetricBuilder instance starts building any metrics, in which

custom code can be executed to set up any auxiliary objects or data structures.

Note: depending on the value of <parameter>SUPPORTSMULTIPROCESS</parameter>, multiple MetricBuilder instances can be running alongside one another

◆ OnBeforeBuildMetricsBatch()

_.Library.Status OnBeforeBuildMetricsBatch ( _.Library.Integer  pFrom,
_.Library.Integer  pTo 
)

Utility method called before a MetricBuilder starts building any metrics for a batch

of elements, for metrics of type $$$IKMTRTYPEDOMAIN

◆ OnBeforeBuildMetricsForGroup()

_.Library.Status OnBeforeBuildMetricsForGroup ( )

Utility method called before a MetricBuilder instance starts building any metrics for the

group identified by <property>CurrentFieldName</property> and <property>CurrentFieldValue</property>, for metrics of type $$$IKMTRTYPEGROUP.

◆ OnBeforeBuildMetricsForSource()

_.Library.Status OnBeforeBuildMetricsForSource ( _.Library.Integer  pSrcId)

Utility method called before a MetricBuilder instance starts building any metrics for the

source identified by pSrcId, for metrics of type $$$IKMTRTYPESOURCE.

Member Data Documentation

◆ BATCHSIZE

BATCHSIZE = None
static

Indicates how many entries a process will reserve for itself to calculate per batch.

The <package>iKnow.Metrics</package> infrastructure is deprecated in favour of the more SQL-oriented approach offered through <class>iKnow.Tables.Utils</class>, where you can add computed fields at different levels and choose whether they need to be persisted or not.

Subclasses of this class should implement at least one of the Calculate***Metrics() methods in this interface to support calculating custom metrics for the corresponding target and type. Supported metrics should then register this subclass as their "builder class" in their definition (see <class>iKnow.Metrics.MetricDefinition</class>).

Metric Builder implementations are invoked through their <method>Build</method> or <method>BuildAll</method> methods and will then start building all applicable metrics, forwarding the actual metric calculations to the Calculate***Metrics() implementations (for example, <method>CalculateEntUniMetrics</method> for target $$$IKMTRENTITY and type $$$IKMTRTYPEDOMAIN). Instances of these implementations will be running in parallel if <parameter>SUPPORTSMULTIPROCESS</parameter> is set to 1 (default = 1), or will run single-threaded otherwise.

Note: When Calculate***Metrics() methods don't return any values for a particular target element, the existing metric value is retained (if any). Returning "" for a value will overwrite (erase) the existing value.

◆ SUPPORTSMULTIPROCESS

SUPPORTSMULTIPROCESS = None
static

This parameter indicates whether or not this MetricBuilder implementation supports.

multiple instances running in parallel to optimize performance. By default, it is set to 1 which means different instances will work in parallel.

◆ CurrentFieldId

CurrentFieldId

If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current.

Metadata Field ID for which metrics are gathered. To be used from within the metrics calculation methods such as <method>CalculateEntityMetrics</method>.  

◆ CurrentFieldName

CurrentFieldName

If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current.

Metadata Field name for which metrics are gathered. To be used from within the metrics calculation methods such as <method>CalculateEntityMetrics</method>.  

◆ CurrentFieldValue

CurrentFieldValue

If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current.

Metadata Value for which metrics are gathered. To be used from within the metrics calculation methods such as <method>CalculateEntityMetrics</method>.  

◆ CurrentFieldValueId

CurrentFieldValueId

If <property>Type</property> = $$$IKMTRTYPEGROUP, this property contains the current.

Metadata Value ID for which metrics are gathered. To be used from within the metrics calculation methods such as <method>CalculateEntityMetrics</method>.  

◆ CurrentSrcId

CurrentSrcId

If <property>Type</property> = $$$IKMTRTYPESOURCE, this property contains the current.

Source ID for which metrics are gathered. To be used from within the metrics calculation methods such as <method>CalculateEntityMetrics</method>.  

◆ DomainId

DomainId

@qualifier final  

 

◆ SrcFilter

SrcFilter

@qualifier final  

 

◆ Target

Target

@qualifier final  

 

◆ Type

Type

@qualifier final