Search in sources :

Example 1 with Configuration

use of co.cask.cdap.filetailer.config.Configuration in project cdap-ingest by caskdata.

the class PollingServiceManager method getConfiguration.

/**
   * Return DropZone configuration
   *
   * @return DropZone configuration
   * @throws ConfigurationLoadingException if configuration load failed
   */
private FileDropZoneConfiguration getConfiguration() throws ConfigurationLoadingException {
    ConfigurationLoader loader = new ConfigurationLoaderImpl();
    Configuration configuration = loader.load(confFile);
    return new FileDropZoneConfigurationImpl(configuration.getProperties());
}
Also used : Configuration(co.cask.cdap.filetailer.config.Configuration) FileDropZoneConfiguration(co.cask.cdap.file.dropzone.config.FileDropZoneConfiguration) ObserverConfiguration(co.cask.cdap.file.dropzone.config.ObserverConfiguration) ConfigurationLoaderImpl(co.cask.cdap.filetailer.config.ConfigurationLoaderImpl) ConfigurationLoader(co.cask.cdap.filetailer.config.ConfigurationLoader) FileDropZoneConfigurationImpl(co.cask.cdap.file.dropzone.config.FileDropZoneConfigurationImpl)

Example 2 with Configuration

use of co.cask.cdap.filetailer.config.Configuration in project cdap-ingest by caskdata.

the class FileDropZoneIT method loadConfig.

private ObserverConfiguration loadConfig(File file) throws ConfigurationLoadingException {
    ConfigurationLoader loader = new ConfigurationLoaderImpl();
    Configuration configuration = loader.load(file);
    List<ObserverConfiguration> observerConfig = new FileDropZoneConfigurationImpl(configuration.getProperties()).getObserverConfiguration();
    return observerConfig.get(0);
}
Also used : Configuration(co.cask.cdap.filetailer.config.Configuration) ObserverConfiguration(co.cask.cdap.file.dropzone.config.ObserverConfiguration) ObserverConfiguration(co.cask.cdap.file.dropzone.config.ObserverConfiguration) ConfigurationLoaderImpl(co.cask.cdap.filetailer.config.ConfigurationLoaderImpl) ConfigurationLoader(co.cask.cdap.filetailer.config.ConfigurationLoader) FileDropZoneConfigurationImpl(co.cask.cdap.file.dropzone.config.FileDropZoneConfigurationImpl)

Example 3 with Configuration

use of co.cask.cdap.filetailer.config.Configuration in project cdap-ingest by caskdata.

the class PipeManager method getPipeConfigs.

/**
   * Get pipes configuration
   *
   * @return the pipes configuration read from the configuration file
   * @throws ConfigurationLoadingException in case can not load configuration
   */
private List<PipeConfiguration> getPipeConfigs() throws ConfigurationLoadingException {
    ConfigurationLoader loader = new ConfigurationLoaderImpl();
    Configuration configuration = loader.load(confFile);
    return configuration.getPipeConfigurations();
}
Also used : Configuration(co.cask.cdap.filetailer.config.Configuration) PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) ConfigurationLoaderImpl(co.cask.cdap.filetailer.config.ConfigurationLoaderImpl) ConfigurationLoader(co.cask.cdap.filetailer.config.ConfigurationLoader)

Example 4 with Configuration

use of co.cask.cdap.filetailer.config.Configuration in project cdap-ingest by caskdata.

the class TailerLogUtils method loadConfig.

public static PipeConfiguration loadConfig() throws ConfigurationLoadingException {
    ConfigurationLoader loader = new ConfigurationLoaderImpl();
    Class<? extends Class> path1 = TailerLogUtils.class.getClass();
    String path = TailerLogUtils.class.getClassLoader().getResource("test4.properties").getFile();
    Configuration configuration = loader.load(new File(path));
    List<PipeConfiguration> flowConfig = configuration.getPipeConfigurations();
    return flowConfig.get(0);
}
Also used : PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) Configuration(co.cask.cdap.filetailer.config.Configuration) PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) ConfigurationLoaderImpl(co.cask.cdap.filetailer.config.ConfigurationLoaderImpl) File(java.io.File) ConfigurationLoader(co.cask.cdap.filetailer.config.ConfigurationLoader)

Example 5 with Configuration

use of co.cask.cdap.filetailer.config.Configuration in project cdap-ingest by caskdata.

the class FileTailerIT method loadConfig.

private PipeConfiguration loadConfig(File file) throws ConfigurationLoadingException {
    ConfigurationLoader loader = new ConfigurationLoaderImpl();
    Configuration configuration = loader.load(file);
    List<PipeConfiguration> pipeConfig = configuration.getPipeConfigurations();
    return pipeConfig.get(0);
}
Also used : PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) Configuration(co.cask.cdap.filetailer.config.Configuration) PipeConfiguration(co.cask.cdap.filetailer.config.PipeConfiguration) ConfigurationLoaderImpl(co.cask.cdap.filetailer.config.ConfigurationLoaderImpl) ConfigurationLoader(co.cask.cdap.filetailer.config.ConfigurationLoader)

Aggregations

Configuration (co.cask.cdap.filetailer.config.Configuration)5 ConfigurationLoader (co.cask.cdap.filetailer.config.ConfigurationLoader)5 ConfigurationLoaderImpl (co.cask.cdap.filetailer.config.ConfigurationLoaderImpl)5 PipeConfiguration (co.cask.cdap.filetailer.config.PipeConfiguration)3 FileDropZoneConfigurationImpl (co.cask.cdap.file.dropzone.config.FileDropZoneConfigurationImpl)2 ObserverConfiguration (co.cask.cdap.file.dropzone.config.ObserverConfiguration)2 FileDropZoneConfiguration (co.cask.cdap.file.dropzone.config.FileDropZoneConfiguration)1 File (java.io.File)1