JNSimba commented on code in PR #171:
URL: 
https://github.com/apache/doris-spark-connector/pull/171#discussion_r1427501099


##########
spark-doris-connector/src/main/java/org/apache/doris/spark/rest/RestService.java:
##########
@@ -592,17 +650,20 @@ public static List<BackendV2.BackendRowV2> 
getBackendRows(SparkSettings sparkSet
     }
 
     /**
-     * choice a Doris BE node to request.
+     * benode does not exist, execute the original FE
+     * @param sparkSettings  settings
      * @param logger slf4j logger
-     * @return the chosen one Doris BE node
-     * @throws IllegalArgumentException BE nodes is illegal
+     * @return Doris Be nodes
+     * @throws DorisException
      */
-    @VisibleForTesting
-    public static String randomBackendV2(SparkSettings sparkSettings, Logger 
logger) throws DorisException {
-        List<BackendV2.BackendRowV2> backends = getBackendRows(sparkSettings, 
logger);
-        Collections.shuffle(backends);
-        BackendV2.BackendRowV2 backend = backends.get(0);
-        return backend.getIp() + ":" + backend.getHttpPort();
+    private static List<BackendV2.BackendRowV2> getBackendRowV2s(SparkSettings 
sparkSettings, Logger logger) throws DorisException {
+        List<BackendV2.BackendRowV2> backends = null;
+        if(notBeNode(sparkSettings, logger)){
+            backends = getBackendRows(sparkSettings, logger);
+        }else{
+            backends = getBeBackendRows(sparkSettings, logger);

Review Comment:
   Is it enough to call the `getBeBackendRows` method directly in the 
`getBackendRows` method? Other methods should not need to be modified?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to