package hex.tree.xgboost.remote;

import water.server.ServletMeta;
import water.server.ServletProvider;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class RemoteXGBoostServletProvider implements ServletProvider {

    private static final List<ServletMeta> SERVLETS = Collections.unmodifiableList(Arrays.asList(
        new ServletMeta("/3/XGBoostExecutor.upload", RemoteXGBoostUploadServlet.class)
    ));

    @Override
    public List<ServletMeta> servlets() {
        return SERVLETS;
    }

    @Override
    public int priority() {
        return 0;
    }

}

@@ -102,33 +102,8 @@
 r;%0A%0A
-import java.util.Arrays;%0A
 impo
@@ -128,16 +128,16 @@
 ctions;%0A
+
 import j
@@ -294,40 +294,27 @@
 ons.
-unmodifiableList(Arrays.as
+singleton
 List(%0A
+    
     
@@ -332,16 +332,24 @@
 vletMeta
+.Builder
 (%22/3/XGB
@@ -408,17 +408,163 @@
 ss)%0A    
-)
+                .withAlwaysEnabled(true) // for external XGBoost on K8s (when LeaderNodeRequestFilter is enabled)%0A                    .build()%0A    
 );%0A%0A    

Allow matrix to be uploaded to any node in external XGB on K8S