Class 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 Details

    • 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:
  • Method Details

    • 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:
      1. Perform any validation of configuration, input types, etc
      2. Instantiate and configure sub-operators, adding them to the provided context via the method OperatorComposable.add(O)
      3. 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 class CompositeOperator
      Parameters:
      ctx - the context