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

Umbrella ticket for refactoring solrj.io.* classes

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • SolrJ
    • None

    Description

      The Streaming API is gaining more and more features and i believe there are a few places where we can cleanup the core codebase to improve the code of those new features. While the Streaming API is still listed experimental I'd like to take the opportunity to make these changes.

      This ticket is intended to act as a umbrella for the various patches I'd like to apply. Due to the core nature within solrj.io of the classes I'd like to change each patch may touch quite a few classes but a goal will be to limit each patch to a singular type of change.

      A few of the changes I have in mind:
      1. Refactor/rename some methods in stream.expr.StreamFactory to make them easier to understand and work with. Also add documentation to the public functions. This includes a changing of some function signatures.

      2. Rename the package io.comp to io.sort because while the classes in here use Java's Comparator interface they are really just sorters. Also rename classes to indicate sorting. (I'm not married to this idea but I think the name change would be beneficial)

      3. Collapse the MultipleFieldComparator and FieldComparator into a single class that can handle both single and multiple field sorting. There are places where we have to check which kind of comparator something is and I think this can be simplified into a single class handling both types.

      4. Per a comment in io.eq.Equalitor, Java 8 has an interface called BiPredicate which can fully replace the Equalitor interface. Given that we're now fully on Java 8 I believe we can get rid of the Equalitor interface in favor of BiPredicate.

      5. Collapse FieldEqualitor and MultipleFieldEqualitor into a single class (same reasoning as with the Sorters).

      6. Remove the need for a special StreamExpressionNamedParameter class. A parameter could just have a name - we don't need a special class for that concept.

      I'm open for discussion on any and all of these suggested changes. The only one that I feel is critically important is the the first one, Refactor/rename some methods in stream.expr.StreamFactory, but if we're gonna go down this path I think this would be a good time to make the other changes as well.

      joel.bernstein, risdenk, caomanhdat, I'm interested in your thoughts on this.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dpgove Dennis Gove
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: