Class SetEvaluator
This evaluator is stateful. It requires a reset for every new match. The method `resolveNewPositions()` returns a portion of positions corresponding to the new portion of the match since the last call. It is thus assumed that a sequence of calls since the instance creation or `reset()` applies to the same match (i.e. the `matchedLabels` passed as an argument to one call is prefix of `matchedLabels` passed in the next call).
Also, a full list of positions for a current match is kept, and it can be obtained via the `getAllPositions()` method. This is for the purpose comparing pattern matching threads in ThreadEquivalence.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()getAllPositions(ArrayView labels) longvoidreset()resolveNewPositions(int currentRow, ArrayView matchedLabels, int partitionStart, int patternStart) This method is used for resolving positions for aggregation: - During pattern matching.
-
Constructor Details
-
SetEvaluator
-
-
Method Details
-
reset
public void reset() -
resolveNewPositions
public ArrayView resolveNewPositions(int currentRow, ArrayView matchedLabels, int partitionStart, int patternStart) This method is used for resolving positions for aggregation: - During pattern matching. In this case, the evaluated label has been appended to `matchedLabels` - When computing row pattern measures after a non-empty match is found. Search is limited up to the current row in case of RUNNING semantics and to the entire match in case of FINAL semantics.TODO If `evaluated` exceeds `aggregated`, we could reuse the pre-evaluated positions. For that, we need to keep count of all previously returned positions from the `aggregated` prefix.
- Returns:
- array of new matching positions since the last call, relative to partition start
-
getAllPositions
-
copy
-
getAllPositionsSizeInBytes
public long getAllPositionsSizeInBytes()
-