Search in sources :

Example 1 with DefaultValidator

use of org.apache.flink.kubernetes.operator.validation.DefaultValidator in project flink-kubernetes-operator by apache.

the class ValidatorUtils method discoverValidators.

public static Set<FlinkResourceValidator> discoverValidators(FlinkConfigManager configManager) {
    Set<FlinkResourceValidator> resourceValidators = new HashSet<>();
    DefaultValidator defaultValidator = new DefaultValidator(configManager);
    defaultValidator.configure(configManager.getDefaultConfig());
    resourceValidators.add(defaultValidator);
    PluginUtils.createPluginManagerFromRootFolder(configManager.getDefaultConfig()).load(FlinkResourceValidator.class).forEachRemaining(validator -> {
        LOG.info("Discovered resource validator from plugin directory[{}]: {}.", System.getenv().getOrDefault(ConfigConstants.ENV_FLINK_PLUGINS_DIR, ConfigConstants.DEFAULT_FLINK_PLUGINS_DIRS), validator.getClass().getName());
        validator.configure(configManager.getDefaultConfig());
        resourceValidators.add(validator);
    });
    return resourceValidators;
}
Also used : DefaultValidator(org.apache.flink.kubernetes.operator.validation.DefaultValidator) FlinkResourceValidator(org.apache.flink.kubernetes.operator.validation.FlinkResourceValidator) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 DefaultValidator (org.apache.flink.kubernetes.operator.validation.DefaultValidator)1 FlinkResourceValidator (org.apache.flink.kubernetes.operator.validation.FlinkResourceValidator)1