@@ -279,7 +279,6 @@ public static interface StrategySupplier {
279
279
* <strong>Default:</strong> {@value #CIRCUIT_BREAKER_SLIDING_WINDOW_SIZE_DEFAULT}
280
280
* </p>
281
281
* @see #getCircuitBreakerSlidingWindowSize()
282
- * @see #circuitBreakerSlidingWindowType
283
282
*/
284
283
private int circuitBreakerSlidingWindowSize ;
285
284
@@ -687,10 +686,10 @@ public static Builder builder(List<ClusterConfig> clusterConfigs) {
687
686
public static class ClusterConfig {
688
687
689
688
/** The Redis endpoint (host and port) for this cluster. */
690
- private HostAndPort hostAndPort ;
689
+ private final Endpoint endpoint ;
691
690
692
691
/** Jedis client configuration containing connection settings and authentication. */
693
- private JedisClientConfig jedisClientConfig ;
692
+ private final JedisClientConfig jedisClientConfig ;
694
693
695
694
/** Optional connection pool configuration for managing connections to this cluster. */
696
695
private GenericObjectPoolConfig <Connection > connectionPoolConfig ;
@@ -714,12 +713,12 @@ public static class ClusterConfig {
714
713
* EchoStrategy for health checks. Use the {@link Builder} for more advanced configuration
715
714
* options.
716
715
* </p>
717
- * @param hostAndPort the Redis endpoint (host and port)
716
+ * @param endpoint the Redis endpoint (host and port)
718
717
* @param clientConfig the Jedis client configuration
719
- * @throws IllegalArgumentException if hostAndPort or clientConfig is null
718
+ * @throws IllegalArgumentException if endpoint or clientConfig is null
720
719
*/
721
- public ClusterConfig (HostAndPort hostAndPort , JedisClientConfig clientConfig ) {
722
- this .hostAndPort = hostAndPort ;
720
+ public ClusterConfig (Endpoint endpoint , JedisClientConfig clientConfig ) {
721
+ this .endpoint = endpoint ;
723
722
this .jedisClientConfig = clientConfig ;
724
723
}
725
724
@@ -729,14 +728,14 @@ public ClusterConfig(HostAndPort hostAndPort, JedisClientConfig clientConfig) {
729
728
* This constructor allows specification of connection pool settings in addition to basic
730
729
* endpoint configuration. Default weight of 1.0f and EchoStrategy for health checks are used.
731
730
* </p>
732
- * @param hostAndPort the Redis endpoint (host and port)
731
+ * @param endpoint the Redis endpoint (host and port)
733
732
* @param clientConfig the Jedis client configuration
734
733
* @param connectionPoolConfig the connection pool configuration
735
- * @throws IllegalArgumentException if hostAndPort or clientConfig is null
734
+ * @throws IllegalArgumentException if endpoint or clientConfig is null
736
735
*/
737
- public ClusterConfig (HostAndPort hostAndPort , JedisClientConfig clientConfig ,
736
+ public ClusterConfig (Endpoint endpoint , JedisClientConfig clientConfig ,
738
737
GenericObjectPoolConfig <Connection > connectionPoolConfig ) {
739
- this .hostAndPort = hostAndPort ;
738
+ this .endpoint = endpoint ;
740
739
this .jedisClientConfig = clientConfig ;
741
740
this .connectionPoolConfig = connectionPoolConfig ;
742
741
}
@@ -746,7 +745,7 @@ public ClusterConfig(HostAndPort hostAndPort, JedisClientConfig clientConfig,
746
745
* @param builder the builder containing configuration values
747
746
*/
748
747
private ClusterConfig (Builder builder ) {
749
- this .hostAndPort = builder .hostAndPort ;
748
+ this .endpoint = builder .endpoint ;
750
749
this .jedisClientConfig = builder .jedisClientConfig ;
751
750
this .connectionPoolConfig = builder .connectionPoolConfig ;
752
751
this .weight = builder .weight ;
@@ -757,20 +756,20 @@ private ClusterConfig(Builder builder) {
757
756
* Returns the Redis endpoint (host and port) for this cluster.
758
757
* @return the host and port information
759
758
*/
760
- public HostAndPort getHostAndPort () {
761
- return hostAndPort ;
759
+ public Endpoint getEndpoint () {
760
+ return endpoint ;
762
761
}
763
762
764
763
/**
765
764
* Creates a new Builder instance for configuring a ClusterConfig.
766
- * @param hostAndPort the Redis endpoint (host and port)
765
+ * @param endpoint the Redis endpoint (host and port)
767
766
* @param clientConfig the Jedis client configuration
768
767
* @return new Builder instance
769
- * @throws IllegalArgumentException if hostAndPort or clientConfig is null
768
+ * @throws IllegalArgumentException if endpoint or clientConfig is null
770
769
*/
771
- // TODO : Replace HostAndPort with Endpoint
772
- public static Builder builder (HostAndPort hostAndPort , JedisClientConfig clientConfig ) {
773
- return new Builder (hostAndPort , clientConfig );
770
+
771
+ public static Builder builder (Endpoint endpoint , JedisClientConfig clientConfig ) {
772
+ return new Builder (endpoint , clientConfig );
774
773
}
775
774
776
775
/**
@@ -833,7 +832,7 @@ public StrategySupplier getHealthCheckStrategySupplier() {
833
832
*/
834
833
public static class Builder {
835
834
/** The Redis endpoint for this cluster configuration. */
836
- private HostAndPort hostAndPort ;
835
+ private Endpoint endpoint ;
837
836
838
837
/** The Jedis client configuration. */
839
838
private JedisClientConfig jedisClientConfig ;
@@ -849,12 +848,12 @@ public static class Builder {
849
848
850
849
/**
851
850
* Constructs a new Builder with required endpoint and client configuration.
852
- * @param hostAndPort the Redis endpoint (host and port)
851
+ * @param endpoint the Redis endpoint (host and port)
853
852
* @param clientConfig the Jedis client configuration
854
- * @throws IllegalArgumentException if hostAndPort or clientConfig is null
853
+ * @throws IllegalArgumentException if endpoint or clientConfig is null
855
854
*/
856
- public Builder (HostAndPort hostAndPort , JedisClientConfig clientConfig ) {
857
- this .hostAndPort = hostAndPort ;
855
+ public Builder (Endpoint endpoint , JedisClientConfig clientConfig ) {
856
+ this .endpoint = endpoint ;
858
857
this .jedisClientConfig = clientConfig ;
859
858
}
860
859
@@ -1104,12 +1103,8 @@ public Builder endpoint(ClusterConfig clusterConfig) {
1104
1103
* @return this builder
1105
1104
*/
1106
1105
public Builder endpoint (Endpoint endpoint , float weight , JedisClientConfig clientConfig ) {
1107
- // Convert Endpoint to HostAndPort for ClusterConfig
1108
- // TODO : Refactor ClusterConfig to accept Endpoint directly
1109
- HostAndPort hostAndPort = (endpoint instanceof HostAndPort ) ? (HostAndPort ) endpoint
1110
- : new HostAndPort (endpoint .getHost (), endpoint .getPort ());
1111
1106
1112
- ClusterConfig clusterConfig = ClusterConfig .builder (hostAndPort , clientConfig ).weight (weight )
1107
+ ClusterConfig clusterConfig = ClusterConfig .builder (endpoint , clientConfig ).weight (weight )
1113
1108
.build ();
1114
1109
1115
1110
this .clusterConfigs .add (clusterConfig );
0 commit comments