Search in sources :

Example 1 with RedisConnectionPool

use of org.apache.nifi.redis.RedisConnectionPool in project nifi by apache.

the class RedisDistributedMapCacheClientService method customValidate.

@Override
protected Collection<ValidationResult> customValidate(ValidationContext validationContext) {
    final List<ValidationResult> results = new ArrayList<>();
    final RedisConnectionPool redisConnectionPool = validationContext.getProperty(REDIS_CONNECTION_POOL).asControllerService(RedisConnectionPool.class);
    if (redisConnectionPool != null) {
        final RedisType redisType = redisConnectionPool.getRedisType();
        if (redisType != null && redisType == RedisType.CLUSTER) {
            results.add(new ValidationResult.Builder().subject(REDIS_CONNECTION_POOL.getDisplayName()).valid(false).explanation(REDIS_CONNECTION_POOL.getDisplayName() + " is configured in clustered mode, and this service requires a non-clustered Redis").build());
        }
    }
    return results;
}
Also used : ArrayList(java.util.ArrayList) ValidationResult(org.apache.nifi.components.ValidationResult) RedisConnectionPool(org.apache.nifi.redis.RedisConnectionPool) RedisType(org.apache.nifi.redis.RedisType)

Aggregations

ArrayList (java.util.ArrayList)1 ValidationResult (org.apache.nifi.components.ValidationResult)1 RedisConnectionPool (org.apache.nifi.redis.RedisConnectionPool)1 RedisType (org.apache.nifi.redis.RedisType)1