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

Use futures::stream in leaf functions #452

Closed
wants to merge 1 commit into from

Conversation

fmassot
Copy link
Contributor

@fmassot fmassot commented Aug 25, 2021

Context / purpose

It could be useful to return futures::stream in leaf functions to:

  • easily limit the number of leaf_search_stream_single_split or leaf_search_single_split executed concurrently
  • easily convert a stream item error SearchError to tonic Status and vice versa, currently leaf_search_stream returns an UnboundedReceiver with a result containing tonic status. We don't want to have this status at the leaf_search_stream level.

Description

This PR shows how to use streams in leaf_search_stream function and the subsequent changes we must apply to make the grpc layer compatible.

Caveats

I did not manage to make the SearchClient returns a stream because of trait bounds error: the stream has to be Send + Sync but I only have a Send stream from tonic response. So I keep the unbounded receiver.

@fmassot fmassot changed the title Use futures::stream in search stream Use futures::stream in leaf functions Aug 25, 2021
@@ -31,7 +32,8 @@ use quickwit_storage::Storage;
use std::sync::Arc;
use tantivy::schema::Type;
use tantivy::ReloadPolicy;
use tokio_stream::wrappers::UnboundedReceiverStream;

const CONCURRENT_SPLIT_SEARCH_STREAM: usize = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

have you tested to see if it was not harming the perf too much?

@fmassot
Copy link
Contributor Author

fmassot commented Aug 30, 2021

closing PR in favor of #487

@fmassot fmassot closed this Aug 30, 2021
@fmassot fmassot deleted the use-stream-for-search-stream branch December 11, 2021 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants