masteryhx commented on code in PR #24072:
URL: https://github.com/apache/flink/pull/24072#discussion_r1457153572
##########
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBConfigurableOptions.java:
##########
@@ -149,24 +144,42 @@ public class RocksDBConfigurableOptions implements
Serializable {
NONE.name(),
LEVEL.name()));
- public static final ConfigOption<CompressionType> COMPRESSION_TYPE =
- key("state.backend.rocksdb.compression.type")
+ public static final ConfigOption<List<CompressionType>>
COMPRESSION_PER_LEVEL =
+ key("state.backend.rocksdb.compression.per.level")
.enumType(CompressionType.class)
- .defaultValue(SNAPPY_COMPRESSION)
+ .asList()
+ .defaultValues(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(),
- BZLIB2_COMPRESSION.name(),
- LZ4_COMPRESSION.name(),
- LZ4HC_COMPRESSION.name(),
- XPRESS_COMPRESSION.name(),
- ZSTD_COMPRESSION.name(),
- DISABLE_COMPRESSION_OPTION.name(),
- SNAPPY_COMPRESSION.name()));
+ Description.builder()
+ .text(
+ "A semicolon-separated list of
Compression Type. Different levels can have different "
+ + "compression policies.
In many cases, lower levels use fast compression algorithms,"
+ + " while higher levels
with more data use slower but more effective compression algorithms. "
+ + "If the
COMPRESSION_PER_LEVEL list is not empty, it should have an entry for each level
of the database, "
+ + "When
level_compaction_dynamic_level_bytes=true, compression_per_level[0] still
determines L0, but other "
Review Comment:
A minor suggestion: replace level_compaction_dynamic_level_bytes with
USE_DYNAMIC_LEVEL_SIZE.key() which could help developers to find the
description conviently
--
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]