- java.lang.Object
-
- com.pervasive.datarush.operators.AbstractLogicalOperator
-
- com.pervasive.datarush.operators.CompositeOperator
-
- com.pervasive.datarush.matching.block.BlockSelf
-
- All Implemented Interfaces:
LogicalOperator
public class BlockSelf extends CompositeOperator
Block records from a single source 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.
-
-
Constructor Summary
Constructors Constructor Description BlockSelf()
Block records from a single source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
compose(CompositionContext ctx)
Compose the body of this operator.RecordPort
getInput()
Gets the record port providing the input to the pair generation.String[]
getKeys()
Get the fields being used for blockingString
getLeftFieldPattern()
Gets the output naming pattern for fields on the left hand side of the pair.RecordPort
getOutput()
Gets the record port providing the results of the pair generation.String
getRightFieldPattern()
Gets the output naming pattern for fields on the right hand side of the pair.void
setKeys(String[] keys)
Set the fields to use as keys for blocking.void
setLeftFieldPattern(String pattern)
Sets the output naming pattern for fields on the left hand side of pairs.void
setRightFieldPattern(String pattern)
Sets the output naming pattern for fields on the right hand side of pairs.-
Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
-
-
-
Constructor Detail
-
BlockSelf
public BlockSelf()
Block records from a single source. Records from the source will be blocked based on key sets and record pairs generated from these groups. Key fields must be identified before execution.- See Also:
setKeys(String[])
-
-
Method Detail
-
getInput
public RecordPort getInput()
Gets the record port providing the input to the pair generation.- Returns:
- the input port for the operation
-
getOutput
public RecordPort getOutput()
Gets the record port providing the results of the pair generation.- Returns:
- the output port for the operation
-
getLeftFieldPattern
public String getLeftFieldPattern()
Gets the output naming pattern for fields on the left hand side of the pair.- Returns:
- the pattern for the left hand side field names in output.
-
setLeftFieldPattern
public void setLeftFieldPattern(String pattern)
Sets the output naming pattern for fields on the left hand side of pairs. This is used to ensure distinct names in the output pairs.- Parameters:
pattern
- name pattern for the left hand side field names
-
getRightFieldPattern
public String getRightFieldPattern()
Gets the output naming pattern for fields on the right hand side of the pair.- Returns:
- the pattern for the right hand side field names in output.
-
setRightFieldPattern
public void setRightFieldPattern(String pattern)
Sets the output naming pattern for fields on the right hand side of pairs. This is used to ensure distinct names in the output pairs.- Parameters:
pattern
- name pattern for the eight hand side field names
-
getKeys
public String[] getKeys()
Get the fields being used for blocking- Returns:
- the set of key fields
-
setKeys
public void setKeys(String[] keys)
Set the fields to use as keys for blocking. Only record pairs where these keys are equal will be output.- Parameters:
keys
- the set of key fields
-
compose
protected void compose(CompositionContext ctx)
Description copied from class:CompositeOperator
Compose 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:
compose
in classCompositeOperator
- Parameters:
ctx
- the context
-
-