Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2870

Improve the efficiency of AtomicFileOutputStream

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.10, 3.5.3, 3.6.0
    • Fix Version/s: 3.4.11, 3.5.4, 3.6.0
    • Component/s: server
    • Labels:
      None

      Description

      The AtomicFileOutputStream extends from FilterOutputStream, where the write function writes data to underlying stream byte by byte: https://searchcode.com/codesearch/view/17990706/, which is very inefficient.

      Currently, we only this this class to write the dynamic config, because it's quite small it won't be a big problem. But in the future we may want to use this class to write the snapshot file, which will take much longer time, tested inside, writing 600MB snapshot will take more than 10 minutes, while using FileOutputStream directly only takes 6s.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lvfangmin Fangmin Lv
                Reporter:
                lvfangmin Fangmin Lv
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: