All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nosqlbench.virtdata.core.bindings.VirtDataLibraries Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.virtdata.core.bindings;

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class VirtDataLibraries implements VirtDataFunctionLibrary  {
    private final static Logger logger = LogManager.getLogger(VirtDataLibraries.class);
    private static final VirtDataLibraries instance = new VirtDataLibraries();
    private final Map> threadSafeCache = new HashMap<>();

    private final VirtDataFunctionResolver resolver = new VirtDataFunctionResolver();

    public static VirtDataLibraries get() {
        return instance;
    }

    private VirtDataLibraries() {
    }

    @Override
    public List resolveFunctions(
            Class returnType,
            Class inputType,
            String functionName,
            Map customConfig,
            Object... parameters)
    {
        List resolvedFunctions = new ArrayList<>();


        List resolved = resolver.resolveFunctions(returnType, inputType, functionName, customConfig, parameters);
        // Written this way to allow for easy debugging and understanding, do not convert to .stream()...
        if (resolved.size()>0) {
            resolvedFunctions.addAll(resolved);
        }
        return resolvedFunctions;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy