Search in sources :

Example 1 with CacheTopologyValidatorProvider

use of org.apache.ignite.plugin.CacheTopologyValidatorProvider in project ignite by apache.

the class CacheGroupContext method topologyValidators.

/**
 * @param ccfg Cache configuration.
 * @param plugins Ignite plugin processor.
 * @return Comprehensive collection of topology validators for the cache based on its configuration
 * and plugin extensions.
 */
private Collection<TopologyValidator> topologyValidators(CacheConfiguration<?, ?> ccfg, IgnitePluginProcessor plugins) {
    List<TopologyValidator> res = new ArrayList<>();
    TopologyValidator ccfgTopValidator = ccfg.getTopologyValidator();
    if (ccfgTopValidator != null)
        res.add(ccfgTopValidator);
    CacheTopologyValidatorProvider[] topValidatorProviders = plugins.extensions(CacheTopologyValidatorProvider.class);
    if (F.isEmpty(topValidatorProviders))
        return res;
    for (CacheTopologyValidatorProvider topValidatorProvider : topValidatorProviders) {
        TopologyValidator validator = topValidatorProvider.topologyValidator(cacheOrGroupName());
        if (validator != null)
            res.add(validator);
    }
    return res;
}
Also used : CacheTopologyValidatorProvider(org.apache.ignite.plugin.CacheTopologyValidatorProvider) ArrayList(java.util.ArrayList) TopologyValidator(org.apache.ignite.configuration.TopologyValidator)

Aggregations

ArrayList (java.util.ArrayList)1 TopologyValidator (org.apache.ignite.configuration.TopologyValidator)1 CacheTopologyValidatorProvider (org.apache.ignite.plugin.CacheTopologyValidatorProvider)1