Add Codec.merge() [LUCENE-4057]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Currently individual codec components can override/optimize merging, e.g. the stored fields impl
uses bulk copying when possible, and so on.
SegmentMerger contains the logic for merging the different codec components, for example it does
mergeFieldInfos(), then mergeFields(), mergeTerms(), and so on. Each of these methods interacts
with the codec apis to finish the merge.
I think it would be cleaner if SegmentMerger called a new method, Codec.merge(), which contained
this logic instead. This way someone could customize this process. I think we could probably even
push some of the impl-dependent stuff (like matchingSegmentReaders) into the impl and out of SegmentMerger.
Setting this for 4.1, I think it would be a nice cleanup but I don't plan on working on this immediately,
and I think we can do this in a backwards compatible way in a minor release.
---
Migrated from [LUCENE-4057](https://issues.apache.org/jira/browse/LUCENE-4057) by Robert Muir (@rmuir), updated May 09 2016
Contributor guide
Research direction
Start by reading SegmentMerger and its mergeFieldInfos(), mergeFields(), and mergeTerms() methods, then trace the codec APIs they call. Compare the existing component-specific merge behavior with the proposed Codec.merge() boundary. Done means the merge orchestration is customizable through Codec.merge() while preserving the stated backwards-compatibility goal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100