OpenSearch/modules
Alan Woodward e2f006eeb4
Merge FetchSubPhase hitsExecute and hitExecute methods (#60907) (#61893)
FetchSubPhase has two 'execute' methods, one which takes all hits to be examined,
and one which takes a single HitContext. It's not obvious which one should be implemented
by a given sub-phase, or if implementing both is a possibility; nor is it obvious that we first
run the hitExecute methods of all subphases, and then subsequently call all the
hitsExecute methods.

This commit reworks FetchSubPhase to replace these two variants with a processor class,
`FetchSubPhaseProcessor`, that is returned from a single `getProcessor` method.  This
processor class has two methods, `setNextReader()` and `process`.  FetchPhase collects
processors from all its subphases (if a subphase does not need to execute on the current
search context, it can return `null` from `getProcessor`).  It then sorts its hits by docid, and
groups them by lucene leaf reader.  For each reader group, it calls `setNextReader()` on
all non-null processors, and then passes each doc id to `process()`.

Implementations of fetch sub phases can divide their concerns into per-request, per-reader
and per-document sections, and no longer need to worry about sorting docs or dealing with
reader slices.

FetchSubPhase now provides a FetchSubPhaseExecutor that exposes two methods,
setNextReader(LeafReaderContext) and execute(HitContext). The parent FetchPhase collects all
these executors together (if a phase should not be executed, then it returns null here); then
it sorts hits, and groups them by reader; for each reader it calls setNextReader, and then
execute for each hit in turn. Individual sub phases no longer need to concern themselves with
sorting docs or keeping track of readers; global structures can be built in
getExecutor(SearchContext), per-reader structures in setNextReader and per-doc in execute.
2020-09-03 12:20:55 +01:00
..
aggs-matrix-stats Replace AggregatorTestCase#search with AggregatorTestCase#searchAndReduce (#60816) 2020-08-10 17:23:00 +02:00
analysis-common Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
geo Add search `fields` parameter to support high-level field retrieval. (#60258) 2020-07-28 10:58:20 -07:00
ingest-common [7.x] Enhance the ingest node simulate verbose output (#60433) (#60678) 2020-08-27 16:53:09 -05:00
ingest-geoip Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
ingest-user-agent Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
kibana [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
lang-expression Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
lang-mustache Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
lang-painless Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
mapper-extras Add specific test for serializing all mapping parameter values (#61844) (#61877) 2020-09-03 09:20:26 +01:00
parent-join Support longs in BitArray (backport of #61867) (#61871) 2020-09-02 17:24:31 -04:00
percolator Merge FetchSubPhase hitsExecute and hitExecute methods (#60907) (#61893) 2020-09-03 12:20:55 +01:00
rank-eval [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
reindex Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
repository-url [7.x] Introduce javaRestTest source set/task and convert modules (#59939) (#60026) 2020-07-28 08:39:11 -05:00
systemd Encapsulate systemd extender 2020-04-20 21:17:42 -04:00
transport-netty4 Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00