[
https://issues.apache.org/jira/browse/CASSANDRA-12937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17709354#comment-17709354
]
Claude Warren commented on CASSANDRA-12937:
-------------------------------------------
How about we settle on something like this:
sstable_compressor has several standard parameters:
* enabled - defaults to true. If false no other parameters may be specified.
(original operation for flag)
* chunk_length – defaults to 16KiB. Converts to chunk_length_in_kb in the
CompressorParams (optional)
* type - A standard type of compression: must be one of none, noop, lz4,
snappy, deflate zstd (optional)
* class_name – standard class_name for compressor class to load. (optional)
* min_compress_ratio – defaults to 0.0 (optional)
* max_compressed_length – defaults to Integer.MAX_VALUE (optional)
type and class_name are mutually exclusive and one must be specified. Type
will define the standard types and class_name specify class to load. Class
must accept a Map<String,String> constructor.
min_compress_ratio and max_compressed_length are mutually exclusive. If
neither is specified a min_compress_ratio of 0.0 is used (current default).
Any other parameters specified are assumed to be arguments passed to the
class_name constructor.
{code:java}sstable_compressor:
class_name: org.apache.cassandra.io.compress.LZ4Compressor.class
lz4_compressor_type: fast
{code}
and
{code:java}sstable_compressor:
type: lz4
lz4_compressor_type: fast
{code}
are the same
We also need to move the {{SSTableCompressionOptions.getCompressionParams()}}
functionality into the {{CompressionParams.fromOptions()}} method to remove the
schema package dependency from the config class.
> Default setting (yaml) for SSTable compression
> ----------------------------------------------
>
> Key: CASSANDRA-12937
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12937
> Project: Cassandra
> Issue Type: Improvement
> Components: Local/Config
> Reporter: Michael Semb Wever
> Assignee: Claude Warren
> Priority: Low
> Labels: AdventCalendar2021, lhf
> Fix For: 5.x
>
> Time Spent: 3h
> Remaining Estimate: 0h
>
> In many situations the choice of compression for sstables is more relevant to
> the disks attached than to the schema and data.
> This issue is to add to cassandra.yaml a default value for sstable
> compression that new tables will inherit (instead of the defaults found in
> {{CompressionParams.DEFAULT}}.
> Examples where this can be relevant are filesystems that do on-the-fly
> compression (btrfs, zfs) or specific disk configurations or even specific C*
> versions (see CASSANDRA-10995 ).
> +Additional information for newcomers+
> Some new fields need to be added to {{cassandra.yaml}} to allow specifying
> the field required for defining the default compression parameters. In
> {{DatabaseDescriptor}} a new {{CompressionParams}} field should be added for
> the default compression. This field should be initialized in
> {{DatabaseDescriptor.applySimpleConfig()}}. At the different places where
> {{CompressionParams.DEFAULT}} was used the code should call
> {{DatabaseDescriptor#getDefaultCompressionParams}} that should return some
> copy of configured {{CompressionParams}}.
> Some unit test using {{OverrideConfigurationLoader}} should be used to test
> that the table schema use the new default when a new table is created (see
> CreateTest for some example).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]