Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18929

Add method to get how many bytes can be written in to ReplyBuilderInterface

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Networking
    • Labels:
      None
    • Minor Change
    • Platform 5 06/26/16

      As OP_COMMANDREPLY can take ~48MB of output docs, and OP_REPLY (for commands) is limited to the 16MB document limit, commands that use output docs need to know when to stop appending documents to the response.

      We should add a new method to ReplyBuilderInterface:

      virtual std::size_t getRemainingSpaceInReply() const;
      

      That returns how many bytes can be written to the message. Then we will need concrete implementations in CommandReplyBuilder (OP_COMMANDREPLY) and LegacyReplyBuilder (OP_REPLY)

      cc: david.storch

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            adam.midvidy Adam Midvidy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: