Search in sources :

Example 1 with SimpleInstallationFinder

use of org.apache.samza.rest.proxy.installation.SimpleInstallationFinder in project samza by apache.

the class SamzaTaskProxyFactory method getTaskProxy.

@Override
public TaskProxy getTaskProxy(TaskResourceConfig config) {
    String installationsPath = config.getInstallationsPath();
    Preconditions.checkArgument(StringUtils.isNotEmpty(installationsPath), String.format("Config param %s is not defined.", BaseResourceConfig.CONFIG_JOB_INSTALLATIONS_PATH));
    String configFactoryClass = config.getJobConfigFactory();
    try {
        InstallationFinder installFinder = new SimpleInstallationFinder(installationsPath, ClassLoaderHelper.fromClassName(configFactoryClass));
        return new SamzaTaskProxy(config, installFinder);
    } catch (Exception e) {
        LOG.error(String.format("Exception during instantiation through configFactory class: %s.", configFactoryClass), e);
        throw new SamzaException(e);
    }
}
Also used : InstallationFinder(org.apache.samza.rest.proxy.installation.InstallationFinder) SimpleInstallationFinder(org.apache.samza.rest.proxy.installation.SimpleInstallationFinder) SimpleInstallationFinder(org.apache.samza.rest.proxy.installation.SimpleInstallationFinder) SamzaException(org.apache.samza.SamzaException) SamzaException(org.apache.samza.SamzaException)

Aggregations

SamzaException (org.apache.samza.SamzaException)1 InstallationFinder (org.apache.samza.rest.proxy.installation.InstallationFinder)1 SimpleInstallationFinder (org.apache.samza.rest.proxy.installation.SimpleInstallationFinder)1