Search in sources :

Example 41 with JetConfig

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

the class ExecutionLifecycleTest method setup.

@Before
public void setup() {
    MockPMS.initCalled.set(false);
    MockPMS.closeCalled.set(false);
    MockPMS.receivedCloseError.set(null);
    MockPS.closeCount.set(0);
    MockPS.initCount.set(0);
    MockPS.receivedCloseErrors.clear();
    MockP.initCount.set(0);
    MockP.closeCount.set(0);
    MockP.receivedCloseErrors.clear();
    StuckProcessor.proceedLatch = new CountDownLatch(1);
    StuckProcessor.executionStarted = new CountDownLatch(NODE_COUNT * LOCAL_PARALLELISM);
    JetConfig config = new JetConfig();
    config.getInstanceConfig().setCooperativeThreadCount(LOCAL_PARALLELISM);
    instance = createJetMember(config);
    createJetMember(config);
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Example 42 with JetConfig

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

the class JetSplitBrainTestSupport method testSplitBrain.

final void testSplitBrain(int firstSubClusterSize, int secondSubClusterSize, Consumer<JetInstance[]> beforeSplit, BiConsumer<JetInstance[], JetInstance[]> onSplit, Consumer<JetInstance[]> afterMerge) {
    checkPositive(firstSubClusterSize, "invalid first sub cluster size: " + firstSubClusterSize);
    checkPositive(secondSubClusterSize, "invalid second sub cluster size: " + secondSubClusterSize);
    JetConfig config = createConfig();
    int clusterSize = firstSubClusterSize + secondSubClusterSize;
    JetInstance[] instances = startInitialCluster(config, clusterSize);
    if (beforeSplit != null) {
        beforeSplit.accept(instances);
    }
    createSplitBrain(instances, firstSubClusterSize, secondSubClusterSize);
    Brains brains = getBrains(instances, firstSubClusterSize, secondSubClusterSize);
    if (onSplit != null) {
        onSplit.accept(brains.firstSubCluster, brains.secondSubCluster);
    }
    healSplitBrain(instances, firstSubClusterSize);
    if (afterMerge != null) {
        afterMerge.accept(instances);
    }
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig)

Example 43 with JetConfig

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

the class ManagedContextTest method setup.

@Before
public void setup() {
    JetConfig jetConfig = new JetConfig();
    jetConfig.getHazelcastConfig().setManagedContext(new MockManagedContext());
    jet = this.createJetMember(jetConfig);
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Example 44 with JetConfig

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

the class BackpressureTest method setUp.

@Before
public void setUp() {
    JetConfig config = new JetConfig();
    config.getInstanceConfig().setCooperativeThreadCount(PARALLELISM_PER_MEMBER);
    jet1 = createJetMember(config);
    jet2 = createJetMember(config);
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Example 45 with JetConfig

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

the class WordCountTest method before.

@Before
public void before() {
    JetConfig config = new JetConfig();
    config.getInstanceConfig().setCooperativeThreadCount(PARALLELISM);
    Config hazelcastConfig = config.getHazelcastConfig();
    hazelcastConfig.getGroupConfig().setName(randomName());
    final JoinConfig join = hazelcastConfig.getNetworkConfig().getJoin();
    join.getMulticastConfig().setEnabled(false);
    join.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1");
    for (int i = 1; i < NODE_COUNT; i++) {
        instance = Jet.newJetInstance(config);
    }
    logger = instance.getHazelcastInstance().getLoggingService().getLogger(WordCountTest.class);
    generateMockInput();
}
Also used : JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) JoinConfig(com.hazelcast.config.JoinConfig) JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Aggregations

JetConfig (com.hazelcast.jet.config.JetConfig)56 Before (org.junit.Before)21 Test (org.junit.Test)15 JetInstance (com.hazelcast.jet.JetInstance)14 Config (com.hazelcast.config.Config)10 Properties (java.util.Properties)9 EventJournalConfig (com.hazelcast.config.EventJournalConfig)8 CountDownLatch (java.util.concurrent.CountDownLatch)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)4 EdgeConfig (com.hazelcast.jet.config.EdgeConfig)4 ClientConfig (com.hazelcast.client.config.ClientConfig)3 MapConfig (com.hazelcast.config.MapConfig)3 JobConfig (com.hazelcast.jet.config.JobConfig)3 MockPS (com.hazelcast.jet.core.TestProcessors.MockPS)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 InputStream (java.io.InputStream)3 JoinConfig (com.hazelcast.config.JoinConfig)2 HazelcastInstance (com.hazelcast.core.HazelcastInstance)2 JetTestInstanceFactory (com.hazelcast.jet.JetTestInstanceFactory)2 Job (com.hazelcast.jet.Job)2