Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2582

Make predefined ReadPreferences in TaggableReadPreference public

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Fully Compatible

    Description

      Current Situation

      The predefined ReadPreferences in TaggableReadPreference (NearestReadPreference, SecondaryPreferredReadPreference, SecondaryReadPreference) are package protected.

      A developer wanting to create a new ReadPreference cannot easily extend from one of the already available ones, and it has to, either duplicate code, or to create the new ReadPreference in a com.mongodb package.

      Desired Behaviour

      If the predefined ReadPreferences would be public, we could easily create new ones by extending them.

      Real Example

      In our case, we would like to create a ReadPreference that chooses one secondary node that does not have a special tag defined. This is currently not possible with the current predefined ReadPreferences, but would be very easy by extending the SecondaryPreferredReadPreference one.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rinoto Ruben Inoto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: