Search in sources :

Example 1 with InputDataSet

use of org.opensearch.ml.common.annotation.InputDataSet in project ml-commons by opensearch-project.

the class MLCommonsClassLoader method loadMLInputDataSetClassMapping.

/**
 * Load ML input data set class
 */
private static void loadMLInputDataSetClassMapping() {
    Reflections reflections = new Reflections("org.opensearch.ml.common.dataset");
    Set<Class<?>> classes = reflections.getTypesAnnotatedWith(InputDataSet.class);
    for (Class<?> clazz : classes) {
        InputDataSet inputDataSet = clazz.getAnnotation(InputDataSet.class);
        MLInputDataType value = inputDataSet.value();
        if (value != null) {
            parameterClassMap.put(value, clazz);
        }
    }
}
Also used : InputDataSet(org.opensearch.ml.common.annotation.InputDataSet) MLInputDataType(org.opensearch.ml.common.dataset.MLInputDataType) Reflections(org.reflections.Reflections)

Aggregations

InputDataSet (org.opensearch.ml.common.annotation.InputDataSet)1 MLInputDataType (org.opensearch.ml.common.dataset.MLInputDataType)1 Reflections (org.reflections.Reflections)1