Search in sources :

Example 1 with JetConfig

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

the class JetDriver method startVendorInstance.

@Override
public void startVendorInstance() throws Exception {
    String workerType = get("WORKER_TYPE");
    LOGGER.info(format("%s HazelcastInstance starting", workerType));
    if ("javaclient".equals(workerType)) {
        File configFile = new File(getUserDir(), "client-hazelcast.xml");
        XmlClientConfigBuilder configBuilder = new XmlClientConfigBuilder(configFile);
        ClientConfig clientConfig = configBuilder.build();
        jet = Jet.newJetClient(clientConfig);
    } else {
        File configFile = new File(getUserDir(), "hazelcast.xml");
        XmlConfigBuilder configBuilder = new XmlConfigBuilder(configFile.getAbsolutePath());
        Config config = configBuilder.build();
        JetConfig jetConfig = new JetConfig();
        jetConfig.setHazelcastConfig(config);
        jet = Jet.newJetInstance(jetConfig);
    }
    LOGGER.info(format("%s HazelcastInstance started", workerType));
    warmupPartitions(jet.getHazelcastInstance());
    LOGGER.info("Warmed up partitions");
}
Also used : XmlConfigBuilder(com.hazelcast.config.XmlConfigBuilder) XmlClientConfigBuilder(com.hazelcast.client.config.XmlClientConfigBuilder) ClientConfig(com.hazelcast.client.config.ClientConfig) Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) ClientConfig(com.hazelcast.client.config.ClientConfig) File(java.io.File) FileUtils.getConfigurationFile(com.hazelcast.simulator.utils.FileUtils.getConfigurationFile) JetConfig(com.hazelcast.jet.config.JetConfig)

Example 2 with JetConfig

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

the class TestApplicationContext method assertJetConfig.

private void assertJetConfig() {
    JetConfig jetConfig = jetInstance.getConfig();
    Config hazelcastConfig = jetConfig.getHazelcastConfig();
    assertHazelcastConfig(hazelcastConfig);
    InstanceConfig instanceConfig = jetConfig.getInstanceConfig();
    assertEquals(4, instanceConfig.getBackupCount());
    assertEquals(2, instanceConfig.getCooperativeThreadCount());
    assertEquals(200, instanceConfig.getFlowControlPeriodMs());
    assertEquals("springTempDir", instanceConfig.getTempDir());
    EdgeConfig edgeConfig = jetConfig.getDefaultEdgeConfig();
    assertEquals(8, edgeConfig.getQueueSize());
    assertEquals(3, edgeConfig.getPacketSizeLimit());
    assertEquals(5, edgeConfig.getReceiveWindowMultiplier());
    assertEquals("bar", jetConfig.getProperties().getProperty("foo"));
}
Also used : InstanceConfig(com.hazelcast.jet.config.InstanceConfig) EdgeConfig(com.hazelcast.jet.config.EdgeConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) JetConfig(com.hazelcast.jet.config.JetConfig) InstanceConfig(com.hazelcast.jet.config.InstanceConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig) EdgeConfig(com.hazelcast.jet.config.EdgeConfig) JetConfig(com.hazelcast.jet.config.JetConfig)

Example 3 with JetConfig

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

the class DetermineLocalParallelismTest method before.

@Before
public void before() {
    JetConfig cfg = new JetConfig();
    cfg.getInstanceConfig().setCooperativeThreadCount(DEFAULT_PARALLELISM);
    JetInstance jet = createJetMember(cfg);
    nodeEngine = getNode(jet.getHazelcastInstance()).getNodeEngine();
}
Also used : JetInstance(com.hazelcast.jet.JetInstance) JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Example 4 with JetConfig

use of com.hazelcast.jet.config.JetConfig 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 5 with JetConfig

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

the class JetTest method when_defaultMapConfig_then_notUsed.

@Test
public void when_defaultMapConfig_then_notUsed() {
    // When
    JetConfig config = new JetConfig();
    config.getHazelcastConfig().getMapConfig("default").setTimeToLiveSeconds(MapConfig.DEFAULT_TTL_SECONDS + 1);
    JetInstance instance = createJetMember(config);
    try {
        // Then
        int actualTTL = instance.getConfig().getHazelcastConfig().findMapConfig(INTERNAL_JET_OBJECTS_PREFIX + "fooMap").getTimeToLiveSeconds();
        assertEquals(MapConfig.DEFAULT_TTL_SECONDS, actualTTL);
    } finally {
        shutdownFactory();
    }
}
Also used : JetConfig(com.hazelcast.jet.config.JetConfig) Test(org.junit.Test)

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