Search in sources :

Example 46 with JetConfig

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

the class ClientDeploymentTest method createCluster.

@Override
protected void createCluster() {
    factory = new JetTestInstanceFactory();
    JetConfig jetConfig = new JetConfig();
    FilteringClassLoader filteringClassLoader = new FilteringClassLoader(singletonList("deployment"), null);
    jetConfig.getHazelcastConfig().setClassLoader(filteringClassLoader);
    factory.newMember(jetConfig);
    client = factory.newClient();
}
Also used : FilteringClassLoader(com.hazelcast.util.FilteringClassLoader) JetConfig(com.hazelcast.jet.config.JetConfig) JetTestInstanceFactory(com.hazelcast.jet.JetTestInstanceFactory)

Example 47 with JetConfig

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

the class DeploymentTest method createCluster.

@Override
protected void createCluster() {
    factory = new JetTestInstanceFactory();
    instance = factory.newMember();
    JetConfig jetConfig = new JetConfig();
    FilteringClassLoader filteringClassLoader = new FilteringClassLoader(singletonList("deployment"), null);
    jetConfig.getHazelcastConfig().setClassLoader(filteringClassLoader);
    factory.newMember(jetConfig);
}
Also used : FilteringClassLoader(com.hazelcast.util.FilteringClassLoader) JetConfig(com.hazelcast.jet.config.JetConfig) JetTestInstanceFactory(com.hazelcast.jet.JetTestInstanceFactory)

Example 48 with JetConfig

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

the class TopologyChangeDuringJobSubmissionTest method setup.

@Before
public void setup() {
    MockPS.closeCount.set(0);
    MockPS.initCount.set(0);
    MockPS.receivedCloseErrors.clear();
    StuckProcessor.proceedLatch = new CountDownLatch(1);
    StuckProcessor.executionStarted = new CountDownLatch(PARALLELISM);
    JetConfig config = new JetConfig();
    config.getHazelcastConfig().setLiteMember(true);
    instance1 = createJetMember(config);
    instance2 = createJetMember();
    warmUpPartitions(instance1.getHazelcastInstance(), instance2.getHazelcastInstance());
}
Also used : CountDownLatch(java.util.concurrent.CountDownLatch) JetConfig(com.hazelcast.jet.config.JetConfig) Before(org.junit.Before)

Example 49 with JetConfig

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

the class XmlConfigTest method when_filePathMemberSpecified_usesSpecifiedFile.

@Test
public void when_filePathMemberSpecified_usesSpecifiedFile() throws IOException {
    // Given
    File tempFile = File.createTempFile("imdg", ".xml");
    try (FileOutputStream os = new FileOutputStream(tempFile)) {
        InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(TEST_XML_2);
        os.write(Util.readFully(resourceAsStream));
    }
    Properties properties = new Properties();
    properties.put(XmlJetConfigLocator.HAZELCAST_MEMBER_CONFIG_PROPERTY, tempFile.getAbsolutePath());
    // When
    JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
    // Then
    assertXmlMemberConfig(jetConfig.getHazelcastConfig());
}
Also used : InputStream(java.io.InputStream) FileOutputStream(java.io.FileOutputStream) Properties(java.util.Properties) File(java.io.File) JetConfig(com.hazelcast.jet.config.JetConfig) Test(org.junit.Test)

Example 50 with JetConfig

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

the class XmlConfigTest method when_classpathSpecified_usesSpecifiedResource.

@Test
public void when_classpathSpecified_usesSpecifiedResource() {
    // Given
    Properties properties = new Properties();
    properties.put(XmlJetConfigLocator.HAZELCAST_JET_CONFIG_PROPERTY, "classpath:" + TEST_XML_1);
    // When
    JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
    // Then
    assertConfig(jetConfig);
    assertDefaultMemberConfig(jetConfig.getHazelcastConfig());
}
Also used : Properties(java.util.Properties) 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