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

DATAMONGO-1311 - Configuration of query batchsize through Query.cursorBatchSize(…). #575

Closed
wants to merge 4 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jun 27, 2018

We now allow configuration of the find cursor/find publisher batch sizes using Query.cursorBatchSize(…). Configuring the batch size gives users more fine-grained control over the fetch behavior especially in reactive usage scenarios as the batch size defaults in FindPublisher to the remaining demand. This can cause several roundtrips in cases the remaining demand is small and the emitted elements are dropped rapidly (e.g. using a filter(…) operator).

With the upgrade to a newer Reactive Streams driver, we can also apply the batch size to aggregation operations invoked through ReactiveMongoTemplate.aggregate(…).


Related ticket: DATAMONGO-1311.

…rBatchSize(…).

We now allow configuration of the find cursor/find publisher batch sizes using Query.cursorBatchSize(…). Configuring the batch size gives users more fine grained control over the fetch behavior especially in reactive usage scenarios as the batch size defaults in FindPublisher to the remaining demand. This can cause several roundtrips in cases the remaining demand is small and the emitted elements are dropped rapidly (e.g. using filter(…)).

With the upgrade to a newer Reactive Streams driver, we can also apply the batch size to aggregation operations invoked through ReactiveMongoTemplate.aggregate(…).
…atchSize = …).

@meta allows now configuration of the cursor batch size for repository query methods.

interface PersonRepository extends Repository<Person, Long> {

	@meta(cursorBatchSize = 100)
	Stream<Person> findAllByLastname(String lastname);
}
Update Javadoc and alter batchSize default to zero.
Along the lines remove deprecated driver method usage and add deprecations for options about the be removed in subsequent MongoDB server releases.
christophstrobl pushed a commit that referenced this pull request Jun 29, 2018
We now allow configuration of the find cursor/find publisher batch sizes using Query.cursorBatchSize(…).
Configuring the batch size gives users more fine grained control over the fetch behavior especially in reactive usage scenarios as the batch size defaults in FindPublisher to the remaining demand. This can cause several roundtrips in cases the remaining demand is small and the emitted elements are dropped rapidly (e.g. using filter(…)).

On the repository level @meta allows now configuration of the cursor batch size for derived finder methods.

interface PersonRepository extends Repository<Person, Long> {

	@meta(cursorBatchSize = 100)
	Stream<Person> findAllByLastname(String lastname);
}

Original Pull Request: #575
christophstrobl added a commit that referenced this pull request Jun 29, 2018
Update Javadoc and add reference documentation.
Alter @meta batchSize default to zero, as negative values bear a special meaning.
Along the lines remove deprecated driver method usage and add deprecations for options about the be removed in subsequent MongoDB server releases.

Original Pull Request: #575
@christophstrobl christophstrobl deleted the issue/DATAMONGO-1311 branch June 29, 2018 08:47
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.

None yet

2 participants