grpc / grpc/grpc-java

Investigate bulk metadata functions

オープン
#5,596 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

Metadata provides limited public APIs for interaction, typically requiring a Metadata.Key to do any reads or writes. This is useful to an application, which may know the key name and marshaller ahead of time, but not so much for middle-ware which may need to scan for keys. As an example, a middle-ware that looks for metadata prefixes and builds a custom Key depending on the suffix of the key name has trouble with the existing Metadata API. It requires multiple iterations through the metadata, and up to O(n^2) ops when trying to extract values with duplicate key names.

Metadata is also mutable, and does not want to expose internals, as they may yet change. I am proposing some experimental APIs here to address the bulk metadata functions use case:

Option 1:

```
// For each value in the MD which matches the key prefix, return the parsed value
List walk(String keyPrefix, Metadata.BinaryMarshaller marshaller) {}
```

Option 2:

```
void walk(Function> nameToKeyFn, Consumer valueConsumer) {}
```

Option 3:
```
// For each value in the MD which matches the key prefix, return the parsed value
void walk(String keyPrefix, Metadata.BinaryMarshaller marshaller, BiConsumer> nameToKeyFn, BiConsumer

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

既存の Metadata API(Metadata.Key と BinaryMarshaller を含む)を確認することから始め、提案されている4つの walk オプションを、middleware のスキャンおよび重複キーのユースケースと比較します。bulk metadata API の設計について決定し、選択した動作を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。