pnowojski commented on code in PR #24072:
URL: https://github.com/apache/flink/pull/24072#discussion_r1452350812


##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBConfigurableOptions.java:
##########
@@ -139,6 +149,25 @@ public class RocksDBConfigurableOptions implements 
Serializable {
                                     NONE.name(),
                                     LEVEL.name()));
 
+    public static final ConfigOption<CompressionType> COMPRESSION_TYPE =
+            key("state.backend.rocksdb.compression.type")
+                    .enumType(CompressionType.class)
+                    .defaultValue(SNAPPY_COMPRESSION)
+                    .withDescription(
+                            String.format(
+                                    "The specified compression type for DB. 
Candidate compression type is %s, %s, %s, %s, %s, "
+                                            + "%s, %s, %s or %s, and RocksDB 
choose '%s' as default style.",
+                                    NO_COMPRESSION.name(),
+                                    SNAPPY_COMPRESSION.name(),
+                                    ZLIB_COMPRESSION.name(),

Review Comment:
   +1 to that suggestion



##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBConfigurableOptions.java:
##########
@@ -139,6 +149,25 @@ public class RocksDBConfigurableOptions implements 
Serializable {
                                     NONE.name(),
                                     LEVEL.name()));
 
+    public static final ConfigOption<CompressionType> COMPRESSION_TYPE =

Review Comment:
   🤔 Maybe rename the parameter name to `rocksdb.compression.types` and then 
implement it a as a comma separated list. Where item N on the list corresponds 
to sst level N-1. Last item on the list maps to "all levels below". And then 
keep `SNAPPY_COMPRESSION` as the default.
   
   This way, user could configure simply:
   
   -  `lz4` - everything will be lz4
   - `NO_COMPRESSION.name()` - there will be no compression at all
   - `NO_COMPRESSION.name(), NO_COMPRESSION.name(), lz4` - L0, L1 using no 
compression. Everything below `lz4`. 
   
   Also I wouldn't worry about this being too complicated for users. No sane 
Flink user will ever look into this, only the power nerds who shouldn't be 
scared the complexity here :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to