[ 
https://issues.apache.org/jira/browse/CASSANDRA-12937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17709048#comment-17709048
 ] 

Stefan Miklosovic commented on CASSANDRA-12937:
-----------------------------------------------

[~claude]

I have one question though ... as I look into it, currently, the configuration 
is done like this, imagine I want to configure Zstd compression, so I would do:

{code}
sstable_compressor:
# defaults to true
  enable: true
  # defaults to 16KiB
  chunk_length: 16KiB
  # min_compress_ratio is only used in snappy, lz4, and custom implementations.
  # defaults to 0.0 see CompressionParams.DEFAULT_MIN_COMPRESS_RATIO
  #min_compress_ratio: 0.0
  # type should be one of the `CompressorType` values: none, noop, lz4, snappy, 
deflate, zstd or custom
  type: zstd
  # if custom type is specified compressor class and parameters must be provided
  #compressor:
    #- class_name: org.apache.cassandra.io.compress.LZ4Compressor # the 
compressor class
    #  parameters:
    #    - param1 : value
{code}

However, by doing so, I can not use the same parameters as used upon CREATE 
TABLE ... For example, I can not specify "compression_level". Where would I put 
it.

Similarly, we basically lost a way how to use already existing options. 
Currently, we would call this below, but where are other options?

{code}
            case zstd:
                return CompressionParams.zstd(chunk_length_in_kb);
{code}

It is good that there is general "compressor" field, but why not to simply call 
"CompressionParams.fromMap(Map)" instead of 
"SSTableCompressionOptions.getCompressionParams()"? So whole configuration 
would be basically a map of parameters, same as we use it upon CQL creation.




> 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: 10m
>  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: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to