Search in sources :

Example 6 with MetadataStoreFactory

use of org.apache.samza.metadatastore.MetadataStoreFactory in project samza by apache.

the class LocalJobPlanner method getMetadataStore.

private MetadataStore getMetadataStore() {
    String metadataStoreFactoryClass = appDesc.getConfig().get(METADATA_STORE_FACTORY_CONFIG);
    if (metadataStoreFactoryClass == null) {
        metadataStoreFactoryClass = DEFAULT_METADATA_STORE_FACTORY;
    }
    MetadataStoreFactory metadataStoreFactory = ReflectionUtil.getObj(metadataStoreFactoryClass, MetadataStoreFactory.class);
    return metadataStoreFactory.getMetadataStore(STREAM_CREATION_METADATA_STORE, appDesc.getConfig(), new MetricsRegistryMap());
}
Also used : MetricsRegistryMap(org.apache.samza.metrics.MetricsRegistryMap) MetadataStoreFactory(org.apache.samza.metadatastore.MetadataStoreFactory) ZkMetadataStoreFactory(org.apache.samza.zk.ZkMetadataStoreFactory)

Example 7 with MetadataStoreFactory

use of org.apache.samza.metadatastore.MetadataStoreFactory in project samza by apache.

the class TestLocalApplicationRunner method testGetCoordinatorStreamStoreFactoryWithJobCoordinatorSystem.

/**
 * Default metadata store factory should not be null if job coordinator system defined and the default
 * ZkJobCoordinator is used.
 */
@Test
public void testGetCoordinatorStreamStoreFactoryWithJobCoordinatorSystem() {
    Optional<MetadataStoreFactory> metadataStoreFactory = LocalApplicationRunner.getDefaultCoordinatorStreamStoreFactory(new MapConfig(ImmutableMap.of(JobConfig.JOB_COORDINATOR_SYSTEM, "test-system")));
    assertTrue(metadataStoreFactory.isPresent());
}
Also used : MapConfig(org.apache.samza.config.MapConfig) InMemoryMetadataStoreFactory(org.apache.samza.metadatastore.InMemoryMetadataStoreFactory) CoordinatorStreamMetadataStoreFactory(org.apache.samza.coordinator.metadatastore.CoordinatorStreamMetadataStoreFactory) MetadataStoreFactory(org.apache.samza.metadatastore.MetadataStoreFactory) ZkMetadataStoreFactory(org.apache.samza.zk.ZkMetadataStoreFactory) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

MetadataStoreFactory (org.apache.samza.metadatastore.MetadataStoreFactory)7 ZkMetadataStoreFactory (org.apache.samza.zk.ZkMetadataStoreFactory)6 MapConfig (org.apache.samza.config.MapConfig)5 CoordinatorStreamMetadataStoreFactory (org.apache.samza.coordinator.metadatastore.CoordinatorStreamMetadataStoreFactory)5 InMemoryMetadataStoreFactory (org.apache.samza.metadatastore.InMemoryMetadataStoreFactory)4 Test (org.junit.Test)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 MetricsRegistryMap (org.apache.samza.metrics.MetricsRegistryMap)3 HashMap (java.util.HashMap)1 JobConfig (org.apache.samza.config.JobConfig)1 CoordinatorStreamStore (org.apache.samza.coordinator.metadatastore.CoordinatorStreamStore)1 CoordinatorStreamValueSerde (org.apache.samza.coordinator.stream.CoordinatorStreamValueSerde)1 MetadataStore (org.apache.samza.metadatastore.MetadataStore)1 ZkMetadataStore (org.apache.samza.zk.ZkMetadataStore)1