public static boolean testConnection(RedisDataNodeRequest request) throws IOException {
        String clusterMode = request.getClusterMode();
        switch (clusterMode) {
            case "standalone":
                return RedisStandaloneTester.builder().host(request.getHost()).port(request.getPort()).build()
                        .testConnection();
            case "cluster":
                return RedisClusterTester.builder().nodes(request.getClusterNodes()).build().testConnection();
            case "sentinel":
                return RedisSentinelTester.builder().masterName(request.getMasterName())
                        .sentinelsInfo(request.getSentinelsInfo()).build().testConnection();
            default:
                throw new IllegalArgumentIOException("Unknown cluster mode: " + clusterMode);
        }
    }
Test the connection to Redis.

@param request RedisDataNodeRequest
@throws IOException if there is an error testing the connection
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/redis/RedisResourceClient.java