use of org.opensearch.ml.engine.annotation.Function in project ml-commons by opensearch-project.
the class MLEngineClassLoader method loadClassMapping.
public static void loadClassMapping() {
Reflections reflections = new Reflections("org.opensearch.ml.engine.algorithms");
Set<Class<?>> classes = reflections.getTypesAnnotatedWith(Function.class);
// Load ML algorithm parameter class
for (Class<?> clazz : classes) {
Function function = clazz.getAnnotation(Function.class);
FunctionName functionName = function.value();
if (functionName != null) {
mlAlgoClassMap.put(functionName, clazz);
}
}
}
Aggregations