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;
    }

}

package hex.tree.xgboost.remote;

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

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

public class RemoteXGBoostServletProvider implements ServletProvider {

    private static final List<ServletMeta> SERVLETS = Collections.singletonList(
            new ServletMeta.Builder("/3/XGBoostExecutor.upload", RemoteXGBoostUploadServlet.class)
                    .withAlwaysEnabled(true) // for external XGBoost on K8s (when LeaderNodeRequestFilter is enabled)
                    .build()
    );

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

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

}

Allow matrix to be uploaded to any node in external XGB on K8S
PUBDEV-8671: Allow matrix to be uploaded to any node in external XGB on K8S
