grpc / grpc/grpc-java

Investigate bulk metadata functions

Abierto
#5,596 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
12.1k
Forks
4k
Merge medio
2 d 17 h
PR fusionados (30 d)
37

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza revisando la Metadata API existente, incluidos Metadata.Key y BinaryMarshaller, y compara las cuatro opciones de walk propuestas con los casos de uso de escaneo de middleware y claves duplicadas. Se considera terminado cuando se haya tomado una decisión sobre el diseño de la API de metadatos en bloque y se haya documentado el comportamiento seleccionado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
api
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.