/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster} running commands * across the cluster via given {@link ClusterCommandExecutor}. * * @param cluster must not be {@literal null}. * @param executor must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster, ClusterCommandExecutor executor) { Assert.notNull(cluster, "JedisCluster must not be null."); Assert.notNull(executor, "ClusterCommandExecutor must not be null."); this.closed = false; this.cluster = cluster; this.topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = executor; this.disposeClusterCommandExecutorOnClose = false; }
/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster}. * * @param cluster must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster) { Assert.notNull(cluster, "JedisCluster must not be null."); this.cluster = cluster; closed = false; topologyProvider = new JedisClusterTopologyProvider(cluster); clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); disposeClusterCommandExecutorOnClose = true; try { DirectFieldAccessor dfa = new DirectFieldAccessor(cluster); clusterCommandExecutor.setMaxRedirects((Integer) dfa.getPropertyValue("maxRedirections")); } catch (Exception e) { // ignore it and work with the executor default } }
/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster} running commands * across the cluster via given {@link ClusterCommandExecutor}. * * @param cluster must not be {@literal null}. * @param executor must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster, ClusterCommandExecutor executor) { Assert.notNull(cluster, "JedisCluster must not be null."); Assert.notNull(executor, "ClusterCommandExecutor must not be null."); this.closed = false; this.cluster = cluster; this.topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = executor; this.disposeClusterCommandExecutorOnClose = false; }
/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster}. * * @param cluster must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster) { Assert.notNull(cluster, "JedisCluster must not be null."); this.cluster = cluster; closed = false; topologyProvider = new JedisClusterTopologyProvider(cluster); clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); disposeClusterCommandExecutorOnClose = true; try { DirectFieldAccessor dfa = new DirectFieldAccessor(cluster); clusterCommandExecutor.setMaxRedirects((Integer) dfa.getPropertyValue("maxRedirections")); } catch (Exception e) { // ignore it and work with the executor default } }
/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster}. * * @param cluster must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster) { Assert.notNull(cluster, "JedisCluster must not be null."); this.cluster = cluster; closed = false; topologyProvider = new JedisClusterTopologyProvider(cluster); clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); disposeClusterCommandExecutorOnClose = true; try { DirectFieldAccessor dfa = new DirectFieldAccessor(cluster); clusterCommandExecutor.setMaxRedirects((Integer) dfa.getPropertyValue("maxRedirections")); } catch (Exception e) { // ignore it and work with the executor default } }
/** * Create new {@link JedisClusterConnection} utilizing native connections via {@link JedisCluster} running commands * across the cluster via given {@link ClusterCommandExecutor}. * * @param cluster must not be {@literal null}. * @param executor must not be {@literal null}. */ public JedisClusterConnection(JedisCluster cluster, ClusterCommandExecutor executor) { Assert.notNull(cluster, "JedisCluster must not be null."); Assert.notNull(executor, "ClusterCommandExecutor must not be null."); this.closed = false; this.cluster = cluster; this.topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = executor; this.disposeClusterCommandExecutorOnClose = false; }
private JedisCluster createCluster() { JedisCluster cluster = createCluster((RedisClusterConfiguration) this.configuration, getPoolConfig()); JedisClusterTopologyProvider topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterConnection.JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); return cluster; }
private JedisCluster createCluster() { JedisCluster cluster = createCluster((RedisClusterConfiguration) this.configuration, getPoolConfig()); JedisClusterTopologyProvider topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterConnection.JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); return cluster; }
private JedisCluster createCluster() { JedisCluster cluster = createCluster((RedisClusterConfiguration) this.configuration, getPoolConfig()); JedisClusterTopologyProvider topologyProvider = new JedisClusterTopologyProvider(cluster); this.clusterCommandExecutor = new ClusterCommandExecutor(topologyProvider, new JedisClusterConnection.JedisClusterNodeResourceProvider(cluster, topologyProvider), EXCEPTION_TRANSLATION); return cluster; }