Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10799

Create a new function to get eligible replicas in HttpShardHandler

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Extract a function called createEligibleReplicas from prepDistributed() in HttpShardHandler.
      This method takes a collection of all available replicas, a cluster state, onlyNrtReplicas boolean and a predicate and returns a list of eligible replicas.

      This helps with readability and could be used to perform further refactoring in the future

      Attachments

        1. SOLR-10799-6X.patch
          2 kB
          Domenico Fabio Marino
        2. SOLR-10799-6X.patch
          2 kB
          Domenico Fabio Marino
        3. SOLR-10799.patch
          4 kB
          Domenico Fabio Marino
        4. SOLR-10799.patch
          4 kB
          Domenico Fabio Marino

        Activity

          The patch without suffixes is for master
          The patch with the 6X suffix is for branch_6x

          dmarino Domenico Fabio Marino added a comment - The patch without suffixes is for master The patch with the 6X suffix is for branch_6x

          Thanks Domenico, the patch looks good to me. The only change I'd do is to move this line:

          final Collection<Replica> allSliceReplicas = slice.getReplicasMap().values();

          inside of the new method, and make it receive the Slice as parameter instead (which in addition it makes it more obvious that it will collect the replicas for a particular slice). What do you think?
          I don't think we need to commit this to 6.x, 6.6 is about to be released and I don't believe there will be a 6.7, 7.0 is close. I'm running tests now and will commit shortly.

          tflobbe Tomas Eduardo Fernandez Lobbe added a comment - Thanks Domenico, the patch looks good to me. The only change I'd do is to move this line: final Collection<Replica> allSliceReplicas = slice.getReplicasMap().values(); inside of the new method, and make it receive the Slice as parameter instead (which in addition it makes it more obvious that it will collect the replicas for a particular slice). What do you think? I don't think we need to commit this to 6.x, 6.6 is about to be released and I don't believe there will be a 6.7, 7.0 is close. I'm running tests now and will commit shortly.

          That is a good point, will update the patch.

          dmarino Domenico Fabio Marino added a comment - That is a good point, will update the patch.

          Commit 3618fc529dff85ee604614b3c545fa0b5fbf3b06 in lucene-solr's branch refs/heads/master from tflobbe
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3618fc5 ]

          SOLR-10799: Refator HttpShardHandler.prepDistributed collection of shard replicas

          jira-bot ASF subversion and git services added a comment - - edited Commit 3618fc529dff85ee604614b3c545fa0b5fbf3b06 in lucene-solr's branch refs/heads/master from tflobbe [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=3618fc5 ] SOLR-10799 : Refator HttpShardHandler.prepDistributed collection of shard replicas

          Thanks Domenico!

          tflobbe Tomas Eduardo Fernandez Lobbe added a comment - Thanks Domenico!

          People

            tflobbe Tomas Eduardo Fernandez Lobbe
            dmarino Domenico Fabio Marino
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: