Skip to content

Commit

Permalink
Rename WithCompressionType to WithCompression. (#1116)
Browse files Browse the repository at this point in the history
Rename the builder method WithCompressionType added in #1013 to
WithCompression to be consistent with the option struct field
named Compression.

Update the godoc for WithCompression with the default compression
algorithm used.
  • Loading branch information
danielmai authored Nov 13, 2019
1 parent 7b4083d commit 5f3b061
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,14 @@ func (opt Options) WithKeepL0InMemory(val bool) Options {
return opt
}

// WithCompressionType returns a new Options value with CompressionType set to the given value.
// WithCompression returns a new Options value with Compression set to the given value.
//
// When compression type is set, every block will be compressed using the specified algorithm.
// When compression is enabled, every block will be compressed using the specified algorithm.
// This option doesn't affect existing tables. Only the newly created tables will be compressed.
func (opt Options) WithCompressionType(cType options.CompressionType) Options {
//
// The default compression algorithm used is zstd when built with Cgo. Without Cgo, the default is
// snappy. Compression is enabled by default.
func (opt Options) WithCompression(cType options.CompressionType) Options {
opt.Compression = cType
return opt
}
Expand Down

0 comments on commit 5f3b061

Please sign in to comment.