- java.lang.Object
-
- com.pervasive.datarush.matching.Phase
-
public class Phase extends Object
Configures a phase of field comparisons, classifiers and a filter to use during a matching operation. A matching operation may be composed with multiple phases. A phase must contain comparisons and a filter. It can contain multiple classifiers, but classifiers are not required by a phase.Comparisons are linked to classifiers by a field name. A comparison produces an output field (a score). Multiple scores are normally fed into a classifier which produces an aggregated score. It is also possible to configure a classifer to take the output of multiple classifiers. A filter is used to filter out records that don't meet the criteria of the filter. The result of a comparison may also be directly fed into a filter when a classifier is not needed.
The result of a phase is a set of field comparison results that are classified into an aggregate score(s) that are used to filter record pairs. Only record pairs that meet the filter criteria are pushed to the resultant data flow.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Phase.CleanupMode
Specifies which fields to remove from records after completion of a phase.
-
Constructor Summary
Constructors Constructor Description Phase()
Construct an empty phase.Phase(Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.Phase(List<Comparison> comparisons, Classifier classifier, Filter filter, Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.Phase(List<Comparison> comparisons, List<Classifier> classifiers, Filter filter, Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClassifier(ClassifierType type, String[] fieldNames)
Add a classifier to this phase using the default output field name.void
addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName)
Add a classifier to this phase.void
addClassifier(ClassifierType type, String[] fieldNames, String propertyName, Object propertyValue)
Add a classifier to this phase.void
addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, String propertyName, Object propertyValue)
Add a classifier to this phase.void
addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, Map<String,Object> properties)
Add a classifier to this phase.void
addClassifier(ClassifierType type, String[] fieldNames, Map<String,Object> properties)
Add a classifier to this phase.void
addClassifiers(Classifier... classifier)
Add a classifier to this phase.void
addComparison(Comparison comparison)
Add a comparison to this phase.void
addComparison(String leftField, String rightField, ComparisonType op, String outputField)
Add a comparison to this phase.void
addComparison(String leftField, String rightField, ComparisonType op, String outputField, String propertyName, Object propertyValue)
Add a comparison to this phase.void
addComparison(String leftField, String rightField, ComparisonType op, String outputField, Map<String,Object> properties)
Add a comparison to this phase.List<Classifier>
getClassifiers()
Get the list of classifiers configured for this phase.Phase.CleanupMode
getCleanupMode()
Gets the cleanup mode configured for phases.List<Comparison>
getComparisons()
Get the list of comparisons configured for this phase.Filter
getFilter()
Get the filter configured for this phase.void
setClassifiers(List<Classifier> classifiers)
Set the classifiers for this phase.void
setCleanupMode(Phase.CleanupMode cleanupMode)
Sets the cleanup mode to apply after a phase completes.void
setComparisons(List<Comparison> comparisons)
Set the comparisons to use in this phase.void
setFilter(Filter filter)
Set the filter to use for this phase.void
setFilter(FilterType type, String propertyName, Object propertyValue)
Set the filter to use for this phase using the default output field name.void
setFilter(FilterType type, String fieldName, String propertyName, Object propertyValue)
Set the filter to use for this phase.void
setFilter(FilterType type, String fieldName, Map<String,Object> properties)
Set the filter to use for this phase.
-
-
-
Constructor Detail
-
Phase
public Phase()
Construct an empty phase. Before execution, comparison, classifier and filter information will need to be supplied.
-
Phase
public Phase(Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration. Before execution, comparison, classifier and filter information will need to be supplied.- Parameters:
cleanupMode
- indicates how to handle input and intermediate fields- See Also:
setComparisons(List)
,setClassifiers(List)
,setFilter(Filter)
-
Phase
public Phase(List<Comparison> comparisons, Classifier classifier, Filter filter, Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.- Parameters:
comparisons
- configuration of the comparisons to executeclassifier
- configuration of the classifier to usefilter
- configuration of the filter to usecleanupMode
- indicates how to handle input and intermediate fields
-
Phase
public Phase(List<Comparison> comparisons, List<Classifier> classifiers, Filter filter, Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.- Parameters:
comparisons
- configuration of the comparisons to executeclassifiers
- configuration of the classifiers to usefilter
- configuration of the filter to usecleanupMode
- indicates how to handle input and intermediate fields
-
-
Method Detail
-
setComparisons
public void setComparisons(List<Comparison> comparisons)
Set the comparisons to use in this phase. Replaces any comparisons already set.- Parameters:
comparisons
- configuration of the comparisons to execute
-
addComparison
public void addComparison(Comparison comparison)
Add a comparison to this phase.- Parameters:
comparison
- configuration of a comparison
-
addComparison
public void addComparison(String leftField, String rightField, ComparisonType op, String outputField)
Add a comparison to this phase.- Parameters:
leftField
- left hand side field to comparerightField
- right hand side field to compareop
- the comparison operation to executeoutputField
- name of the field with the comparison result
-
addComparison
public void addComparison(String leftField, String rightField, ComparisonType op, String outputField, String propertyName, Object propertyValue)
Add a comparison to this phase.- Parameters:
leftField
- left hand side field to comparerightField
- right hand side field to compareop
- the comparison operation to executeoutputField
- name of the field with the comparison resultpropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific property
-
addComparison
public void addComparison(String leftField, String rightField, ComparisonType op, String outputField, Map<String,Object> properties)
Add a comparison to this phase.- Parameters:
leftField
- left hand side field to comparerightField
- right hand side field to compareop
- the comparison operation to executeoutputField
- name of the field with the comparison resultproperties
- implementation specific properties
-
getComparisons
public List<Comparison> getComparisons()
Get the list of comparisons configured for this phase.- Returns:
- list of comparisons configured for this phase
-
getClassifiers
public List<Classifier> getClassifiers()
Get the list of classifiers configured for this phase.- Returns:
- list of classifiers configured for this phase
-
addClassifiers
public void addClassifiers(Classifier... classifier)
Add a classifier to this phase.- Parameters:
classifier
- configuration of a classifier
-
setClassifiers
public void setClassifiers(List<Classifier> classifiers)
Set the classifiers for this phase. Replaces any classifiers already set.- Parameters:
classifiers
- classifiers for this phase
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames)
Add a classifier to this phase using the default output field name.- Parameters:
type
- classifier typefieldNames
- names of input fields
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName)
Add a classifier to this phase.- Parameters:
type
- classifier typefieldNames
- names of input fieldsoutputFieldName
- name of the field with the classifier result
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames, String propertyName, Object propertyValue)
Add a classifier to this phase.- Parameters:
type
- classifier typefieldNames
- names of input fieldspropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific property
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames, Map<String,Object> properties)
Add a classifier to this phase.- Parameters:
type
- classifier typefieldNames
- names of input fieldsproperties
- implementation specific properties
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, String propertyName, Object propertyValue)
Add a classifier to this phase.- Parameters:
type
- classifier typefieldNames
- names of input fieldsoutputFieldName
- name of the field with the classifier resultpropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific property
-
addClassifier
public void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, Map<String,Object> properties)
Add a classifier to this phase.- Parameters:
type
- classifier typefieldNames
- names of input fieldsoutputFieldName
- name of the field with the classifier resultproperties
- implementation specific properties
-
getFilter
public Filter getFilter()
Get the filter configured for this phase.- Returns:
- configured filter
-
setFilter
public void setFilter(Filter filter)
Set the filter to use for this phase.- Parameters:
filter
- configured filter
-
setFilter
public void setFilter(FilterType type, String fieldName, Map<String,Object> properties)
Set the filter to use for this phase.- Parameters:
type
- filter typefieldName
- input field nameproperties
- implementation specific properties
-
setFilter
public void setFilter(FilterType type, String fieldName, String propertyName, Object propertyValue)
Set the filter to use for this phase.- Parameters:
type
- filter typefieldName
- input field namepropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific property
-
setFilter
public void setFilter(FilterType type, String propertyName, Object propertyValue)
Set the filter to use for this phase using the default output field name.- Parameters:
type
- filter typepropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific property
-
getCleanupMode
public Phase.CleanupMode getCleanupMode()
Gets the cleanup mode configured for phases.- Returns:
- the configured post-phase cleanup.
-
setCleanupMode
public void setCleanupMode(Phase.CleanupMode cleanupMode)
Sets the cleanup mode to apply after a phase completes.- Parameters:
cleanupMode
- the post-phase cleanup action
-
-