Skip to content

Delegate Collection Property Management to CollectionPropertiesZkStateReader#2584

Closed
aparnasuresh85 wants to merge 2 commits into
apache:mainfrom
aparnasuresh85:refactor-zkstatereader
Closed

Delegate Collection Property Management to CollectionPropertiesZkStateReader#2584
aparnasuresh85 wants to merge 2 commits into
apache:mainfrom
aparnasuresh85:refactor-zkstatereader

Conversation

@aparnasuresh85
Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-XXXXX

Description

Summary
This PR introduces CollectionPropertiesZkStateReader to manage collection property methods, shifting these responsibilities from ZkStateReader.

Purpose
ZkStateReader is currently overloaded with tasks, including refreshing and maintaining state for live nodes, collections, cluster state, collection properties, replica properties, aliases, and more. By distributing these responsibilities into specialized classes, we can ensure that each class has a single, well-defined responsibility, thereby reducing complexity.

This PR aims to transfer collection property management to CollectionPropertiesZkStateReader.

  • Separation of Concerns: Enhances modularity by isolating logic specific to collection properties.
  • Improved Maintainability: Simplifies ZkStateReader, making the codebase easier to manage.
  • Backward Compatibility: ZkStateReader's API remains unchanged, ensuring backward compatibility.

Solution

Please provide a short description of the approach taken to implement your solution.

Tests

Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.

Ensured all existing tests pass.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

Copy link
Copy Markdown
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

I'm concerned you copied this from our fork of Solr, and thus it's not a strict refactor. I suggest producing this PR very mechanically via a series of IntelliJ IDE driven refactorings to minimize human error. Then force push a replacement. I try to do IDE driven refactorings for coding I do; IntelliJ has always excelled at this.

}

private void notifyCloudCollectionsListeners(boolean notifyIfSame) {
if (cloudCollectionsListeners.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not a pure refactor

* changes.
*/
public void registerCloudCollectionsListener(CloudCollectionsListener cloudCollectionsListener) {
if (cloudCollectionsListeners.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not a pure refactor

@dsmiley dsmiley removed request for gus-asf and tflobbe July 23, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants