/** * Creates new {@link LettuceClusterConnection} using {@link LettuceConnectionProvider} running commands across the * cluster via given {@link ClusterCommandExecutor}. * * @param connectionProvider must not be {@literal null}. * @since 2.0 */ public LettuceClusterConnection(LettuceConnectionProvider connectionProvider) { super(null, connectionProvider, RedisURI.DEFAULT_TIMEOUT_DURATION.toMillis(), 0); Assert.isTrue(connectionProvider instanceof ClusterConnectionProvider, "LettuceConnectionProvider must be a ClusterConnectionProvider."); this.clusterClient = getClient(); this.topologyProvider = new LettuceClusterTopologyProvider(this.clusterClient); this.clusterCommandExecutor = new ClusterCommandExecutor(this.topologyProvider, new LettuceClusterNodeResourceProvider(getConnectionProvider()), exceptionConverter); this.disposeClusterCommandExecutorOnClose = true; }
/** * Creates new {@link LettuceClusterConnection} using {@link LettuceConnectionProvider} running commands across the * cluster via given {@link ClusterCommandExecutor}. * * @param connectionProvider must not be {@literal null}. * @since 2.0 */ public LettuceClusterConnection(LettuceConnectionProvider connectionProvider) { super(null, connectionProvider, RedisURI.DEFAULT_TIMEOUT_DURATION.toMillis(), 0); Assert.isTrue(connectionProvider instanceof ClusterConnectionProvider, "LettuceConnectionProvider must be a ClusterConnectionProvider."); this.clusterClient = getClient(); this.topologyProvider = new LettuceClusterTopologyProvider(this.clusterClient); this.clusterCommandExecutor = new ClusterCommandExecutor(this.topologyProvider, new LettuceClusterNodeResourceProvider(getConnectionProvider()), exceptionConverter); this.disposeClusterCommandExecutorOnClose = true; }
/** * Creates new {@link LettuceClusterConnection} using {@link LettuceConnectionProvider} running commands across the * cluster via given {@link ClusterCommandExecutor}. * * @param connectionProvider must not be {@literal null}. * @since 2.0 */ public LettuceClusterConnection(LettuceConnectionProvider connectionProvider) { super(null, connectionProvider, RedisURI.DEFAULT_TIMEOUT_DURATION.toMillis(), 0); Assert.isTrue(connectionProvider instanceof ClusterConnectionProvider, "LettuceConnectionProvider must be a ClusterConnectionProvider."); this.clusterClient = getClient(); this.topologyProvider = new LettuceClusterTopologyProvider(this.clusterClient); this.clusterCommandExecutor = new ClusterCommandExecutor(this.topologyProvider, new LettuceClusterNodeResourceProvider(getConnectionProvider()), exceptionConverter); this.disposeClusterCommandExecutorOnClose = true; }
public void afterPropertiesSet() { this.client = createClient(); this.connectionProvider = createConnectionProvider(client, LettuceConnection.CODEC); this.reactiveConnectionProvider = createConnectionProvider(client, LettuceReactiveRedisConnection.CODEC); if (isClusterAware()) { this.clusterCommandExecutor = new ClusterCommandExecutor( new LettuceClusterTopologyProvider((RedisClusterClient) client), new LettuceClusterConnection.LettuceClusterNodeResourceProvider(this.connectionProvider), EXCEPTION_TRANSLATION); } }
public void afterPropertiesSet() { this.client = createClient(); this.connectionProvider = createConnectionProvider(client, LettuceConnection.CODEC); this.reactiveConnectionProvider = createConnectionProvider(client, LettuceReactiveRedisConnection.CODEC); if (isClusterAware()) { this.clusterCommandExecutor = new ClusterCommandExecutor( new LettuceClusterTopologyProvider((RedisClusterClient) client), new LettuceClusterConnection.LettuceClusterNodeResourceProvider(this.connectionProvider), EXCEPTION_TRANSLATION); } }
public void afterPropertiesSet() { this.client = createClient(); this.connectionProvider = createConnectionProvider(client, LettuceConnection.CODEC); this.reactiveConnectionProvider = createConnectionProvider(client, LettuceReactiveRedisConnection.CODEC); if (isClusterAware()) { this.clusterCommandExecutor = new ClusterCommandExecutor( new LettuceClusterTopologyProvider((RedisClusterClient) client), new LettuceClusterConnection.LettuceClusterNodeResourceProvider(this.connectionProvider), EXCEPTION_TRANSLATION); } if (getEagerInitialization() && getShareNativeConnection()) { initConnection(); } }