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

Some cleanups to OperationRouting #119440

Conversation

original-brownbear
Copy link
Member

Two small cleanups that remove duplication and dead-code:

  1. The shardId method can be made static, it's only non-static use in mocking was unnecessary and could just be deleted
  2. Filtering for searchable shards is the same logic now for stateful and stateless. We also only use it when building a filtered PlainShardIterator so it might as well live there to remove some duplication.

Two small cleanups that remove duplication and dead-code:
1. The shardId method can be made `static`, it's only non-static use in mocking was unnecessary and could just be deleted
2. Filtering for searchable shards is the same logic now for stateful and stateless. We also only use it when building a
filtered `PlainShardIterator` so it might as well live there to remove some duplication.
@original-brownbear original-brownbear added >non-issue :Search/Search Search-related issues that do not fall into other categories labels Jan 1, 2025
@elasticsearchmachine elasticsearchmachine added v9.0.0 Team:Search Meta label for search team labels Jan 1, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@original-brownbear original-brownbear added auto-backport Automatically create backport pull requests when merged v8.18.0 labels Jan 6, 2025
@original-brownbear
Copy link
Member Author

Thanks Luca!

@original-brownbear original-brownbear merged commit ee12925 into elastic:main Jan 6, 2025
16 checks passed
@original-brownbear original-brownbear deleted the cleanup-operation-routing branch January 6, 2025 15:57
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jan 6, 2025
Two small cleanups that remove duplication and dead-code:
1. The shardId method can be made `static`, it's only non-static use in mocking was unnecessary and could just be deleted
2. Filtering for searchable shards is the same logic now for stateful and stateless. We also only use it when building a
filtered `PlainShardIterator` so it might as well live there to remove some duplication.
elasticsearchmachine pushed a commit that referenced this pull request Jan 7, 2025
Two small cleanups that remove duplication and dead-code:
1. The shardId method can be made `static`, it's only non-static use in mocking was unnecessary and could just be deleted
2. Filtering for searchable shards is the same logic now for stateful and stateless. We also only use it when building a
filtered `PlainShardIterator` so it might as well live there to remove some duplication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants