OpenSearch/plugins
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
..
analysis-icu Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-kuromoji Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-nori Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-phonetic Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-smartcn Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-stempel Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
analysis-ukrainian Upgrade to Lucene 8.6.2 (#61688) 2020-08-31 09:54:07 -04:00
discovery-azure-classic Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
discovery-ec2 Do not create two loggers for DeprecationLogger backport(#58435) (#61530) 2020-08-26 16:04:02 +02:00
discovery-gce Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
examples Merge test runner task into RestIntegTest (7.x backport) (#60600) 2020-08-04 14:46:32 +02:00
ingest-attachment Add data.path fast path for FilePermission (#61302) 2020-09-01 12:03:22 -06:00
mapper-annotated-text Merge FetchSubPhase hitsExecute and hitExecute methods (#60907) (#61893) 2020-09-03 12:20:55 +01:00
mapper-murmur3 Pass SearchLookup supplier through to fielddataBuilder (#61430) (#61638) 2020-08-27 18:09:56 +02:00
mapper-size Make MetadataFieldMapper extend ParametrizedFieldMapper (#59847) (#60924) 2020-08-11 09:02:28 +01:00
repository-azure [7.x] Convert repository-* from integTest to [yaml | java]RestTest or internalClusterTest (#60085) (#60404) 2020-07-29 11:19:44 -05:00
repository-gcs Remove GCS Bucket Exists Check (#60899) (#60914) 2020-08-11 09:54:27 +02:00
repository-hdfs Remove old test mute code (#61277) 2020-08-19 09:40:59 +01:00
repository-s3 Cleanly Handle S3 SDK Exceptions in Request Counting (#61686) (#61698) 2020-08-31 11:05:59 +02:00
store-smb [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00
transport-nio [7.x] Convert most OSS plugins from integTest to [yaml | java]RestTest or internalClusterTest (#59444) (#60343) 2020-07-29 13:06:13 -05:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00