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

Don't allow 0 maxStaleness in ReadPreference API

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.4.0-rc1, 3.4.0
    • None
    • Query Operations
    • None

    Description

      The driver currently allows a value of 0 for maxStaleness, which it documents to mean "no maximum". This is unnecessarily confusing, as users might thing, despite the API docs, that maxStaleness of 0 means "totally fresh".

      Consider changing the ReadPreference API to not treat 0 specially, and require either:

      • use of overloaded factory methods that don't take a maxStaleness parameter to indicate that there is no maximum
      • use boxed Long so that null can be passed as a value, and don't treat 0 specially.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: