jt2594838 commented on code in PR #16281:
URL: https://github.com/apache/iotdb/pull/16281#discussion_r2307008859


##########
iotdb-client/isession/src/main/java/org/apache/iotdb/isession/SessionConfig.java:
##########
@@ -57,4 +60,26 @@ public class SessionConfig {
   public static final String SQL_DIALECT = "tree";
 
   private SessionConfig() {}
+
+  // Endpoint selection strategy constants
+  // public static final String ENDPOINT_SELECTION_STRATEGY = "retry_strategy";
+  public static final String ENDPOINT_SELECTION_STRATEGY_RANDOM = "random";
+  public static final String ENDPOINT_SELECTION_STRATEGY_SEQUENTIAL = 
"sequential";
+  public static final String DEFAULT_ENDPOINT_SELECTION_STRATEGY =
+      ENDPOINT_SELECTION_STRATEGY_RANDOM;
+
+  /**
+   * Creates an endpoint selection strategy based on the given strategy name.
+   *
+   * @param strategyName name of the strategy ("random" or "sequential")
+   * @return configured strategy instance
+   * @throws IllegalArgumentException if strategyName is null or empty
+   */
+  public static EndpointSelectionStrategy createSelectionStrategy(String 
strategyName) {
+    if (ENDPOINT_SELECTION_STRATEGY_SEQUENTIAL.equalsIgnoreCase(strategyName)) 
{
+      return new SequentialSelectionStrategy();
+    }
+    // Default to random strategy
+    return new RandomSelectionStrategy();
+  }

Review Comment:
   May print a warn log if the provided name is neither.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to