use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class ConfigXmlGenerator method jetConfig.
private static void jetConfig(XmlGenerator gen, Config config) {
JetConfig jetConfig = config.getJetConfig();
EdgeConfig edgeConfig = jetConfig.getDefaultEdgeConfig();
gen.open("jet", "enabled", jetConfig.isEnabled(), "resource-upload-enabled", jetConfig.isResourceUploadEnabled()).node("cooperative-thread-count", jetConfig.getCooperativeThreadCount()).node("flow-control-period", jetConfig.getFlowControlPeriodMs()).node("backup-count", jetConfig.getBackupCount()).node("scale-up-delay-millis", jetConfig.getScaleUpDelayMillis()).node("lossless-restart-enabled", jetConfig.isLosslessRestartEnabled()).node("max-processor-accumulated-records", jetConfig.getMaxProcessorAccumulatedRecords()).open("edge-defaults").node("queue-size", edgeConfig.getQueueSize()).node("packet-size-limit", edgeConfig.getPacketSizeLimit()).node("receive-window-multiplier", edgeConfig.getReceiveWindowMultiplier()).close().close();
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class TestInClusterSupport method prepareConfig.
protected static Config prepareConfig() {
parallelism = Runtime.getRuntime().availableProcessors() / MEMBER_COUNT / 2;
Config config = smallInstanceConfig();
JetConfig jetConfig = config.getJetConfig().setResourceUploadEnabled(true);
jetConfig.setCooperativeThreadCount(max(2, parallelism));
config.getMetricsConfig().setCollectionFrequencySeconds(1);
// Set partition count to match the parallelism of IMap sources.
// Their preferred local parallelism is 2, therefore partition count
// should be 2 * MEMBER_COUNT.
config.setProperty(ClusterProperty.PARTITION_COUNT.getName(), "" + 2 * MEMBER_COUNT);
config.addCacheConfig(new CacheSimpleConfig().setName("*"));
config.getMapConfig(JOURNALED_MAP_PREFIX + '*').getEventJournalConfig().setEnabled(true);
config.getCacheConfig(JOURNALED_CACHE_PREFIX + '*').getEventJournalConfig().setEnabled(true);
return config;
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class JobClassLoaderService method getOrCreateClassLoader.
/**
* Get or create a Job classloader for a job with given config.
* <p>
* It also creates processor classloaders if any are configured.
*
* @param config job config to use to create the classloader
* @param jobId id of the job
* @param phase phase for which the classloader is needed - coordinator/member
* @return job classloader
*/
public ClassLoader getOrCreateClassLoader(JobConfig config, long jobId, JobPhase phase) {
JetConfig jetConfig = nodeEngine.getConfig().getJetConfig();
JobClassLoaders jobClassLoaders = classLoaders.compute(jobId, (k, current) -> {
JobClassLoaders result = current;
if (current == null) {
result = createJobClassLoaders(config, jobId, jetConfig);
}
result.recordPhase(phase);
return result;
});
jobClassLoaders.recordPhase(phase);
return jobClassLoaders.jobClassLoader();
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testJetConfig.
@Test
public void testJetConfig() {
JetConfig jetConfig = config.getJetConfig();
assertTrue(jetConfig.isEnabled());
assertTrue(jetConfig.isResourceUploadEnabled());
assertEquals(4, jetConfig.getCooperativeThreadCount());
assertEquals(2, jetConfig.getBackupCount());
assertEquals(200, jetConfig.getFlowControlPeriodMs());
assertEquals(20000, jetConfig.getScaleUpDelayMillis());
assertEquals(1000000, jetConfig.getMaxProcessorAccumulatedRecords());
assertFalse(jetConfig.isLosslessRestartEnabled());
EdgeConfig edgeConfig = jetConfig.getDefaultEdgeConfig();
assertEquals(2048, edgeConfig.getQueueSize());
assertEquals(15000, edgeConfig.getPacketSizeLimit());
assertEquals(4, edgeConfig.getReceiveWindowMultiplier());
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleJet.
private void handleJet(Node node) {
JetConfig jetConfig = config.getJetConfig();
NamedNodeMap attributes = node.getAttributes();
for (int a = 0; a < attributes.getLength(); a++) {
Node attribute = attributes.item(a);
if (matches("enabled", attribute.getNodeName())) {
boolean enabled = getBooleanValue(getAttribute(node, "enabled"));
jetConfig.setEnabled(enabled);
} else if (matches("resource-upload-enabled", attribute.getNodeName())) {
boolean resourceUploadEnabled = getBooleanValue(getAttribute(node, "resource-upload-enabled"));
jetConfig.setResourceUploadEnabled(resourceUploadEnabled);
}
}
// <instance> tag will be ignored.
for (Node child : childElements(node)) {
String nodeName = cleanNodeName(child);
if (matches("cooperative-thread-count", nodeName)) {
jetConfig.setCooperativeThreadCount(getIntegerValue("cooperative-thread-count", getTextContent(child)));
} else if (matches("flow-control-period", nodeName)) {
jetConfig.setFlowControlPeriodMs(getIntegerValue("flow-control-period", getTextContent(child)));
} else if (matches("backup-count", nodeName)) {
jetConfig.setBackupCount(getIntegerValue("backup-count", getTextContent(child)));
} else if (matches("scale-up-delay-millis", nodeName)) {
jetConfig.setScaleUpDelayMillis(getLongValue("scale-up-delay-millis", getTextContent(child)));
} else if (matches("lossless-restart-enabled", nodeName)) {
jetConfig.setLosslessRestartEnabled(getBooleanValue(getTextContent(child)));
} else if (matches("max-processor-accumulated-records", nodeName)) {
jetConfig.setMaxProcessorAccumulatedRecords(getLongValue("max-processor-accumulated-records", getTextContent(child)));
} else if (matches("edge-defaults", nodeName)) {
handleEdgeDefaults(jetConfig, child);
} else if (matches("instance", nodeName)) {
if (jetConfigContainsInstanceConfigFields(node)) {
LOGGER.warning("<instance> tag will be ignored " + "since <jet> tag already contains the instance fields.");
} else {
LOGGER.warning("<instance> tag is deprecated, use <jet> tag directly for configuration.");
handleInstance(jetConfig, child);
}
}
}
}
Aggregations