quickwit-oss/quickwit

Refactor Source building

オープン

#1,064 opened on 2022/01/11

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (581 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (11,537 個のスター)
PR merge metrics
 (平均マージ 5d 18h) (30d で 41 merged PRs)

説明

In #1058, we did one step from (dynamic factory + json) to a static enum world in order to have source type specific source params validation.

We are now half-way between two worlds.

Solution 1

Just go full enum. The factory is a function of the enum. Pros: Very simple Cons: Does not separate the concern super well.

Note: If we go for that route, source_type() should return an enum too.

Solution 2

Use a SourceParams trait that can build a Source type (does the job of the factory) and do dark magic, like what @fmassot did for the IndexConfig deserialization.

コントリビューターガイド