LiebingYu commented on code in PR #2273:
URL: https://github.com/apache/fluss/pull/2273#discussion_r2867197279
##########
fluss-common/src/main/java/org/apache/fluss/config/FlussConfigUtils.java:
##########
@@ -77,4 +81,109 @@ static Map<String, ConfigOption<?>>
extractConfigOptions(String prefix) {
}
return options;
}
+
+ public static void validateCoordinatorConfigs(Configuration conf) {
+ validServerConfigs(conf);
+
+ validMinValue(conf, ConfigOptions.DEFAULT_REPLICATION_FACTOR, 1);
+ validMinValue(conf, ConfigOptions.KV_MAX_RETAINED_SNAPSHOTS, 1);
+ validMinValue(conf, ConfigOptions.SERVER_IO_POOL_SIZE, 1);
+
+ // Validate remote.data.dirs
+ List<String> remoteDataDirs = conf.get(ConfigOptions.REMOTE_DATA_DIRS);
+ for (int i = 0; i < remoteDataDirs.size(); i++) {
+ String remoteDataDir = remoteDataDirs.get(i);
+ try {
+ new FsPath(remoteDataDir);
+ } catch (Exception e) {
+ throw new IllegalConfigurationException(
+ String.format(
+ "Invalid remote path for %s at index %d.",
+ ConfigOptions.REMOTE_DATA_DIRS.key(), i),
+ e);
+ }
+ }
+
+ // Validate remote.data.dirs.strategy
+ ConfigOptions.RemoteDataDirStrategy remoteDataDirStrategy =
+ conf.get(ConfigOptions.REMOTE_DATA_DIRS_STRATEGY);
+ if (remoteDataDirStrategy ==
ConfigOptions.RemoteDataDirStrategy.WEIGHTED_ROUND_ROBIN) {
+ List<Integer> weights =
conf.get(ConfigOptions.REMOTE_DATA_DIRS_WEIGHTS);
+ if (!remoteDataDirs.isEmpty() && !weights.isEmpty()) {
+ if (remoteDataDirs.size() != weights.size()) {
+ throw new IllegalConfigurationException(
+ String.format(
+ "The size of '%s' (%d) must match the size
of '%s' (%d) when using WEIGHTED_ROUND_ROBIN strategy.",
+ ConfigOptions.REMOTE_DATA_DIRS.key(),
+ remoteDataDirs.size(),
+
ConfigOptions.REMOTE_DATA_DIRS_WEIGHTS.key(),
+ weights.size()));
+ }
+ // Validate all weights are positive
+ for (int i = 0; i < weights.size(); i++) {
+ if (weights.get(i) < 0) {
Review Comment:
Yes. Suppose we want to migrate data away from a storage path; setting the
value to 0 would be an effective approach.
--
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]