Use GridFS/DEFAULT_CHUNKSIZE instead of our own default

Ruby driver uses 2 MB default chunk size, Java driver uses 256K. Lets use what the Java driver
does.
This commit is contained in:
Michael S. Klishin 2011-12-31 16:55:32 +04:00
parent 1187719ac1
commit a3d6a66eb1

View file

@ -17,8 +17,6 @@
} }
byte-array-type (class (make-array Byte/TYPE 0))) byte-array-type (class (make-array Byte/TYPE 0)))
(def ^:dynamic *chunk-size* (* 2 1024 1024))
;; ... ;; ...
@ -70,7 +68,7 @@
(defmacro store (defmacro store
[^GridFSInputFile input & body] [^GridFSInputFile input & body]
`(let [^GridFSInputFile f# (doto ~input ~@body)] `(let [^GridFSInputFile f# (doto ~input ~@body)]
(.save f# *chunk-size*) (.save f# GridFS/DEFAULT_CHUNKSIZE)
(from-db-object f# true))) (from-db-object f# true)))