/** * 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}. * * @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 } }