Search in sources :

Example 1 with MockSystemFactory

use of org.apache.samza.system.MockSystemFactory in project samza by apache.

the class SamzaSqlIntegrationTestHarness method runApplication.

protected void runApplication(Config config) {
    // Use MockSystemFactory for the coordinator system
    MockSystemFactory.MSG_QUEUES.put(new SystemStreamPartition(MOCK_METADATA_SYSTEM, CoordinatorStreamUtil.getCoordinatorStreamName(SamzaSqlTestConfig.SQL_JOB, SamzaSqlTestConfig.SQL_JOB_PROCESSOR_ID), new Partition(0)), new ArrayList<>());
    HashMap<String, String> mapConfig = new HashMap<>();
    mapConfig.put(JobConfig.JOB_COORDINATOR_SYSTEM, MOCK_METADATA_SYSTEM);
    mapConfig.put(String.format(SystemConfig.SYSTEM_FACTORY_FORMAT, MOCK_METADATA_SYSTEM), MockSystemFactory.class.getName());
    // configs for using in-memory system as the default system
    mapConfig.putAll(baseInMemorySystemConfigs());
    mapConfig.putAll(config);
    SamzaSqlApplicationRunner runner = new SamzaSqlApplicationRunner(true, new MapConfig(mapConfig));
    executeRun(runner, config);
    runner.waitForFinish();
}
Also used : Partition(org.apache.samza.Partition) SystemStreamPartition(org.apache.samza.system.SystemStreamPartition) SamzaSqlApplicationRunner(org.apache.samza.sql.runner.SamzaSqlApplicationRunner) HashMap(java.util.HashMap) MapConfig(org.apache.samza.config.MapConfig) MockSystemFactory(org.apache.samza.system.MockSystemFactory) SystemStreamPartition(org.apache.samza.system.SystemStreamPartition)

Aggregations

HashMap (java.util.HashMap)1 Partition (org.apache.samza.Partition)1 MapConfig (org.apache.samza.config.MapConfig)1 SamzaSqlApplicationRunner (org.apache.samza.sql.runner.SamzaSqlApplicationRunner)1 MockSystemFactory (org.apache.samza.system.MockSystemFactory)1 SystemStreamPartition (org.apache.samza.system.SystemStreamPartition)1