Conversation

olavloite

The Spanner Async API uses an ExecutorProvider for producing rows for an AsyncResultSet. The default that is automatically created is fine for most use cases, but did not allow users to override the default settings that are:

  • a pool containing at most 8 threads
  • threads automatically time out after 1 minute if they are not used

This PR adds the possibility for users to supply their own ExecutorProvider to use with the async API.

Fixes #1262

@olavloiteolavloite requested a review from a team as a code owner June 29, 2021 09:39
@product-auto-labelproduct-auto-label bot added the api: spannerIssues related to the googleapis/java-spanner API.label Jun 29, 2021
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if there are any metrics available for the thread pool? I think we should expose thread pool usage in cloud monitoring for the default executor.

@olavloite

Do you know if there are any metrics available for the thread pool? I think we should expose thread pool usage in cloud monitoring for the default executor.

The standard executor services in Java do not expose any metrics, so we would need to add that ourselves (or add some open source library, there are a couple that do this). I'll add a feature request for it to the repository.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on . Already have an account? Sign in to comment
api: spannerIssues related to the googleapis/java-spanner API.cla: yesThis human has signed the Contributor License Agreement.
None yet

Successfully merging this pull request may close these issues.

support for custom ExecutorProvider in SpannerOptions.Builder