Commit 170ea27
authored
Refactor the filter rewrite optimization (#14464)
* Refactor
Split the single Helper classes and move the classes into a new package for any optimization we introduced for search path.
Rename the class name to make it more straightforward and general
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
refactor the canOptimize logic
sort out the basic rule about how to provide data from aggregator, and where to put common logic
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
refactor the data provider and try optimize logic
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
extract segment match all logic
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor
inline class
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Fix a bug
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* address comment
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* prepareFromSegment now doesn't return Ranges
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* how it looks like when introduce interfaces
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* remove interface, clean up
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* improve doc
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* move multirangetraversal logic to helper
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* improve the refactor
package name -> filterrewrite
move tree traversal logic to new class
add documentation for important abstract methods
add sub class for composite aggregation bridge
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Address Marc's comments
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Address concurrent segment search concern
To save the ranges per segment, now change to a map that save ranges for segments separately.
The increment document function "incrementBucketDocCount" should already be thread safe, as it's the same method used by normal aggregation execution path
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* remove circular dependency
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Address comment
- remove map of segment ranges, pass in by calling getRanges when needed
- use AtomicInteger for the debug info
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
---------
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>1 parent 978d14e commit 170ea27
14 files changed
Lines changed: 1256 additions & 1027 deletions
File tree
- server/src/main/java/org/opensearch/search/aggregations/bucket
- composite
- filterrewrite
- histogram
- range
Lines changed: 0 additions & 849 deletions
This file was deleted.
Lines changed: 59 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | | - | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
181 | 173 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
197 | 190 | | |
198 | | - | |
199 | 191 | | |
200 | | - | |
201 | | - | |
202 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
203 | 196 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
207 | 200 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 201 | + | |
| 202 | + | |
214 | 203 | | |
215 | | - | |
216 | 204 | | |
217 | | - | |
218 | | - | |
219 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
| |||
368 | 374 | | |
369 | 375 | | |
370 | 376 | | |
371 | | - | |
| 377 | + | |
372 | 378 | | |
373 | 379 | | |
374 | 380 | | |
| |||
551 | 557 | | |
552 | 558 | | |
553 | 559 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
| 560 | + | |
559 | 561 | | |
560 | 562 | | |
561 | 563 | | |
| |||
709 | 711 | | |
710 | 712 | | |
711 | 713 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
| 714 | + | |
718 | 715 | | |
719 | 716 | | |
server/src/main/java/org/opensearch/search/aggregations/bucket/filterrewrite/AggregatorBridge.java
Lines changed: 84 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments