Search in sources :

Example 1 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast-jet by hazelcast.

the class GroupTransform_IntegrationTest method before.

@Before
public void before() {
    JetConfig config = new JetConfig();
    config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig().setMapName("source").setEnabled(true));
    instance = createJetMember(config);
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Example 2 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast-jet by hazelcast.

the class HazelcastConnectorTest method setup.

@Before
public void setup() {
    JetConfig jetConfig = new JetConfig();
    Config hazelcastConfig = jetConfig.getHazelcastConfig();
    hazelcastConfig.addCacheConfig(new CacheSimpleConfig().setName("*"));
    hazelcastConfig.addEventJournalConfig(new EventJournalConfig().setCacheName("stream*").setMapName("stream*"));
    jetInstance = createJetMember(jetConfig);
    JetInstance jetInstance2 = createJetMember(jetConfig);
    sourceName = randomString();
    sinkName = randomString();
    streamSourceName = "stream" + sourceName;
    streamSinkName = "stream" + sinkName;
    // workaround for `cache is not created` exception, create cache locally on all nodes
    JetCacheManager cacheManager = jetInstance2.getCacheManager();
    cacheManager.getCache(sourceName);
    cacheManager.getCache(sinkName);
    cacheManager.getCache(streamSourceName);
    cacheManager.getCache(streamSinkName);
}
Also used : CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) JetInstance(com.hazelcast.jet.JetInstance) JetCacheManager(com.hazelcast.jet.JetCacheManager) JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Example 3 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast-jet by hazelcast.

the class SnapshotFailureTest method setup.

@Before
public void setup() {
    JetConfig config = new JetConfig();
    config.getInstanceConfig().setCooperativeThreadCount(LOCAL_PARALLELISM);
    // force snapshots to fail by adding a failing map store configuration for snapshot data maps
    MapConfig mapConfig = new MapConfig(SnapshotRepository.SNAPSHOT_DATA_NAME_PREFIX + '*');
    MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig();
    mapStoreConfig.setEnabled(true);
    mapStoreConfig.setImplementation(new FailingMapStore());
    config.getHazelcastConfig().addMapConfig(mapConfig);
    config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig().setMapName(SnapshotRepository.SNAPSHOT_NAME_PREFIX + '*'));
    JetInstance[] instances = createJetMembers(config, 2);
    instance1 = instances[0];
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) MapConfig(com.hazelcast.config.MapConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) JetConfig(com.hazelcast.jet.config.JetConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) Before(org.junit.Before)

Example 4 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast by hazelcast.

the class AbstractRecordStore method addMutationObservers.

// Overridden in EE.
protected void addMutationObservers() {
    // Add observer for event journal
    EventJournalConfig eventJournalConfig = mapContainer.getEventJournalConfig();
    if (eventJournalConfig != null && eventJournalConfig.isEnabled()) {
        mutationObserver.add(new EventJournalWriterMutationObserver(mapServiceContext.getEventJournal(), mapContainer, partitionId));
    }
    // Add observer for json metadata
    if (mapContainer.getMapConfig().getMetadataPolicy() == MetadataPolicy.CREATE_ON_UPDATE) {
        mutationObserver.add(new JsonMetadataMutationObserver(serializationService, JsonMetadataInitializer.INSTANCE, getOrCreateMetadataStore()));
    }
    // Add observer for indexing
    indexingObserver = new IndexingMutationObserver<>(this, serializationService);
    mutationObserver.add(indexingObserver);
}
Also used : EventJournalConfig(com.hazelcast.config.EventJournalConfig)

Example 5 with EventJournalConfig

use of com.hazelcast.config.EventJournalConfig in project hazelcast by hazelcast.

the class ReplicationOperation method getRingbufferConfig.

/**
 * Returns the ringbuffer config for the provided namespace. The namespace
 * provides information whether the requested ringbuffer is a ringbuffer
 * that the user is directly interacting with through a ringbuffer proxy
 * or if this is a backing ringbuffer for an event journal.
 * If a ringbuffer configuration for an event journal is requested, this
 * method will expect the configuration for the relevant map or cache
 * to be available.
 *
 * @param service the ringbuffer service
 * @param ns      the object namespace for which we are creating a ringbuffer
 * @return the ringbuffer configuration
 * @throws CacheNotExistsException if a config for a cache event journal was requested
 *                                 and the cache configuration was not found
 */
private RingbufferConfig getRingbufferConfig(RingbufferService service, ObjectNamespace ns) {
    final String serviceName = ns.getServiceName();
    if (RingbufferService.SERVICE_NAME.equals(serviceName)) {
        return service.getRingbufferConfig(ns.getObjectName());
    } else if (MapService.SERVICE_NAME.equals(serviceName)) {
        final MapService mapService = getNodeEngine().getService(MapService.SERVICE_NAME);
        final MapEventJournal journal = mapService.getMapServiceContext().getEventJournal();
        final EventJournalConfig journalConfig = journal.getEventJournalConfig(ns);
        return journal.toRingbufferConfig(journalConfig, ns);
    } else if (CacheService.SERVICE_NAME.equals(serviceName)) {
        final CacheService cacheService = getNodeEngine().getService(CacheService.SERVICE_NAME);
        final CacheEventJournal journal = cacheService.getEventJournal();
        final EventJournalConfig journalConfig = journal.getEventJournalConfig(ns);
        return journal.toRingbufferConfig(journalConfig, ns);
    } else {
        throw new IllegalArgumentException("Unsupported ringbuffer service name " + serviceName);
    }
}
Also used : MapEventJournal(com.hazelcast.map.impl.journal.MapEventJournal) MapService(com.hazelcast.map.impl.MapService) CacheEventJournal(com.hazelcast.cache.impl.journal.CacheEventJournal) EventJournalConfig(com.hazelcast.config.EventJournalConfig) CacheService(com.hazelcast.cache.impl.CacheService)

Aggregations

EventJournalConfig (com.hazelcast.config.EventJournalConfig)32 Config (com.hazelcast.config.Config)13 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)10 JetConfig (com.hazelcast.jet.config.JetConfig)9 Before (org.junit.Before)9 MapConfig (com.hazelcast.config.MapConfig)6 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)6 AttributeConfig (com.hazelcast.config.AttributeConfig)5 IndexConfig (com.hazelcast.config.IndexConfig)5 MapStoreConfig (com.hazelcast.config.MapStoreConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 NearCacheConfig (com.hazelcast.config.NearCacheConfig)5 AwsConfig (com.hazelcast.config.AwsConfig)4 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)4 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)4 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)4 DiskTierConfig (com.hazelcast.config.DiskTierConfig)4 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)4 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)4 EvictionConfig (com.hazelcast.config.EvictionConfig)4