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);
}
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);
}
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];
}
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);
}
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);
}
}
Aggregations