zuston commented on code in PR #3358:
URL: https://github.com/apache/fluss/pull/3358#discussion_r3285587803
##########
fluss-server/src/main/java/org/apache/fluss/server/utils/TableDescriptorValidation.java:
##########
@@ -417,6 +418,17 @@ private static void checkTieredLog(Configuration
tableConf) {
}
}
+ private static void checkLogSegmentFileSize(Configuration tableConf) {
+ if (tableConf.contains(ConfigOptions.LOG_SEGMENT_FILE_SIZE)
+ &&
tableConf.get(ConfigOptions.LOG_SEGMENT_FILE_SIZE).getBytes()
+ > Integer.MAX_VALUE) {
+ throw new InvalidConfigException(
+ String.format(
+ "Invalid configuration for %s, it must be less
than or equal %d bytes.",
+ ConfigOptions.LOG_SEGMENT_FILE_SIZE.key(),
Integer.MAX_VALUE));
+ }
+ }
+
private static void checkPartition(
Configuration tableConf, List<String> partitionKeys, RowType
rowType) {
boolean isPartitioned = !partitionKeys.isEmpty();
Review Comment:
When surfacing this part of the code, could we move the option validation
logic into the option definitions themselves? For example:
```java
public static final ConfigOption<Integer> TABLE_TIERED_LOG_LOCAL_SEGMENTS =
key("table.log.tiered.local-segments")
.intType()
.defaultValue(2)
.valueValidator(v -> v > 0, "must be greater than zero")
.withDescription(
"The number of log segments to retain in local
for each table when log tiered storage is enabled. "
+ "It must be greater that 0. The
default is 2.");
```
--
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]