use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet-reference-manual by hazelcast.
the class Considerations method s9.
static void s9() {
// tag::s9[]
SerializerConfig serializerConfig = new SerializerConfig().setImplementation(new MyItemSerializer()).setTypeClass(MyItem.class);
JetConfig config = new JetConfig();
config.getHazelcastConfig().getSerializationConfig().addSerializerConfig(serializerConfig);
JetInstance jet = Jet.newJetInstance(config);
// end::s9[]
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast-jet-reference-manual by hazelcast.
the class ImdgConnectors method s9.
static void s9() {
// tag::s9[]
JetConfig cfg = new JetConfig();
cfg.getHazelcastConfig().getMapEventJournalConfig("inputMap").setEnabled(true).setCapacity(// how many events to keep before evicting
1000).setTimeToLiveSeconds(// evict events older than this
10);
JetInstance jet = Jet.newJetInstance(cfg);
// end::s9[]
// tag::s10[]
cfg.getHazelcastConfig().getCacheEventJournalConfig("inputCache").setEnabled(true).setCapacity(1000).setTimeToLiveSeconds(10);
// end::s10[]
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class JetInfoCollector method forEachMetric.
@Override
public void forEachMetric(Node node, BiConsumer<PhoneHomeMetrics, String> metricsConsumer) {
JetConfig jetConfig = node.getNodeEngine().getConfig().getJetConfig();
boolean isJetEnabled = jetConfig.isEnabled();
metricsConsumer.accept(PhoneHomeMetrics.JET_ENABLED, String.valueOf(isJetEnabled));
metricsConsumer.accept(PhoneHomeMetrics.JET_RESOURCE_UPLOAD_ENABLED, String.valueOf(jetConfig.isResourceUploadEnabled()));
if (isJetEnabled) {
JetServiceBackend jetServiceBackend = node.getNodeEngine().getService(JetServiceBackend.SERVICE_NAME);
long jobSubmittedCount = jetServiceBackend.getJobCoordinationService().getJobSubmittedCount();
metricsConsumer.accept(PhoneHomeMetrics.JET_JOBS_SUBMITTED, String.valueOf(jobSubmittedCount));
}
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class JetServiceBackend method configureJetInternalObjects.
public void configureJetInternalObjects(Config config, HazelcastProperties properties) {
JetConfig jetConfig = config.getJetConfig();
MapConfig internalMapConfig = new MapConfig(INTERNAL_JET_OBJECTS_PREFIX + '*').setBackupCount(jetConfig.getBackupCount()).setStatisticsEnabled(true);
internalMapConfig.getMergePolicyConfig().setPolicy(DiscardMergePolicy.class.getName());
MapConfig resultsMapConfig = new MapConfig(internalMapConfig).setName(JOB_RESULTS_MAP_NAME).setTimeToLiveSeconds(properties.getSeconds(JOB_RESULTS_TTL_SECONDS));
MapConfig metricsMapConfig = new MapConfig(internalMapConfig).setName(JOB_METRICS_MAP_NAME).setTimeToLiveSeconds(properties.getSeconds(JOB_RESULTS_TTL_SECONDS));
config.addMapConfig(internalMapConfig).addMapConfig(resultsMapConfig).addMapConfig(metricsMapConfig);
}
use of com.hazelcast.jet.config.JetConfig in project hazelcast by hazelcast.
the class Jet method newJetInstance.
/**
* @deprecated since 5.0
* Use {@link Hazelcast#newHazelcastInstance(Config)} and then get
* {@link JetService} from the created {@link HazelcastInstance} by
* using {@link HazelcastInstance#getJet()}}.
*/
@Deprecated
@Nonnull
public static JetInstance newJetInstance(@Nonnull JetConfig config) {
Preconditions.checkNotNull(config, "config");
Config hzConfig = new Config();
hzConfig.setJetConfig(config);
return (JetInstance) Hazelcast.newHazelcastInstance(hzConfig).getJet();
}
Aggregations