Skip to content

Commit b7037e2

Browse files
p-mongozachmccormickEmily Giurleop
authored
RUBY-2439 Implement snappy compression support (#2125)
* WIP * WIP 2 * Fix uri options spec tests * Ensure that snappy can install gem extensions * Add new test constraints * Require snappy compression for appropriate tests * Make snappy an optional dependency of the driver * Make changes suggested in PR review * Make sure that tests with snappy compression only run when snappy support is enabled * Add snappy to URI options * Add new UnmetDependency error and improve performance of Snappy check * tweak exception message * fix uri options spec tests * put jruby config into the template * fix zlib test * do not require that snappy is defined * redo snappy system dep handling * clean up Co-authored-by: Zach McCormick <[email protected]> Co-authored-by: Emily Giurleo <[email protected]> Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent ea7b70c commit b7037e2

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

source/tutorials/ruby-driver-create-client.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ Ruby Options
320320

321321
* - ``:compressors``
322322
- A list of potential compressors to use, in order of preference. The driver chooses the first
323-
compressor that is also supported by the server. Currently the driver only supports 'zlib'.
323+
compressor that is also supported by the server. Currently the driver only supports 'snappy'
324+
and 'zlib'.
324325
- ``Array<String>``
325326
- none
326327

@@ -739,12 +740,17 @@ URI options are explained in detail in the :manual:`Connection URI reference
739740
* - compressors=Strings
740741
- ``:compressors => Array<String>``
741742

742-
Specified as a comma-separated list. Note that the Ruby driver only supports zlib
743-
compression; however, other drivers may support snappy. For maximum compatibility with
744-
drivers, specify ``"snappy,zlib"``; if compatibility with other drivers is not a concern,
745-
specify ``"zlib".`` Compression is not enabled by default and when using MongoDB 4.0 and
746-
earlier, so zlib compression must be manually enabled on the server in order for the Ruby
747-
driver to compress wire protocol data.
743+
Specified as a comma-separated list. The Ruby driver currently supports snappy
744+
and zlib compression algorithms; the first algorithm in the list that the server
745+
also supports will be used. Compression must be explicitly enabled by
746+
specifying the desired compression algorithm; use "snappy,zlib" for maximum server
747+
compatibility. Snappy compression requires separate installation of the
748+
snappy Ruby library; if the snappy Ruby library is not available,
749+
the driver raises an error during ``Mongo::Client`` creation.
750+
When using MongoDB 4.0 and earlier, zlib compression is supported by the
751+
server but must be manually enabled; if zlib is the only compression algorithm
752+
requested (or available due to missing snappy Ruby library), 4.0 and
753+
earlier servers must be configured to explicitly enable zlib compression.
748754

749755
* - connect=String
750756
- ``:connect => Symbol``

0 commit comments

Comments
 (0)