use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class JobRepositoryTest method setup.
@Before
public void setup() {
JetConfig config = new JetConfig();
Properties properties = config.getProperties();
properties.setProperty(JOB_SCAN_PERIOD.getName(), Long.toString(JOB_SCAN_PERIOD_IN_MILLIS));
instance = createJetMember(config);
jobRepository = new JobRepository(instance, null);
jobRepository.setResourcesExpirationMillis(RESOURCES_EXPIRATION_TIME_MILLIS);
jobIds = instance.getMap(RANDOM_IDS_MAP_NAME);
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class XmlConfigTest method when_filePathSpecified_usesSpecifiedFile.
@Test
public void when_filePathSpecified_usesSpecifiedFile() throws IOException {
// Given
File tempFile = File.createTempFile("jet", ".xml");
try (FileOutputStream os = new FileOutputStream(tempFile)) {
InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(TEST_XML_1);
os.write(Util.readFully(resourceAsStream));
}
Properties properties = new Properties();
properties.put(XmlJetConfigLocator.HAZELCAST_JET_CONFIG_PROPERTY, tempFile.getAbsolutePath());
// When
JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
// Then
assertConfig(jetConfig);
assertDefaultMemberConfig(jetConfig.getHazelcastConfig());
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class XmlConfigTest method when_noConfigSpecified_usesDefaultConfig.
@Test
public void when_noConfigSpecified_usesDefaultConfig() {
// When
JetConfig jetConfig = XmlJetConfigBuilder.getConfig(new Properties());
// Then
assertEquals(Runtime.getRuntime().availableProcessors(), jetConfig.getInstanceConfig().getCooperativeThreadCount());
assertEquals(DEFAULT_FLOW_CONTROL_PERIOD_MS, jetConfig.getInstanceConfig().getFlowControlPeriodMs());
assertDefaultMemberConfig(jetConfig.getHazelcastConfig());
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet by hazelcast.
the class XmlConfigTest method when_configHasVariable_variablesAreReplaced.
@Test
public void when_configHasVariable_variablesAreReplaced() {
// Given
Properties properties = new Properties();
properties.put(XmlJetConfigLocator.HAZELCAST_JET_CONFIG_PROPERTY, "classpath:hazelcast-jet-with-variables.xml");
properties.put("working.directory", "/var/tmp");
properties.put("thread.count", String.valueOf(55));
properties.put("flow.control.period", "50");
properties.put("backup.count", "2");
// When
JetConfig jetConfig = XmlJetConfigBuilder.getConfig(properties);
// Then
assertConfig(jetConfig);
}
use of com.hazelcast.jet.config.JetConfig 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];
}
Aggregations