-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EQL: Introduce support for sequences (#56300)
Initial support for EQL sequences The current algorithm is focused on correctness and does not contain any optimization which is left for the future. The current implementation uses a state machine approach which moves ascending and runs each query one after the other working on computing sequences as the data comes in. For each result, the key and its timestamp are being extracted which are then used for matching/building a sequence.
- Loading branch information
Showing
65 changed files
with
2,940 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...k/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/assembler/Criterion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.eql.execution.assembler; | ||
|
||
import org.elasticsearch.search.builder.SearchSourceBuilder; | ||
import org.elasticsearch.xpack.ql.execution.search.extractor.HitExtractor; | ||
|
||
import java.util.List; | ||
|
||
public class Criterion { | ||
|
||
private final SearchSourceBuilder searchSource; | ||
private final List<HitExtractor> keyExtractors; | ||
private final HitExtractor timestampExtractor; | ||
|
||
public Criterion(SearchSourceBuilder searchSource, List<HitExtractor> searchAfterExractors, HitExtractor timestampExtractor) { | ||
this.searchSource = searchSource; | ||
this.keyExtractors = searchAfterExractors; | ||
this.timestampExtractor = timestampExtractor; | ||
} | ||
|
||
public SearchSourceBuilder searchSource() { | ||
return searchSource; | ||
} | ||
|
||
public List<HitExtractor> keyExtractors() { | ||
return keyExtractors; | ||
} | ||
|
||
public HitExtractor timestampExtractor() { | ||
return timestampExtractor; | ||
} | ||
|
||
public void fromTimestamp(long timestampMarker) { | ||
// TODO: this is likely to be rewritten afterwards | ||
searchSource.searchAfter(new Object[] { timestampMarker }); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../plugin/eql/src/main/java/org/elasticsearch/xpack/eql/execution/assembler/Executable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.eql.execution.assembler; | ||
|
||
import org.elasticsearch.action.ActionListener; | ||
import org.elasticsearch.xpack.eql.session.Results; | ||
|
||
public interface Executable { | ||
|
||
void execute(ActionListener<Results> resultsListener); | ||
} |
Oops, something went wrong.