use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class WindowGroupTransform_IntegrationTest method before.
@Before
public void before() {
JetConfig config = new JetConfig();
config.getHazelcastConfig().addEventJournalConfig(new EventJournalConfig().setMapName("source*").setEnabled(true));
config.getHazelcastConfig().setProperty(GroupProperty.PARTITION_COUNT.getName(), "1");
instance = createJetMember(config);
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class AsyncMapWriterTest method setup.
@Before
public void setup() {
JetConfig jetConfig = new JetConfig();
Config config = jetConfig.getHazelcastConfig();
// use two partitions per member
config.setProperty(GroupProperty.PARTITION_COUNT.getName(), String.valueOf(NODE_COUNT * 2));
config.setProperty(GroupProperty.OPERATION_CALL_TIMEOUT_MILLIS.getName(), "3000");
config.getMapConfig("default").setBackupCount(1).setAsyncBackupCount(0);
config.getMapConfig(ALWAYS_FAILING_MAP).getMapStoreConfig().setEnabled(true).setImplementation(new AlwaysFailingMapStore());
config.getMapConfig(RETRYABLE_MAP).getMapStoreConfig().setEnabled(true).setImplementation(new RetryableMapStore());
JetInstance[] instances = createJetMembers(jetConfig, NODE_COUNT);
instance1 = instances[0];
instance2 = instances[1];
nodeEngine = getNodeEngineImpl(instance1.getHazelcastInstance());
writer = new AsyncMapWriter(nodeEngine);
map = instance1.getMap("testMap");
writer.setMapName(map.getName());
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class HazelcastRemoteConnectorTest method setUp.
@BeforeClass
public static void setUp() {
JetConfig jetConfig = new JetConfig();
Config hazelcastConfig = jetConfig.getHazelcastConfig();
hazelcastConfig.addCacheConfig(new CacheSimpleConfig().setName("*"));
jet = factory.newMember(jetConfig);
JetInstance jet2 = factory.newMember(jetConfig);
Config config = new Config();
config.addCacheConfig(new CacheSimpleConfig().setName("*"));
config.addEventJournalConfig(new EventJournalConfig().setCacheName("default").setMapName("default"));
config.getGroupConfig().setName(randomName());
hz = Hazelcast.newHazelcastInstance(config);
HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config);
clientConfig = new ClientConfig();
clientConfig.getGroupConfig().setName(config.getGroupConfig().getName());
Address address = hz.getCluster().getLocalMember().getAddress();
clientConfig.getNetworkConfig().addAddress(address.getHost() + ':' + address.getPort());
// workaround for `cache is not created` exception, create cache locally on all nodes
hz2.getCacheManager().getCache(SOURCE_NAME);
hz2.getCacheManager().getCache(SINK_NAME);
jet2.getCacheManager().getCache(SOURCE_NAME);
jet2.getCacheManager().getCache(SINK_NAME);
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class StreamEventJournalPTest method setUp.
@Before
public void setUp() {
JetConfig config = new JetConfig();
EventJournalConfig journalConfig = new EventJournalConfig().setMapName("*").setCapacity(JOURNAL_CAPACITY).setEnabled(true);
config.getHazelcastConfig().setProperty(PARTITION_COUNT.getName(), String.valueOf(NUM_PARTITIONS));
config.getHazelcastConfig().addEventJournalConfig(journalConfig);
instance = this.createJetMember(config);
map = (MapProxyImpl<String, Integer>) instance.getHazelcastInstance().<String, Integer>getMap("test");
List<Integer> allPartitions = IntStream.range(0, NUM_PARTITIONS).boxed().collect(toList());
supplier = () -> new StreamEventJournalP<>(map, allPartitions, e -> true, EventJournalMapEvent::getNewValue, START_FROM_OLDEST, false, wmGenParams(Integer::intValue, limitingLag(0), suppressAll(), -1));
key0 = generateKeyForPartition(instance.getHazelcastInstance(), 0);
key1 = generateKeyForPartition(instance.getHazelcastInstance(), 1);
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class StreamEventJournalP_WmCoalescingTest method setUp.
@Before
public void setUp() {
JetConfig config = new JetConfig();
EventJournalConfig journalConfig = new EventJournalConfig().setMapName("*").setCapacity(JOURNAL_CAPACITY).setEnabled(true);
config.getHazelcastConfig().setProperty(PARTITION_COUNT.getName(), "2");
config.getHazelcastConfig().addEventJournalConfig(journalConfig);
JetInstance instance = this.createJetMember(config);
assert map == null;
map = (MapProxyImpl<Integer, Integer>) instance.getHazelcastInstance().<Integer, Integer>getMap("test");
partitionKeys = new int[2];
for (int i = 1; IntStream.of(partitionKeys).anyMatch(val -> val == 0); i++) {
int partitionId = instance.getHazelcastInstance().getPartitionService().getPartition(i).getPartitionId();
partitionKeys[partitionId] = i;
}
}
Aggregations