java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.CompositeOperator
com.pervasive.datarush.matching.block.BlockRecords
- All Implemented Interfaces:
LogicalOperator
Block records into groups of like records based on a set of key fields
and generate record pairs from these groups.
Blocking records in this way allows reduces the number of record pairs
generated which leads to many less comparison operations. This can
dramatically speed up execution of record matching if the keys are
trustworthy.
The output is generated as a set of flows each containing record pairs generated from the input data source. Since the partitioning is based on key values, the output flows may be unbalanced in terms of the number of record pairs contained within each.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.Gets the output naming pattern for fields from the left hand input.Gets the record port providing the left hand input to the pair generation.String[]Gets the fields used as keys for data on the left hand side.Gets the record port providing the results of the pair generation.Gets the output naming pattern for fields from the right hand input.Gets the record port providing the right hand input to the pair generation.String[]Gets the fields used as keys for data on the right hand side.voidsetLeftFieldPattern(String pattern) Sets the output naming pattern for fields from the left hand input.voidsetLeftKeys(String[] keys) Sets the fields used as keys for data on the left hand side.voidsetRightFieldPattern(String pattern) Sets the output naming pattern for fields from the right hand input.voidsetRightKeys(String[] keys) Sets the fields used as keys for data on the right hand side.Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Constructor Details
-
BlockRecords
public BlockRecords()Generates pairs of records based on matching key fields. These fields must be identified before execution.- See Also:
-
-
Method Details
-
getLeftInput
Gets the record port providing the left hand input to the pair generation.- Returns:
- the left input port for the operation
-
getRightInput
Gets the record port providing the right hand input to the pair generation.- Returns:
- the right input port for the operation
-
getOutput
Gets the record port providing the results of the pair generation.- Returns:
- the output port for the operation
-
getLeftFieldPattern
Gets the output naming pattern for fields from the left hand input.- Returns:
- the pattern for the left hand side field names in output.
-
setLeftFieldPattern
Sets the output naming pattern for fields from the left hand input. This is used to ensure distinct names in the output pairs.- Parameters:
pattern- name pattern for the left hand side field names
-
getRightFieldPattern
Gets the output naming pattern for fields from the right hand input.- Returns:
- the pattern for the right hand side field names in output.
-
setRightFieldPattern
Sets the output naming pattern for fields from the right hand input. This is used to ensure distinct names in the output pairs.- Parameters:
pattern- name pattern for the right hand side field names
-
getLeftKeys
Gets the fields used as keys for data on the left hand side.- Returns:
- the key fields on the left hand side
-
setLeftKeys
Sets the fields used as keys for data on the left hand side. There must be an equal number of keys specified on the left and right sides. Only record pairs where these keys are equal will be output; key comparison is done by position.- Parameters:
keys- the key fields on the left hand side
-
getRightKeys
Gets the fields used as keys for data on the right hand side.- Returns:
- the key fields on the right hand side
-
setRightKeys
Sets the fields used as keys for data on the right hand side. There must be an equal number of keys specified on the left and right sides. Only record pairs where these keys are equal will be output; key comparison is done by position.- Parameters:
keys- the key fields on the right hand side
-
compose
Description copied from class:CompositeOperatorCompose the body of this operator. Implementations should do the following:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O) - Create necessary connections via the method
OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
composein classCompositeOperator- Parameters:
ctx- the context
-