public class Phase extends Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
Phase.CleanupMode
Specifies which fields to remove from records after
completion of a phase.
|
Constructor and Description |
---|
Phase()
Construct an empty phase.
|
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.
|
Phase(Phase.CleanupMode cleanupMode)
Construct a phase with the given configuration.
|
Modifier and Type | Method and 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,
Map<String,Object> properties)
Add a classifier to this phase.
|
void |
addClassifier(ClassifierType type,
String[] fieldNames,
String outputFieldName)
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,
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 |
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,
Map<String,Object> properties)
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.
|
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 fieldName,
Map<String,Object> properties)
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.
|
public Phase()
public Phase(Phase.CleanupMode cleanupMode)
cleanupMode
- indicates how to handle input and intermediate fieldssetComparisons(List)
,
setClassifiers(List)
,
setFilter(Filter)
public Phase(List<Comparison> comparisons, Classifier classifier, Filter filter, Phase.CleanupMode cleanupMode)
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 fieldspublic Phase(List<Comparison> comparisons, List<Classifier> classifiers, Filter filter, Phase.CleanupMode cleanupMode)
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 fieldspublic void setComparisons(List<Comparison> comparisons)
comparisons
- configuration of the comparisons to executepublic void addComparison(Comparison comparison)
comparison
- configuration of a comparisonpublic void addComparison(String leftField, String rightField, ComparisonType op, String outputField)
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 resultpublic void addComparison(String leftField, String rightField, ComparisonType op, String outputField, String propertyName, Object propertyValue)
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 propertypublic void addComparison(String leftField, String rightField, ComparisonType op, String outputField, Map<String,Object> properties)
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 propertiespublic List<Comparison> getComparisons()
public List<Classifier> getClassifiers()
public void addClassifiers(Classifier... classifier)
classifier
- configuration of a classifierpublic void setClassifiers(List<Classifier> classifiers)
classifiers
- classifiers for this phasepublic void addClassifier(ClassifierType type, String[] fieldNames)
type
- classifier typefieldNames
- names of input fieldspublic void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName)
type
- classifier typefieldNames
- names of input fieldsoutputFieldName
- name of the field with the classifier resultpublic void addClassifier(ClassifierType type, String[] fieldNames, String propertyName, Object propertyValue)
type
- classifier typefieldNames
- names of input fieldspropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific propertypublic void addClassifier(ClassifierType type, String[] fieldNames, Map<String,Object> properties)
type
- classifier typefieldNames
- names of input fieldsproperties
- implementation specific propertiespublic void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, String propertyName, Object propertyValue)
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 propertypublic void addClassifier(ClassifierType type, String[] fieldNames, String outputFieldName, Map<String,Object> properties)
type
- classifier typefieldNames
- names of input fieldsoutputFieldName
- name of the field with the classifier resultproperties
- implementation specific propertiespublic Filter getFilter()
public void setFilter(Filter filter)
filter
- configured filterpublic void setFilter(FilterType type, String fieldName, Map<String,Object> properties)
type
- filter typefieldName
- input field nameproperties
- implementation specific propertiespublic void setFilter(FilterType type, String fieldName, String propertyName, Object propertyValue)
type
- filter typefieldName
- input field namepropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific propertypublic void setFilter(FilterType type, String propertyName, Object propertyValue)
type
- filter typepropertyName
- name of an implementation specific propertypropertyValue
- value of an implementation specific propertypublic Phase.CleanupMode getCleanupMode()
public void setCleanupMode(Phase.CleanupMode cleanupMode)
cleanupMode
- the post-phase cleanup actionCopyright © 2021 Actian Corporation. All rights reserved.