googleapis / googleapis/google-cloud-java

[sdk-platform-java] [ggj] generate example of ApiCallContext.withRetrySettings on client

Abierto
#12,543 1 comentario 0 reacciones 0 asignados Ver en GitHub
priority: p3 type: feature request
Lenguaje dominante
Java
Estrellas
2.1k
Forks
1.2k
Merge medio
1 d 23 h
PR fusionados (30 d)
157

Descripción

https://github.com/googleapis/gax-java/pull/1238 introduced a new feature to the `ApiCallContext` that allows end users to supply `RetrySetttings` to be used for a single method invocation. The examples and documentation in the PR are generic, and show how to create an entirely new `RetrySettings` instance to supply via `withRetrySettings`, but there is API specific documentation that ggj could generate that would greatly help users. We should generate a single, client-level example of configuring `RetrySettings` via the `ApiCallContext` in the GAPIC layer that utilizes that GAPIC's `StubSettings` class as a base `RetrySettings` to modify. An example usage is as follows:

```java
LanguageServiceClient client = LanguageServiceClient.create();

// In order to adjust the RetrySettings on a per-call basis, modify the default settings
// and supply it via the ApiCallContext.
RetrySettings retrySettings =
client
.getSettings()
.analyzeSentimentSettings()
.getRetrySettings()
.toBuilder()
.setTotalTimeout(Duration.ofSeconds(10L))
.builder();

ApiCallContext callContext = GrpcCallContext.createDefault().withRetrySettings(retrySettings);

client.analyzeSentimentCallable().call(request, callContext);
```

_Note: The spacing is probably off there._

A similar existing example in [`LanguageServiceStubSettings`](https://github.com/googleapis/java-language/blob/master/google-cloud-language/src/main/java/com/google/cloud/language/v1/stub/LanguageServiceStubSettings.java#L70-L85).

I'm thinking it would be generated in this [client-level doc comment](https://github.com/googleapis/java-language/blob/master/google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java#L61-L91) block somewhere.

cc: @miraleung

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con el comentario de documentación a nivel de cliente en google-cloud-language/src/main/java/com/google/cloud/language/v1/LanguageServiceClient.java y compara el ejemplo existente en LanguageServiceStubSettings.java. Rastrea cómo se generan estos comentarios y, a continuación, añade un ejemplo generado a nivel de cliente que muestre ApiCallContext.withRetrySettings usando una base de StubSettings RetrySettings; la tarea estará terminada cuando el ejemplo aparezca correctamente en los clientes GAPIC generados.

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

Evaluación

Stack tecnológico
java
Área
documentation
Tipo de issue
Documentación
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.