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

Gridfs chunk size should be configurable during creation

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.12.2
    • Fix Version/s: 3.1.0
    • Component/s: GridFS
    • Labels:
      None
    • Story Points:
      1

      Description

      Refer:
      https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/gridfs/GridFSInputFile.java#L64

      The _chunksize and the buffer parameter gets created using the default value frm GridFS which is 255k.

      Though we can reconfigure the chunksize later using setChunkSize, however during creation 255k chunk of memory in Java program gets reserved which feels a little inefficient use of memory if we are going to resize chunksize later.

      Ideally, I think we should be able to inject the chunksize during creation:
      https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/gridfs/GridFS.java#L381
      as a parameter which can default to DEFAULT_CHUNKSIZE.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: