Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support setting an async executor provider #1263

Merged
merged 2 commits into from Jun 30, 2021
Merged

Conversation

olavloite
Copy link
Collaborator

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

@olavloite olavloite requested a review from a team as a code owner June 29, 2021 09:39
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Jun 29, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 29, 2021
Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

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
Copy link
Collaborator Author

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.

Copy link

@pravsingh pravsingh left a comment

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 GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support for custom ExecutorProvider in SpannerOptions.Builder
3 participants