Skip to content

Commit

Permalink
passing config for Merge() as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Thejas-bhat committed Sep 6, 2024
1 parent c49bc71 commit de21e72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index/scorch/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ func (s *Scorch) planMergeAtSnapshot(ctx context.Context,

atomic.AddUint64(&s.stats.TotFileMergeZapBeg, 1)
prevBytesReadTotal := cumulateBytesRead(segmentsToMerge)
newDocNums, _, err := s.segPlugin.Merge(segmentsToMerge, docsToDrop, path,
cw.cancelCh, s)
newDocNums, _, err := s.segPlugin.MergeEx(segmentsToMerge, docsToDrop, path,
cw.cancelCh, s, s.segmentConfig)
atomic.AddUint64(&s.stats.TotFileMergeZapEnd, 1)

fileMergeZapTime := uint64(time.Since(fileMergeZapStartTime))
Expand Down Expand Up @@ -469,7 +469,7 @@ func (s *Scorch) mergeSegmentBases(snapshot *IndexSnapshot,
path := s.path + string(os.PathSeparator) + filename

newDocNums, _, err :=
s.segPlugin.Merge(sbs, sbsDrops, path, s.closeCh, s)
s.segPlugin.MergeEx(sbs, sbsDrops, path, s.closeCh, s, s.segmentConfig)

atomic.AddUint64(&s.stats.TotMemMergeZapEnd, 1)

Expand Down
4 changes: 4 additions & 0 deletions index/scorch/segment_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ type SegmentPlugin interface {
Merge(segments []segment.Segment, drops []*roaring.Bitmap, path string,
closeCh chan struct{}, s segment.StatsReporter) (
[][]uint64, uint64, error)

MergeEx(segments []segment.Segment, drops []*roaring.Bitmap, path string,
closeCh chan struct{}, s segment.StatsReporter, config map[string]interface{}) (
[][]uint64, uint64, error)
}

var supportedSegmentPlugins map[string]map[uint32]SegmentPlugin
Expand Down

0 comments on commit de21e72

Please sign in to comment.